rebilly-js-sdk 47.9.0 → 47.10.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 +79 -26
- package/dist/rebilly-js-sdk.es.js +10 -7
- package/dist/rebilly-js-sdk.umd.js +7 -7
- package/package.json +1 -1
package/dist/rebilly-js-sdk.d.ts
CHANGED
|
@@ -1702,8 +1702,8 @@ declare module rebilly {
|
|
|
1702
1702
|
type StorefrontPatchKycDocumentResponse = operations['StorefrontPatchKycDocument']['responses']['200']['content']['application/json']
|
|
1703
1703
|
type StorefrontPatchKycDocumentResponsePromise = Promise<{fields: StorefrontPatchKycDocumentResponse}>
|
|
1704
1704
|
|
|
1705
|
-
type StorefrontGetKycRequestRequest = { id : String }
|
|
1706
|
-
|
|
1705
|
+
type StorefrontGetKycRequestRequest = operations['StorefrontGetKycRequest']['parameters'] & { id : String }
|
|
1706
|
+
|
|
1707
1707
|
type StorefrontGetKycRequestResponse = operations['StorefrontGetKycRequest']['responses']['200']['content']['application/json']
|
|
1708
1708
|
type StorefrontGetKycRequestResponsePromise = Promise<{fields: StorefrontGetKycRequestResponse}>
|
|
1709
1709
|
|
|
@@ -1772,8 +1772,8 @@ declare module rebilly {
|
|
|
1772
1772
|
type StorefrontGetPlanCollectionResponse = operations['StorefrontGetPlanCollection']['responses']['200']['content']['application/json'][0]
|
|
1773
1773
|
type StorefrontGetPlanCollectionResponsePromise = Promise<{ items: {fields: StorefrontGetPlanCollectionResponse}[], getJSON: object, total?: number, offset?: number, limit?: number }>
|
|
1774
1774
|
|
|
1775
|
-
type StorefrontGetPlanRequest = { id : String }
|
|
1776
|
-
|
|
1775
|
+
type StorefrontGetPlanRequest = operations['StorefrontGetPlan']['parameters'] & { id : String }
|
|
1776
|
+
|
|
1777
1777
|
type StorefrontGetPlanResponse = operations['StorefrontGetPlan']['responses']['200']['content']['application/json']
|
|
1778
1778
|
type StorefrontGetPlanResponsePromise = Promise<{fields: StorefrontGetPlanResponse}>
|
|
1779
1779
|
|
|
@@ -5604,6 +5604,13 @@ export interface coreComponents {
|
|
|
5604
5604
|
token: string;
|
|
5605
5605
|
};
|
|
5606
5606
|
};
|
|
5607
|
+
/** BlueSnap 3DS Servers. */
|
|
5608
|
+
BlueSnap3dsServers: {
|
|
5609
|
+
name: "ThreeDSecureIO3dsServer";
|
|
5610
|
+
};
|
|
5611
|
+
/** ThreeDSecureIO3dsServer. */
|
|
5612
|
+
BlueSnapThreeDSecureIOServer: coreComponents["schemas"]["BlueSnap3dsServers"] &
|
|
5613
|
+
coreComponents["schemas"]["ThreeDSecureIO3dsServer"];
|
|
5607
5614
|
/** BlueSnap config. */
|
|
5608
5615
|
BlueSnap: coreComponents["schemas"]["GatewayAccount"] & {
|
|
5609
5616
|
/** BlueSnap credentials object. */
|
|
@@ -5623,6 +5630,7 @@ export interface coreComponents {
|
|
|
5623
5630
|
/** The Rebilly custom field to use for sending transaction metadata. */
|
|
5624
5631
|
metadataCustomField?: string;
|
|
5625
5632
|
};
|
|
5633
|
+
threeDSecureServer?: coreComponents["schemas"]["BlueSnap3dsServers"];
|
|
5626
5634
|
};
|
|
5627
5635
|
/** BraintreePayments Gateway config. */
|
|
5628
5636
|
BraintreePayments: coreComponents["schemas"]["GatewayAccount"] & {
|
|
@@ -19901,6 +19909,13 @@ export interface usersComponents {
|
|
|
19901
19909
|
token: string;
|
|
19902
19910
|
};
|
|
19903
19911
|
};
|
|
19912
|
+
/** BlueSnap 3DS Servers. */
|
|
19913
|
+
BlueSnap3dsServers: {
|
|
19914
|
+
name: "ThreeDSecureIO3dsServer";
|
|
19915
|
+
};
|
|
19916
|
+
/** ThreeDSecureIO3dsServer. */
|
|
19917
|
+
BlueSnapThreeDSecureIOServer: usersComponents["schemas"]["BlueSnap3dsServers"] &
|
|
19918
|
+
usersComponents["schemas"]["ThreeDSecureIO3dsServer"];
|
|
19904
19919
|
/** BlueSnap config. */
|
|
19905
19920
|
BlueSnap: usersComponents["schemas"]["GatewayAccount"] & {
|
|
19906
19921
|
/** BlueSnap credentials object. */
|
|
@@ -19920,6 +19935,7 @@ export interface usersComponents {
|
|
|
19920
19935
|
/** The Rebilly custom field to use for sending transaction metadata. */
|
|
19921
19936
|
metadataCustomField?: string;
|
|
19922
19937
|
};
|
|
19938
|
+
threeDSecureServer?: usersComponents["schemas"]["BlueSnap3dsServers"];
|
|
19923
19939
|
};
|
|
19924
19940
|
/** BraintreePayments Gateway config. */
|
|
19925
19941
|
BraintreePayments: usersComponents["schemas"]["GatewayAccount"] & {
|
|
@@ -33353,11 +33369,15 @@ export interface storefrontComponents {
|
|
|
33353
33369
|
/** The links related to resource. */
|
|
33354
33370
|
_links?: Partial<storefrontComponents["schemas"]["SelfLink"]>[];
|
|
33355
33371
|
};
|
|
33356
|
-
|
|
33372
|
+
StorefrontProduct: storefrontComponents["schemas"]["CommonProduct"] & {
|
|
33357
33373
|
/** The links related to resource. */
|
|
33358
33374
|
_links?: Partial<storefrontComponents["schemas"]["SelfLink"]>[];
|
|
33359
33375
|
};
|
|
33360
|
-
|
|
33376
|
+
StorefrontPlan: storefrontComponents["schemas"]["CommonPlan"] & {
|
|
33377
|
+
/** Any embedded objects available that are requested by the `expand` querystring parameter. */
|
|
33378
|
+
_embedded?: {
|
|
33379
|
+
product?: storefrontComponents["schemas"]["StorefrontProduct"];
|
|
33380
|
+
};
|
|
33361
33381
|
/** The links related to resource. */
|
|
33362
33382
|
_links?: Partial<storefrontComponents["schemas"]["SelfLink"]>[];
|
|
33363
33383
|
};
|
|
@@ -33451,6 +33471,12 @@ export interface storefrontComponents {
|
|
|
33451
33471
|
collectionFilter: string;
|
|
33452
33472
|
/** The partial search of the text fields. */
|
|
33453
33473
|
collectionQuery: string;
|
|
33474
|
+
/**
|
|
33475
|
+
* Expand a response to get a full related object included inside of the `_embedded` path in the response.
|
|
33476
|
+
* It accepts a comma-separated list of objects to expand.
|
|
33477
|
+
* See the [expand guide](https://api-reference.rebilly.com/#section/Expand-to-include-embedded-objects) for more info.
|
|
33478
|
+
*/
|
|
33479
|
+
collectionExpand: string;
|
|
33454
33480
|
/** The collection items sort field and order (prefix with "-" for descending sort). */
|
|
33455
33481
|
collectionSort: string[];
|
|
33456
33482
|
/** The resource identifier string. */
|
|
@@ -33916,6 +33942,14 @@ export interface operations {
|
|
|
33916
33942
|
/** The resource identifier string. */
|
|
33917
33943
|
id: storefrontComponents["parameters"]["resourceId"];
|
|
33918
33944
|
};
|
|
33945
|
+
query: {
|
|
33946
|
+
/**
|
|
33947
|
+
* Expand a response to get a full related object included inside of the `_embedded` path in the response.
|
|
33948
|
+
* It accepts a comma-separated list of objects to expand.
|
|
33949
|
+
* See the [expand guide](https://api-reference.rebilly.com/#section/Expand-to-include-embedded-objects) for more info.
|
|
33950
|
+
*/
|
|
33951
|
+
expand?: storefrontComponents["parameters"]["collectionExpand"];
|
|
33952
|
+
};
|
|
33919
33953
|
};
|
|
33920
33954
|
responses: {
|
|
33921
33955
|
/** KYC request was retrieved successfully. */
|
|
@@ -34279,6 +34313,12 @@ export interface operations {
|
|
|
34279
34313
|
offset?: storefrontComponents["parameters"]["collectionOffset"];
|
|
34280
34314
|
/** The partial search of the text fields. */
|
|
34281
34315
|
q?: storefrontComponents["parameters"]["collectionQuery"];
|
|
34316
|
+
/**
|
|
34317
|
+
* Expand a response to get a full related object included inside of the `_embedded` path in the response.
|
|
34318
|
+
* It accepts a comma-separated list of objects to expand.
|
|
34319
|
+
* See the [expand guide](https://api-reference.rebilly.com/#section/Expand-to-include-embedded-objects) for more info.
|
|
34320
|
+
*/
|
|
34321
|
+
expand?: storefrontComponents["parameters"]["collectionExpand"];
|
|
34282
34322
|
};
|
|
34283
34323
|
};
|
|
34284
34324
|
responses: {
|
|
@@ -34300,6 +34340,14 @@ export interface operations {
|
|
|
34300
34340
|
/** The resource identifier string. */
|
|
34301
34341
|
id: storefrontComponents["parameters"]["resourceId"];
|
|
34302
34342
|
};
|
|
34343
|
+
query: {
|
|
34344
|
+
/**
|
|
34345
|
+
* Expand a response to get a full related object included inside of the `_embedded` path in the response.
|
|
34346
|
+
* It accepts a comma-separated list of objects to expand.
|
|
34347
|
+
* See the [expand guide](https://api-reference.rebilly.com/#section/Expand-to-include-embedded-objects) for more info.
|
|
34348
|
+
*/
|
|
34349
|
+
expand?: storefrontComponents["parameters"]["collectionExpand"];
|
|
34350
|
+
};
|
|
34303
34351
|
};
|
|
34304
34352
|
responses: {
|
|
34305
34353
|
/** Plan was retrieved successfully. */
|
|
@@ -34847,15 +34895,6 @@ export interface reportsComponents {
|
|
|
34847
34895
|
/** The partial search of the text fields. */
|
|
34848
34896
|
q?: string;
|
|
34849
34897
|
};
|
|
34850
|
-
/** The date range (can be in relative formats). If omitted, all time will be included. See the [Date Range guide](https://docs-reconciliation.rebilly.com/getting-started/date-range) for more options and examples. */
|
|
34851
|
-
dateRange?: {
|
|
34852
|
-
/** Any valid datetime arguments including [relative datetime arguments](http://php.net/manual/en/datetime.formats.php). */
|
|
34853
|
-
start: string;
|
|
34854
|
-
/** Any valid datetime arguments including [relative datetime arguments](http://php.net/manual/en/datetime.formats.php). */
|
|
34855
|
-
end: string;
|
|
34856
|
-
/** The field to apply date range to. */
|
|
34857
|
-
field?: string;
|
|
34858
|
-
};
|
|
34859
34898
|
/** List of emails to be notified when export is completed. */
|
|
34860
34899
|
emailNotification?: string[];
|
|
34861
34900
|
/** List of fields to include in the export. See supporting documentation for more info. If omitted, default fields will be included. */
|
|
@@ -34885,33 +34924,42 @@ export interface reportsComponents {
|
|
|
34885
34924
|
Partial<reportsComponents["schemas"]["LinkFileDownload"]> &
|
|
34886
34925
|
Partial<reportsComponents["schemas"]["LinkSignedLink"]>)[];
|
|
34887
34926
|
};
|
|
34927
|
+
/** The date range (can be in relative formats). If omitted, all time will be included. See the [Date Range guide](https://docs-reconciliation.rebilly.com/getting-started/date-range) for more options and examples. */
|
|
34928
|
+
DataExportDateRange: {
|
|
34929
|
+
/** Any valid datetime arguments including [relative datetime arguments](http://php.net/manual/en/datetime.formats.php). */
|
|
34930
|
+
start: string;
|
|
34931
|
+
/** Any valid datetime arguments including [relative datetime arguments](http://php.net/manual/en/datetime.formats.php). */
|
|
34932
|
+
end: string;
|
|
34933
|
+
/** The field to apply date range to. */
|
|
34934
|
+
field?: string;
|
|
34935
|
+
};
|
|
34888
34936
|
/** Customers resource type to export. */
|
|
34889
34937
|
customers: reportsComponents["schemas"]["DataExport"] & {
|
|
34890
|
-
dateRange?: {
|
|
34938
|
+
dateRange?: reportsComponents["schemas"]["DataExportDateRange"] & {
|
|
34891
34939
|
field: string;
|
|
34892
34940
|
};
|
|
34893
34941
|
};
|
|
34894
34942
|
/** Orders resource type to export. */
|
|
34895
34943
|
subscriptions: reportsComponents["schemas"]["DataExport"] & {
|
|
34896
|
-
dateRange?: {
|
|
34944
|
+
dateRange?: reportsComponents["schemas"]["DataExportDateRange"] & {
|
|
34897
34945
|
field: string;
|
|
34898
34946
|
};
|
|
34899
34947
|
};
|
|
34900
34948
|
/** Transactions resource type to export. */
|
|
34901
34949
|
transactions: reportsComponents["schemas"]["DataExport"] & {
|
|
34902
|
-
dateRange?: {
|
|
34950
|
+
dateRange?: reportsComponents["schemas"]["DataExportDateRange"] & {
|
|
34903
34951
|
field: string;
|
|
34904
34952
|
};
|
|
34905
34953
|
};
|
|
34906
34954
|
/** Invoices resource type to export. */
|
|
34907
34955
|
invoices: reportsComponents["schemas"]["DataExport"] & {
|
|
34908
|
-
dateRange?: {
|
|
34956
|
+
dateRange?: reportsComponents["schemas"]["DataExportDateRange"] & {
|
|
34909
34957
|
field: string;
|
|
34910
34958
|
};
|
|
34911
34959
|
};
|
|
34912
34960
|
/** Invoice items resource type to export. */
|
|
34913
34961
|
invoiceItems: reportsComponents["schemas"]["DataExport"] & {
|
|
34914
|
-
dateRange?: {
|
|
34962
|
+
dateRange?: reportsComponents["schemas"]["DataExportDateRange"] & {
|
|
34915
34963
|
field: string;
|
|
34916
34964
|
};
|
|
34917
34965
|
};
|
|
@@ -40530,8 +40578,9 @@ declare module "resources/storefront/kyc-requests-resource" {
|
|
|
40530
40578
|
export default function KycRequestsResource({ apiHandler }: {
|
|
40531
40579
|
apiHandler: any;
|
|
40532
40580
|
}): {
|
|
40533
|
-
get({ id }: {
|
|
40581
|
+
get({ id, expand }: {
|
|
40534
40582
|
id: any;
|
|
40583
|
+
expand?: any;
|
|
40535
40584
|
}): rebilly.StorefrontGetKycRequestResponsePromise;
|
|
40536
40585
|
};
|
|
40537
40586
|
}
|
|
@@ -40586,9 +40635,10 @@ declare module "resources/storefront/plans-resource" {
|
|
|
40586
40635
|
export default function PlansResource({ apiHandler }: {
|
|
40587
40636
|
apiHandler: any;
|
|
40588
40637
|
}): {
|
|
40589
|
-
getAll({ filter, sort, limit, offset, q, }?: rebilly.StorefrontGetPlanCollectionRequest): rebilly.StorefrontGetPlanCollectionResponsePromise;
|
|
40590
|
-
get({ id }: {
|
|
40638
|
+
getAll({ filter, sort, limit, offset, q, expand, }?: rebilly.StorefrontGetPlanCollectionRequest): rebilly.StorefrontGetPlanCollectionResponsePromise;
|
|
40639
|
+
get({ id, expand }: {
|
|
40591
40640
|
id: any;
|
|
40641
|
+
expand?: any;
|
|
40592
40642
|
}): rebilly.StorefrontGetPlanResponsePromise;
|
|
40593
40643
|
};
|
|
40594
40644
|
}
|
|
@@ -40721,8 +40771,9 @@ declare module "resources/storefront/storefront-api-instance" {
|
|
|
40721
40771
|
}): any;
|
|
40722
40772
|
};
|
|
40723
40773
|
kycRequests: {
|
|
40724
|
-
get({ id }: {
|
|
40774
|
+
get({ id, expand }: {
|
|
40725
40775
|
id: any;
|
|
40776
|
+
expand?: any;
|
|
40726
40777
|
}): rebilly.StorefrontGetKycRequestResponsePromise;
|
|
40727
40778
|
};
|
|
40728
40779
|
orders: {
|
|
@@ -40777,15 +40828,17 @@ declare module "resources/storefront/storefront-api-instance" {
|
|
|
40777
40828
|
}): any;
|
|
40778
40829
|
};
|
|
40779
40830
|
plans: {
|
|
40780
|
-
getAll({ filter, sort, limit, offset, q, }?: {
|
|
40831
|
+
getAll({ filter, sort, limit, offset, q, expand, }?: {
|
|
40781
40832
|
filter?: string;
|
|
40782
40833
|
sort?: string[];
|
|
40783
40834
|
limit?: number;
|
|
40784
40835
|
offset?: number;
|
|
40785
40836
|
q?: string;
|
|
40837
|
+
expand?: string;
|
|
40786
40838
|
}): rebilly.StorefrontGetPlanCollectionResponsePromise;
|
|
40787
|
-
get({ id }: {
|
|
40839
|
+
get({ id, expand }: {
|
|
40788
40840
|
id: any;
|
|
40841
|
+
expand?: any;
|
|
40789
40842
|
}): rebilly.StorefrontGetPlanResponsePromise;
|
|
40790
40843
|
};
|
|
40791
40844
|
products: {
|
|
@@ -1583,7 +1583,7 @@ function cloneArrayDeep(arr, instanceClone) {
|
|
|
1583
1583
|
return res;
|
|
1584
1584
|
}
|
|
1585
1585
|
var cloneDeep_1 = cloneDeep;
|
|
1586
|
-
const version = "47.
|
|
1586
|
+
const version = "47.10.0";
|
|
1587
1587
|
let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
1588
1588
|
let nanoid = (size = 21) => {
|
|
1589
1589
|
let id = "";
|
|
@@ -4495,8 +4495,9 @@ function KycDocumentsResource({ apiHandler }) {
|
|
|
4495
4495
|
}
|
|
4496
4496
|
function KycRequestsResource({ apiHandler }) {
|
|
4497
4497
|
return {
|
|
4498
|
-
get({ id }) {
|
|
4499
|
-
|
|
4498
|
+
get({ id, expand = null }) {
|
|
4499
|
+
const params = { expand };
|
|
4500
|
+
return apiHandler.get(`kyc-requests/${id}`, params);
|
|
4500
4501
|
}
|
|
4501
4502
|
};
|
|
4502
4503
|
}
|
|
@@ -4563,13 +4564,15 @@ function PlansResource({ apiHandler }) {
|
|
|
4563
4564
|
sort = null,
|
|
4564
4565
|
limit = null,
|
|
4565
4566
|
offset = null,
|
|
4566
|
-
q = null
|
|
4567
|
+
q = null,
|
|
4568
|
+
expand = null
|
|
4567
4569
|
} = {}) {
|
|
4568
|
-
const params = { filter, sort, limit, offset, q };
|
|
4570
|
+
const params = { filter, sort, limit, offset, q, expand };
|
|
4569
4571
|
return apiHandler.getAll(`plans`, params);
|
|
4570
4572
|
},
|
|
4571
|
-
get({ id }) {
|
|
4572
|
-
|
|
4573
|
+
get({ id, expand = null }) {
|
|
4574
|
+
const params = { expand };
|
|
4575
|
+
return apiHandler.get(`plans/${id}`, params);
|
|
4573
4576
|
}
|
|
4574
4577
|
};
|
|
4575
4578
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var Ys=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Qs=Object.prototype.hasOwnProperty,Zs=Object.prototype.propertyIsEnumerable;var Ae=(d,p,A)=>p in d?Ys(d,p,{enumerable:!0,configurable:!0,writable:!0,value:A}):d[p]=A,J=(d,p)=>{for(var A in p||(p={}))Qs.call(p,A)&&Ae(d,A,p[A]);if(ut)for(var A of ut(p))Zs.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,
|
|
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,Mt=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,Nt=Ct,Bt=Tt,Ut=ke,Lt=jt,Ft=Dt,Kt=Mt,ae=xe,Vt=Te,zt=Y,Pe=function(e){return new Promise(function(n,s){var u=e.data,o=e.headers,l=e.responseType,a;function h(){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 g=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(g+":"+w)}var b=Lt(e.baseURL,e.url);c.open(e.method.toUpperCase(),Ut(b,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};Nt(function(z){n(z),h()},function(z){s(z),h()},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(b))&&e.xsrfCookieName?Bt.read(e.xsrfCookieName):void 0;ne&&(o[e.xsrfHeaderName]=ne)}"setRequestHeader"in c&&Q.forEach(o,function(P,T){typeof u=="undefined"&&T.toLowerCase()==="content-type"?delete o[T]:c.setRequestHeader(T,P)}),Q.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),l&&l!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(a=function(E){!c||(s(!E||E&&E.type?new zt("canceled"):E),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a))),u||(u=null),c.send(u)})},y=v,Oe=Et,_t=Ce,Jt=Te,Wt={"Content-Type":"application/x-www-form-urlencoded"};function je(t,e){!y.isUndefined(t)&&y.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(y.isString(t))try{return(e||JSON.parse)(t),y.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"),y.isFormData(e)||y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e)?e:y.isArrayBufferView(e)?e.buffer:y.isURLSearchParams(e)?(je(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):y.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&&y.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, */*"}}};y.forEach(["delete","get","head"],function(e){Z.headers[e]={}}),y.forEach(["post","put","patch"],function(e){Z.headers[e]=y.merge(Wt)});var me=Z,Yt=v,Qt=me,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,fe=Zt,Ht=qe,er=me,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=fe.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=fe.call(e,s.data,s.headers,e.transformResponse),s},function(s){return Ht(s)||(ge(e),s&&s.response&&(s.response.data=fe.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})},R=v,Me=function(e,r){r=r||{};var n={};function s(c,g){return R.isPlainObject(c)&&R.isPlainObject(g)?R.merge(c,g):R.isPlainObject(g)?R.merge({},g):R.isArray(g)?g.slice():g}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 h={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(g){var w=h[g]||u,b=w(g);R.isUndefined(b)&&w!==a||(n[g]=b)}),n},Ne={version:"0.26.1"},nr=Ne.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=Me,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(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(u=u&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});var o=[];this.interceptors.response.forEach(function(b){o.push(b.fulfilled,b.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 h=r;s.length;){var c=s.shift(),g=s.shift();try{h=c(h)}catch(w){g(w);break}}try{l=Fe(h)}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)}},mr=v,fr=function(e){return mr.isObject(e)&&e.isAxiosError===!0},Ve=v,gr=A,ee=lr,hr=Me,pr=me;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=Ne.version,k.all=function(e){return Promise.all(e)},k.spread=ar,k.isAxiosError=fr,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 $r{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 yr 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:yr,RebillyValidationError:br,RebillyNotFoundError:Ar,RebillyConflictError:vr,RebillyForbiddenError:wr,RebillyMethodNotAllowedError:Rr,RebillyTimeoutError:Er,RebillyCanceledError:Sr};/*!
|
|
1
|
+
var Ys=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Qs=Object.prototype.hasOwnProperty,Zs=Object.prototype.propertyIsEnumerable;var Ae=(d,p,A)=>p in d?Ys(d,p,{enumerable:!0,configurable:!0,writable:!0,value:A}):d[p]=A,J=(d,p)=>{for(var A in p||(p={}))Qs.call(p,A)&&Ae(d,A,p[A]);if(ut)for(var A of ut(p))Zs.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,t){return function(){for(var s=new Array(arguments.length),u=0;u<s.length;u++)s[u]=arguments[u];return e.apply(t,s)}},ot=A,I=Object.prototype.toString;function se(r){return Array.isArray(r)}function ue(r){return typeof r=="undefined"}function lt(r){return r!==null&&!ue(r)&&r.constructor!==null&&!ue(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function we(r){return I.call(r)==="[object ArrayBuffer]"}function it(r){return I.call(r)==="[object FormData]"}function ct(r){var e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&we(r.buffer),e}function at(r){return typeof r=="string"}function mt(r){return typeof r=="number"}function Re(r){return r!==null&&typeof r=="object"}function W(r){if(I.call(r)!=="[object Object]")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function ft(r){return I.call(r)==="[object Date]"}function gt(r){return I.call(r)==="[object File]"}function ht(r){return I.call(r)==="[object Blob]"}function Ee(r){return I.call(r)==="[object Function]"}function pt(r){return Re(r)&&Ee(r.pipe)}function dt(r){return I.call(r)==="[object URLSearchParams]"}function $t(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function yt(){return typeof navigator!="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window!="undefined"&&typeof document!="undefined"}function oe(r,e){if(!(r===null||typeof r=="undefined"))if(typeof r!="object"&&(r=[r]),se(r))for(var t=0,n=r.length;t<n;t++)e.call(null,r[t],t,r);else for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&e.call(null,r[s],s,r)}function le(){var r={};function e(s,u){W(r[u])&&W(s)?r[u]=le(r[u],s):W(s)?r[u]=le({},s):se(s)?r[u]=s.slice():r[u]=s}for(var t=0,n=arguments.length;t<n;t++)oe(arguments[t],e);return r}function bt(r,e,t){return oe(e,function(s,u){t&&typeof s=="function"?r[u]=ot(s,t):r[u]=s}),r}function At(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}var v={isArray:se,isArrayBuffer:we,isBuffer:lt,isFormData:it,isArrayBufferView:ct,isString:at,isNumber:mt,isObject:Re,isPlainObject:W,isUndefined:ue,isDate:ft,isFile:gt,isBlob:ht,isFunction:Ee,isStream:pt,isURLSearchParams:dt,isStandardBrowserEnv:yt,forEach:oe,merge:le,extend:bt,trim:$t,stripBOM:At},N=v;function Se(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ke=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(N.isURLSearchParams(t))s=t.toString();else{var u=[];N.forEach(t,function(a,h){a===null||typeof a=="undefined"||(N.isArray(a)?h=h+"[]":a=[a],N.forEach(a,function(g){N.isDate(g)?g=g.toISOString():N.isObject(g)&&(g=JSON.stringify(g)),u.push(Se(h)+"="+Se(g))}))}),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,t,n){return this.handlers.push({fulfilled:e,rejected:t,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,t){Rt.forEach(e,function(s,u){u!==t&&u.toUpperCase()===t.toUpperCase()&&(e[t]=s,delete e[u])})},Ce=function(e,t,n,s,u){return e.config=t,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,t,n,s,u){var o=new Error(e);return St(o,t,n,s,u)},kt=xe,Ct=function(e,t,n){var s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(kt("Request failed with status code "+n.status,n.config,null,n.request,n))},X=v,Tt=X.isStandardBrowserEnv()?function(){return{write:function(t,n,s,u,o,l){var a=[];a.push(t+"="+encodeURIComponent(n)),X.isNumber(s)&&a.push("expires="+new Date(s).toGMTString()),X.isString(u)&&a.push("path="+u),X.isString(o)&&a.push("domain="+o),l===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(t){var n=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(t){this.write(t,"",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,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Pt=xt,Ot=It,jt=function(e,t){return e&&!Pt(t)?Ot(e,t):t},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 t={},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(t[n]&&qt.indexOf(n)>=0)return;n==="set-cookie"?t[n]=(t[n]?t[n]:[]).concat([s]):t[n]=t[n]?t[n]+", "+s:s}}),t},Ie=v,Mt=Ie.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),n;function s(u){var o=u;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.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(r){this.message=r}ce.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},ce.prototype.__CANCEL__=!0;var Y=ce,Q=v,Nt=Ct,Bt=Tt,Ut=ke,Lt=jt,Ft=Dt,Kt=Mt,ae=xe,Vt=Te,zt=Y,Pe=function(e){return new Promise(function(n,s){var u=e.data,o=e.headers,l=e.responseType,a;function h(){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 g=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.Authorization="Basic "+btoa(g+":"+w)}var b=Lt(e.baseURL,e.url);c.open(e.method.toUpperCase(),Ut(b,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};Nt(function(z){n(z),h()},function(z){s(z),h()},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(b))&&e.xsrfCookieName?Bt.read(e.xsrfCookieName):void 0;ne&&(o[e.xsrfHeaderName]=ne)}"setRequestHeader"in c&&Q.forEach(o,function(P,T){typeof u=="undefined"&&T.toLowerCase()==="content-type"?delete o[T]:c.setRequestHeader(T,P)}),Q.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),l&&l!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(a=function(E){!c||(s(!E||E&&E.type?new zt("canceled"):E),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a))),u||(u=null),c.send(u)})},y=v,Oe=Et,_t=Ce,Jt=Te,Wt={"Content-Type":"application/x-www-form-urlencoded"};function je(r,e){!y.isUndefined(r)&&y.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function Gt(){var r;return(typeof XMLHttpRequest!="undefined"||typeof process!="undefined"&&Object.prototype.toString.call(process)==="[object process]")&&(r=Pe),r}function Xt(r,e,t){if(y.isString(r))try{return(e||JSON.parse)(r),y.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}var Z={transitional:Jt,adapter:Gt(),transformRequest:[function(e,t){return Oe(t,"Accept"),Oe(t,"Content-Type"),y.isFormData(e)||y.isArrayBuffer(e)||y.isBuffer(e)||y.isStream(e)||y.isFile(e)||y.isBlob(e)?e:y.isArrayBufferView(e)?e.buffer:y.isURLSearchParams(e)?(je(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):y.isObject(e)||t&&t["Content-Type"]==="application/json"?(je(t,"application/json"),Xt(e)):e}],transformResponse:[function(e){var t=this.transitional||Z.transitional,n=t&&t.silentJSONParsing,s=t&&t.forcedJSONParsing,u=!n&&this.responseType==="json";if(u||s&&y.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, */*"}}};y.forEach(["delete","get","head"],function(e){Z.headers[e]={}}),y.forEach(["post","put","patch"],function(e){Z.headers[e]=y.merge(Wt)});var me=Z,Yt=v,Qt=me,Zt=function(e,t,n){var s=this||Qt;return Yt.forEach(n,function(o){e=o.call(s,e,t)}),e},qe=function(e){return!!(e&&e.__CANCEL__)},De=v,fe=Zt,Ht=qe,er=me,tr=Y;function ge(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new tr("canceled")}var rr=function(e){ge(e),e.headers=e.headers||{},e.data=fe.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 t=e.adapter||er.adapter;return t(e).then(function(s){return ge(e),s.data=fe.call(e,s.data,s.headers,e.transformResponse),s},function(s){return Ht(s)||(ge(e),s&&s.response&&(s.response.data=fe.call(e,s.response.data,s.response.headers,e.transformResponse))),Promise.reject(s)})},R=v,Me=function(e,t){t=t||{};var n={};function s(c,g){return R.isPlainObject(c)&&R.isPlainObject(g)?R.merge(c,g):R.isPlainObject(g)?R.merge({},g):R.isArray(g)?g.slice():g}function u(c){if(R.isUndefined(t[c])){if(!R.isUndefined(e[c]))return s(void 0,e[c])}else return s(e[c],t[c])}function o(c){if(!R.isUndefined(t[c]))return s(void 0,t[c])}function l(c){if(R.isUndefined(t[c])){if(!R.isUndefined(e[c]))return s(void 0,e[c])}else return s(void 0,t[c])}function a(c){if(c in t)return s(e[c],t[c]);if(c in e)return s(void 0,e[c])}var h={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(t)),function(g){var w=h[g]||u,b=w(g);R.isUndefined(b)&&w!==a||(n[g]=b)}),n},Ne={version:"0.26.1"},nr=Ne.version,he={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){he[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});var Be={};he.transitional=function(e,t,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"+(t?" in "+t:"")));return t&&!Be[o]&&(Be[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(u,o,l):!0}};function sr(r,e,t){if(typeof r!="object")throw new TypeError("options must be an object");for(var n=Object.keys(r),s=n.length;s-- >0;){var u=n[s],o=e[u];if(o){var l=r[u],a=l===void 0||o(l,u,r);if(a!==!0)throw new TypeError("option "+u+" must be "+a);continue}if(t!==!0)throw Error("Unknown option "+u)}}var ur={assertOptions:sr,validators:he},Ue=v,or=ke,Le=wt,Fe=rr,H=Me,Ke=ur,B=Ke.validators;function F(r){this.defaults=r,this.interceptors={request:new Le,response:new Le}}F.prototype.request=function(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=H(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var n=t.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(b){typeof b.runWhen=="function"&&b.runWhen(t)===!1||(u=u&&b.synchronous,s.unshift(b.fulfilled,b.rejected))});var o=[];this.interceptors.response.forEach(function(b){o.push(b.fulfilled,b.rejected)});var l;if(!u){var a=[Fe,void 0];for(Array.prototype.unshift.apply(a,s),a=a.concat(o),l=Promise.resolve(t);a.length;)l=l.then(a.shift(),a.shift());return l}for(var h=t;s.length;){var c=s.shift(),g=s.shift();try{h=c(h)}catch(w){g(w);break}}try{l=Fe(h)}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(t,n){return this.request(H(n||{},{method:e,url:t,data:(n||{}).data}))}}),Ue.forEach(["post","put","patch"],function(e){F.prototype[e]=function(t,n,s){return this.request(H(s||{},{method:e,url:t,data:n}))}});var lr=F,ir=Y;function U(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(s){e=s});var t=this;this.promise.then(function(n){if(!!t._listeners){var s,u=t._listeners.length;for(s=0;s<u;s++)t._listeners[s](n);t._listeners=null}}),this.promise.then=function(n){var s,u=new Promise(function(o){t.subscribe(o),s=o}).then(n);return u.cancel=function(){t.unsubscribe(s)},u},r(function(s){t.reason||(t.reason=new ir(s),e(t.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 t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}},U.source=function(){var e,t=new U(function(s){e=s});return{token:t,cancel:e}};var cr=U,ar=function(e){return function(n){return e.apply(null,n)}},mr=v,fr=function(e){return mr.isObject(e)&&e.isAxiosError===!0},Ve=v,gr=A,ee=lr,hr=Me,pr=me;function ze(r){var e=new ee(r),t=gr(ee.prototype.request,e);return Ve.extend(t,ee.prototype,e),Ve.extend(t,e),t.create=function(s){return ze(hr(r,s))},t}var k=ze(pr);k.Axios=ee,k.Cancel=Y,k.CancelToken=cr,k.isCancel=qe,k.VERSION=Ne.version,k.all=function(e){return Promise.all(e)},k.spread=ar,k.isAxiosError=fr,p.exports=k,p.exports.default=k;var pe=p.exports;function te(r,{exclude:e=[]}={}){Object.freeze(r);const t=typeof r=="function";return Object.getOwnPropertyNames(r).forEach(n=>{(t?n!=="caller"&&n!=="callee"&&n!=="arguments":!0)&&r[n]!==null&&!e.includes(n)&&(typeof r[n]=="object"||typeof r[n]=="function")&&!Object.isFrozen(r[n])&&te(r[n],{exclude:e})}),r}class _e{constructor({data:e,status:t,statusText:n,headers:s},u={}){this.response={status:t,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:t,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:t,statusText:n,headers:s},this.items=e.map(o=>new _e({data:o,status:t,statusText:n,headers:s})),this.config=u,te(this,{exclude:["cancelToken"]})}getJSON(){return JSON.parse(JSON.stringify({items:this.items}))}}class $r{constructor({data:e,status:t,statusText:n,headers:s},u={}){this.response={status:t,statusText:n,headers:s},this.data=e,this.config=u}}class C extends Error{constructor({error:e,name:t=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=t||"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 yr 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:yr,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.
|
|
@@ -9,7 +9,7 @@ var Ys=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Qs=Object.p
|
|
|
9
9
|
*
|
|
10
10
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
11
11
|
* Released under the MIT License.
|
|
12
|
-
*/var Cr=kr;function We(
|
|
12
|
+
*/var Cr=kr;function We(r){return Cr(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}var Tr=function(e){var t,n;return!(We(e)===!1||(t=e.constructor,typeof t!="function")||(n=t.prototype,We(n)===!1)||n.hasOwnProperty("isPrototypeOf")===!1)};/*!
|
|
13
13
|
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) 2015, Jon Schlinkert.
|
|
@@ -19,19 +19,19 @@ var Ys=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Qs=Object.p
|
|
|
19
19
|
*
|
|
20
20
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
21
21
|
* Released under the MIT License.
|
|
22
|
-
*/var xr=function(e,
|
|
22
|
+
*/var xr=function(e,t,n){for(var s in e)if(t.call(n,e[s],s,e)===!1)break},Xe=Ge,Ir=xr;function Pr(r,e){if(!Xe(r))throw new TypeError("mixin-object expects the first argument to be an object.");for(var t=arguments.length,n=0;++n<t;){var s=arguments[n];Xe(s)&&Ir(s,Or,r)}return r}function Or(r,e){this[e]=r}var jr=Pr,qr=Object.prototype.toString,Dr=function(e){var t=typeof e;return t==="undefined"?"undefined":e===null?"null":e===!0||e===!1||e instanceof Boolean?"boolean":t==="string"||e instanceof String?"string":t==="number"||e instanceof Number?"number":t==="function"||e instanceof Function?typeof e.constructor.name!="undefined"&&e.constructor.name.slice(0,9)==="Generator"?"generatorfunction":"function":typeof Array.isArray!="undefined"&&Array.isArray(e)?"array":e instanceof RegExp?"regexp":e instanceof Date?"date":(t=qr.call(e),t==="[object RegExp]"?"regexp":t==="[object Date]"?"date":t==="[object Arguments]"?"arguments":t==="[object Error]"?"error":t==="[object Promise]"?"promise":Mr(e)?"buffer":t==="[object Set]"?"set":t==="[object WeakSet]"?"weakset":t==="[object Map]"?"map":t==="[object WeakMap]"?"weakmap":t==="[object Symbol]"?"symbol":t==="[object Map Iterator]"?"mapiterator":t==="[object Set Iterator]"?"setiterator":t==="[object String Iterator]"?"stringiterator":t==="[object Array Iterator]"?"arrayiterator":t==="[object Int8Array]"?"int8array":t==="[object Uint8Array]"?"uint8array":t==="[object Uint8ClampedArray]"?"uint8clampedarray":t==="[object Int16Array]"?"int16array":t==="[object Uint16Array]"?"uint16array":t==="[object Int32Array]"?"int32array":t==="[object Uint32Array]"?"uint32array":t==="[object Float32Array]"?"float32array":t==="[object Float64Array]"?"float64array":"object")};function Mr(r){return r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}/*!
|
|
23
23
|
* shallow-clone <https://github.com/jonschlinkert/shallow-clone>
|
|
24
24
|
*
|
|
25
25
|
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
26
26
|
* Released under the MIT License.
|
|
27
|
-
*/var Nr=Ge,Br=jr,Ur=Dr;function j(
|
|
27
|
+
*/var Nr=Ge,Br=jr,Ur=Dr;function j(r){var e=Ur(r);return j.hasOwnProperty(e)?j[e](r):r}j.array=function(e){return e.slice()},j.date=function(e){return new Date(+e)},j.object=function(e){return Nr(e)?Br({},e):e},j.regexp=function(e){var t="";return t+=e.multiline?"m":"",t+=e.global?"g":"",t+=e.ignorecase?"i":"",new RegExp(e.source,t)};var Lr=j,Fr=Object.prototype.toString,Kr=function(e){var t=typeof e;return t==="undefined"?"undefined":e===null?"null":e===!0||e===!1||e instanceof Boolean?"boolean":t==="string"||e instanceof String?"string":t==="number"||e instanceof Number?"number":t==="function"||e instanceof Function?typeof e.constructor.name!="undefined"&&e.constructor.name.slice(0,9)==="Generator"?"generatorfunction":"function":typeof Array.isArray!="undefined"&&Array.isArray(e)?"array":e instanceof RegExp?"regexp":e instanceof Date?"date":(t=Fr.call(e),t==="[object RegExp]"?"regexp":t==="[object Date]"?"date":t==="[object Arguments]"?"arguments":t==="[object Error]"?"error":t==="[object Promise]"?"promise":Vr(e)?"buffer":t==="[object Set]"?"set":t==="[object WeakSet]"?"weakset":t==="[object Map]"?"map":t==="[object WeakMap]"?"weakmap":t==="[object Symbol]"?"symbol":t==="[object Map Iterator]"?"mapiterator":t==="[object Set Iterator]"?"setiterator":t==="[object String Iterator]"?"stringiterator":t==="[object Array Iterator]"?"arrayiterator":t==="[object Int8Array]"?"int8array":t==="[object Uint8Array]"?"uint8array":t==="[object Uint8ClampedArray]"?"uint8clampedarray":t==="[object Int16Array]"?"int16array":t==="[object Uint16Array]"?"uint16array":t==="[object Int32Array]"?"int32array":t==="[object Uint32Array]"?"uint32array":t==="[object Float32Array]"?"float32array":t==="[object Float64Array]"?"float64array":"object")};function Vr(r){return r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}/*!
|
|
28
28
|
* for-in <https://github.com/jonschlinkert/for-in>
|
|
29
29
|
*
|
|
30
30
|
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
31
31
|
* Released under the MIT License.
|
|
32
|
-
*/var zr=function(e,
|
|
32
|
+
*/var zr=function(e,t,n){for(var s in e)if(t.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 _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.9.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 $e({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 h(i=t.jwt){const m=l();t.apiKey=null,t.jwt=i,delete m.common["REB-APIKEY"],m.common.Authorization=`Bearer ${i}`,e.defaults.headers=m}function c(i=t.publishableKey){const m=l();t.publishableKey=i,m.common.Authorization=`${i}`,e.defaults.headers=m}function g({host:i,port:m,auth:f}){e.defaults.proxy={host:i,port:m,auth:f}}function w({live:i=null,sandbox:m=null}){i&&(t.apiEndpoints.live=i),m&&(t.apiEndpoints.sandbox=m),e.defaults.baseURL=u()}function b(i,{thenDelegate:m,catchDelegate:f=()=>{}}){return Ye(i)&&e.interceptors[q[i]].use(m,f)}function V(i,m){return Ye(i)&&e.interceptors[q[i]].eject(m)}function ne({thenDelegate:i,catchDelegate:m=()=>{}}){return b(q.request,{thenDelegate:i,catchDelegate:m})}function E(i){V(q.request,i)}function P({thenDelegate:i,catchDelegate:m=()=>{}}){return b(q.response,{thenDelegate:i,catchDelegate:m})}function T(i){V(q.response,i)}function x({request:i,isCollection:m,config:f}){const $=et(f),{id:O,cancelToken:Xs}=L.save();$.cancelToken=Xs;const st=async function(){try{const _=await i($);return z({response:_,isCollection:m,config:$})}catch(_){return He({error:_,config:$})}finally{L.deleteById(O)}}();return st.cancel=_=>re.cancelById(O,_),st}function z({response:i,isCollection:m,config:f}){return m?new dr(i,f):new _e(i,f)}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 Ks(i){return i.params!==void 0&&(i.params=Object.keys(i.params).filter(m=>i.params[m]!==null&&i.params[m]!=="").reduce((m,f)=>(m[f]=i.params[f],m),{})),i}function et(i={}){const m=Ks(i);return J({},m)}function tt(i,m={}){return x({request:f=>e.get(i,f),config:{params:m}})}function Vs(i,m){return x({request:f=>e.get(i,f),config:{params:m},isCollection:!0})}function rt(i,m,f={}){let $={};return f.authenticate===!1&&($={headers:l()},delete $.headers.common["REB-APIKEY"],delete $.headers.common.Authorization),f.params&&($.params=J({},f.params)),x({request:O=>e.post(i,m,O),config:$})}function nt(i,m,f={}){return x({request:$=>e.put(i,m,$),config:{params:f}})}function zs(i,m){return x({request:f=>e.patch(i,m,f),config:{}})}function _s(i){return x({request:m=>e.delete(i,m),config:{}})}function Js(i,m){return x({request:f=>e.delete(i,f),config:{data:J({},m)}})}async function Ws(i,m,f,$={}){if(m==="")return rt(i,f,{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,f,$);throw O}}async function Gs(i,m){const f=et(m);try{const $=await e.get(i,f);return new $r($,f)}catch($){return He({error:$,config:f})}}return{getInstance:n,addRequestInterceptor:ne,removeRequestInterceptor:E,addResponseInterceptor:P,removeResponseInterceptor:T,setTimeout:a,setProxyAgent:g,setSessionToken:h,setPublishableKey:c,setEndpoints:w,get:tt,getAll:Vs,post:rt,put:nt,patch:zs,delete:_s,deleteAll:Js,create:Ws,download:Gs}}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 mn({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 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 $n({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 bn({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("credit-memos",l)},create({id:e="",data:r}){return t.create(`credit-memos/${e}`,e,r)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`credit-memos/${e}`,n)},update({id:e,data:r}){return t.put(`credit-memos/${e}`,r)},void({id:e}){return t.post(`credit-memos/${e}/void`)},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(`credit-memos/${e}/timeline`,l)},createTimelineComment({id:e,data:r}){return t.post(`credit-memos/${e}/timeline`,r)},getTimelineMessage({id:e,messageId:r}){return t.get(`credit-memos/${e}/timeline/${r}`)},deleteTimelineMessage({id:e,messageId:r}){return t.delete(`credit-memos/${e}/timeline/${r}`)}}}function An({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 vn({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 wn({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 Rn({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 En({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 Sn({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 kn({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 Cn({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 Tn({apiHandler:t}){return{getAll(){return t.getAll("email-notifications")}}}function xn({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 h={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return t.getAll(`events/${e}/rules/history`,h)},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 h={limit:r,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return t.getAll(`events/${e}/rules/drafts`,h)},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 In({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 Pn({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 h=t.delete(`files/${e}`);return n.push(h),h})();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 On({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 jn({apiHandler:t}){return{getAll(){return t.getAll("integrations")},get({label:e}){return t.get(`integrations/${e}`)}}}function qn({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}`)},getAllCreditMemoAllocations({id:e,limit:r=null,offset:n=null}){const s={limit:r,offset:n};return t.getAll(`invoices/${e}/credit-memo-allocations`,s)},getCreditMemoAllocation({id:e,creditMemoId:r,limit:n=null,offset:s=null}){const u={limit:n,offset:s};return t.get(`invoices/${e}/credit-memo-allocations/${r}`,u)},applyCreditMemo({id:e,creditMemoId:r,data:n}){return t.put(`invoices/${e}/credit-memo-allocations/${r}`,n)},deleteCreditMemoAllocation({id:e,creditMemoId:r}){return t.delete(`invoices/${e}/credit-memo-allocations/${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 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-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 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("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{getKycSettings(){return t.get("kyc-settings")},updateKycSettings({data:e}){return t.put("kyc-settings",e)}}}function Bn({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 Un({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 Ln({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 Fn({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 Kn({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 Vn({apiHandler:t}){return{getAll(){return t.getAll("payment-methods")},get({apiName:e}){return t.get(`payment-methods/${e}`)}}}function zn({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 _n({apiHandler:t}){return{create({data:e}){return t.post("payouts",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("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 Wn({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 Gn({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 Xn({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 Yn({apiHandler:t}){return{readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Qn({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 Zn({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 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("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 es({apiHandler:t}){return{getAll({eventType:e}){return t.getAll(`send-through-attribution/${e}`)}}}function ts({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 rs({apiHandler:t}){return{get(){return t.get("status")}}}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-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 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-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 us({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 os({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 ls({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 is({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 cs({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 as({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 ms({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 gs{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=mn({apiHandler:e}),this.balanceTransactions=fn({apiHandler:e}),this.billingPortals=gn({apiHandler:e}),this.blocklists=hn({apiHandler:e}),this.broadcastMessages=pn({apiHandler:e}),this.checkoutForms=dn({apiHandler:e}),this.coupons=$n({apiHandler:e}),this.credentialHashes=yn({apiHandler:e}),this.creditMemos=bn({apiHandler:e}),this.customDomains=An({apiHandler:e}),this.customFields=vn({apiHandler:e}),this.customerAuthentication=wn({apiHandler:e}),this.customers=Rn({apiHandler:e}),this.digitalWallets=En({apiHandler:e}),this.disputes=Sn({apiHandler:e}),this.emailDeliverySettings=kn({apiHandler:e}),this.emailMessages=Cn({apiHandler:e}),this.emailNotifications=Tn({apiHandler:e}),this.events=xn({apiHandler:e}),this.fees=In({apiHandler:e}),this.files=Pn({apiHandler:e}),this.gatewayAccounts=On({apiHandler:e}),this.integrations=jn({apiHandler:e}),this.invoices=qn({apiHandler:e}),this.kycDocuments=Dn({apiHandler:e}),this.kycRequests=Mn({apiHandler:e}),this.kycSettings=Nn({apiHandler:e}),this.lists=Bn({apiHandler:e}),this.memberships=Un({apiHandler:e}),this.organizations=Ln({apiHandler:e}),this.paymentCardsBankNames=Fn({apiHandler:e}),this.paymentInstruments=Kn({apiHandler:e}),this.paymentMethods=Vn({apiHandler:e}),this.paymentTokens=zn({apiHandler:e}),this.payouts=_n({apiHandler:e}),this.plans=Jn({apiHandler:e}),this.previews=Wn({apiHandler:e}),this.products=Gn({apiHandler:e}),this.profile=Xn({apiHandler:e}),this.purchase=Yn({apiHandler:e}),this.roles=Qn({apiHandler:e}),this.search=Zn({apiHandler:e}),this.segments=Hn({apiHandler:e}),this.sendThroughAttribution=es({apiHandler:e}),this.shippingRates=ts({apiHandler:e}),this.status=rs({apiHandler:e}),this.subscriptionCancellations=ns({apiHandler:e}),this.subscriptionPauses=ss({apiHandler:e}),this.subscriptionReactivations=us({apiHandler:e}),this.subscriptions=os({apiHandler:e}),this.tags=ls({apiHandler:e}),this.tracking=is({apiHandler:e}),this.transactions=cs({apiHandler:e}),this.users=as({apiHandler:e}),this.webhooks=ms({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 hs({apiHandler:t}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return t.get(`customers/${e}/summary-metrics`)}}}function ps({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)},queue({id:e="",data:r,expand:n=null}){const s={expand:n};return t.create(`data-exports/${e}`,e,r,s)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`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 ds({apiHandler:t}){return{getTransactionHistogramReport({periodStart:e,periodEnd:r,aggregationField:n,aggregationPeriod:s,metric:u,filter:o=null}){const l={periodStart:e,periodEnd:r,aggregationField:n,aggregationPeriod:s,metric:u,filter:o};return t.get("histograms/transactions",l)}}}function $s({apiHandler:t}){return{getApiLogSummary({periodStart:e,periodEnd:r,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:r,limit:n,offset:s};return t.get("reports/api-log-summary",u)},getCumulativeSubscriptions({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o};return t.get("reports/cumulative-subscriptions",l)},getDashboardMetrics({periodStart:e,periodEnd:r,metrics:n=null,segments:s=null}){const u={periodStart:e,periodEnd:r,metrics:n,segments:s};return t.get("reports/dashboard",u)},getDccMarkup({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o};return t.get("reports/dcc-markup",l)},getDisputes({aggregationField:e,periodMonth:r,limit:n=null,offset:s=null,filter:u=null}){const o={aggregationField:e,periodMonth:r,limit:n,offset:s,filter:u};return t.get("reports/disputes",o)},getEventsTriggeredSummary({periodStart:e,periodEnd:r,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:r,limit:n,offset:s};return t.get("reports/events-triggered",u)},getTriggeredEventRuleReport({eventType:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null}){const o={periodStart:r,periodEnd:n,limit:s,offset:u};return t.get(`reports/events-triggered/${e}/rules`,o)},getFutureRenewals({periodStart:e,periodEnd:r,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:r,limit:n,offset:s};return t.get("reports/future-renewals",u)},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({currency:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null}){const o={currency:e,periodStart:r,periodEnd:n,limit:s,offset:u};return t.get("reports/monthly-recurring-revenue",o)},getRenewalSales({periodStart:e,periodEnd:r,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:r,limit:n,offset:s};return t.get("reports/renewal-sales",u)},getRetentionPercentage({aggregationField:e,aggregationPeriod:r,includeSwitchedSubscriptions:n=null,periodStart:s,periodEnd:u,limit:o=null,offset:l=null,filter:a=null,criteria:h=null}){const c={aggregationField:e,aggregationPeriod:r,includeSwitchedSubscriptions:n,periodStart:s,periodEnd:u,limit:o,offset:l,filter:a,criteria:h};return t.get("reports/retention-percentage",c)},getRetentionValue({aggregationField:e,aggregationPeriod:r,includeRefunds:n=null,includeDisputes:s=null,periodStart:u,periodEnd:o,limit:l=null,offset:a=null,filter:h=null,sort:c=null,criteria:g=null}){const w={aggregationField:e,aggregationPeriod:r,includeRefunds:n,includeDisputes:s,periodStart:u,periodEnd:o,limit:l,offset:a,filter:h,sort:c,criteria:g};return t.get("reports/retention-value",w)},getRevenueWaterfall({currency:e,issuedFrom:r,issuedTo:n,recognizedTo:s}){const u={currency:e,issuedFrom:r,issuedTo:n,recognizedTo:s};return t.get("reports/revenue-waterfall",u)},getSubscriptionCancellation({periodStart:e,periodEnd:r,aggregationField:n,limit:s=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:r,aggregationField:n,limit:s,offset:u,filter:o};return t.get("reports/subscription-cancellation",l)},getSubscriptionRenewal({periodStart:e,periodEnd:r,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:r,limit:n,offset:s};return t.get("reports/subscription-renewal",u)},getTimeSeriesTransaction({type:e,subaggregate:r,periodStart:n,periodEnd:s}){const u={type:e,subaggregate:r,periodStart:n,periodEnd:s};return t.get("reports/time-series-transaction",u)},getTransactionsTimeDispute({aggregationField:e,periodStart:r,periodEnd:n,limit:s=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:r,periodEnd:n,limit:s,offset:u,filter:o};return t.get("reports/transactions-time-dispute",l)},getTransactions({periodStart:e,periodEnd:r,aggregationField:n,limit:s=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:r,aggregationField:n,limit:s,offset:u,filter:o};return t.get("reports/transactions",l)}}}function ys({apiHandler:t}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return t.get(`subscriptions/${e}/summary-metrics`)}}}function bs({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 As({apiHandler:t}){return{query(){return t.get("location")}}}const M={CustomersResource:hs,DataExportsResource:ps,HistogramsResource:ds,ReportsResource:$s,SubscriptionsResource:ys,TimelinesResource:bs,LocationResource:As};class vs{constructor({apiHandler:e}){this.customers=M.CustomersResource({apiHandler:e}),this.dataExports=M.DataExportsResource({apiHandler:e}),this.histograms=M.HistogramsResource({apiHandler:e}),this.reports=M.ReportsResource({apiHandler:e}),this.subscriptions=M.SubscriptionsResource({apiHandler:e}),this.timelines=M.TimelinesResource({apiHandler:e}),this.location=M.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 ws({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 Rs({apiHandler:t}){return{login({data:e}){return t.post("login",e)},logout(){return t.post("logout")}}}function Es({apiHandler:t}){return{get({slug:e}){return t.get(`billing-portals/${e}`)}}}function Ss({apiHandler:t}){return{get({id:e}){return t.get(`checkout-forms/${e}`)}}}function ks({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 Cs({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 Ts({apiHandler:t}){return{get({id:e}){return t.get(`kyc-requests/${e}`)}}}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("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 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("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 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("plans",o)},get({id:e}){return t.get(`plans/${e}`)}}}function Os({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 js({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 qs({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 Ds({apiHandler:t}){return{get({id:e}){return t.get(`websites/${e}`)}}}class Ms{constructor({apiHandler:e}){this.account=ws({apiHandler:e}),this.authorization=Rs({apiHandler:e}),this.billingPortals=Es({apiHandler:e}),this.checkoutForms=Ss({apiHandler:e}),this.invoices=ks({apiHandler:e}),this.kycDocuments=Cs({apiHandler:e}),this.kycRequests=Ts({apiHandler:e}),this.orders=xs({apiHandler:e}),this.paymentInstruments=Is({apiHandler:e}),this.plans=Ps({apiHandler:e}),this.products=Os({apiHandler:e}),this.purchase=js({apiHandler:e}),this.transactions=qs({apiHandler:e}),this.websites=Ds({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 gs({apiHandler:t})}function Bs({apiHandler:t}){return new vs({apiHandler:t})}function Us({apiHandler:t}){return new Ms({apiHandler:t})}const ye={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=ye}={}){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=$e({options:{apiEndpoints:s,apiKey:t,apiVersion:"",isSandbox:e,requestTimeout:r,jwt:null,organizationId:n}});return Ns({apiHandler:o})}function Ls({apiKey:t=null,sandbox:e=!1,timeout:r=be,organizationId:n=null,urls:s=ye}={}){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=$e({options:{apiEndpoints:s,apiKey:t,apiVersion:"experimental",isSandbox:e,requestTimeout:r,jwt:null,organizationId:n}});return Bs({apiHandler:o})}function Fs({publishableKey:t=null,jwt:e=null,sandbox:r=!1,timeout:n=be,organizationId:s=null,urls:u=ye}={}){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=$e({options:o});return l.setSessionToken(o.jwt),Us({apiHandler:l})}d.RebillyAPI=Ze,d.RebillyErrors=S,d.RebillyExperimentalAPI=Ls,d.RebillyStorefrontAPI=Fs,d.cancellation=un,d.default=Ze,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
37
|
+
*/var _r=zr,Jr=Object.prototype.hasOwnProperty,Wr=function(e,t,n){_r(e,function(s,u){if(Jr.call(e,u))return t.call(n,e[u],u,e)})},Gr=Tr,Xr=Lr,Yr=Kr,Qr=Wr;function de(r,e){switch(Yr(r)){case"object":return Zr(r,e);case"array":return Hr(r,e);default:return Xr(r)}}function Zr(r,e){if(Gr(r)){var t={};return Qr(r,function(n,s){this[s]=de(n,e)},t),t}else return e?e(r):r}function Hr(r,e){for(var t=r.length,n=[],s=-1;++s<t;)n[s]=de(r[s],e);return n}var en=de;const tn="47.10.0";let rn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",nn=(r=21)=>{let e="",t=r;for(;t--;)e+=rn[Math.random()*64|0];return e};class sn{constructor({id:e=null,created:t=null}={}){this.id=e||nn(),this.created=t||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,t)=>{try{L.getById(e).cancel(t),L.deleteById(e)}catch{}}),ve(re,"cancelAll",e=>L.getAll().forEach(t=>{t.cancel(e),L.deleteById(t.id)}));var un={cancelAll:(...r)=>re.cancelAll(...r)};const q={request:"request",response:"response"},Ye=r=>{if(!Object.values(q).includes(r))throw new Error(`There is no such interceptor type as "${r}"`);return!0};function $e({options:r}){const e=t();function t(){return pe.create(s())}function n(){return e}function s(){return{baseURL:u(),timeout:r.requestTimeout,headers:o()}}function u(){let i=r.isSandbox?r.apiEndpoints.sandbox:r.apiEndpoints.live;return r.apiVersion&&(i=`${i}/${r.apiVersion}`),r.organizationId&&(i=`${i}/organizations/${r.organizationId}`),`${i}`}function o(){const i={"REB-API-CONSUMER":`RebillySDK/JS-SDK ${tn}`};return r.apiKey&&(i["REB-APIKEY"]=r.apiKey),i}function l(){return en(e.defaults.headers)}function a(i){r.requestTimeout=Number(i),e.defaults.timeout=r.requestTimeout}function h(i=r.jwt){const m=l();r.apiKey=null,r.jwt=i,delete m.common["REB-APIKEY"],m.common.Authorization=`Bearer ${i}`,e.defaults.headers=m}function c(i=r.publishableKey){const m=l();r.publishableKey=i,m.common.Authorization=`${i}`,e.defaults.headers=m}function g({host:i,port:m,auth:f}){e.defaults.proxy={host:i,port:m,auth:f}}function w({live:i=null,sandbox:m=null}){i&&(r.apiEndpoints.live=i),m&&(r.apiEndpoints.sandbox=m),e.defaults.baseURL=u()}function b(i,{thenDelegate:m,catchDelegate:f=()=>{}}){return Ye(i)&&e.interceptors[q[i]].use(m,f)}function V(i,m){return Ye(i)&&e.interceptors[q[i]].eject(m)}function ne({thenDelegate:i,catchDelegate:m=()=>{}}){return b(q.request,{thenDelegate:i,catchDelegate:m})}function E(i){V(q.request,i)}function P({thenDelegate:i,catchDelegate:m=()=>{}}){return b(q.response,{thenDelegate:i,catchDelegate:m})}function T(i){V(q.response,i)}function x({request:i,isCollection:m,config:f}){const $=et(f),{id:O,cancelToken:Xs}=L.save();$.cancelToken=Xs;const st=async function(){try{const _=await i($);return z({response:_,isCollection:m,config:$})}catch(_){return He({error:_,config:$})}finally{L.deleteById(O)}}();return st.cancel=_=>re.cancelById(O,_),st}function z({response:i,isCollection:m,config:f}){return m?new dr(i,f):new _e(i,f)}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 Ks(i){return i.params!==void 0&&(i.params=Object.keys(i.params).filter(m=>i.params[m]!==null&&i.params[m]!=="").reduce((m,f)=>(m[f]=i.params[f],m),{})),i}function et(i={}){const m=Ks(i);return J({},m)}function tt(i,m={}){return x({request:f=>e.get(i,f),config:{params:m}})}function Vs(i,m){return x({request:f=>e.get(i,f),config:{params:m},isCollection:!0})}function rt(i,m,f={}){let $={};return f.authenticate===!1&&($={headers:l()},delete $.headers.common["REB-APIKEY"],delete $.headers.common.Authorization),f.params&&($.params=J({},f.params)),x({request:O=>e.post(i,m,O),config:$})}function nt(i,m,f={}){return x({request:$=>e.put(i,m,$),config:{params:f}})}function zs(i,m){return x({request:f=>e.patch(i,m,f),config:{}})}function _s(i){return x({request:m=>e.delete(i,m),config:{}})}function Js(i,m){return x({request:f=>e.delete(i,f),config:{data:J({},m)}})}async function Ws(i,m,f,$={}){if(m==="")return rt(i,f,{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,f,$);throw O}}async function Gs(i,m){const f=et(m);try{const $=await e.get(i,f);return new $r($,f)}catch($){return He({error:$,config:f})}}return{getInstance:n,addRequestInterceptor:ne,removeRequestInterceptor:E,addResponseInterceptor:P,removeResponseInterceptor:T,setTimeout:a,setProxyAgent:g,setSessionToken:h,setPublishableKey:c,setEndpoints:w,get:tt,getAll:Vs,post:rt,put:nt,patch:zs,delete:_s,deleteAll:Js,create:Ws,download:Gs}}function on({apiHandler:r}){return{activate({token:e}){return r.post(`activation/${e}`,{authenticate:!1})},forgotPassword({data:e}){return r.post("forgot-password",e,{authenticate:!1})},logout(){return r.post("logout")},signIn({data:e}){return r.post("signin",e,{authenticate:!1})},signUp({data:e}){return r.post("signup",e,{authenticate:!1})}}}function ln({apiHandler:r}){return{getAll({firstName:e,lastName:t,dob:n=null,country:s=null}){const u={firstName:e,lastName:t,dob:n,country:s};return r.getAll("aml",u)}}}function cn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null}={}){const s={limit:e,offset:t,sort:n};return r.getAll("api-keys",s)},create({id:e="",data:t}){return r.create(`api-keys/${e}`,e,t)},get({id:e}){return r.get(`api-keys/${e}`)},update({id:e,data:t}){return r.put(`api-keys/${e}`,t)},delete({id:e}){return r.delete(`api-keys/${e}`)}}}function an({apiHandler:r}){return{get({applicationId:e}){return r.get(`application-instances/${e}`)},upsert({applicationId:e,data:t}){return r.put(`application-instances/${e}`,t)},delete({applicationId:e}){return r.delete(`application-instances/${e}`)}}}function mn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:t,filter:n,q:s,expand:u,fields:o,sort:l};return r.getAll("applications",a)},create({data:e}){return r.post("applications",e)},get({id:e}){return r.get(`applications/${e}`)},getInstances({id:e}){return r.getAll(`applications/${e}/instances`)},getInstance({id:e,organizationId:t}){return r.get(`applications/${e}/instances/${t}`)}}}function fn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("balance-transactions",n)},get({id:e}){return r.get(`balance-transactions/${e}`)}}}function gn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("billing-portals",o)},create({id:e="",data:t}){return r.create(`billing-portals/${e}`,e,t)},get({id:e}){return r.get(`billing-portals/${e}`)},update({id:e,data:t}){return r.put(`billing-portals/${e}`,t)},delete({id:e}){return r.delete(`billing-portals/${e}`)}}}function hn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("blocklists",o)},create({id:e="",data:t}){return r.create(`blocklists/${e}`,e,t)},get({id:e}){return r.get(`blocklists/${e}`)},delete({id:e}){return r.delete(`blocklists/${e}`)}}}function pn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null}={}){const u={limit:e,offset:t,sort:n,filter:s};return r.getAll("broadcast-messages",u)},create({data:e}){return r.post("broadcast-messages",e)},get({id:e}){return r.get(`broadcast-messages/${e}`)},delete({id:e}){return r.delete(`broadcast-messages/${e}`)},update({id:e,data:t}){return r.patch(`broadcast-messages/${e}`,t)}}}function dn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("checkout-forms",o)},create({id:e="",data:t}){return r.create(`checkout-forms/${e}`,e,t)},get({id:e}){return r.get(`checkout-forms/${e}`)},update({id:e,data:t}){return r.put(`checkout-forms/${e}`,t)},delete({id:e}){return r.delete(`checkout-forms/${e}`)}}}function $n({apiHandler:r}){return{getAllRedemptions({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("coupons-redemptions",o)},redeem({data:e}){return r.post("coupons-redemptions",e)},getRedemption({id:e}){return r.get(`coupons-redemptions/${e}`)},cancelRedemption({id:e}){return r.post(`coupons-redemptions/${e}/cancel`)},getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("coupons",o)},create({id:e="",data:t}){return r.create(`coupons/${e}`,e,t)},get({id:e}){return r.get(`coupons/${e}`)},update({id:e,data:t}){return r.put(`coupons/${e}`,t)},setExpiration({id:e,data:t}){return r.post(`coupons/${e}/expiration`,t)}}}function yn({apiHandler:r}){return{createAWSSESCredential({data:e}){return r.post("credential-hashes/aws-ses",e)},getAWSSESCredential({hash:e}){return r.get(`credential-hashes/aws-ses/${e}`)},updateAWSSESCredential({hash:e,data:t}){return r.patch(`credential-hashes/aws-ses/${e}`,t)},createEmailCredential({data:e}){return r.post("credential-hashes/emails",e)},getEmailCredential({hash:e}){return r.get(`credential-hashes/emails/${e}`)},patchEmailCredential({hash:e,data:t}){return r.patch(`credential-hashes/emails/${e}`,t)},createMailgunCredential({data:e}){return r.post("credential-hashes/mailgun",e)},getMailgunCredential({hash:e}){return r.get(`credential-hashes/mailgun/${e}`)},patchMailgunCredential({hash:e,data:t}){return r.patch(`credential-hashes/mailgun/${e}`,t)},getAllOAuth2Credentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/oauth2",o)},createOAuth2Credential({data:e}){return r.post("credential-hashes/oauth2",e)},getOAuth2Credential({hash:e}){return r.get(`credential-hashes/oauth2/${e}`)},updateOAuth2Credential({hash:e,data:t}){return r.patch(`credential-hashes/oauth2/${e}`,t)},getOAuth2CredentialItems({hash:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,fields:o=null,sort:l=null}){const a={limit:t,offset:n,filter:s,q:u,fields:o,sort:l};return r.getAll(`credential-hashes/oauth2/${e}/items`,a)},getAllPlaidCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/plaid",o)},createPlaidCredential({data:e}){return r.post("credential-hashes/plaid",e)},getPlaidCredential({hash:e}){return r.get(`credential-hashes/plaid/${e}`)},updatePlaidCredential({hash:e,data:t}){return r.patch(`credential-hashes/plaid/${e}`,t)},createPostmarkCredential({data:e}){return r.post("credential-hashes/postmark",e)},getPostmarkCredential({hash:e}){return r.get(`credential-hashes/postmark/${e}`)},patchPostmarkCredential({hash:e,data:t}){return r.patch(`credential-hashes/postmark/${e}`,t)},createSendGridCredential({data:e}){return r.post("credential-hashes/sendgrid",e)},getSendGridCredential({hash:e}){return r.get(`credential-hashes/sendgrid/${e}`)},patchSendGridCredential({hash:e,data:t}){return r.patch(`credential-hashes/sendgrid/${e}`,t)},createWebhookCredential({data:e}){return r.post("credential-hashes/webhooks",e)},getWebhookCredential({hash:e}){return r.get(`credential-hashes/webhooks/${e}`)},patchWebhookCredential({hash:e,data:t}){return r.patch(`credential-hashes/webhooks/${e}`,t)},getAllExperianCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/experian",o)},createExperianCredential({data:e}){return r.post("credential-hashes/experian",e)},getExperianCredential({hash:e}){return r.get(`credential-hashes/experian/${e}`)},updateExperianCredential({hash:e,data:t}){return r.patch(`credential-hashes/experian/${e}`,t)},getAllTaxJarCredentials({filter:e=null,limit:t=null,offset:n=null,sort:s=null,q:u=null}={}){const o={filter:e,limit:t,offset:n,sort:s,q:u};return r.getAll("credential-hashes/taxjar",o)},createTaxJarCredential({data:e}){return r.post("credential-hashes/taxjar",e)},getTaxJarCredential({hash:e}){return r.get(`credential-hashes/taxjar/${e}`)},updateTaxJarCredential({hash:e,data:t}){return r.patch(`credential-hashes/taxjar/${e}`,t)}}}function bn({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u,expand:o};return r.getAll("credit-memos",l)},create({id:e="",data:t}){return r.create(`credit-memos/${e}`,e,t)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`credit-memos/${e}`,n)},update({id:e,data:t}){return r.put(`credit-memos/${e}`,t)},void({id:e}){return r.post(`credit-memos/${e}/void`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:t,offset:n,filter:s,sort:u,q:o};return r.getAll(`credit-memos/${e}/timeline`,l)},createTimelineComment({id:e,data:t}){return r.post(`credit-memos/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`credit-memos/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`credit-memos/${e}/timeline/${t}`)}}}function An({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("custom-domains",o)},create({data:e}){return r.post("custom-domains",e)},get({domain:e}){return r.get(`custom-domains/${e}`)},delete({domain:e}){return r.delete(`custom-domains/${e}`)}}}function vn({apiHandler:r}){return{getAll({resource:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`custom-fields/${e}`,s)},get({resource:e,name:t}){return r.get(`custom-fields/${e}/${t}`)},create({resource:e,name:t,data:n}){return r.put(`custom-fields/${e}/${t}`,n)},update({resource:e,name:t,data:n}){return r.put(`custom-fields/${e}/${t}`,n)}}}function wn({apiHandler:r}){return{getAuthOptions(){return r.get("authentication-options")},updateAuthOptions({data:e}){return r.put("authentication-options",e)},getAllAuthTokens({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("authentication-tokens",n)},login({data:e}){return r.post("authentication-tokens",e)},verify({token:e}){return r.get(`authentication-tokens/${e}`)},logout({token:e}){return r.delete(`authentication-tokens/${e}`)},exchangeToken({token:e,data:t}){return r.post(`authentication-tokens/${e}/exchange`,t)},getAllCredentials({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("credentials",n)},createCredential({id:e="",data:t}){return r.create(`credentials/${e}`,e,t)},getCredential({id:e}){return r.get(`credentials/${e}`)},updateCredential({id:e,data:t}){return r.put(`credentials/${e}`,t)},deleteCredential({id:e}){return r.delete(`credentials/${e}`)},getAllResetPasswordTokens({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("password-tokens",n)},createResetPasswordToken({data:e}){return r.post("password-tokens",e)},getResetPasswordToken({id:e}){return r.get(`password-tokens/${e}`)},deleteResetPasswordToken({id:e}){return r.delete(`password-tokens/${e}`)}}}const D={Accept:"text/csv"},Qe={Accept:"application/pdf"};function Rn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:t,filter:n,q:s,expand:u,fields:o,sort:l};return r.getAll("customers",a)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`customers/${e}`,e,t,s)},get({id:e,expand:t=null,fields:n=null}){const s={expand:t,fields:n};return r.get(`customers/${e}`,s)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`customers/${e}`,t,s)},merge({id:e,targetCustomerId:t}){return r.delete(`customers/${e}?targetCustomerId=${t}`)},getAml({id:e}){return r.getAll(`customers/${e}/aml`)},getLeadSource({id:e}){return r.get(`customers/${e}/lead-source`)},createLeadSource({id:e,data:t}){return r.put(`customers/${e}/lead-source`,t)},updateLeadSource({id:e,data:t}){return r.put(`customers/${e}/lead-source`,t)},deleteLeadSource({id:e}){return r.delete(`customers/${e}/lead-source`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:t,offset:n,filter:s,sort:u,q:o};return r.getAll(`customers/${e}/timeline`,l)},createTimelineComment({id:e,data:t}){return r.post(`customers/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`customers/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`customers/${e}/timeline/${t}`)},getAllUpcomingInvoices({id:e,expand:t=null}){const n={expand:t};return r.getAll(`customers/${e}/upcoming-invoices`,n)},getCustomerEddScore({id:e}){return r.get(`customers/${e}/edd-score`)},patchCustomerEddScore({id:e,data:t}){return r.patch(`customers/${e}/edd-score`,t)},getEddTimelineCollection({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:t,offset:n,filter:s,sort:u,q:o};return r.getAll(`customers/${e}/edd-timeline`,l)},createEddTimelineComment({id:e,data:t}){return r.post(`customers/${e}/edd-timeline`,t)},GetEddSearchResults({id:e}){return r.get(`customers/${e}/edd-search-results`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:o},headers:D};return r.download("customers",l)}}}function En({apiHandler:r}){return{create({data:e}){return r.post("digital-wallets/onboarding/apple-pay",e)},validate({data:e}){return r.post("digital-wallets/validation",e)}}}function Sn({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u,expand:o};return r.getAll("disputes",l)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`disputes/${e}`,e,t,s)},get({id:e}){return r.get(`disputes/${e}`)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`disputes/${e}`,t,s)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:o},headers:D};return r.download("disputes",l)}}}function kn({apiHandler:r}){return{verify({token:e}){return r.put(`email-delivery-setting-verifications/${e}`)},getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null}={}){const o={limit:e,offset:t,filter:n,sort:s,q:u};return r.getAll("email-delivery-settings",o)},create({data:e}){return r.post("email-delivery-settings",e)},get({id:e}){return r.get(`email-delivery-settings/${e}`)},delete({id:e}){return r.delete(`email-delivery-settings/${e}`)},update({id:e,data:t}){return r.patch(`email-delivery-settings/${e}`,t)},resendVerification({id:e}){return r.post(`email-delivery-settings/${e}/resend-email-verification`)}}}function Cn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,q:n=null,sort:s=null,filter:u=null}={}){const o={limit:e,offset:t,q:n,sort:s,filter:u};return r.getAll("email-messages",o)},create({data:e}){return r.post("email-messages",e)},get({id:e}){return r.get(`email-messages/${e}`)},delete({id:e}){return r.delete(`email-messages/${e}`)},send({id:e,data:t={status:"outbox"}}){return r.patch(`email-messages/${e}`,t)}}}function Tn({apiHandler:r}){return{getAll(){return r.getAll("email-notifications")}}}function xn({apiHandler:r}){return{getAll(){return r.getAll("events")},get({eventType:e}){return r.get(`events/${e}`)},getRules({eventType:e}){return r.get(`events/${e}/rules`)},createRules({eventType:e,data:t}){return r.put(`events/${e}/rules`,t)},updateRules({eventType:e,data:t}){return r.put(`events/${e}/rules`,t)},getAllTimelineMessages({eventType:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:t,offset:n,filter:s,sort:u,q:o};return r.getAll(`events/${e}/timeline`,l)},createTimelineComment({eventType:e,data:t}){return r.post(`events/${e}/timeline`,t)},getTimelineMessage({eventType:e,messageId:t}){return r.get(`events/${e}/timeline/${t}`)},deleteTimelineMessage({eventType:e,messageId:t}){return r.delete(`events/${e}/timeline/${t}`)},getRulesHistory({eventType:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,sort:o=null,fields:l=null,expand:a=null}){const h={limit:t,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return r.getAll(`events/${e}/rules/history`,h)},getRulesVersionNumber({eventType:e,version:t,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return r.get(`events/${e}/rules/history/${t}`,u)},getRulesVersionDetail({eventType:e,version:t,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return r.get(`events/${e}/rules/versions/${t}`,u)},getAllDraftRulesets({eventType:e,limit:t=null,offset:n=null,filter:s=null,q:u=null,sort:o=null,fields:l=null,expand:a=null}){const h={limit:t,offset:n,filter:s,q:u,sort:o,fields:l,expand:a};return r.getAll(`events/${e}/rules/drafts`,h)},createDraftRuleset({eventType:e,data:t}){return r.post(`events/${e}/rules/drafts`,t)},getDraftRuleset({eventType:e,id:t,fields:n=null,expand:s=null}){const u={fields:n,expand:s};return r.get(`events/${e}/rules/drafts/${t}`,u)},updateDraftRuleset({eventType:e,id:t,data:n}){return r.put(`events/${e}/rules/drafts/${t}`,n)},deleteDraftRuleset({eventType:e,id:t}){return r.delete(`events/${e}/rules/drafts/${t}`)}}}function In({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("fees",n)},create({id:e="",data:t}){return r.create(`fees/${e}`,e,t)},get({id:e}){return r.get(`fees/${e}`)},upsert({id:e,data:t}){return r.put(`fees/${e}`,t)},patch({id:e,data:t}){return r.patch(`fees/${e}`,t)}}}function Pn({apiHandler:r}){return{getAllAttachments({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:t,filter:n,q:s,expand:u,fields:o,sort:l};return r.getAll("attachments",a)},attach({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`attachments/${e}`,e,t,s)},getAttachment({id:e}){return r.get(`attachments/${e}`)},updateAttachment({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`attachments/${e}`,t,s)},detach({id:e}){return r.delete(`attachments/${e}`)},getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,expand:u=null,fields:o=null,sort:l=null}={}){const a={limit:e,offset:t,filter:n,q:s,expand:u,fields:o,sort:l};return r.getAll("files",a)},upload({fileObject:e}){return r.post("files",e)},get({id:e}){return r.get(`files/${e}`)},update({id:e,data:t}){return r.put(`files/${e}`,t)},delete({id:e}){return r.delete(`files/${e}`)},download({id:e}){const t={responseType:"arraybuffer"};return r.download(`files/${e}/download`,t)},detachAndDelete({id:e}){const t={filter:`fileId:${e}`};let n=[];const u=(async()=>{const o=this.getAllAttachments(t);n.push(o);const a=(await o).items.map(c=>this.detach({id:c.fields.id}));n=[...n,a],await Promise.all(a);const h=r.delete(`files/${e}`);return n.push(h),h})();return u.cancel=()=>{n.forEach(o=>o.cancel())},u},uploadAndUpdate({fileObject:e,data:t={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:t.description,tags:t.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 On({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null,fields:o=null}={}){const l={limit:e,offset:t,sort:n,filter:s,q:u,fields:o};return r.getAll("gateway-accounts",l)},create({id:e="",data:t}){return r.create(`gateway-accounts/${e}`,e,t)},get({id:e}){return r.get(`gateway-accounts/${e}`)},update({id:e,data:t}){return r.patch(`gateway-accounts/${e}`,t)},delete({id:e}){return r.delete(`gateway-accounts/${e}`)},close({id:e}){return r.post(`gateway-accounts/${e}/close`)},disable({id:e}){return r.post(`gateway-accounts/${e}/disable`)},getAllDowntimeSchedules({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null}){const o={limit:t,offset:n,filter:s,sort:u};return r.getAll(`gateway-accounts/${e}/downtime-schedules`,o)},createDowntimeSchedule({id:e,data:t}){return r.post(`gateway-accounts/${e}/downtime-schedules`,t)},getDowntimeSchedule({id:e,downtimeId:t}){return r.get(`gateway-accounts/${e}/downtime-schedules/${t}`)},updateDowntimeSchedule({id:e,downtimeId:t,data:n}){return r.put(`gateway-accounts/${e}/downtime-schedules/${t}`,n)},deleteDowntimeSchedule({id:e,downtimeId:t}){return r.delete(`gateway-accounts/${e}/downtime-schedules/${t}`)},enable({id:e}){return r.post(`gateway-accounts/${e}/enable`)},getAllVolumeLimits({id:e}){return r.getAll(`gateway-accounts/${e}/limits`)},getVolumeLimit({id:e,limitId:t}){return r.get(`gateway-accounts/${e}/limits/${t}`)},updateVolumeLimit({id:e,limitId:t,data:n}){return r.put(`gateway-accounts/${e}/limits/${t}`,n)},deleteVolumeLimit({id:e,limitId:t}){return r.delete(`gateway-accounts/${e}/limits/${t}`)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:t,offset:n,filter:s,sort:u,q:o};return r.getAll(`gateway-accounts/${e}/timeline`,l)},createTimelineComment({id:e,data:t}){return r.post(`gateway-accounts/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`gateway-accounts/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`gateway-accounts/${e}/timeline/${t}`)},checkCredentials({id:e}){return r.post(`gateway-accounts/${e}/check-credentials`)},getFinancialSettings({id:e}){return r.get(`gateway-accounts/${e}/financial-settings`)},setFinancialSettings({id:e,data:t}){return r.put(`gateway-accounts/${e}/financial-settings`,t)}}}function jn({apiHandler:r}){return{getAll(){return r.getAll("integrations")},get({label:e}){return r.get(`integrations/${e}`)}}}function qn({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u,expand:o};return r.getAll("invoices",l)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`invoices/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`invoices/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`invoices/${e}`,t,s)},getAllInvoiceItems({id:e,limit:t=null,offset:n=null,expand:s=null}){const u={limit:t,offset:n,expand:s};return r.getAll(`invoices/${e}/items`,u)},createInvoiceItem({id:e,data:t}){return r.post(`invoices/${e}/items`,t)},getInvoiceItem({id:e,itemId:t}){return r.get(`invoices/${e}/items/${t}`)},updateInvoiceItem({id:e,itemId:t,data:n}){return r.put(`invoices/${e}/items/${t}`,n)},deleteInvoiceItem({id:e,itemId:t}){return r.delete(`invoices/${e}/items/${t}`)},issue({id:e,data:t}){return r.post(`invoices/${e}/issue`,t)},abandon({id:e}){return r.post(`invoices/${e}/abandon`)},void({id:e}){return r.post(`invoices/${e}/void`)},recalculate({id:e}){return r.post(`invoices/${e}/recalculate`)},reissue({id:e,data:t}){return r.post(`invoices/${e}/reissue`,t)},getAllTransactionAllocations({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`invoices/${e}/transaction-allocations`,s)},applyTransaction({id:e,data:t}){return r.post(`invoices/${e}/transaction`,t)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:t,offset:n,filter:s,sort:u,q:o};return r.getAll(`invoices/${e}/timeline`,l)},createTimelineComment({id:e,data:t}){return r.post(`invoices/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`invoices/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`invoices/${e}/timeline/${t}`)},getAllCreditMemoAllocations({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.getAll(`invoices/${e}/credit-memo-allocations`,s)},getCreditMemoAllocation({id:e,creditMemoId:t,limit:n=null,offset:s=null}){const u={limit:n,offset:s};return r.get(`invoices/${e}/credit-memo-allocations/${t}`,u)},applyCreditMemo({id:e,creditMemoId:t,data:n}){return r.put(`invoices/${e}/credit-memo-allocations/${t}`,n)},deleteCreditMemoAllocation({id:e,creditMemoId:t}){return r.delete(`invoices/${e}/credit-memo-allocations/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:o},headers:D};return r.download("invoices",l)},downloadPDF({id:e}){const t={headers:Qe,responseType:"arraybuffer"};return r.download(`invoices/${e}`,t)}}}function Dn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("kyc-documents",u)},create({id:e="",data:t}){return r.create(`kyc-documents/${e}`,e,t)},get({id:e}){return r.get(`kyc-documents/${e}`)},update({id:e,data:t}){return r.put(`kyc-documents/${e}`,t)},accept({id:e}){return r.post(`kyc-documents/${e}/acceptance`)},matches({id:e,data:t}){return r.post(`kyc-documents/${e}/matches`,t)},reject({id:e,data:t}){return r.post(`kyc-documents/${e}/rejection`,t)},review({id:e}){return r.post(`kyc-documents/${e}/review`)},startReview({id:e}){return r.post(`kyc-documents/${e}/start-review`)},stopReview({id:e}){return r.post(`kyc-documents/${e}/stop-review`)}}}function Mn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("kyc-requests",u)},create({data:e}){return r.post("kyc-requests",e)},get({id:e}){return r.get(`kyc-requests/${e}`)},delete({id:e}){return r.delete(`kyc-requests/${e}`)},update({id:e,data:t}){return r.patch(`kyc-requests/${e}`,t)}}}function Nn({apiHandler:r}){return{getKycSettings(){return r.get("kyc-settings")},updateKycSettings({data:e}){return r.put("kyc-settings",e)}}}function Bn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,fields:u=null,q:o=null}={}){const l={limit:e,offset:t,filter:n,sort:s,fields:u,q:o};return r.getAll("lists",l)},create({id:e="",data:t}){return r.create(`lists/${e}`,e,t)},getLatestVersion({id:e}){return r.get(`lists/${e}`)},update({id:e,data:t}){return r.put(`lists/${e}`,t)},delete({id:e}){return r.delete(`lists/${e}`)},getByVersion({id:e,version:t}){return r.get(`lists/${e}/${t}`)}}}function Un({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("memberships",u)},get({organizationId:e,userId:t}){return r.get(`memberships/${e}/${t}`)},update({organizationId:e,userId:t,data:n}){return r.put(`memberships/${e}/${t}`,n)},delete({organizationId:e,userId:t}){return r.delete(`memberships/${e}/${t}`)}}}function Ln({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null}={}){const u={limit:e,offset:t,filter:n,q:s};return r.getAll("organizations",u)},create({data:e}){return r.post("organizations",e)},get({id:e}){return r.get(`organizations/${e}`)},update({id:e,data:t}){return r.patch(`organizations/${e}`,t)}}}function Fn({apiHandler:r}){return{getAll({limit:e=null,q:t=null}={}){const n={limit:e,q:t};return r.getAll("payment-cards-bank-names",n)}}}function Kn({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u,expand:o};return r.getAll("payment-instruments",l)},create({data:e}){return r.post("payment-instruments",e)},get({id:e}){return r.get(`payment-instruments/${e}`)},update({id:e,data:t}){return r.patch(`payment-instruments/${e}`,t)},deactivate({id:e}){return r.post(`payment-instruments/${e}/deactivation`)}}}function Vn({apiHandler:r}){return{getAll(){return r.getAll("payment-methods")},get({apiName:e}){return r.get(`payment-methods/${e}`)}}}function zn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("tokens",n)},create({data:e}){return r.post("tokens",e)},get({token:e}){return r.get(`tokens/${e}`)}}}function _n({apiHandler:r}){return{create({data:e}){return r.post("payouts",e)}}}function Jn({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("plans",o)},create({id:e="",data:t}){return r.create(`plans/${e}`,e,t)},get({id:e}){return r.get(`plans/${e}`)},update({id:e,data:t}){return r.put(`plans/${e}`,t)},delete({id:e}){return r.delete(`plans/${e}`)}}}function Wn({apiHandler:r}){return{sendEmailRuleAction({data:e}){return r.post("previews/rule-actions/send-email",e)},triggerWebhookRuleAction({data:e}){return r.post("previews/rule-actions/trigger-webhook",e)},webhook({data:e}){return r.post("previews/webhooks",e)},order({data:e}){return r.post("previews/orders",e)}}}function Gn({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("products",o)},create({id:e="",data:t}){return r.create(`products/${e}`,e,t)},get({id:e}){return r.get(`products/${e}`)},update({id:e,data:t}){return r.put(`products/${e}`,t)},delete({id:e}){return r.delete(`products/${e}`)}}}function Xn({apiHandler:r}){return{startPermissionsEmulation({data:e}){return r.post("permissions-emulation",e)},stopPermissionsEmulation(){return r.delete("permissions-emulation")},get(){return r.get("profile")},update({data:e}){return r.put("profile",e)},getMfa(){return r.get("profile/mfa")},updateMfa(){return r.post("profile/mfa")},deleteMfa(){return r.delete("profile/mfa")},updatePassword({data:e}){return r.post("profile/password",e)},resetTotp(){return r.post("profile/totp-reset")}}}function Yn({apiHandler:r}){return{readyToPay({data:e}){return r.post("ready-to-pay",e)}}}function Qn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null,expand:o=null}={}){const l={limit:e,offset:t,filter:n,sort:s,q:u,expand:o};return r.getAll("roles",l)},create({id:e="",data:t}){return r.create(`roles/${e}`,e,t)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`roles/${e}`,n)},update({id:e,data:t}){return r.put(`roles/${e}`,t)},delete({id:e}){return r.delete(`roles/${e}`)}}}function Zn({apiHandler:r}){return{get({sort:e=null,limit:t=null,offset:n=null,q:s=null}){const u={sort:e,limit:t,offset:n,q:s};return r.get("search",u)}}}function Hn({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("grid-segments",o)},create({id:e="",data:t}){return r.create(`grid-segments/${e}`,e,t)},get({id:e}){return r.get(`grid-segments/${e}`)},update({id:e,data:t}){return r.put(`grid-segments/${e}`,t)},delete({id:e}){return r.delete(`grid-segments/${e}`)}}}function es({apiHandler:r}){return{getAll({eventType:e}){return r.getAll(`send-through-attribution/${e}`)}}}function ts({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null,q:u=null}={}){const o={limit:e,offset:t,filter:n,sort:s,q:u};return r.getAll("shipping-rates",o)},create({id:e="",data:t}){return r.create(`shipping-rates/${e}`,e,t)},get({id:e}){return r.get(`shipping-rates/${e}`)},update({id:e,data:t}){return r.put(`shipping-rates/${e}`,t)},delete({id:e}){return r.delete(`shipping-rates/${e}`)}}}function rs({apiHandler:r}){return{get(){return r.get("status")}}}function ns({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-cancellations",u)},create({id:e="",data:t}){return r.create(`subscription-cancellations/${e}`,e,t)},get({id:e}){return r.get(`subscription-cancellations/${e}`)},delete({id:e}){return r.delete(`subscription-cancellations/${e}`)},patch({id:e,data:t}){return r.patch(`subscription-cancellations/${e}`,t)}}}function ss({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-pauses",u)},pause({id:e="",data:t}){return r.create(`subscription-pauses/${e}`,e,t)},get({id:e}){return r.get(`subscription-pauses/${e}`)},update({id:e,data:t}){return r.put(`subscription-pauses/${e}`,t)},delete({id:e}){return r.delete(`subscription-pauses/${e}`)}}}function us({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,sort:s=null}={}){const u={limit:e,offset:t,filter:n,sort:s};return r.getAll("subscription-reactivations",u)},reactivate({data:e}){return r.post("subscription-reactivations",e)},get({id:e}){return r.get(`subscription-reactivations/${e}`)}}}function os({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u,expand:o};return r.getAll("subscriptions",l)},create({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`subscriptions/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`subscriptions/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`subscriptions/${e}`,t,s)},delete({id:e}){return r.delete(`subscriptions/${e}`)},void({id:e}){return r.post(`subscriptions/${e}/void`)},changeItems({id:e,data:t}){return r.post(`subscriptions/${e}/change-items`,t)},createInterimInvoice({id:e,data:t}){return r.post(`subscriptions/${e}/interim-invoice`,t)},getAllUpcomingInvoices({id:e,expand:t=null}){const n={expand:t};return r.getAll(`subscriptions/${e}/upcoming-invoices`,n)},issueUpcomingInvoice({id:e,invoiceId:t,data:n}){return r.post(`subscriptions/${e}/upcoming-invoices/${t}/issue`,n)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null,sort:u=null,q:o=null}){const l={limit:t,offset:n,filter:s,sort:u,q:o};return r.getAll(`subscriptions/${e}/timeline`,l)},createTimelineComment({id:e,data:t}){return r.post(`subscriptions/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`subscriptions/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`subscriptions/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:o},headers:D};return r.download("subscriptions",l)}}}function ls({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("tags",o)},create({data:e}){return r.post("tags",e)},get({tag:e}){return r.get(`tags/${e}`)},delete({tag:e}){return r.delete(`tags/${e}`)},update({tag:e,data:t}){return r.patch(`tags/${e}`,t)},tagCustomers({tag:e,data:t}){return r.post(`tags/${e}/customers`,t)},untagCustomers({tag:e,data:t}){return r.delete(`tags/${e}/customers`,t)},tagCustomer({tag:e,customerId:t}){return r.post(`tags/${e}/customers/${t}`)},untagCustomer({tag:e,customerId:t}){return r.delete(`tags/${e}/customers/${t}`)},tagKycDocuments({tag:e,data:t}){return r.post(`tags/${e}/kyc-documents`,t)},untagKycDocuments({tag:e,data:t}){return r.delete(`tags/${e}/kyc-documents`,t)},tagKycDocument({tag:e,kycDocumentId:t}){return r.post(`tags/${e}/kyc-documents/${t}`)},untagKycDocument({tag:e,kycDocumentId:t}){return r.delete(`tags/${e}/kyc-documents/${t}`)}}}function is({apiHandler:r}){return{getAllApiLogs({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/api",o)},getApiLog({id:e}){return r.get(`tracking/api/${e}`)},getAllListsChangesHistory({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/lists",o)},getAllWebhookTrackingLogs({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("tracking/webhooks",o)},getWebhookTrackingLog({id:e}){return r.get(`tracking/webhooks/${e}`)},resendWebhook({id:e}){return r.post(`tracking/webhooks/${e}/resend`)},downloadApiLogsCSV({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={params:{limit:e,offset:t,sort:n,filter:s,q:u},headers:D};return r.download("tracking/api",o)}}}function cs({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null,expand:o=null}={}){const l={limit:e,offset:t,filter:n,q:s,sort:u,expand:o};return r.getAll("transactions",l)},create({data:e,expand:t=null}){const n={expand:t};return r.post("transactions",e,n)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`transactions/${e}`,n)},patch({id:e,data:t}){return r.patch(`transactions/${e}`,t)},query({id:e}){return r.post(`transactions/${e}/query`)},update({id:e,data:t}){return r.post(`transactions/${e}/update`,t)},refund({id:e,data:t}){return r.post(`transactions/${e}/refund`,t)},getAllTimelineMessages({id:e,limit:t=null,offset:n=null,filter:s=null}){const u={limit:t,offset:n,filter:s};return r.getAll(`transactions/${e}/timeline`,u)},createTimelineComment({id:e,data:t}){return r.post(`transactions/${e}/timeline`,t)},getTimelineMessage({id:e,messageId:t}){return r.get(`transactions/${e}/timeline/${t}`)},deleteTimelineMessage({id:e,messageId:t}){return r.delete(`transactions/${e}/timeline/${t}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:o},headers:D};return r.download("transactions",l)}}}function as({apiHandler:r}){return{getResetPasswordToken({token:e}){return r.get(`reset-password/${e}`)},resetPassword({token:e,data:t}){return r.post(`reset-password/${e}`,t)},getAll({limit:e=null,offset:t=null,sort:n=null,filter:s=null,q:u=null}={}){const o={limit:e,offset:t,sort:n,filter:s,q:u};return r.getAll("users",o)},create({id:e="",data:t}){return r.create(`users/${e}`,e,t)},get({id:e}){return r.get(`users/${e}`)},update({id:e,data:t}){return r.put(`users/${e}`,t)},getMfa({id:e}){return r.get(`users/${e}/mfa`)},updatePassword({id:e,data:t}){return r.post(`users/${e}/password`,t)},resetTotp({id:e}){return r.post(`users/${e}/totp-reset`)}}}function ms({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null}={}){const s={limit:e,offset:t,filter:n};return r.getAll("webhooks",s)},create({id:e="",data:t}){return r.create(`webhooks/${e}`,e,t)},get({id:e}){return r.get(`webhooks/${e}`)},update({id:e,data:t}){return r.put(`webhooks/${e}`,t)}}}function fs({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,q:n=null,filter:s=null,sort:u=null}={}){const o={limit:e,offset:t,q:n,filter:s,sort:u};return r.getAll("websites",o)},create({id:e="",data:t}){return r.create(`websites/${e}`,e,t)},get({id:e}){return r.get(`websites/${e}`)},update({id:e,data:t}){return r.put(`websites/${e}`,t)},delete({id:e}){return r.delete(`websites/${e}`)},downloadCSV({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:o=null}={}){const l={params:{limit:e,offset:t,sort:n,expand:s,filter:u,q:o},headers:D};return r.download("websites",l)}}}class gs{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=mn({apiHandler:e}),this.balanceTransactions=fn({apiHandler:e}),this.billingPortals=gn({apiHandler:e}),this.blocklists=hn({apiHandler:e}),this.broadcastMessages=pn({apiHandler:e}),this.checkoutForms=dn({apiHandler:e}),this.coupons=$n({apiHandler:e}),this.credentialHashes=yn({apiHandler:e}),this.creditMemos=bn({apiHandler:e}),this.customDomains=An({apiHandler:e}),this.customFields=vn({apiHandler:e}),this.customerAuthentication=wn({apiHandler:e}),this.customers=Rn({apiHandler:e}),this.digitalWallets=En({apiHandler:e}),this.disputes=Sn({apiHandler:e}),this.emailDeliverySettings=kn({apiHandler:e}),this.emailMessages=Cn({apiHandler:e}),this.emailNotifications=Tn({apiHandler:e}),this.events=xn({apiHandler:e}),this.fees=In({apiHandler:e}),this.files=Pn({apiHandler:e}),this.gatewayAccounts=On({apiHandler:e}),this.integrations=jn({apiHandler:e}),this.invoices=qn({apiHandler:e}),this.kycDocuments=Dn({apiHandler:e}),this.kycRequests=Mn({apiHandler:e}),this.kycSettings=Nn({apiHandler:e}),this.lists=Bn({apiHandler:e}),this.memberships=Un({apiHandler:e}),this.organizations=Ln({apiHandler:e}),this.paymentCardsBankNames=Fn({apiHandler:e}),this.paymentInstruments=Kn({apiHandler:e}),this.paymentMethods=Vn({apiHandler:e}),this.paymentTokens=zn({apiHandler:e}),this.payouts=_n({apiHandler:e}),this.plans=Jn({apiHandler:e}),this.previews=Wn({apiHandler:e}),this.products=Gn({apiHandler:e}),this.profile=Xn({apiHandler:e}),this.purchase=Yn({apiHandler:e}),this.roles=Qn({apiHandler:e}),this.search=Zn({apiHandler:e}),this.segments=Hn({apiHandler:e}),this.sendThroughAttribution=es({apiHandler:e}),this.shippingRates=ts({apiHandler:e}),this.status=rs({apiHandler:e}),this.subscriptionCancellations=ns({apiHandler:e}),this.subscriptionPauses=ss({apiHandler:e}),this.subscriptionReactivations=us({apiHandler:e}),this.subscriptions=os({apiHandler:e}),this.tags=ls({apiHandler:e}),this.tracking=is({apiHandler:e}),this.transactions=cs({apiHandler:e}),this.users=as({apiHandler:e}),this.webhooks=ms({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 hs({apiHandler:r}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return r.get(`customers/${e}/summary-metrics`)}}}function ps({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,sort:n=null,expand:s=null,filter:u=null,q:o=null,criteria:l=null}={}){const a={limit:e,offset:t,sort:n,expand:s,filter:u,q:o,criteria:l};return r.getAll("data-exports",a)},queue({id:e="",data:t,expand:n=null}){const s={expand:n};return r.create(`data-exports/${e}`,e,t,s)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`data-exports/${e}`,n)},update({id:e,data:t,expand:n=null}){const s={expand:n};return r.put(`data-exports/${e}`,t,s)},delete({id:e}){return r.delete(`data-exports/${e}`)}}}function ds({apiHandler:r}){return{getTransactionHistogramReport({periodStart:e,periodEnd:t,aggregationField:n,aggregationPeriod:s,metric:u,filter:o=null}){const l={periodStart:e,periodEnd:t,aggregationField:n,aggregationPeriod:s,metric:u,filter:o};return r.get("histograms/transactions",l)}}}function $s({apiHandler:r}){return{getApiLogSummary({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/api-log-summary",u)},getCumulativeSubscriptions({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:o};return r.get("reports/cumulative-subscriptions",l)},getDashboardMetrics({periodStart:e,periodEnd:t,metrics:n=null,segments:s=null}){const u={periodStart:e,periodEnd:t,metrics:n,segments:s};return r.get("reports/dashboard",u)},getDccMarkup({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:o};return r.get("reports/dcc-markup",l)},getDisputes({aggregationField:e,periodMonth:t,limit:n=null,offset:s=null,filter:u=null}){const o={aggregationField:e,periodMonth:t,limit:n,offset:s,filter:u};return r.get("reports/disputes",o)},getEventsTriggeredSummary({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/events-triggered",u)},getTriggeredEventRuleReport({eventType:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null}){const o={periodStart:t,periodEnd:n,limit:s,offset:u};return r.get(`reports/events-triggered/${e}/rules`,o)},getFutureRenewals({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/future-renewals",u)},getKycAcceptanceSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-acceptance-summary",n)},getKycRejectionSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-rejection-summary",n)},getKycRequestSummary({periodStart:e,periodEnd:t}){const n={periodStart:e,periodEnd:t};return r.get("reports/kyc-request-summary",n)},getMonthlyRecurringRevenue({currency:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null}){const o={currency:e,periodStart:t,periodEnd:n,limit:s,offset:u};return r.get("reports/monthly-recurring-revenue",o)},getRenewalSales({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/renewal-sales",u)},getRetentionPercentage({aggregationField:e,aggregationPeriod:t,includeSwitchedSubscriptions:n=null,periodStart:s,periodEnd:u,limit:o=null,offset:l=null,filter:a=null,criteria:h=null}){const c={aggregationField:e,aggregationPeriod:t,includeSwitchedSubscriptions:n,periodStart:s,periodEnd:u,limit:o,offset:l,filter:a,criteria:h};return r.get("reports/retention-percentage",c)},getRetentionValue({aggregationField:e,aggregationPeriod:t,includeRefunds:n=null,includeDisputes:s=null,periodStart:u,periodEnd:o,limit:l=null,offset:a=null,filter:h=null,sort:c=null,criteria:g=null}){const w={aggregationField:e,aggregationPeriod:t,includeRefunds:n,includeDisputes:s,periodStart:u,periodEnd:o,limit:l,offset:a,filter:h,sort:c,criteria:g};return r.get("reports/retention-value",w)},getRevenueWaterfall({currency:e,issuedFrom:t,issuedTo:n,recognizedTo:s}){const u={currency:e,issuedFrom:t,issuedTo:n,recognizedTo:s};return r.get("reports/revenue-waterfall",u)},getSubscriptionCancellation({periodStart:e,periodEnd:t,aggregationField:n,limit:s=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:t,aggregationField:n,limit:s,offset:u,filter:o};return r.get("reports/subscription-cancellation",l)},getSubscriptionRenewal({periodStart:e,periodEnd:t,limit:n=null,offset:s=null}){const u={periodStart:e,periodEnd:t,limit:n,offset:s};return r.get("reports/subscription-renewal",u)},getTimeSeriesTransaction({type:e,subaggregate:t,periodStart:n,periodEnd:s}){const u={type:e,subaggregate:t,periodStart:n,periodEnd:s};return r.get("reports/time-series-transaction",u)},getTransactionsTimeDispute({aggregationField:e,periodStart:t,periodEnd:n,limit:s=null,offset:u=null,filter:o=null}){const l={aggregationField:e,periodStart:t,periodEnd:n,limit:s,offset:u,filter:o};return r.get("reports/transactions-time-dispute",l)},getTransactions({periodStart:e,periodEnd:t,aggregationField:n,limit:s=null,offset:u=null,filter:o=null}){const l={periodStart:e,periodEnd:t,aggregationField:n,limit:s,offset:u,filter:o};return r.get("reports/transactions",l)}}}function ys({apiHandler:r}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return r.get(`subscriptions/${e}/summary-metrics`)}}}function bs({apiHandler:r}){return{getActivityFeed({eventTypes:e=null,limit:t=1e3,offset:n=0}){const s={eventTypes:e,limit:t,offset:n};return r.getAll("activity-feed",s)},getTransaction({id:e="",eventTypes:t=null,limit:n=1e3,offset:s=0}){const u={eventTypes:t,limit:n,offset:s};return r.getAll(`transactions/${e}/timeline`,u)},getCustomer({id:e="",eventTypes:t=null,limit:n=1e3,offset:s=0}){const u={eventTypes:t,limit:n,offset:s};return r.getAll(`customers/${e}/timeline`,u)}}}function As({apiHandler:r}){return{query(){return r.get("location")}}}const M={CustomersResource:hs,DataExportsResource:ps,HistogramsResource:ds,ReportsResource:$s,SubscriptionsResource:ys,TimelinesResource:bs,LocationResource:As};class vs{constructor({apiHandler:e}){this.customers=M.CustomersResource({apiHandler:e}),this.dataExports=M.DataExportsResource({apiHandler:e}),this.histograms=M.HistogramsResource({apiHandler:e}),this.reports=M.ReportsResource({apiHandler:e}),this.subscriptions=M.SubscriptionsResource({apiHandler:e}),this.timelines=M.TimelinesResource({apiHandler:e}),this.location=M.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 ws({apiHandler:r}){return{get(){return r.get("account")},update({data:e}){return r.patch("account",e)},requestPasswordReset({data:e}){return r.post("account/forgot-password",e)},changePassword({data:e}){return r.patch("account/password",e)},resendEmailVerification({data:e}){return r.post("account/resend-verification",e)},confirmPasswordReset({token:e,data:t}){return r.post(`account/reset-password/${e}`,t)},verifyEmail({token:e}){return r.post(`account/verification/${e}`)},register({data:e}){return r.post("register",e)}}}function Rs({apiHandler:r}){return{login({data:e}){return r.post("login",e)},logout(){return r.post("logout")}}}function Es({apiHandler:r}){return{get({slug:e}){return r.get(`billing-portals/${e}`)}}}function Ss({apiHandler:r}){return{get({id:e}){return r.get(`checkout-forms/${e}`)}}}function ks({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("invoices",o)},get({id:e}){return r.get(`invoices/${e}`)},downloadPDF({id:e}){const t={headers:Qe,responseType:"arraybuffer"};return r.download(`invoices/${e}`,t)}}}function Cs({apiHandler:r}){return{getAll({limit:e=null,offset:t=null}={}){const n={limit:e,offset:t};return r.getAll("kyc-documents",n)},create({data:e}){return r.post("kyc-documents",e)},get({id:e}){return r.get(`kyc-documents/${e}`)},update({id:e,data:t}){return r.patch(`kyc-documents/${e}`,t)}}}function Ts({apiHandler:r}){return{get({id:e,expand:t=null}){const n={expand:t};return r.get(`kyc-requests/${e}`,n)}}}function xs({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("orders",o)},get({id:e}){return r.get(`orders/${e}`)},update({id:e,data:t}){return r.patch(`orders/${e}`,t)},cancel({id:e,data:t}){return r.post(`orders/${e}/cancellation`,t)}}}function Is({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("payment-instruments",o)},create({data:e}){return r.post("payment-instruments",e)},get({id:e,limit:t=null,offset:n=null}){const s={limit:t,offset:n};return r.get(`payment-instruments/${e}`,s)},update({id:e,data:t}){return r.patch(`payment-instruments/${e}`,t)},deactivate({id:e}){return r.post(`payment-instruments/${e}/deactivation`)},getSetupTransaction({id:e}){return r.get(`payment-instruments/${e}/setup`)},setup({id:e,data:t}){return r.post(`payment-instruments/${e}/setup`,t)}}}function Ps({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null,expand:o=null}={}){const l={filter:e,sort:t,limit:n,offset:s,q:u,expand:o};return r.getAll("plans",l)},get({id:e,expand:t=null}){const n={expand:t};return r.get(`plans/${e}`,n)}}}function Os({apiHandler:r}){return{getAll({filter:e=null,sort:t=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:t,limit:n,offset:s,q:u};return r.getAll("products",o)},get({id:e}){return r.get(`products/${e}`)}}}function js({apiHandler:r}){return{payment({data:e}){return r.post("payment",e)},purchase({data:e}){return r.post("purchase",e)},preview({data:e}){return r.post("preview-purchase",e)},readyToPay({data:e}){return r.post("ready-to-pay",e)}}}function qs({apiHandler:r}){return{getAll({limit:e=null,offset:t=null,filter:n=null,q:s=null,sort:u=null}={}){const o={limit:e,offset:t,filter:n,q:s,sort:u};return r.getAll("transactions",o)},get({id:e}){return r.get(`transactions/${e}`)},update({id:e,data:t}){return r.patch(`transactions/${e}`,t)}}}function Ds({apiHandler:r}){return{get({id:e}){return r.get(`websites/${e}`)}}}class Ms{constructor({apiHandler:e}){this.account=ws({apiHandler:e}),this.authorization=Rs({apiHandler:e}),this.billingPortals=Es({apiHandler:e}),this.checkoutForms=Ss({apiHandler:e}),this.invoices=ks({apiHandler:e}),this.kycDocuments=Cs({apiHandler:e}),this.kycRequests=Ts({apiHandler:e}),this.orders=xs({apiHandler:e}),this.paymentInstruments=Is({apiHandler:e}),this.plans=Ps({apiHandler:e}),this.products=Os({apiHandler:e}),this.purchase=js({apiHandler:e}),this.transactions=qs({apiHandler:e}),this.websites=Ds({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:r}){return new gs({apiHandler:r})}function Bs({apiHandler:r}){return new vs({apiHandler:r})}function Us({apiHandler:r}){return new Ms({apiHandler:r})}const ye={live:"https://api.rebilly.com",sandbox:"https://api-sandbox.rebilly.com"},be=6e3;function Ze({apiKey:r=null,sandbox:e=!1,timeout:t=be,organizationId:n=null,urls:s=ye}={}){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=$e({options:{apiEndpoints:s,apiKey:r,apiVersion:"",isSandbox:e,requestTimeout:t,jwt:null,organizationId:n}});return Ns({apiHandler:o})}function Ls({apiKey:r=null,sandbox:e=!1,timeout:t=be,organizationId:n=null,urls:s=ye}={}){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=$e({options:{apiEndpoints:s,apiKey:r,apiVersion:"experimental",isSandbox:e,requestTimeout:t,jwt:null,organizationId:n}});return Bs({apiHandler:o})}function Fs({publishableKey:r=null,jwt:e=null,sandbox:t=!1,timeout:n=be,organizationId:s=null,urls:u=ye}={}){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:r,jwt:e,apiVersion:"storefront",isSandbox:t,requestTimeout:n,organizationId:s},l=$e({options:o});return l.setSessionToken(o.jwt),Us({apiHandler:l})}d.RebillyAPI=Ze,d.RebillyErrors=S,d.RebillyExperimentalAPI=Ls,d.RebillyStorefrontAPI=Fs,d.cancellation=un,d.default=Ze,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|