rebilly-js-sdk 47.11.0 → 47.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9407,9 +9407,7 @@ export interface coreComponents {
9407
9407
  shippingAmount: number;
9408
9408
  /** The (invoice's) tax amount to credit. */
9409
9409
  taxAmount: number;
9410
- /** The (invoice's) discount amount to credit. */
9411
- discountAmount: number;
9412
- /** The sum of all credits in the credit memo (items, shipping, tax, discount). */
9410
+ /** The sum of all credits in the credit memo (items, shipping, tax). */
9413
9411
  totalAmount: number;
9414
9412
  /** The amount of `totalAmount` which hasn't been allocated anywhere yet. */
9415
9413
  unusedAmount: number;
@@ -25705,7 +25703,13 @@ export interface usersComponents {
25705
25703
  /** Linked File object id. */
25706
25704
  fileId?: string | null;
25707
25705
  /** Status of organization data export request. */
25708
- status?: "pending" | "processing" | "completed" | "queued" | "failed";
25706
+ status?:
25707
+ | "pending"
25708
+ | "processing"
25709
+ | "completed"
25710
+ | "queued"
25711
+ | "failed"
25712
+ | "expired";
25709
25713
  /** Organization data export resources array. */
25710
25714
  items?: usersComponents["schemas"]["OrganizationExportResource"][];
25711
25715
  /** Time at which the organization data export was requested. */
@@ -30642,6 +30646,8 @@ export interface operations {
30642
30646
  filter?: usersComponents["parameters"]["collectionFilter"];
30643
30647
  /** The partial search of the text fields. */
30644
30648
  q?: usersComponents["parameters"]["collectionQuery"];
30649
+ /** The collection items sort field and order (prefix with "-" for descending sort). */
30650
+ sort?: usersComponents["parameters"]["collectionSort"];
30645
30651
  };
30646
30652
  };
30647
30653
  responses: {
@@ -37900,7 +37906,7 @@ declare module "resources/organization-exports-resource" {
37900
37906
  export default function OrganizationExportsResource({ apiHandler }: {
37901
37907
  apiHandler: any;
37902
37908
  }): {
37903
- getAll({ limit, offset, filter, q }?: rebilly.GetOrganizationExportCollectionRequest): rebilly.GetOrganizationExportCollectionResponsePromise;
37909
+ getAll({ limit, offset, filter, q, sort, }?: rebilly.GetOrganizationExportCollectionRequest): rebilly.GetOrganizationExportCollectionResponsePromise;
37904
37910
  create(): any;
37905
37911
  get({ id }: {
37906
37912
  id: any;
@@ -39603,11 +39609,12 @@ declare module "resources/api-instance" {
39603
39609
  }): any;
39604
39610
  };
39605
39611
  organizationExports: {
39606
- getAll({ limit, offset, filter, q }?: {
39612
+ getAll({ limit, offset, filter, q, sort, }?: {
39607
39613
  limit?: number;
39608
39614
  offset?: number;
39609
39615
  filter?: string;
39610
39616
  q?: string;
39617
+ sort?: string[];
39611
39618
  }): rebilly.GetOrganizationExportCollectionResponsePromise;
39612
39619
  create(): any;
39613
39620
  get({ id }: {
@@ -1583,7 +1583,7 @@ function cloneArrayDeep(arr, instanceClone) {
1583
1583
  return res;
1584
1584
  }
1585
1585
  var cloneDeep_1 = cloneDeep;
1586
- const version = "47.11.0";
1586
+ const version = "47.11.1";
1587
1587
  let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
1588
1588
  let nanoid = (size = 21) => {
1589
1589
  let id = "";
@@ -3238,8 +3238,14 @@ function MembershipsResource({ apiHandler }) {
3238
3238
  }
3239
3239
  function OrganizationExportsResource({ apiHandler }) {
3240
3240
  return {
3241
- getAll({ limit = null, offset = null, filter = null, q = null } = {}) {
3242
- const params = { limit, offset, filter, q };
3241
+ getAll({
3242
+ limit = null,
3243
+ offset = null,
3244
+ filter = null,
3245
+ q = null,
3246
+ sort = null
3247
+ } = {}) {
3248
+ const params = { limit, offset, filter, q, sort };
3243
3249
  return apiHandler.getAll(`organization-exports`, params);
3244
3250
  },
3245
3251
  create() {
@@ -34,4 +34,4 @@ var Qs=Object.defineProperty;var ut=Object.getOwnPropertySymbols;var Zs=Object.p
34
34
  *
35
35
  * Copyright (c) 2014-2017, Jon Schlinkert.
36
36
  * Released under the MIT License.
37
- */var _r=Vr,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.11.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 z(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){z(q.request,i)}function P({thenDelegate:i,catchDelegate:m=()=>{}}){return b(q.response,{thenDelegate:i,catchDelegate:m})}function T(i){z(q.response,i)}function x({request:i,isCollection:m,config:f}){const $=et(f),{id:O,cancelToken:Ys}=L.save();$.cancelToken=Ys;const st=async function(){try{const _=await i($);return V({response:_,isCollection:m,config:$})}catch(_){return He({error:_,config:$})}finally{L.deleteById(O)}}();return st.cancel=_=>re.cancelById(O,_),st}function V({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 zs(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=zs(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 _s(i,m){return x({request:f=>e.patch(i,m,f),config:{}})}function Js(i){return x({request:m=>e.delete(i,m),config:{}})}function Ws(i,m){return x({request:f=>e.delete(i,f),config:{data:J({},m)}})}async function Gs(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 Xs(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:_s,delete:Js,deleteAll:Ws,create:Gs,download:Xs}}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("organization-exports",u)},create(){return t.post("organization-exports")},get({id:e}){return t.get(`organization-exports/${e}`)}}}function Fn({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 Kn({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 zn({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 _n({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 Jn({apiHandler:t}){return{create({data:e}){return t.post("payouts",e)}}}function Wn({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("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 Gn({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 Xn({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 Yn({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 Qn({apiHandler:t}){return{readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Zn({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 Hn({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 es({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 ts({apiHandler:t}){return{getAll({eventType:e}){return t.getAll(`send-through-attribution/${e}`)}}}function rs({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 ns({apiHandler:t}){return{get(){return t.get("status")}}}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-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 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-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 os({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 ls({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 is({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 cs({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 as({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 ms({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 fs({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 gs({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 hs{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.organizationExports=Ln({apiHandler:e}),this.organizations=Fn({apiHandler:e}),this.paymentCardsBankNames=Kn({apiHandler:e}),this.paymentInstruments=zn({apiHandler:e}),this.paymentMethods=Vn({apiHandler:e}),this.paymentTokens=_n({apiHandler:e}),this.payouts=Jn({apiHandler:e}),this.plans=Wn({apiHandler:e}),this.previews=Gn({apiHandler:e}),this.products=Xn({apiHandler:e}),this.profile=Yn({apiHandler:e}),this.purchase=Qn({apiHandler:e}),this.roles=Zn({apiHandler:e}),this.search=Hn({apiHandler:e}),this.segments=es({apiHandler:e}),this.sendThroughAttribution=ts({apiHandler:e}),this.shippingRates=rs({apiHandler:e}),this.status=ns({apiHandler:e}),this.subscriptionCancellations=ss({apiHandler:e}),this.subscriptionPauses=us({apiHandler:e}),this.subscriptionReactivations=os({apiHandler:e}),this.subscriptions=ls({apiHandler:e}),this.tags=is({apiHandler:e}),this.tracking=cs({apiHandler:e}),this.transactions=as({apiHandler:e}),this.users=ms({apiHandler:e}),this.webhooks=fs({apiHandler:e}),this.websites=gs({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 ps({apiHandler:t}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return t.get(`customers/${e}/summary-metrics`)}}}function ds({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 $s({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 ys({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 bs({apiHandler:t}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return t.get(`subscriptions/${e}/summary-metrics`)}}}function As({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 vs({apiHandler:t}){return{query(){return t.get("location")}}}const M={CustomersResource:ps,DataExportsResource:ds,HistogramsResource:$s,ReportsResource:ys,SubscriptionsResource:bs,TimelinesResource:As,LocationResource:vs};class ws{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 Rs({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 Es({apiHandler:t}){return{login({data:e}){return t.post("login",e)},logout(){return t.post("logout")}}}function Ss({apiHandler:t}){return{get({slug:e}){return t.get(`billing-portals/${e}`)}}}function ks({apiHandler:t}){return{get({id:e}){return t.get(`checkout-forms/${e}`)}}}function Cs({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("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 Ts({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 xs({apiHandler:t}){return{get({id:e,expand:r=null}){const n={expand:r};return t.get(`kyc-requests/${e}`,n)}}}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("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 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("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 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("plans",l)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`plans/${e}`,n)}}}function js({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 qs({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 Ds({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 Ms({apiHandler:t}){return{get({id:e}){return t.get(`websites/${e}`)}}}class Ns{constructor({apiHandler:e}){this.account=Rs({apiHandler:e}),this.authorization=Es({apiHandler:e}),this.billingPortals=Ss({apiHandler:e}),this.checkoutForms=ks({apiHandler:e}),this.invoices=Cs({apiHandler:e}),this.kycDocuments=Ts({apiHandler:e}),this.kycRequests=xs({apiHandler:e}),this.orders=Is({apiHandler:e}),this.paymentInstruments=Ps({apiHandler:e}),this.plans=Os({apiHandler:e}),this.products=js({apiHandler:e}),this.purchase=qs({apiHandler:e}),this.transactions=Ds({apiHandler:e}),this.websites=Ms({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 Bs({apiHandler:t}){return new hs({apiHandler:t})}function Us({apiHandler:t}){return new ws({apiHandler:t})}function Ls({apiHandler:t}){return new Ns({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 Bs({apiHandler:o})}function Fs({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 Us({apiHandler:o})}function Ks({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),Ls({apiHandler:l})}d.RebillyAPI=Ze,d.RebillyErrors=S,d.RebillyExperimentalAPI=Fs,d.RebillyStorefrontAPI=Ks,d.cancellation=un,d.default=Ze,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
37
+ */var _r=Vr,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.11.1";let rn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",nn=(t=21)=>{let e="",r=t;for(;r--;)e+=rn[Math.random()*64|0];return e};class sn{constructor({id:e=null,created:r=null}={}){this.id=e||nn(),this.created=r||new Date().getTime(),this.cancelSource=pe.CancelToken.source(),this.cancel=this.cancelSource.cancel,this.cancelToken=this.cancelSource.token,te(this,{exclude:["cancelSource","cancelToken","cancel"]})}}class K{constructor(){if(K.instance)return K.instance;this.requests={},K.instance=this}getAll(){return Object.values(this.requests)}getById(e){return this.requests[e]}deleteById(e){!this.requests[e]||delete this.requests[e]}save(){const e=new sn;return this.requests[e.id]=e,{id:e.id,cancelToken:e.cancelToken}}}var L=new K;class re{}ve(re,"cancelById",(e,r)=>{try{L.getById(e).cancel(r),L.deleteById(e)}catch{}}),ve(re,"cancelAll",e=>L.getAll().forEach(r=>{r.cancel(e),L.deleteById(r.id)}));var un={cancelAll:(...t)=>re.cancelAll(...t)};const q={request:"request",response:"response"},Ye=t=>{if(!Object.values(q).includes(t))throw new Error(`There is no such interceptor type as "${t}"`);return!0};function $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 z(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){z(q.request,i)}function P({thenDelegate:i,catchDelegate:m=()=>{}}){return b(q.response,{thenDelegate:i,catchDelegate:m})}function T(i){z(q.response,i)}function x({request:i,isCollection:m,config:f}){const $=et(f),{id:O,cancelToken:Ys}=L.save();$.cancelToken=Ys;const st=async function(){try{const _=await i($);return V({response:_,isCollection:m,config:$})}catch(_){return He({error:_,config:$})}finally{L.deleteById(O)}}();return st.cancel=_=>re.cancelById(O,_),st}function V({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 zs(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=zs(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 _s(i,m){return x({request:f=>e.patch(i,m,f),config:{}})}function Js(i){return x({request:m=>e.delete(i,m),config:{}})}function Ws(i,m){return x({request:f=>e.delete(i,f),config:{data:J({},m)}})}async function Gs(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 Xs(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:_s,delete:Js,deleteAll:Ws,create:Gs,download:Xs}}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,sort:u=null}={}){const o={limit:e,offset:r,filter:n,q:s,sort:u};return t.getAll("organization-exports",o)},create(){return t.post("organization-exports")},get({id:e}){return t.get(`organization-exports/${e}`)}}}function Fn({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 Kn({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 zn({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 _n({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 Jn({apiHandler:t}){return{create({data:e}){return t.post("payouts",e)}}}function Wn({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("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 Gn({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 Xn({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 Yn({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 Qn({apiHandler:t}){return{readyToPay({data:e}){return t.post("ready-to-pay",e)}}}function Zn({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 Hn({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 es({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 ts({apiHandler:t}){return{getAll({eventType:e}){return t.getAll(`send-through-attribution/${e}`)}}}function rs({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 ns({apiHandler:t}){return{get(){return t.get("status")}}}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-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 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-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 os({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 ls({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 is({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 cs({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 as({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 ms({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 fs({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 gs({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 hs{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.organizationExports=Ln({apiHandler:e}),this.organizations=Fn({apiHandler:e}),this.paymentCardsBankNames=Kn({apiHandler:e}),this.paymentInstruments=zn({apiHandler:e}),this.paymentMethods=Vn({apiHandler:e}),this.paymentTokens=_n({apiHandler:e}),this.payouts=Jn({apiHandler:e}),this.plans=Wn({apiHandler:e}),this.previews=Gn({apiHandler:e}),this.products=Xn({apiHandler:e}),this.profile=Yn({apiHandler:e}),this.purchase=Qn({apiHandler:e}),this.roles=Zn({apiHandler:e}),this.search=Hn({apiHandler:e}),this.segments=es({apiHandler:e}),this.sendThroughAttribution=ts({apiHandler:e}),this.shippingRates=rs({apiHandler:e}),this.status=ns({apiHandler:e}),this.subscriptionCancellations=ss({apiHandler:e}),this.subscriptionPauses=us({apiHandler:e}),this.subscriptionReactivations=os({apiHandler:e}),this.subscriptions=ls({apiHandler:e}),this.tags=is({apiHandler:e}),this.tracking=cs({apiHandler:e}),this.transactions=as({apiHandler:e}),this.users=ms({apiHandler:e}),this.webhooks=fs({apiHandler:e}),this.websites=gs({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 ps({apiHandler:t}){return{getCustomerLifetimeSummaryMetrics({customerId:e}){return t.get(`customers/${e}/summary-metrics`)}}}function ds({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 $s({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 ys({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 bs({apiHandler:t}){return{getSubscriptionSummaryMetrics({subscriptionId:e}){return t.get(`subscriptions/${e}/summary-metrics`)}}}function As({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 vs({apiHandler:t}){return{query(){return t.get("location")}}}const M={CustomersResource:ps,DataExportsResource:ds,HistogramsResource:$s,ReportsResource:ys,SubscriptionsResource:bs,TimelinesResource:As,LocationResource:vs};class ws{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 Rs({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 Es({apiHandler:t}){return{login({data:e}){return t.post("login",e)},logout(){return t.post("logout")}}}function Ss({apiHandler:t}){return{get({slug:e}){return t.get(`billing-portals/${e}`)}}}function ks({apiHandler:t}){return{get({id:e}){return t.get(`checkout-forms/${e}`)}}}function Cs({apiHandler:t}){return{getAll({filter:e=null,sort:r=null,limit:n=null,offset:s=null,q:u=null}={}){const o={filter:e,sort:r,limit:n,offset:s,q:u};return t.getAll("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 Ts({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 xs({apiHandler:t}){return{get({id:e,expand:r=null}){const n={expand:r};return t.get(`kyc-requests/${e}`,n)}}}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("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 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("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 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("plans",l)},get({id:e,expand:r=null}){const n={expand:r};return t.get(`plans/${e}`,n)}}}function js({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 qs({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 Ds({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 Ms({apiHandler:t}){return{get({id:e}){return t.get(`websites/${e}`)}}}class Ns{constructor({apiHandler:e}){this.account=Rs({apiHandler:e}),this.authorization=Es({apiHandler:e}),this.billingPortals=Ss({apiHandler:e}),this.checkoutForms=ks({apiHandler:e}),this.invoices=Cs({apiHandler:e}),this.kycDocuments=Ts({apiHandler:e}),this.kycRequests=xs({apiHandler:e}),this.orders=Is({apiHandler:e}),this.paymentInstruments=Ps({apiHandler:e}),this.plans=Os({apiHandler:e}),this.products=js({apiHandler:e}),this.purchase=qs({apiHandler:e}),this.transactions=Ds({apiHandler:e}),this.websites=Ms({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 Bs({apiHandler:t}){return new hs({apiHandler:t})}function Us({apiHandler:t}){return new ws({apiHandler:t})}function Ls({apiHandler:t}){return new Ns({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 Bs({apiHandler:o})}function Fs({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 Us({apiHandler:o})}function Ks({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),Ls({apiHandler:l})}d.RebillyAPI=Ze,d.RebillyErrors=S,d.RebillyExperimentalAPI=Fs,d.RebillyStorefrontAPI=Ks,d.cancellation=un,d.default=Ze,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rebilly-js-sdk",
3
- "version": "47.11.0",
3
+ "version": "47.11.1",
4
4
  "description": "Official Rebilly API JS library for the browser and Node",
5
5
  "types": "./dist/rebilly-js-sdk.d.ts",
6
6
  "main": "./dist/rebilly-js-sdk.umd.js",