@botpress/client 0.9.5 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.cjs.map +3 -3
- package/dist/gen/api.d.ts +87 -1
- package/dist/gen/base.d.ts +1 -1
- package/dist/gen/client.d.ts +3 -1
- package/dist/gen/common.d.ts +1 -1
- package/dist/gen/configuration.d.ts +1 -1
- package/dist/gen/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/bundle.cjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let a=new this(e);return t.forEach(n=>a.set(n)),a}static accessor(e){let a=(this[Ka]=this[Ka]={accessors:{}}).accessors,n=this.prototype;function o(i){let r=Fe(i);a[r]||(Fi(n,i),a[r]=!0)}return u.isArray(e)?e.forEach(o):o(e),this}};Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);u.reduceDescriptors(Ee.prototype,({value:s},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>s,set(a){this[t]=a}}});u.freezeMethods(Ee);var M=Ee;function Ge(s,e){let t=this||Ue,a=e||t,n=M.from(a.headers),o=a.data;return u.forEach(s,function(r){o=r.call(t,o,n.normalize(),e?e.status:void 0)}),n.normalize(),o}function Ne(s){return!!(s&&s.__CANCEL__)}function Ja(s,e,t){P.call(this,s??"canceled",P.ERR_CANCELED,e,t),this.name="CanceledError"}u.inherits(Ja,P,{__CANCEL__:!0});var ae=Ja;function le(s,e,t){let a=t.config.validateStatus;!t.status||!a||a(t.status)?s(t):e(new P("Request failed with status code "+t.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function hs(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function ys(s,e){return e?s.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):s}function ye(s,e){return s&&!hs(e)?ys(s,e):e}var Sn=K(Xa(),1),Vn=K(require("http"),1),_n=K(require("https"),1),Wn=K(require("util"),1),Ln=K(Rn(),1),ie=K(require("zlib"),1);var Ae="1.6.1";function $e(s){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return e&&e[1]||""}var Pr=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function Is(s,e,t){let a=t&&t.Blob||L.classes.Blob,n=$e(s);if(e===void 0&&a&&(e=!0),n==="data"){s=n.length?s.slice(n.length+1):s;let o=Pr.exec(s);if(!o)throw new P("Invalid URL",P.ERR_INVALID_URL);let i=o[1],r=o[2],c=o[3],l=Buffer.from(decodeURIComponent(c),r?"base64":"utf8");if(e){if(!a)throw new P("Blob is not supported",P.ERR_NOT_SUPPORT);return new a([l],{type:i})}return l}throw new P("Unsupported protocol "+n,P.ERR_NOT_SUPPORT)}var Ce=K(require("stream"),1);var Cn=K(require("stream"),1);function Br(s,e){let t=0,a=1e3/e,n=null;return function(i,r){let c=Date.now();if(i||c-t>a)return n&&(clearTimeout(n),n=null),t=c,s.apply(null,r);n||(n=setTimeout(()=>(n=null,t=Date.now(),s.apply(null,r)),a-(c-t)))}}var An=Br;function wr(s,e){s=s||10;let t=new Array(s),a=new Array(s),n=0,o=0,i;return e=e!==void 0?e:1e3,function(c){let l=Date.now(),p=a[o];i||(i=l),t[n]=c,a[n]=l;let d=o,C=0;for(;d!==n;)C+=t[d++],d=d%s;if(n=(n+1)%s,n===o&&(o=(o+1)%s),l-i<e)return;let q=p&&l-p;return q?Math.round(C*1e3/q):void 0}}var gt=wr;var xt=Symbol("internals"),qs=class extends Cn.default.Transform{constructor(e){e=u.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(r,c)=>!u.isUndefined(c[r])),super({readableHighWaterMark:e.chunkSize});let t=this,a=this[xt]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},n=gt(a.ticksRate*e.samplesCount,a.timeWindow);this.on("newListener",r=>{r==="progress"&&(a.isCaptured||(a.isCaptured=!0))});let o=0;a.updateProgress=An(function(){let c=a.length,l=a.bytesSeen,p=l-o;if(!p||t.destroyed)return;let d=n(p);o=l,process.nextTick(()=>{t.emit("progress",{loaded:l,total:c,progress:c?l/c:void 0,bytes:p,rate:d||void 0,estimated:d&&c&&l<=c?(c-l)/d:void 0})})},a.ticksRate);let i=()=>{a.updateProgress(!0)};this.once("end",i),this.once("error",i)}_read(e){let t=this[xt];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,a){let n=this,o=this[xt],i=o.maxRate,r=this.readableHighWaterMark,c=o.timeWindow,l=1e3/c,p=i/l,d=o.minChunkSize!==!1?Math.max(o.minChunkSize,p*.01):0;function C(m,k){let I=Buffer.byteLength(m);o.bytesSeen+=I,o.bytes+=I,o.isCaptured&&o.updateProgress(),n.push(m)?process.nextTick(k):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(k)}}let q=(m,k)=>{let I=Buffer.byteLength(m),T=null,V=r,D,N=0;if(i){let F=Date.now();(!o.ts||(N=F-o.ts)>=c)&&(o.ts=F,D=p-o.bytes,o.bytes=D<0?-D:0,N=0),D=p-o.bytes}if(i){if(D<=0)return setTimeout(()=>{k(null,m)},c-N);D<V&&(V=D)}V&&I>V&&I-V>d&&(T=m.subarray(V),m=m.subarray(0,V)),C(m,T?()=>{process.nextTick(k,null,T)}:k)};q(e,function m(k,I){if(k)return a(k);I?q(I,m):a(null)})}setLength(e){return this[xt].length=+e,this}},Us=qs;var Mn=K(require("events"),1);var Pn=require("util"),Bn=require("stream");var{asyncIterator:kn}=Symbol,Ir=async function*(s){s.stream?yield*s.stream():s.arrayBuffer?yield await s.arrayBuffer():s[kn]?yield*s[kn]():yield s},ht=Ir;var qr=u.ALPHABET.ALPHA_DIGIT+"-_",Ke=new Pn.TextEncoder,de=`\r
|
|
9
9
|
`,Ur=Ke.encode(de),Er=2,Es=class{constructor(e,t){let{escapeName:a}=this.constructor,n=u.isString(t),o=`Content-Disposition: form-data; name="${a(e)}"${!n&&t.name?`; filename="${a(t.name)}"`:""}${de}`;n?t=Ke.encode(String(t).replace(/\r?\n|\r\n?/g,de)):o+=`Content-Type: ${t.type||"application/octet-stream"}${de}`,this.headers=Ke.encode(o+de),this.contentLength=n?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+Er,this.name=e,this.value=t}async*encode(){yield this.headers;let{value:e}=this;u.isTypedArray(e)?yield e:yield*ht(e),yield Ur}static escapeName(e){return String(e).replace(/[\r\n"]/g,t=>({"\r":"%0D","\n":"%0A",'"':"%22"})[t])}},Tr=(s,e,t)=>{let{tag:a="form-data-boundary",size:n=25,boundary:o=a+"-"+u.generateString(n,qr)}=t||{};if(!u.isFormData(s))throw TypeError("FormData instance required");if(o.length<1||o.length>70)throw Error("boundary must be 10-70 characters long");let i=Ke.encode("--"+o+de),r=Ke.encode("--"+o+"--"+de+de),c=r.byteLength,l=Array.from(s.entries()).map(([d,C])=>{let q=new Es(d,C);return c+=q.size,q});c+=i.byteLength*l.length,c=u.toFiniteNumber(c);let p={"Content-Type":`multipart/form-data; boundary=${o}`};return Number.isFinite(c)&&(p["Content-Length"]=c),e&&e(p),Bn.Readable.from(async function*(){for(let d of l)yield i,yield*d.encode();yield r}())},wn=Tr;var In=K(require("stream"),1),Ts=class extends In.default.Transform{__transform(e,t,a){this.push(e),a()}_transform(e,t,a){if(e.length!==0&&(this._transform=this.__transform,e[0]!==120)){let n=Buffer.alloc(2);n[0]=120,n[1]=156,this.push(n,t)}this.__transform(e,t,a)}},qn=Ts;var Or=(s,e)=>u.isAsyncFn(s)?function(...t){let a=t.pop();s.apply(this,t).then(n=>{try{e?a(null,...e(n)):a(null,n)}catch(o){a(o)}},a)}:s,Un=Or;var En={flush:ie.default.constants.Z_SYNC_FLUSH,finishFlush:ie.default.constants.Z_SYNC_FLUSH},Dr={flush:ie.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:ie.default.constants.BROTLI_OPERATION_FLUSH},Tn=u.isFunction(ie.default.createBrotliDecompress),{http:Sr,https:Vr}=Ln.default,_r=/https:?/,On=L.protocols.map(s=>s+":");function Wr(s){s.beforeRedirects.proxy&&s.beforeRedirects.proxy(s),s.beforeRedirects.config&&s.beforeRedirects.config(s)}function jn(s,e,t){let a=e;if(!a&&a!==!1){let n=(0,Sn.getProxyForUrl)(t);n&&(a=new URL(n))}if(a){if(a.username&&(a.auth=(a.username||"")+":"+(a.password||"")),a.auth){(a.auth.username||a.auth.password)&&(a.auth=(a.auth.username||"")+":"+(a.auth.password||""));let o=Buffer.from(a.auth,"utf8").toString("base64");s.headers["Proxy-Authorization"]="Basic "+o}s.headers.host=s.hostname+(s.port?":"+s.port:"");let n=a.hostname||a.host;s.hostname=n,s.host=n,s.port=a.port,s.path=t,a.protocol&&(s.protocol=a.protocol.includes(":")?a.protocol:`${a.protocol}:`)}s.beforeRedirects.proxy=function(o){jn(o,e,o.href)}}var Lr=typeof process<"u"&&u.kindOf(process)==="process",Mr=s=>new Promise((e,t)=>{let a,n,o=(c,l)=>{n||(n=!0,a&&a(c,l))},i=c=>{o(c),e(c)},r=c=>{o(c,!0),t(c)};s(i,r,c=>a=c).catch(r)}),jr=({address:s,family:e})=>{if(!u.isString(s))throw TypeError("address must be a string");return{address:s,family:e||(s.indexOf(".")<0?6:4)}},Dn=(s,e)=>jr(u.isObject(s)?s:{address:s,family:e}),Fn=Lr&&function(e){return Mr(async function(a,n,o){let{data:i,lookup:r,family:c}=e,{responseType:l,responseEncoding:p}=e,d=e.method.toUpperCase(),C,q=!1,m;if(r){let B=Un(r,w=>u.isArray(w)?w:[w]);r=(w,Q,Be)=>{B(w,Q,(z,ce,$t)=>{let ne=u.isArray(ce)?ce.map(te=>Dn(te)):[Dn(ce,$t)];Q.all?Be(z,ne):Be(z,ne[0].address,ne[0].family)})}}let k=new Mn.default,I=()=>{e.cancelToken&&e.cancelToken.unsubscribe(T),e.signal&&e.signal.removeEventListener("abort",T),k.removeAllListeners()};o((B,w)=>{C=!0,w&&(q=!0,I())});function T(B){k.emit("abort",!B||B.type?new ae(null,e,m):B)}k.once("abort",n),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(T),e.signal&&(e.signal.aborted?T():e.signal.addEventListener("abort",T)));let V=ye(e.baseURL,e.url),D=new URL(V,"http://localhost"),N=D.protocol||On[0];if(N==="data:"){let B;if(d!=="GET")return le(a,n,{status:405,statusText:"method not allowed",headers:{},config:e});try{B=Is(e.url,l==="blob",{Blob:e.env&&e.env.Blob})}catch(w){throw P.from(w,P.ERR_BAD_REQUEST,e)}return l==="text"?(B=B.toString(p),(!p||p==="utf8")&&(B=u.stripBOM(B))):l==="stream"&&(B=Ce.default.Readable.from(B)),le(a,n,{data:B,status:200,statusText:"OK",headers:new M,config:e})}if(On.indexOf(N)===-1)return n(new P("Unsupported protocol "+N,P.ERR_BAD_REQUEST,e));let F=M.from(e.headers).normalize();F.set("User-Agent","axios/"+Ae,!1);let ge=e.onDownloadProgress,_e=e.onUploadProgress,xe=e.maxRate,Pe,zt;if(u.isSpecCompliantForm(i)){let B=F.getContentType(/boundary=([-_\w\d]{10,70})/i);i=wn(i,w=>{F.set(w)},{tag:`axios-${Ae}-boundary`,boundary:B&&B[1]||void 0})}else if(u.isFormData(i)&&u.isFunction(i.getHeaders)){if(F.set(i.getHeaders()),!F.hasContentLength())try{let B=await Wn.default.promisify(i.getLength).call(i);Number.isFinite(B)&&B>=0&&F.setContentLength(B)}catch{}}else if(u.isBlob(i))i.size&&F.setContentType(i.type||"application/octet-stream"),F.setContentLength(i.size||0),i=Ce.default.Readable.from(ht(i));else if(i&&!u.isStream(i)){if(!Buffer.isBuffer(i))if(u.isArrayBuffer(i))i=Buffer.from(new Uint8Array(i));else if(u.isString(i))i=Buffer.from(i,"utf-8");else return n(new P("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",P.ERR_BAD_REQUEST,e));if(F.setContentLength(i.length,!1),e.maxBodyLength>-1&&i.length>e.maxBodyLength)return n(new P("Request body larger than maxBodyLength limit",P.ERR_BAD_REQUEST,e))}let no=u.toFiniteNumber(F.getContentLength());u.isArray(xe)?(Pe=xe[0],zt=xe[1]):Pe=zt=xe,i&&(_e||Pe)&&(u.isStream(i)||(i=Ce.default.Readable.from(i,{objectMode:!1})),i=Ce.default.pipeline([i,new Us({length:no,maxRate:u.toFiniteNumber(Pe)})],u.noop),_e&&i.on("progress",B=>{_e(Object.assign(B,{upload:!0}))}));let We;if(e.auth){let B=e.auth.username||"",w=e.auth.password||"";We=B+":"+w}if(!We&&D.username){let B=D.username,w=D.password;We=B+":"+w}We&&F.delete("authorization");let Gs;try{Gs=he(D.pathname+D.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(B){let w=new Error(B.message);return w.config=e,w.url=e.url,w.exists=!0,n(w)}F.set("Accept-Encoding","gzip, compress, deflate"+(Tn?", br":""),!1);let $={path:Gs,method:d,headers:F.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:We,protocol:N,family:c,beforeRedirect:Wr,beforeRedirects:{}};!u.isUndefined(r)&&($.lookup=r),e.socketPath?$.socketPath=e.socketPath:($.hostname=D.hostname,$.port=D.port,jn($,e.proxy,N+"//"+D.hostname+(D.port?":"+D.port:"")+$.path));let Ze,Ht=_r.test($.protocol);if($.agent=Ht?e.httpsAgent:e.httpAgent,e.transport?Ze=e.transport:e.maxRedirects===0?Ze=Ht?_n.default:Vn.default:(e.maxRedirects&&($.maxRedirects=e.maxRedirects),e.beforeRedirect&&($.beforeRedirects.config=e.beforeRedirect),Ze=Ht?Vr:Sr),e.maxBodyLength>-1?$.maxBodyLength=e.maxBodyLength:$.maxBodyLength=1/0,e.insecureHTTPParser&&($.insecureHTTPParser=e.insecureHTTPParser),m=Ze.request($,function(w){if(m.destroyed)return;let Q=[w],Be=+w.headers["content-length"];if(ge){let te=new Us({length:u.toFiniteNumber(Be),maxRate:u.toFiniteNumber(zt)});ge&&te.on("progress",et=>{ge(Object.assign(et,{download:!0}))}),Q.push(te)}let z=w,ce=w.req||m;if(e.decompress!==!1&&w.headers["content-encoding"])switch((d==="HEAD"||w.statusCode===204)&&delete w.headers["content-encoding"],(w.headers["content-encoding"]||"").toLowerCase()){case"gzip":case"x-gzip":case"compress":case"x-compress":Q.push(ie.default.createUnzip(En)),delete w.headers["content-encoding"];break;case"deflate":Q.push(new qn),Q.push(ie.default.createUnzip(En)),delete w.headers["content-encoding"];break;case"br":Tn&&(Q.push(ie.default.createBrotliDecompress(Dr)),delete w.headers["content-encoding"])}z=Q.length>1?Ce.default.pipeline(Q,u.noop):Q[0];let $t=Ce.default.finished(z,()=>{$t(),I()}),ne={status:w.statusCode,statusText:w.statusMessage,headers:new M(w.headers),config:e,request:ce};if(l==="stream")ne.data=z,le(a,n,ne);else{let te=[],et=0;z.on("data",function(H){te.push(H),et+=H.length,e.maxContentLength>-1&&et>e.maxContentLength&&(q=!0,z.destroy(),n(new P("maxContentLength size of "+e.maxContentLength+" exceeded",P.ERR_BAD_RESPONSE,e,ce)))}),z.on("aborted",function(){if(q)return;let H=new P("maxContentLength size of "+e.maxContentLength+" exceeded",P.ERR_BAD_RESPONSE,e,ce);z.destroy(H),n(H)}),z.on("error",function(H){m.destroyed||n(P.from(H,null,e,ce))}),z.on("end",function(){try{let H=te.length===1?te[0]:Buffer.concat(te);l!=="arraybuffer"&&(H=H.toString(p),(!p||p==="utf8")&&(H=u.stripBOM(H))),ne.data=H}catch(H){return n(P.from(H,null,e,ne.request,ne))}le(a,n,ne)})}k.once("abort",te=>{z.destroyed||(z.emit("error",te),z.destroy())})}),k.once("abort",B=>{n(B),m.destroy(B)}),m.on("error",function(w){n(P.from(w,null,e,m))}),m.on("socket",function(w){w.setKeepAlive(!0,1e3*60)}),e.timeout){let B=parseInt(e.timeout,10);if(Number.isNaN(B)){n(new P("error trying to parse `config.timeout` to int",P.ERR_BAD_OPTION_VALUE,e,m));return}m.setTimeout(B,function(){if(C)return;let Q=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",Be=e.transitional||qe;e.timeoutErrorMessage&&(Q=e.timeoutErrorMessage),n(new P(Q,Be.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,e,m)),T()})}if(u.isStream(i)){let B=!1,w=!1;i.on("end",()=>{B=!0}),i.once("error",Q=>{w=!0,m.destroy(Q)}),i.on("close",()=>{!B&&!w&&T(new ae("Request stream has been aborted",e,m))}),i.pipe(m)}else m.end(i)})};var Gn=L.hasStandardBrowserEnv?function(){return{write:function(t,a,n,o,i,r){let c=[];c.push(t+"="+encodeURIComponent(a)),u.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),u.isString(o)&&c.push("path="+o),u.isString(i)&&c.push("domain="+i),r===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(t){let a=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();var Nn=L.hasStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),a;function n(o){let i=o;return e&&(t.setAttribute("href",i),i=t.href),t.setAttribute("href",i),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return a=n(window.location.href),function(i){let r=u.isString(i)?n(i):i;return r.protocol===a.protocol&&r.host===a.host}}():function(){return function(){return!0}}();function Qn(s,e){let t=0,a=gt(50,250);return n=>{let o=n.loaded,i=n.lengthComputable?n.total:void 0,r=o-t,c=a(r),l=o<=i;t=o;let p={loaded:o,total:i,progress:i?o/i:void 0,bytes:r,rate:c||void 0,estimated:c&&i&&l?(i-o)/c:void 0,event:n};p[e?"download":"upload"]=!0,s(p)}}var Fr=typeof XMLHttpRequest<"u",zn=Fr&&function(s){return new Promise(function(t,a){let n=s.data,o=M.from(s.headers).normalize(),i=s.responseType,r;function c(){s.cancelToken&&s.cancelToken.unsubscribe(r),s.signal&&s.signal.removeEventListener("abort",r)}let l;if(u.isFormData(n)){if(L.hasStandardBrowserEnv||L.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if((l=o.getContentType())!==!1){let[m,...k]=l?l.split(";").map(I=>I.trim()).filter(Boolean):[];o.setContentType([m||"multipart/form-data",...k].join("; "))}}let p=new XMLHttpRequest;if(s.auth){let m=s.auth.username||"",k=s.auth.password?unescape(encodeURIComponent(s.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+k))}let d=ye(s.baseURL,s.url);p.open(s.method.toUpperCase(),he(d,s.params,s.paramsSerializer),!0),p.timeout=s.timeout;function C(){if(!p)return;let m=M.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),I={data:!i||i==="text"||i==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:m,config:s,request:p};le(function(V){t(V),c()},function(V){a(V),c()},I),p=null}if("onloadend"in p?p.onloadend=C:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(C)},p.onabort=function(){p&&(a(new P("Request aborted",P.ECONNABORTED,s,p)),p=null)},p.onerror=function(){a(new P("Network Error",P.ERR_NETWORK,s,p)),p=null},p.ontimeout=function(){let k=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",I=s.transitional||qe;s.timeoutErrorMessage&&(k=s.timeoutErrorMessage),a(new P(k,I.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,s,p)),p=null},L.hasStandardBrowserEnv){let m=Nn(d)&&s.xsrfCookieName&&Gn.read(s.xsrfCookieName);m&&o.set(s.xsrfHeaderName,m)}n===void 0&&o.setContentType(null),"setRequestHeader"in p&&u.forEach(o.toJSON(),function(k,I){p.setRequestHeader(I,k)}),u.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),i&&i!=="json"&&(p.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&p.addEventListener("progress",Qn(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&p.upload&&p.upload.addEventListener("progress",Qn(s.onUploadProgress)),(s.cancelToken||s.signal)&&(r=m=>{p&&(a(!m||m.type?new ae(null,s,p):m),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(r),s.signal&&(s.signal.aborted?r():s.signal.addEventListener("abort",r)));let q=$e(d);if(q&&L.protocols.indexOf(q)===-1){a(new P("Unsupported protocol "+q+":",P.ERR_BAD_REQUEST,s));return}p.send(n||null)})};var Os={http:Fn,xhr:zn};u.forEach(Os,(s,e)=>{if(s){try{Object.defineProperty(s,"name",{value:e})}catch{}Object.defineProperty(s,"adapterName",{value:e})}});var Hn=s=>`- ${s}`,Gr=s=>u.isFunction(s)||s===null||s===!1,yt={getAdapter:s=>{s=u.isArray(s)?s:[s];let{length:e}=s,t,a,n={};for(let o=0;o<e;o++){t=s[o];let i;if(a=t,!Gr(t)&&(a=Os[(i=String(t)).toLowerCase()],a===void 0))throw new P(`Unknown adapter '${i}'`);if(a)break;n[i||"#"+o]=a}if(!a){let o=Object.entries(n).map(([r,c])=>`adapter ${r} `+(c===!1?"is not supported by the environment":"is not available in the build")),i=e?o.length>1?`since :
|
|
10
10
|
`+o.map(Hn).join(`
|
|
11
|
-
`):" "+Hn(o[0]):"as no adapter specified";throw new P("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return a},adapters:Os};function Ds(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new ae(null,s)}function bt(s){return Ds(s),s.headers=M.from(s.headers),s.data=Ge.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),yt.getAdapter(s.adapter||Ue.adapter)(s).then(function(a){return Ds(s),a.data=Ge.call(s,s.transformResponse,a),a.headers=M.from(a.headers),a},function(a){return Ne(a)||(Ds(s),a&&a.response&&(a.response.data=Ge.call(s,s.transformResponse,a.response),a.response.headers=M.from(a.response.headers))),Promise.reject(a)})}var $n=s=>s instanceof M?s.toJSON():s;function re(s,e){e=e||{};let t={};function a(l,p,d){return u.isPlainObject(l)&&u.isPlainObject(p)?u.merge.call({caseless:d},l,p):u.isPlainObject(p)?u.merge({},p):u.isArray(p)?p.slice():p}function n(l,p,d){if(u.isUndefined(p)){if(!u.isUndefined(l))return a(void 0,l,d)}else return a(l,p,d)}function o(l,p){if(!u.isUndefined(p))return a(void 0,p)}function i(l,p){if(u.isUndefined(p)){if(!u.isUndefined(l))return a(void 0,l)}else return a(void 0,p)}function r(l,p,d){if(d in e)return a(l,p);if(d in s)return a(void 0,l)}let c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:r,headers:(l,p)=>n($n(l),$n(p),!0)};return u.forEach(Object.keys(Object.assign({},s,e)),function(p){let d=c[p]||n,C=d(s[p],e[p],p);u.isUndefined(C)&&d!==r||(t[p]=C)}),t}var Ss={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{Ss[s]=function(a){return typeof a===s||"a"+(e<1?"n ":" ")+s}});var Kn={};Ss.transitional=function(e,t,a){function n(o,i){return"[Axios v"+Ae+"] Transitional option '"+o+"'"+i+(a?". "+a:"")}return(o,i,r)=>{if(e===!1)throw new P(n(i," has been removed"+(t?" in "+t:"")),P.ERR_DEPRECATED);return t&&!Kn[i]&&(Kn[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,i,r):!0}};function Nr(s,e,t){if(typeof s!="object")throw new P("options must be an object",P.ERR_BAD_OPTION_VALUE);let a=Object.keys(s),n=a.length;for(;n-- >0;){let o=a[n],i=e[o];if(i){let r=s[o],c=r===void 0||i(r,o,s);if(c!==!0)throw new P("option "+o+" must be "+c,P.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new P("Unknown option "+o,P.ERR_BAD_OPTION)}}var vt={assertOptions:Nr,validators:Ss};var me=vt.validators,Ve=class{constructor(e){this.defaults=e,this.interceptors={request:new ds,response:new ds}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=re(this.defaults,t);let{transitional:a,paramsSerializer:n,headers:o}=t;a!==void 0&&vt.assertOptions(a,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1),n!=null&&(u.isFunction(n)?t.paramsSerializer={serialize:n}:vt.assertOptions(n,{encode:me.function,serialize:me.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&u.merge(o.common,o[t.method]);o&&u.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),t.headers=M.concat(i,o);let r=[],c=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(t)===!1||(c=c&&k.synchronous,r.unshift(k.fulfilled,k.rejected))});let l=[];this.interceptors.response.forEach(function(k){l.push(k.fulfilled,k.rejected)});let p,d=0,C;if(!c){let m=[bt.bind(this),void 0];for(m.unshift.apply(m,r),m.push.apply(m,l),C=m.length,p=Promise.resolve(t);d<C;)p=p.then(m[d++],m[d++]);return p}C=r.length;let q=t;for(d=0;d<C;){let m=r[d++],k=r[d++];try{q=m(q)}catch(I){k.call(this,I);break}}try{p=bt.call(this,q)}catch(m){return Promise.reject(m)}for(d=0,C=l.length;d<C;)p=p.then(l[d++],l[d++]);return p}getUri(e){e=re(this.defaults,e);let t=ye(e.baseURL,e.url);return he(t,e.params,e.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(e){Ve.prototype[e]=function(t,a){return this.request(re(a||{},{method:e,url:t,data:(a||{}).data}))}});u.forEach(["post","put","patch"],function(e){function t(a){return function(o,i,r){return this.request(re(r||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Ve.prototype[e]=t(),Ve.prototype[e+"Form"]=t(!0)});var Je=Ve;var Ye=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});let a=this;this.promise.then(n=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](n);a._listeners=null}),this.promise.then=n=>{let o,i=new Promise(r=>{a.subscribe(r),o=r}).then(n);return i.cancel=function(){a.unsubscribe(o)},i},e(function(o,i,r){a.reason||(a.reason=new ae(o,i,r),t(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ye(function(n){e=n}),cancel:e}}},Jn=Ye;function Vs(s){return function(t){return s.apply(null,t)}}function _s(s){return u.isObject(s)&&s.isAxiosError===!0}var Ws={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ws).forEach(([s,e])=>{Ws[e]=s});var Yn=Ws;function Xn(s){let e=new Je(s),t=Le(Je.prototype.request,e);return u.extend(t,Je.prototype,e,{allOwnKeys:!0}),u.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return Xn(re(s,n))},t}var W=Xn(Ue);W.Axios=Je;W.CanceledError=ae;W.CancelToken=Jn;W.isCancel=Ne;W.VERSION=Ae;W.toFormData=pe;W.AxiosError=P;W.Cancel=W.CanceledError;W.all=function(e){return Promise.all(e)};W.spread=Vs;W.isAxiosError=_s;W.mergeConfig=re;W.AxiosHeaders=M;W.formToJSON=s=>pt(u.isHTMLForm(s)?new FormData(s):s);W.getAdapter=yt.getAdapter;W.HttpStatusCode=Yn;W.default=W;var f=W;var{Axios:Qr,AxiosError:zr,CanceledError:Hr,isCancel:$r,CancelToken:Kr,VERSION:Jr,all:Yr,Cancel:Xr,isAxiosError:Zr,spread:ec,toFormData:tc,AxiosHeaders:sc,HttpStatusCode:ac,formToJSON:nc,getAdapter:oc,mergeConfig:ic}=f;var Xe=K(Zn()),mc="https://api.botpress.cloud",fc=6e4,gc="BP_API_URL",xc="BP_BOT_ID",hc="BP_INTEGRATION_ID",yc="BP_WORKSPACE_ID",bc="BP_TOKEN";function eo(s){let e=vc(s),t={};e.workspaceId&&(t["x-workspace-id"]=e.workspaceId),e.botId&&(t["x-bot-id"]=e.botId),e.integrationId&&(t["x-integration-id"]=e.integrationId),e.token&&(t.Authorization=`Bearer ${e.token}`),t={...t,...e.headers};let a=e.apiUrl??mc,n=e.timeout??fc;return{apiUrl:a,timeout:n,withCredentials:Xe.isBrowser,headers:t}}function vc(s){return Xe.isBrowser?s:Xe.isNode?Rc(s):s}function Rc(s){let e={...s,apiUrl:s.apiUrl??process.env[gc],botId:s.botId??process.env[xc],integrationId:s.integrationId??process.env[hc],workspaceId:s.workspaceId??process.env[yc]},t=e.token??process.env[bc];return t&&(e.token=t),e}var g="https://api.botpress.cloud".replace(/\/+$/,"");var Rt=class{constructor(e,t=g,a=f){this.basePath=t;this.axios=a;e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}configuration},At=class extends Error{constructor(t,a){super(a);this.field=t;this.name="RequiredError"}};var x="https://example.com",A=function(s,e,t){if(t==null)throw new At(e,`Required parameter ${e} was null or undefined when calling ${s}.`)};function Ms(s,e,t=""){e!=null&&(typeof e=="object"?Array.isArray(e)?e.forEach(a=>Ms(s,a,t)):Object.keys(e).forEach(a=>Ms(s,e[a],`${t}${t!==""?".":""}${a}`)):s.has(t)?s.append(t,e):s.set(t,e))}var h=function(s,...e){let t=new URLSearchParams(s.search);Ms(t,e),s.search=t.toString()},E=function(s,e,t){let a=typeof s!="string";return(a&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):a)?JSON.stringify(s!==void 0?s:{}):s||""},y=function(s){return s.pathname+s.search+s.hash},b=function(s,e,t,a){return(n=e,o=t)=>{let i={...s.options,url:(a?.basePath||o)+s.url};return n.request(i)}};var Ac=function(s){return{addParticipant:async(e,t,a={})=>{A("addParticipant","id",e);let n="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"POST",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},breakDownWorkspaceUsageByBot:async(e,t,a,n={})=>{A("breakDownWorkspaceUsageByBot","id",e),A("breakDownWorkspaceUsageByBot","type",t);let o="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.type=t),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},callAction:async(e,t={})=>{let a="/v1/chat/actions",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},changeAISpendQuota:async(e,t={})=>{let a="/v1/admin/quotas/ai-spend",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"PUT",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},changeWorkspacePlan:async(e,t,a={})=>{A("changeWorkspacePlan","id",e);let n="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},chargeWorkspaceUnpaidInvoices:async(e,t,a={})=>{A("chargeWorkspaceUnpaidInvoices","id",e);let n="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"POST",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},configureIntegration:async(e,t={})=>{let a="/v1/chat/integrations/configure",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createBot:async(e,t={})=>{let a="/v1/admin/bots",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createConversation:async(e,t={})=>{let a="/v1/chat/conversations",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createEvent:async(e,t={})=>{let a="/v1/chat/events",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createFile:async(e,t={})=>{let a="/v1/storage/files",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createIntegration:async(e,t={})=>{let a="/v1/admin/integrations",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createMessage:async(e,t={})=>{let a="/v1/chat/messages",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createPersonalAccessToken:async(e,t={})=>{let a="/v1/admin/account/pats",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createUser:async(e,t={})=>{let a="/v1/chat/users",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createWorkspace:async(e,t={})=>{let a="/v1/admin/workspaces",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createWorkspaceMember:async(e,t={})=>{let a="/v1/admin/workspace-members",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},deleteBot:async(e,t={})=>{A("deleteBot","id",e);let a="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteBotIssue:async(e,t,a={})=>{A("deleteBotIssue","id",e),A("deleteBotIssue","issueId",t);let n="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(e))).replace("{issueId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"DELETE",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},deleteConversation:async(e,t={})=>{A("deleteConversation","id",e);let a="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteFile:async(e,t={})=>{A("deleteFile","id",e);let a="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteIntegration:async(e,t={})=>{A("deleteIntegration","id",e);let a="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteMessage:async(e,t={})=>{A("deleteMessage","id",e);let a="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deletePersonalAccessToken:async(e,t={})=>{A("deletePersonalAccessToken","id",e);let a="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteUser:async(e,t={})=>{A("deleteUser","id",e);let a="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteWorkspace:async(e,t={})=>{A("deleteWorkspace","id",e);let a="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteWorkspaceMember:async(e,t={})=>{A("deleteWorkspaceMember","id",e);let a="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},downloadFile:async(e,t={})=>{A("downloadFile","id",e);let a="/v1/storage/files/{id}/download".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getAccount:async(e={})=>{let t="/v1/admin/account/me",a=new URL(t,x),n;s&&(n=s.baseOptions);let o={method:"GET",...n,...e},i={};h(a,{});let c=n&&n.headers?n.headers:{};return o.headers={...i,...c,...e.headers},{url:y(a),options:o}},getAllWorkspaceQuotaCompletion:async(e={})=>{let t="/v1/admin/workspaces/usages/quota-completion",a=new URL(t,x),n;s&&(n=s.baseOptions);let o={method:"GET",...n,...e},i={};h(a,{});let c=n&&n.headers?n.headers:{};return o.headers={...i,...c,...e.headers},{url:y(a),options:o}},getAuditRecords:async(e,t,a={})=>{A("getAuditRecords","id",e);let n="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getBot:async(e,t={})=>{A("getBot","id",e);let a="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getBotAnalytics:async(e,t,a,n={})=>{A("getBotAnalytics","id",e),A("getBotAnalytics","startDate",t),A("getBotAnalytics","endDate",a);let o="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.startDate=t),a!==void 0&&(p.endDate=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},getBotLogs:async(e,t,a,n,o={})=>{A("getBotLogs","id",e),A("getBotLogs","timeStart",t),A("getBotLogs","timeEnd",a);let i="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(e))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"GET",...c,...o},p={},d={};t!==void 0&&(d.timeStart=t),a!==void 0&&(d.timeEnd=a),n!==void 0&&(d.nextToken=n),h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},{url:y(r),options:l}},getBotWebchat:async(e,t,a={})=>{A("getBotWebchat","id",e),A("getBotWebchat","type",t);let n="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.type=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getConversation:async(e,t={})=>{A("getConversation","id",e);let a="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getEvent:async(e,t={})=>{A("getEvent","id",e);let a="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getFile:async(e,t={})=>{A("getFile","id",e);let a="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getIntegration:async(e,t={})=>{A("getIntegration","id",e);let a="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getIntegrationByName:async(e,t,a={})=>{A("getIntegrationByName","name",e),A("getIntegrationByName","version",t);let n="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getIntegrationLogs:async(e,t,a,n,o={})=>{A("getIntegrationLogs","id",e),A("getIntegrationLogs","timeStart",t),A("getIntegrationLogs","timeEnd",a);let i="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(e))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"GET",...c,...o},p={},d={};t!==void 0&&(d.timeStart=t),a!==void 0&&(d.timeEnd=a),n!==void 0&&(d.nextToken=n),h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},{url:y(r),options:l}},getMessage:async(e,t={})=>{A("getMessage","id",e);let a="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getOrCreateConversation:async(e,t={})=>{let a="/v1/chat/conversations/get-or-create",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},getOrCreateMessage:async(e,t={})=>{let a="/v1/chat/messages/get-or-create",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},getOrCreateUser:async(e,t={})=>{let a="/v1/chat/users/get-or-create",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},getParticipant:async(e,t,a={})=>{A("getParticipant","id",e),A("getParticipant","userId",t);let n="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(e))).replace("{userId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getPublicIntegration:async(e,t,a={})=>{A("getPublicIntegration","name",e),A("getPublicIntegration","version",t);let n="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getPublicIntegrationById:async(e,t={})=>{A("getPublicIntegrationById","id",e);let a="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getState:async(e,t,a,n={})=>{A("getState","type",e),A("getState","id",t),A("getState","name",a);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(a))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={};h(i,{});let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},getUsage:async(e,t,a,n={})=>{A("getUsage","type",e),A("getUsage","id",t);let o="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.type=e),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},getUser:async(e,t={})=>{A("getUser","id",e);let a="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getWorkspace:async(e,t={})=>{A("getWorkspace","id",e);let a="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getWorkspaceBillingDetails:async(e,t={})=>{A("getWorkspaceBillingDetails","id",e);let a="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getWorkspaceQuota:async(e,t,a,n={})=>{A("getWorkspaceQuota","id",e),A("getWorkspaceQuota","type",t);let o="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.type=t),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},introspect:async(e,t={})=>{let a="/v1/admin/introspect",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},listBotIssueEvents:async(e,t,a={})=>{A("listBotIssueEvents","id",e),A("listBotIssueEvents","issueId",t);let n="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(e))).replace("{issueId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listBotIssues:async(e,t,a={})=>{A("listBotIssues","id",e);let n="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listBots:async(e,t,a={})=>{let n="/v1/admin/bots",o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};e!==void 0&&(l.dev=e),t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listConversations:async(e,t,a,n={})=>{let o="/v1/chat/conversations",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.tags=t),a&&(p.participantIds=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listEvents:async(e,t,a,n,o,i={})=>{let r="/v1/chat/events",c=new URL(r,x),l;s&&(l=s.baseOptions);let p={method:"GET",...l,...i},d={},C={};e!==void 0&&(C.nextToken=e),t!==void 0&&(C.type=t),a!==void 0&&(C.conversationId=a),n!==void 0&&(C.userId=n),o!==void 0&&(C.messageId=o),h(c,C);let q=l&&l.headers?l.headers:{};return p.headers={...d,...q,...i.headers},{url:y(c),options:p}},listFiles:async(e,t,a={})=>{A("listFiles","botId",e);let n="/v1/storage/files",o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),e!==void 0&&(l.botId=e),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listIntegrations:async(e,t,a,n,o={})=>{let i="/v1/admin/integrations",r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"GET",...c,...o},p={},d={};e!==void 0&&(d.nextToken=e),t!==void 0&&(d.name=t),a!==void 0&&(d.version=a),n!==void 0&&(d.dev=n),h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},{url:y(r),options:l}},listMessages:async(e,t,a,n={})=>{let o="/v1/chat/messages",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.conversationId=t),a!==void 0&&(p.tags=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listParticipants:async(e,t,a={})=>{A("listParticipants","id",e);let n="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listPersonalAccessTokens:async(e={})=>{let t="/v1/admin/account/pats",a=new URL(t,x),n;s&&(n=s.baseOptions);let o={method:"GET",...n,...e},i={};h(a,{});let c=n&&n.headers?n.headers:{};return o.headers={...i,...c,...e.headers},{url:y(a),options:o}},listPublicIntegrations:async(e,t,a,n={})=>{let o="/v1/admin/hub/integrations",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.name=t),a!==void 0&&(p.version=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listUsageHistory:async(e,t,a={})=>{A("listUsageHistory","type",e),A("listUsageHistory","id",t);let n="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};e!==void 0&&(l.type=e),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listUsers:async(e,t,a,n={})=>{let o="/v1/chat/users",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.conversationId=t),a!==void 0&&(p.tags=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listWorkspaceInvoices:async(e,t={})=>{A("listWorkspaceInvoices","id",e);let a="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},listWorkspaceMembers:async(e,t={})=>{let a="/v1/admin/workspace-members",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={},c={};e!==void 0&&(c.nextToken=e),h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},listWorkspaceQuotas:async(e,t,a={})=>{A("listWorkspaceQuotas","id",e);let n="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.period=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listWorkspaceUsages:async(e,t,a,n={})=>{A("listWorkspaceUsages","id",e),A("listWorkspaceUsages","type",t);let o="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.type=t),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listWorkspaces:async(e,t={})=>{let a="/v1/admin/workspaces",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={},c={};e!==void 0&&(c.nextToken=e),h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},patchState:async(e,t,a,n,o={})=>{A("patchState","type",e),A("patchState","id",t),A("patchState","name",a);let i="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(a))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"PATCH",...c,...o},p={},d={};p["Content-Type"]="application/json",h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},l.data=E(n,l,s),{url:y(r),options:l}},removeParticipant:async(e,t,a={})=>{A("removeParticipant","id",e),A("removeParticipant","userId",t);let n="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(e))).replace("{userId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"DELETE",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},setState:async(e,t,a,n,o={})=>{A("setState","type",e),A("setState","id",t),A("setState","name",a);let i="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(a))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"POST",...c,...o},p={},d={};p["Content-Type"]="application/json",h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},l.data=E(n,l,s),{url:y(r),options:l}},setWorkspacePaymentMethod:async(e,t,a={})=>{A("setWorkspacePaymentMethod","id",e);let n="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},transferBot:async(e,t,a={})=>{A("transferBot","id",e);let n="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"POST",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateBot:async(e,t,a={})=>{A("updateBot","id",e);let n="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateConversation:async(e,t,a={})=>{A("updateConversation","id",e);let n="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateIntegration:async(e,t,a={})=>{A("updateIntegration","id",e);let n="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateMessage:async(e,t,a={})=>{A("updateMessage","id",e);let n="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateUser:async(e,t,a={})=>{A("updateUser","id",e);let n="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateWorkspace:async(e,t,a={})=>{A("updateWorkspace","id",e);let n="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateWorkspaceMember:async(e,t,a={})=>{A("updateWorkspaceMember","id",e);let n="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}}}},v=function(s){let e=Ac(s);return{async addParticipant(t,a,n){let o=await e.addParticipant(t,a,n);return b(o,f,g,s)},async breakDownWorkspaceUsageByBot(t,a,n,o){let i=await e.breakDownWorkspaceUsageByBot(t,a,n,o);return b(i,f,g,s)},async callAction(t,a){let n=await e.callAction(t,a);return b(n,f,g,s)},async changeAISpendQuota(t,a){let n=await e.changeAISpendQuota(t,a);return b(n,f,g,s)},async changeWorkspacePlan(t,a,n){let o=await e.changeWorkspacePlan(t,a,n);return b(o,f,g,s)},async chargeWorkspaceUnpaidInvoices(t,a,n){let o=await e.chargeWorkspaceUnpaidInvoices(t,a,n);return b(o,f,g,s)},async configureIntegration(t,a){let n=await e.configureIntegration(t,a);return b(n,f,g,s)},async createBot(t,a){let n=await e.createBot(t,a);return b(n,f,g,s)},async createConversation(t,a){let n=await e.createConversation(t,a);return b(n,f,g,s)},async createEvent(t,a){let n=await e.createEvent(t,a);return b(n,f,g,s)},async createFile(t,a){let n=await e.createFile(t,a);return b(n,f,g,s)},async createIntegration(t,a){let n=await e.createIntegration(t,a);return b(n,f,g,s)},async createMessage(t,a){let n=await e.createMessage(t,a);return b(n,f,g,s)},async createPersonalAccessToken(t,a){let n=await e.createPersonalAccessToken(t,a);return b(n,f,g,s)},async createUser(t,a){let n=await e.createUser(t,a);return b(n,f,g,s)},async createWorkspace(t,a){let n=await e.createWorkspace(t,a);return b(n,f,g,s)},async createWorkspaceMember(t,a){let n=await e.createWorkspaceMember(t,a);return b(n,f,g,s)},async deleteBot(t,a){let n=await e.deleteBot(t,a);return b(n,f,g,s)},async deleteBotIssue(t,a,n){let o=await e.deleteBotIssue(t,a,n);return b(o,f,g,s)},async deleteConversation(t,a){let n=await e.deleteConversation(t,a);return b(n,f,g,s)},async deleteFile(t,a){let n=await e.deleteFile(t,a);return b(n,f,g,s)},async deleteIntegration(t,a){let n=await e.deleteIntegration(t,a);return b(n,f,g,s)},async deleteMessage(t,a){let n=await e.deleteMessage(t,a);return b(n,f,g,s)},async deletePersonalAccessToken(t,a){let n=await e.deletePersonalAccessToken(t,a);return b(n,f,g,s)},async deleteUser(t,a){let n=await e.deleteUser(t,a);return b(n,f,g,s)},async deleteWorkspace(t,a){let n=await e.deleteWorkspace(t,a);return b(n,f,g,s)},async deleteWorkspaceMember(t,a){let n=await e.deleteWorkspaceMember(t,a);return b(n,f,g,s)},async downloadFile(t,a){let n=await e.downloadFile(t,a);return b(n,f,g,s)},async getAccount(t){let a=await e.getAccount(t);return b(a,f,g,s)},async getAllWorkspaceQuotaCompletion(t){let a=await e.getAllWorkspaceQuotaCompletion(t);return b(a,f,g,s)},async getAuditRecords(t,a,n){let o=await e.getAuditRecords(t,a,n);return b(o,f,g,s)},async getBot(t,a){let n=await e.getBot(t,a);return b(n,f,g,s)},async getBotAnalytics(t,a,n,o){let i=await e.getBotAnalytics(t,a,n,o);return b(i,f,g,s)},async getBotLogs(t,a,n,o,i){let r=await e.getBotLogs(t,a,n,o,i);return b(r,f,g,s)},async getBotWebchat(t,a,n){let o=await e.getBotWebchat(t,a,n);return b(o,f,g,s)},async getConversation(t,a){let n=await e.getConversation(t,a);return b(n,f,g,s)},async getEvent(t,a){let n=await e.getEvent(t,a);return b(n,f,g,s)},async getFile(t,a){let n=await e.getFile(t,a);return b(n,f,g,s)},async getIntegration(t,a){let n=await e.getIntegration(t,a);return b(n,f,g,s)},async getIntegrationByName(t,a,n){let o=await e.getIntegrationByName(t,a,n);return b(o,f,g,s)},async getIntegrationLogs(t,a,n,o,i){let r=await e.getIntegrationLogs(t,a,n,o,i);return b(r,f,g,s)},async getMessage(t,a){let n=await e.getMessage(t,a);return b(n,f,g,s)},async getOrCreateConversation(t,a){let n=await e.getOrCreateConversation(t,a);return b(n,f,g,s)},async getOrCreateMessage(t,a){let n=await e.getOrCreateMessage(t,a);return b(n,f,g,s)},async getOrCreateUser(t,a){let n=await e.getOrCreateUser(t,a);return b(n,f,g,s)},async getParticipant(t,a,n){let o=await e.getParticipant(t,a,n);return b(o,f,g,s)},async getPublicIntegration(t,a,n){let o=await e.getPublicIntegration(t,a,n);return b(o,f,g,s)},async getPublicIntegrationById(t,a){let n=await e.getPublicIntegrationById(t,a);return b(n,f,g,s)},async getState(t,a,n,o){let i=await e.getState(t,a,n,o);return b(i,f,g,s)},async getUsage(t,a,n,o){let i=await e.getUsage(t,a,n,o);return b(i,f,g,s)},async getUser(t,a){let n=await e.getUser(t,a);return b(n,f,g,s)},async getWorkspace(t,a){let n=await e.getWorkspace(t,a);return b(n,f,g,s)},async getWorkspaceBillingDetails(t,a){let n=await e.getWorkspaceBillingDetails(t,a);return b(n,f,g,s)},async getWorkspaceQuota(t,a,n,o){let i=await e.getWorkspaceQuota(t,a,n,o);return b(i,f,g,s)},async introspect(t,a){let n=await e.introspect(t,a);return b(n,f,g,s)},async listBotIssueEvents(t,a,n){let o=await e.listBotIssueEvents(t,a,n);return b(o,f,g,s)},async listBotIssues(t,a,n){let o=await e.listBotIssues(t,a,n);return b(o,f,g,s)},async listBots(t,a,n){let o=await e.listBots(t,a,n);return b(o,f,g,s)},async listConversations(t,a,n,o){let i=await e.listConversations(t,a,n,o);return b(i,f,g,s)},async listEvents(t,a,n,o,i,r){let c=await e.listEvents(t,a,n,o,i,r);return b(c,f,g,s)},async listFiles(t,a,n){let o=await e.listFiles(t,a,n);return b(o,f,g,s)},async listIntegrations(t,a,n,o,i){let r=await e.listIntegrations(t,a,n,o,i);return b(r,f,g,s)},async listMessages(t,a,n,o){let i=await e.listMessages(t,a,n,o);return b(i,f,g,s)},async listParticipants(t,a,n){let o=await e.listParticipants(t,a,n);return b(o,f,g,s)},async listPersonalAccessTokens(t){let a=await e.listPersonalAccessTokens(t);return b(a,f,g,s)},async listPublicIntegrations(t,a,n,o){let i=await e.listPublicIntegrations(t,a,n,o);return b(i,f,g,s)},async listUsageHistory(t,a,n){let o=await e.listUsageHistory(t,a,n);return b(o,f,g,s)},async listUsers(t,a,n,o){let i=await e.listUsers(t,a,n,o);return b(i,f,g,s)},async listWorkspaceInvoices(t,a){let n=await e.listWorkspaceInvoices(t,a);return b(n,f,g,s)},async listWorkspaceMembers(t,a){let n=await e.listWorkspaceMembers(t,a);return b(n,f,g,s)},async listWorkspaceQuotas(t,a,n){let o=await e.listWorkspaceQuotas(t,a,n);return b(o,f,g,s)},async listWorkspaceUsages(t,a,n,o){let i=await e.listWorkspaceUsages(t,a,n,o);return b(i,f,g,s)},async listWorkspaces(t,a){let n=await e.listWorkspaces(t,a);return b(n,f,g,s)},async patchState(t,a,n,o,i){let r=await e.patchState(t,a,n,o,i);return b(r,f,g,s)},async removeParticipant(t,a,n){let o=await e.removeParticipant(t,a,n);return b(o,f,g,s)},async setState(t,a,n,o,i){let r=await e.setState(t,a,n,o,i);return b(r,f,g,s)},async setWorkspacePaymentMethod(t,a,n){let o=await e.setWorkspacePaymentMethod(t,a,n);return b(o,f,g,s)},async transferBot(t,a,n){let o=await e.transferBot(t,a,n);return b(o,f,g,s)},async updateBot(t,a,n){let o=await e.updateBot(t,a,n);return b(o,f,g,s)},async updateConversation(t,a,n){let o=await e.updateConversation(t,a,n);return b(o,f,g,s)},async updateIntegration(t,a,n){let o=await e.updateIntegration(t,a,n);return b(o,f,g,s)},async updateMessage(t,a,n){let o=await e.updateMessage(t,a,n);return b(o,f,g,s)},async updateUser(t,a,n){let o=await e.updateUser(t,a,n);return b(o,f,g,s)},async updateWorkspace(t,a,n){let o=await e.updateWorkspace(t,a,n);return b(o,f,g,s)},async updateWorkspaceMember(t,a,n){let o=await e.updateWorkspaceMember(t,a,n);return b(o,f,g,s)}}};var Ct=class extends Rt{addParticipant(e,t){return v(this.configuration).addParticipant(e.id,e.addParticipantBody,t).then(a=>a(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(e,t){return v(this.configuration).breakDownWorkspaceUsageByBot(e.id,e.type,e.period,t).then(a=>a(this.axios,this.basePath))}callAction(e={},t){return v(this.configuration).callAction(e.callActionBody,t).then(a=>a(this.axios,this.basePath))}changeAISpendQuota(e={},t){return v(this.configuration).changeAISpendQuota(e.changeAISpendQuotaBody,t).then(a=>a(this.axios,this.basePath))}changeWorkspacePlan(e,t){return v(this.configuration).changeWorkspacePlan(e.id,e.changeWorkspacePlanBody,t).then(a=>a(this.axios,this.basePath))}chargeWorkspaceUnpaidInvoices(e,t){return v(this.configuration).chargeWorkspaceUnpaidInvoices(e.id,e.chargeWorkspaceUnpaidInvoicesBody,t).then(a=>a(this.axios,this.basePath))}configureIntegration(e={},t){return v(this.configuration).configureIntegration(e.configureIntegrationBody,t).then(a=>a(this.axios,this.basePath))}createBot(e={},t){return v(this.configuration).createBot(e.createBotBody,t).then(a=>a(this.axios,this.basePath))}createConversation(e={},t){return v(this.configuration).createConversation(e.createConversationBody,t).then(a=>a(this.axios,this.basePath))}createEvent(e={},t){return v(this.configuration).createEvent(e.createEventBody,t).then(a=>a(this.axios,this.basePath))}createFile(e={},t){return v(this.configuration).createFile(e.createFileBody,t).then(a=>a(this.axios,this.basePath))}createIntegration(e={},t){return v(this.configuration).createIntegration(e.createIntegrationBody,t).then(a=>a(this.axios,this.basePath))}createMessage(e={},t){return v(this.configuration).createMessage(e.createMessageBody,t).then(a=>a(this.axios,this.basePath))}createPersonalAccessToken(e={},t){return v(this.configuration).createPersonalAccessToken(e.createPersonalAccessTokenBody,t).then(a=>a(this.axios,this.basePath))}createUser(e={},t){return v(this.configuration).createUser(e.createUserBody,t).then(a=>a(this.axios,this.basePath))}createWorkspace(e={},t){return v(this.configuration).createWorkspace(e.createWorkspaceBody,t).then(a=>a(this.axios,this.basePath))}createWorkspaceMember(e={},t){return v(this.configuration).createWorkspaceMember(e.createWorkspaceMemberBody,t).then(a=>a(this.axios,this.basePath))}deleteBot(e,t){return v(this.configuration).deleteBot(e.id,t).then(a=>a(this.axios,this.basePath))}deleteBotIssue(e,t){return v(this.configuration).deleteBotIssue(e.id,e.issueId,t).then(a=>a(this.axios,this.basePath))}deleteConversation(e,t){return v(this.configuration).deleteConversation(e.id,t).then(a=>a(this.axios,this.basePath))}deleteFile(e,t){return v(this.configuration).deleteFile(e.id,t).then(a=>a(this.axios,this.basePath))}deleteIntegration(e,t){return v(this.configuration).deleteIntegration(e.id,t).then(a=>a(this.axios,this.basePath))}deleteMessage(e,t){return v(this.configuration).deleteMessage(e.id,t).then(a=>a(this.axios,this.basePath))}deletePersonalAccessToken(e,t){return v(this.configuration).deletePersonalAccessToken(e.id,t).then(a=>a(this.axios,this.basePath))}deleteUser(e,t){return v(this.configuration).deleteUser(e.id,t).then(a=>a(this.axios,this.basePath))}deleteWorkspace(e,t){return v(this.configuration).deleteWorkspace(e.id,t).then(a=>a(this.axios,this.basePath))}deleteWorkspaceMember(e,t){return v(this.configuration).deleteWorkspaceMember(e.id,t).then(a=>a(this.axios,this.basePath))}downloadFile(e,t){return v(this.configuration).downloadFile(e.id,t).then(a=>a(this.axios,this.basePath))}getAccount(e){return v(this.configuration).getAccount(e).then(t=>t(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(e){return v(this.configuration).getAllWorkspaceQuotaCompletion(e).then(t=>t(this.axios,this.basePath))}getAuditRecords(e,t){return v(this.configuration).getAuditRecords(e.id,e.nextToken,t).then(a=>a(this.axios,this.basePath))}getBot(e,t){return v(this.configuration).getBot(e.id,t).then(a=>a(this.axios,this.basePath))}getBotAnalytics(e,t){return v(this.configuration).getBotAnalytics(e.id,e.startDate,e.endDate,t).then(a=>a(this.axios,this.basePath))}getBotLogs(e,t){return v(this.configuration).getBotLogs(e.id,e.timeStart,e.timeEnd,e.nextToken,t).then(a=>a(this.axios,this.basePath))}getBotWebchat(e,t){return v(this.configuration).getBotWebchat(e.id,e.type,t).then(a=>a(this.axios,this.basePath))}getConversation(e,t){return v(this.configuration).getConversation(e.id,t).then(a=>a(this.axios,this.basePath))}getEvent(e,t){return v(this.configuration).getEvent(e.id,t).then(a=>a(this.axios,this.basePath))}getFile(e,t){return v(this.configuration).getFile(e.id,t).then(a=>a(this.axios,this.basePath))}getIntegration(e,t){return v(this.configuration).getIntegration(e.id,t).then(a=>a(this.axios,this.basePath))}getIntegrationByName(e,t){return v(this.configuration).getIntegrationByName(e.name,e.version,t).then(a=>a(this.axios,this.basePath))}getIntegrationLogs(e,t){return v(this.configuration).getIntegrationLogs(e.id,e.timeStart,e.timeEnd,e.nextToken,t).then(a=>a(this.axios,this.basePath))}getMessage(e,t){return v(this.configuration).getMessage(e.id,t).then(a=>a(this.axios,this.basePath))}getOrCreateConversation(e={},t){return v(this.configuration).getOrCreateConversation(e.getOrCreateConversationBody,t).then(a=>a(this.axios,this.basePath))}getOrCreateMessage(e={},t){return v(this.configuration).getOrCreateMessage(e.getOrCreateMessageBody,t).then(a=>a(this.axios,this.basePath))}getOrCreateUser(e={},t){return v(this.configuration).getOrCreateUser(e.getOrCreateUserBody,t).then(a=>a(this.axios,this.basePath))}getParticipant(e,t){return v(this.configuration).getParticipant(e.id,e.userId,t).then(a=>a(this.axios,this.basePath))}getPublicIntegration(e,t){return v(this.configuration).getPublicIntegration(e.name,e.version,t).then(a=>a(this.axios,this.basePath))}getPublicIntegrationById(e,t){return v(this.configuration).getPublicIntegrationById(e.id,t).then(a=>a(this.axios,this.basePath))}getState(e,t){return v(this.configuration).getState(e.type,e.id,e.name,t).then(a=>a(this.axios,this.basePath))}getUsage(e,t){return v(this.configuration).getUsage(e.type,e.id,e.period,t).then(a=>a(this.axios,this.basePath))}getUser(e,t){return v(this.configuration).getUser(e.id,t).then(a=>a(this.axios,this.basePath))}getWorkspace(e,t){return v(this.configuration).getWorkspace(e.id,t).then(a=>a(this.axios,this.basePath))}getWorkspaceBillingDetails(e,t){return v(this.configuration).getWorkspaceBillingDetails(e.id,t).then(a=>a(this.axios,this.basePath))}getWorkspaceQuota(e,t){return v(this.configuration).getWorkspaceQuota(e.id,e.type,e.period,t).then(a=>a(this.axios,this.basePath))}introspect(e={},t){return v(this.configuration).introspect(e.introspectBody,t).then(a=>a(this.axios,this.basePath))}listBotIssueEvents(e,t){return v(this.configuration).listBotIssueEvents(e.id,e.issueId,t).then(a=>a(this.axios,this.basePath))}listBotIssues(e,t){return v(this.configuration).listBotIssues(e.id,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listBots(e={},t){return v(this.configuration).listBots(e.dev,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listConversations(e={},t){return v(this.configuration).listConversations(e.nextToken,e.tags,e.participantIds,t).then(a=>a(this.axios,this.basePath))}listEvents(e={},t){return v(this.configuration).listEvents(e.nextToken,e.type,e.conversationId,e.userId,e.messageId,t).then(a=>a(this.axios,this.basePath))}listFiles(e,t){return v(this.configuration).listFiles(e.botId,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listIntegrations(e={},t){return v(this.configuration).listIntegrations(e.nextToken,e.name,e.version,e.dev,t).then(a=>a(this.axios,this.basePath))}listMessages(e={},t){return v(this.configuration).listMessages(e.nextToken,e.conversationId,e.tags,t).then(a=>a(this.axios,this.basePath))}listParticipants(e,t){return v(this.configuration).listParticipants(e.id,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listPersonalAccessTokens(e){return v(this.configuration).listPersonalAccessTokens(e).then(t=>t(this.axios,this.basePath))}listPublicIntegrations(e={},t){return v(this.configuration).listPublicIntegrations(e.nextToken,e.name,e.version,t).then(a=>a(this.axios,this.basePath))}listUsageHistory(e,t){return v(this.configuration).listUsageHistory(e.type,e.id,t).then(a=>a(this.axios,this.basePath))}listUsers(e={},t){return v(this.configuration).listUsers(e.nextToken,e.conversationId,e.tags,t).then(a=>a(this.axios,this.basePath))}listWorkspaceInvoices(e,t){return v(this.configuration).listWorkspaceInvoices(e.id,t).then(a=>a(this.axios,this.basePath))}listWorkspaceMembers(e={},t){return v(this.configuration).listWorkspaceMembers(e.nextToken,t).then(a=>a(this.axios,this.basePath))}listWorkspaceQuotas(e,t){return v(this.configuration).listWorkspaceQuotas(e.id,e.period,t).then(a=>a(this.axios,this.basePath))}listWorkspaceUsages(e,t){return v(this.configuration).listWorkspaceUsages(e.id,e.type,e.period,t).then(a=>a(this.axios,this.basePath))}listWorkspaces(e={},t){return v(this.configuration).listWorkspaces(e.nextToken,t).then(a=>a(this.axios,this.basePath))}patchState(e,t){return v(this.configuration).patchState(e.type,e.id,e.name,e.patchStateBody,t).then(a=>a(this.axios,this.basePath))}removeParticipant(e,t){return v(this.configuration).removeParticipant(e.id,e.userId,t).then(a=>a(this.axios,this.basePath))}setState(e,t){return v(this.configuration).setState(e.type,e.id,e.name,e.setStateBody,t).then(a=>a(this.axios,this.basePath))}setWorkspacePaymentMethod(e,t){return v(this.configuration).setWorkspacePaymentMethod(e.id,e.setWorkspacePaymentMethodBody,t).then(a=>a(this.axios,this.basePath))}transferBot(e,t){return v(this.configuration).transferBot(e.id,e.transferBotBody,t).then(a=>a(this.axios,this.basePath))}updateBot(e,t){return v(this.configuration).updateBot(e.id,e.updateBotBody,t).then(a=>a(this.axios,this.basePath))}updateConversation(e,t){return v(this.configuration).updateConversation(e.id,e.updateConversationBody,t).then(a=>a(this.axios,this.basePath))}updateIntegration(e,t){return v(this.configuration).updateIntegration(e.id,e.updateIntegrationBody,t).then(a=>a(this.axios,this.basePath))}updateMessage(e,t){return v(this.configuration).updateMessage(e.id,e.updateMessageBody,t).then(a=>a(this.axios,this.basePath))}updateUser(e,t){return v(this.configuration).updateUser(e.id,e.updateUserBody,t).then(a=>a(this.axios,this.basePath))}updateWorkspace(e,t){return v(this.configuration).updateWorkspace(e.id,e.updateWorkspaceBody,t).then(a=>a(this.axios,this.basePath))}updateWorkspaceMember(e,t){return v(this.configuration).updateWorkspaceMember(e.id,e.updateWorkspaceMemberBody,t).then(a=>a(this.axios,this.basePath))}};var to=K(require("crypto"));var Cc={getRandomValues:s=>new Uint8Array(s.map(()=>Math.floor(Math.random()*256)))},js=typeof window<"u"&&typeof window.document<"u"?window.crypto:to.default;js.getRandomValues||(js=Cc);var S=class extends Error{constructor(t,a,n,o,i,r){super(o);this.code=t;this.description=a;this.type=n;this.message=o;this.error=i;this.id=r;this.id||(this.id=S.generateId())}isApiError=!0;format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let t=this.getPrefix(),a=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],n=4,o=Array.from(js.getRandomValues(new Uint8Array(n))).map(i=>i.toString(16).padStart(2,"0")).join("").toUpperCase();return`${t}_${a}x${o}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},kc=s=>typeof s=="object"&&!Array.isArray(s)&&s!==null,so=s=>s instanceof S||kc(s)&&s.isApiError===!0,fe=class extends S{constructor(e,t,a){super(500,"An unknown error occurred","Unknown",e,t,a)}},kt=class extends S{constructor(e,t,a){super(500,"An internal error occurred","Internal",e,t,a)}},Pt=class extends S{constructor(e,t,a){super(401,"The request requires to be authenticated.","Unauthorized",e,t,a)}},Bt=class extends S{constructor(e,t,a){super(403,"The requested action can't be peform by this resource.","Forbidden",e,t,a)}},wt=class extends S{constructor(e,t,a){super(413,"The request payload is too large.","PayloadTooLarge",e,t,a)}},It=class extends S{constructor(e,t,a){super(400,"The request payload is invalid.","InvalidPayload",e,t,a)}},qt=class extends S{constructor(e,t,a){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",e,t,a)}},Ut=class extends S{constructor(e,t,a){super(405,"The requested method does not exist.","MethodNotFound",e,t,a)}},Et=class extends S{constructor(e,t,a){super(404,"The requested resource does not exist.","ResourceNotFound",e,t,a)}},Tt=class extends S{constructor(e,t,a){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",e,t,a)}},Ot=class extends S{constructor(e,t,a){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",e,t,a)}},Dt=class extends S{constructor(e,t,a){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",e,t,a)}},St=class extends S{constructor(e,t,a){super(409,"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.","RelationConflict",e,t,a)}},Vt=class extends S{constructor(e,t,a){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",e,t,a)}},_t=class extends S{constructor(e,t,a){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",e,t,a)}},Wt=class extends S{constructor(e,t,a){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",e,t,a)}},Lt=class extends S{constructor(e,t,a){super(409,"The record attempted to be created already exists.","AlreadyExists",e,t,a)}},Mt=class extends S{constructor(e,t,a){super(429,"The request has been rate limited.","RateLimited",e,t,a)}},jt=class extends S{constructor(e,t,a){super(402,"A payment is required to perform this request.","PaymentRequired",e,t,a)}},Ft=class extends S{constructor(e,t,a){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",e,t,a)}},Gt=class extends S{constructor(e,t,a){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",e,t,a)}},Pc={Unknown:fe,Internal:kt,Unauthorized:Pt,Forbidden:Bt,PayloadTooLarge:wt,InvalidPayload:It,UnsupportedMediaType:qt,MethodNotFound:Ut,ResourceNotFound:Et,InvalidJsonSchema:Tt,InvalidDataFormat:Ot,InvalidIdentifier:Dt,RelationConflict:St,ReferenceNotFound:Vt,InvalidQuery:_t,Runtime:Wt,AlreadyExists:Lt,RateLimited:Mt,PaymentRequired:jt,QuotaExceeded:Ft,LimitExceeded:Gt},Nt=s=>so(s)?s:s instanceof Error?new fe(s.message,s):typeof s=="string"?new fe(s):Bc(s);function Bc(s){if(typeof s=="object"&&"code"in s&&"type"in s&&"id"in s&&"message"in s&&typeof s.type=="string"&&typeof s.message=="string"){let e=Pc[s.type];return e?new e(s.message,void 0,s.id||"UNKNOWN"):new fe(`An unclassified API error occurred: ${s.message} (Type: ${s.type}, Code: ${s.code})`)}return new fe("An invalid error occurred: "+JSON.stringify(s))}var Qt=class{_innerClient;constructor(e,t,a){this._innerClient=new Ct(e,t,a)}createConversation=e=>this._innerClient.createConversation({createConversationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getConversation=e=>this._innerClient.getConversation(e).then(t=>t.data).catch(t=>{throw R(t)});listConversations=e=>this._innerClient.listConversations(e).then(t=>t.data).catch(t=>{throw R(t)});getOrCreateConversation=e=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateConversation=({id:e,...t})=>this._innerClient.updateConversation({id:e,updateConversationBody:t}).then(a=>a.data).catch(a=>{throw R(a)});deleteConversation=e=>this._innerClient.deleteConversation(e).then(t=>t.data).catch(t=>{throw R(t)});listParticipants=e=>this._innerClient.listParticipants(e).then(t=>t.data).catch(t=>{throw R(t)});addParticipant=({id:e,...t})=>this._innerClient.addParticipant({id:e,addParticipantBody:t}).then(a=>a.data).catch(a=>{throw R(a)});getParticipant=e=>this._innerClient.getParticipant(e).then(t=>t.data).catch(t=>{throw R(t)});removeParticipant=e=>this._innerClient.removeParticipant(e).then(t=>t.data).catch(t=>{throw R(t)});createEvent=e=>this._innerClient.createEvent({createEventBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getEvent=e=>this._innerClient.getEvent(e).then(t=>t.data).catch(t=>{throw R(t)});listEvents=e=>this._innerClient.listEvents(e).then(t=>t.data).catch(t=>{throw R(t)});createMessage=e=>this._innerClient.createMessage({createMessageBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getOrCreateMessage=e=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getMessage=e=>this._innerClient.getMessage(e).then(t=>t.data).catch(t=>{throw R(t)});updateMessage=({id:e,...t})=>this._innerClient.updateMessage({id:e,updateMessageBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listMessages=e=>this._innerClient.listMessages(e).then(t=>t.data).catch(t=>{throw R(t)});deleteMessage=e=>this._innerClient.deleteMessage(e).then(t=>t.data).catch(t=>{throw R(t)});createUser=e=>this._innerClient.createUser({createUserBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getUser=e=>this._innerClient.getUser(e).then(t=>t.data).catch(t=>{throw R(t)});listUsers=e=>this._innerClient.listUsers(e).then(t=>t.data).catch(t=>{throw R(t)});getOrCreateUser=e=>this._innerClient.getOrCreateUser({getOrCreateUserBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateUser=({id:e,...t})=>this._innerClient.updateUser({id:e,updateUserBody:t}).then(a=>a.data).catch(a=>{throw R(a)});deleteUser=e=>this._innerClient.deleteUser(e).then(t=>t.data).catch(t=>{throw R(t)});getState=e=>this._innerClient.getState(e).then(t=>t.data).catch(t=>{throw R(t)});setState=({type:e,id:t,name:a,...n})=>this._innerClient.setState({type:e,id:t,name:a,setStateBody:n}).then(o=>o.data).catch(o=>{throw R(o)});patchState=({type:e,id:t,name:a,...n})=>this._innerClient.patchState({type:e,id:t,name:a,patchStateBody:n}).then(o=>o.data).catch(o=>{throw R(o)});callAction=e=>this._innerClient.callAction({callActionBody:e}).then(t=>t.data).catch(t=>{throw R(t)});configureIntegration=e=>this._innerClient.configureIntegration({configureIntegrationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getAccount=()=>this._innerClient.getAccount().then(e=>e.data).catch(e=>{throw R(e)});listPersonalAccessTokens=()=>this._innerClient.listPersonalAccessTokens().then(e=>e.data).catch(e=>{throw R(e)});createPersonalAccessToken=e=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:e}).then(t=>t.data).catch(t=>{throw R(t)});deletePersonalAccessToken=e=>this._innerClient.deletePersonalAccessToken(e).then(t=>t.data).catch(t=>{throw R(t)});listPublicIntegrations=e=>this._innerClient.listPublicIntegrations(e).then(t=>t.data).catch(t=>{throw R(t)});getPublicIntegrationById=e=>this._innerClient.getPublicIntegrationById(e).then(t=>t.data).catch(t=>{throw R(t)});getPublicIntegration=e=>this._innerClient.getPublicIntegration(e).then(t=>t.data).catch(t=>{throw R(t)});createBot=e=>this._innerClient.createBot({createBotBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateBot=({id:e,...t})=>this._innerClient.updateBot({id:e,updateBotBody:t}).then(a=>a.data).catch(a=>{throw R(a)});transferBot=({id:e,...t})=>this._innerClient.transferBot({id:e,transferBotBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listBots=e=>this._innerClient.listBots(e).then(t=>t.data).catch(t=>{throw R(t)});getBot=e=>this._innerClient.getBot(e).then(t=>t.data).catch(t=>{throw R(t)});deleteBot=e=>this._innerClient.deleteBot(e).then(t=>t.data).catch(t=>{throw R(t)});getBotLogs=e=>this._innerClient.getBotLogs(e).then(t=>t.data).catch(t=>{throw R(t)});getBotWebchat=e=>this._innerClient.getBotWebchat(e).then(t=>t.data).catch(t=>{throw R(t)});getBotAnalytics=e=>this._innerClient.getBotAnalytics(e).then(t=>t.data).catch(t=>{throw R(t)});listBotIssues=e=>this._innerClient.listBotIssues(e).then(t=>t.data).catch(t=>{throw R(t)});deleteBotIssue=e=>this._innerClient.deleteBotIssue(e).then(t=>t.data).catch(t=>{throw R(t)});listBotIssueEvents=e=>this._innerClient.listBotIssueEvents(e).then(t=>t.data).catch(t=>{throw R(t)});getWorkspaceBillingDetails=e=>this._innerClient.getWorkspaceBillingDetails(e).then(t=>t.data).catch(t=>{throw R(t)});setWorkspacePaymentMethod=({id:e,...t})=>this._innerClient.setWorkspacePaymentMethod({id:e,setWorkspacePaymentMethodBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listWorkspaceInvoices=e=>this._innerClient.listWorkspaceInvoices(e).then(t=>t.data).catch(t=>{throw R(t)});chargeWorkspaceUnpaidInvoices=({id:e,...t})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:e,chargeWorkspaceUnpaidInvoicesBody:t}).then(a=>a.data).catch(a=>{throw R(a)});createWorkspace=e=>this._innerClient.createWorkspace({createWorkspaceBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getWorkspace=e=>this._innerClient.getWorkspace(e).then(t=>t.data).catch(t=>{throw R(t)});listWorkspaceUsages=e=>this._innerClient.listWorkspaceUsages(e).then(t=>t.data).catch(t=>{throw R(t)});breakDownWorkspaceUsageByBot=e=>this._innerClient.breakDownWorkspaceUsageByBot(e).then(t=>t.data).catch(t=>{throw R(t)});getAllWorkspaceQuotaCompletion=()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(e=>e.data).catch(e=>{throw R(e)});getWorkspaceQuota=e=>this._innerClient.getWorkspaceQuota(e).then(t=>t.data).catch(t=>{throw R(t)});listWorkspaceQuotas=e=>this._innerClient.listWorkspaceQuotas(e).then(t=>t.data).catch(t=>{throw R(t)});updateWorkspace=({id:e,...t})=>this._innerClient.updateWorkspace({id:e,updateWorkspaceBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listWorkspaces=e=>this._innerClient.listWorkspaces(e).then(t=>t.data).catch(t=>{throw R(t)});changeWorkspacePlan=({id:e,...t})=>this._innerClient.changeWorkspacePlan({id:e,changeWorkspacePlanBody:t}).then(a=>a.data).catch(a=>{throw R(a)});deleteWorkspace=e=>this._innerClient.deleteWorkspace(e).then(t=>t.data).catch(t=>{throw R(t)});getAuditRecords=e=>this._innerClient.getAuditRecords(e).then(t=>t.data).catch(t=>{throw R(t)});listWorkspaceMembers=e=>this._innerClient.listWorkspaceMembers(e).then(t=>t.data).catch(t=>{throw R(t)});deleteWorkspaceMember=e=>this._innerClient.deleteWorkspaceMember(e).then(t=>t.data).catch(t=>{throw R(t)});createWorkspaceMember=e=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateWorkspaceMember=({id:e,...t})=>this._innerClient.updateWorkspaceMember({id:e,updateWorkspaceMemberBody:t}).then(a=>a.data).catch(a=>{throw R(a)});createIntegration=e=>this._innerClient.createIntegration({createIntegrationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateIntegration=({id:e,...t})=>this._innerClient.updateIntegration({id:e,updateIntegrationBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listIntegrations=e=>this._innerClient.listIntegrations(e).then(t=>t.data).catch(t=>{throw R(t)});getIntegration=e=>this._innerClient.getIntegration(e).then(t=>t.data).catch(t=>{throw R(t)});getIntegrationLogs=e=>this._innerClient.getIntegrationLogs(e).then(t=>t.data).catch(t=>{throw R(t)});getIntegrationByName=e=>this._innerClient.getIntegrationByName(e).then(t=>t.data).catch(t=>{throw R(t)});deleteIntegration=e=>this._innerClient.deleteIntegration(e).then(t=>t.data).catch(t=>{throw R(t)});getUsage=e=>this._innerClient.getUsage(e).then(t=>t.data).catch(t=>{throw R(t)});listUsageHistory=e=>this._innerClient.listUsageHistory(e).then(t=>t.data).catch(t=>{throw R(t)});changeAISpendQuota=e=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:e}).then(t=>t.data).catch(t=>{throw R(t)});introspect=e=>this._innerClient.introspect({introspectBody:e}).then(t=>t.data).catch(t=>{throw R(t)});createFile=e=>this._innerClient.createFile({createFileBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getFile=e=>this._innerClient.getFile(e).then(t=>t.data).catch(t=>{throw R(t)});downloadFile=e=>this._innerClient.downloadFile(e).then(t=>t.data).catch(t=>{throw R(t)});deleteFile=e=>this._innerClient.deleteFile(e).then(t=>t.data).catch(t=>{throw R(t)});listFiles=e=>this._innerClient.listFiles(e).then(t=>t.data).catch(t=>{throw R(t)})};function R(s){return f.isAxiosError(s)&&s.response?.data?Nt(s.response.data):Nt(s)}var ao=100*1024*1024,wc=ao,Ic=ao,Fs=class extends Qt{config;constructor(e={}){let t=eo(e),{apiUrl:a,headers:n,withCredentials:o,timeout:i}=t,r=f.create({headers:n,withCredentials:o,timeout:i,maxBodyLength:wc,maxContentLength:Ic});super(void 0,a,r),this.config=t}};0&&(module.exports={AlreadyExistsError,Client,ForbiddenError,InternalError,InvalidDataFormatError,InvalidIdentifierError,InvalidJsonSchemaError,InvalidPayloadError,InvalidQueryError,LimitExceededError,MethodNotFoundError,PayloadTooLargeError,PaymentRequiredError,QuotaExceededError,RateLimitedError,ReferenceNotFoundError,RelationConflictError,ResourceNotFoundError,RuntimeError,UnauthorizedError,UnknownError,UnsupportedMediaTypeError,axios,errorFrom,isApiError});
|
|
11
|
+
`):" "+Hn(o[0]):"as no adapter specified";throw new P("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return a},adapters:Os};function Ds(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new ae(null,s)}function bt(s){return Ds(s),s.headers=M.from(s.headers),s.data=Ge.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),yt.getAdapter(s.adapter||Ue.adapter)(s).then(function(a){return Ds(s),a.data=Ge.call(s,s.transformResponse,a),a.headers=M.from(a.headers),a},function(a){return Ne(a)||(Ds(s),a&&a.response&&(a.response.data=Ge.call(s,s.transformResponse,a.response),a.response.headers=M.from(a.response.headers))),Promise.reject(a)})}var $n=s=>s instanceof M?s.toJSON():s;function re(s,e){e=e||{};let t={};function a(l,p,d){return u.isPlainObject(l)&&u.isPlainObject(p)?u.merge.call({caseless:d},l,p):u.isPlainObject(p)?u.merge({},p):u.isArray(p)?p.slice():p}function n(l,p,d){if(u.isUndefined(p)){if(!u.isUndefined(l))return a(void 0,l,d)}else return a(l,p,d)}function o(l,p){if(!u.isUndefined(p))return a(void 0,p)}function i(l,p){if(u.isUndefined(p)){if(!u.isUndefined(l))return a(void 0,l)}else return a(void 0,p)}function r(l,p,d){if(d in e)return a(l,p);if(d in s)return a(void 0,l)}let c={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:r,headers:(l,p)=>n($n(l),$n(p),!0)};return u.forEach(Object.keys(Object.assign({},s,e)),function(p){let d=c[p]||n,C=d(s[p],e[p],p);u.isUndefined(C)&&d!==r||(t[p]=C)}),t}var Ss={};["object","boolean","number","function","string","symbol"].forEach((s,e)=>{Ss[s]=function(a){return typeof a===s||"a"+(e<1?"n ":" ")+s}});var Kn={};Ss.transitional=function(e,t,a){function n(o,i){return"[Axios v"+Ae+"] Transitional option '"+o+"'"+i+(a?". "+a:"")}return(o,i,r)=>{if(e===!1)throw new P(n(i," has been removed"+(t?" in "+t:"")),P.ERR_DEPRECATED);return t&&!Kn[i]&&(Kn[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,i,r):!0}};function Nr(s,e,t){if(typeof s!="object")throw new P("options must be an object",P.ERR_BAD_OPTION_VALUE);let a=Object.keys(s),n=a.length;for(;n-- >0;){let o=a[n],i=e[o];if(i){let r=s[o],c=r===void 0||i(r,o,s);if(c!==!0)throw new P("option "+o+" must be "+c,P.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new P("Unknown option "+o,P.ERR_BAD_OPTION)}}var vt={assertOptions:Nr,validators:Ss};var me=vt.validators,Ve=class{constructor(e){this.defaults=e,this.interceptors={request:new ds,response:new ds}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=re(this.defaults,t);let{transitional:a,paramsSerializer:n,headers:o}=t;a!==void 0&&vt.assertOptions(a,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1),n!=null&&(u.isFunction(n)?t.paramsSerializer={serialize:n}:vt.assertOptions(n,{encode:me.function,serialize:me.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&u.merge(o.common,o[t.method]);o&&u.forEach(["delete","get","head","post","put","patch","common"],m=>{delete o[m]}),t.headers=M.concat(i,o);let r=[],c=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(t)===!1||(c=c&&k.synchronous,r.unshift(k.fulfilled,k.rejected))});let l=[];this.interceptors.response.forEach(function(k){l.push(k.fulfilled,k.rejected)});let p,d=0,C;if(!c){let m=[bt.bind(this),void 0];for(m.unshift.apply(m,r),m.push.apply(m,l),C=m.length,p=Promise.resolve(t);d<C;)p=p.then(m[d++],m[d++]);return p}C=r.length;let q=t;for(d=0;d<C;){let m=r[d++],k=r[d++];try{q=m(q)}catch(I){k.call(this,I);break}}try{p=bt.call(this,q)}catch(m){return Promise.reject(m)}for(d=0,C=l.length;d<C;)p=p.then(l[d++],l[d++]);return p}getUri(e){e=re(this.defaults,e);let t=ye(e.baseURL,e.url);return he(t,e.params,e.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(e){Ve.prototype[e]=function(t,a){return this.request(re(a||{},{method:e,url:t,data:(a||{}).data}))}});u.forEach(["post","put","patch"],function(e){function t(a){return function(o,i,r){return this.request(re(r||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Ve.prototype[e]=t(),Ve.prototype[e+"Form"]=t(!0)});var Je=Ve;var Ye=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});let a=this;this.promise.then(n=>{if(!a._listeners)return;let o=a._listeners.length;for(;o-- >0;)a._listeners[o](n);a._listeners=null}),this.promise.then=n=>{let o,i=new Promise(r=>{a.subscribe(r),o=r}).then(n);return i.cancel=function(){a.unsubscribe(o)},i},e(function(o,i,r){a.reason||(a.reason=new ae(o,i,r),t(a.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ye(function(n){e=n}),cancel:e}}},Jn=Ye;function Vs(s){return function(t){return s.apply(null,t)}}function _s(s){return u.isObject(s)&&s.isAxiosError===!0}var Ws={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ws).forEach(([s,e])=>{Ws[e]=s});var Yn=Ws;function Xn(s){let e=new Je(s),t=Le(Je.prototype.request,e);return u.extend(t,Je.prototype,e,{allOwnKeys:!0}),u.extend(t,e,null,{allOwnKeys:!0}),t.create=function(n){return Xn(re(s,n))},t}var W=Xn(Ue);W.Axios=Je;W.CanceledError=ae;W.CancelToken=Jn;W.isCancel=Ne;W.VERSION=Ae;W.toFormData=pe;W.AxiosError=P;W.Cancel=W.CanceledError;W.all=function(e){return Promise.all(e)};W.spread=Vs;W.isAxiosError=_s;W.mergeConfig=re;W.AxiosHeaders=M;W.formToJSON=s=>pt(u.isHTMLForm(s)?new FormData(s):s);W.getAdapter=yt.getAdapter;W.HttpStatusCode=Yn;W.default=W;var f=W;var{Axios:Qr,AxiosError:zr,CanceledError:Hr,isCancel:$r,CancelToken:Kr,VERSION:Jr,all:Yr,Cancel:Xr,isAxiosError:Zr,spread:ec,toFormData:tc,AxiosHeaders:sc,HttpStatusCode:ac,formToJSON:nc,getAdapter:oc,mergeConfig:ic}=f;var Xe=K(Zn()),mc="https://api.botpress.cloud",fc=6e4,gc="BP_API_URL",xc="BP_BOT_ID",hc="BP_INTEGRATION_ID",yc="BP_WORKSPACE_ID",bc="BP_TOKEN";function eo(s){let e=vc(s),t={};e.workspaceId&&(t["x-workspace-id"]=e.workspaceId),e.botId&&(t["x-bot-id"]=e.botId),e.integrationId&&(t["x-integration-id"]=e.integrationId),e.token&&(t.Authorization=`Bearer ${e.token}`),t={...t,...e.headers};let a=e.apiUrl??mc,n=e.timeout??fc;return{apiUrl:a,timeout:n,withCredentials:Xe.isBrowser,headers:t}}function vc(s){return Xe.isBrowser?s:Xe.isNode?Rc(s):s}function Rc(s){let e={...s,apiUrl:s.apiUrl??process.env[gc],botId:s.botId??process.env[xc],integrationId:s.integrationId??process.env[hc],workspaceId:s.workspaceId??process.env[yc]},t=e.token??process.env[bc];return t&&(e.token=t),e}var g="https://api.botpress.cloud".replace(/\/+$/,"");var Rt=class{constructor(e,t=g,a=f){this.basePath=t;this.axios=a;e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}configuration},At=class extends Error{constructor(t,a){super(a);this.field=t;this.name="RequiredError"}};var x="https://example.com",A=function(s,e,t){if(t==null)throw new At(e,`Required parameter ${e} was null or undefined when calling ${s}.`)};function Ms(s,e,t=""){e!=null&&(typeof e=="object"?Array.isArray(e)?e.forEach(a=>Ms(s,a,t)):Object.keys(e).forEach(a=>Ms(s,e[a],`${t}${t!==""?".":""}${a}`)):s.has(t)?s.append(t,e):s.set(t,e))}var h=function(s,...e){let t=new URLSearchParams(s.search);Ms(t,e),s.search=t.toString()},E=function(s,e,t){let a=typeof s!="string";return(a&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):a)?JSON.stringify(s!==void 0?s:{}):s||""},y=function(s){return s.pathname+s.search+s.hash},b=function(s,e,t,a){return(n=e,o=t)=>{let i={...s.options,url:(a?.basePath||o)+s.url};return n.request(i)}};var Ac=function(s){return{addParticipant:async(e,t,a={})=>{A("addParticipant","id",e);let n="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"POST",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},breakDownWorkspaceUsageByBot:async(e,t,a,n={})=>{A("breakDownWorkspaceUsageByBot","id",e),A("breakDownWorkspaceUsageByBot","type",t);let o="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.type=t),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},callAction:async(e,t={})=>{let a="/v1/chat/actions",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},changeAISpendQuota:async(e,t={})=>{let a="/v1/admin/quotas/ai-spend",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"PUT",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},changeWorkspacePlan:async(e,t,a={})=>{A("changeWorkspacePlan","id",e);let n="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},chargeWorkspaceUnpaidInvoices:async(e,t,a={})=>{A("chargeWorkspaceUnpaidInvoices","id",e);let n="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"POST",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},configureIntegration:async(e,t={})=>{let a="/v1/chat/integrations/configure",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createBot:async(e,t={})=>{let a="/v1/admin/bots",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createConversation:async(e,t={})=>{let a="/v1/chat/conversations",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createEvent:async(e,t={})=>{let a="/v1/chat/events",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createFile:async(e,t={})=>{let a="/v1/storage/files",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createIntegration:async(e,t={})=>{let a="/v1/admin/integrations",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createMessage:async(e,t={})=>{let a="/v1/chat/messages",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createPersonalAccessToken:async(e,t={})=>{let a="/v1/admin/account/pats",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createUser:async(e,t={})=>{let a="/v1/chat/users",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createWorkspace:async(e,t={})=>{let a="/v1/admin/workspaces",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},createWorkspaceMember:async(e,t={})=>{let a="/v1/admin/workspace-members",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},deleteBot:async(e,t={})=>{A("deleteBot","id",e);let a="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteBotIssue:async(e,t,a={})=>{A("deleteBotIssue","id",e),A("deleteBotIssue","issueId",t);let n="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(e))).replace("{issueId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"DELETE",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},deleteConversation:async(e,t={})=>{A("deleteConversation","id",e);let a="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteFile:async(e,t={})=>{A("deleteFile","id",e);let a="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteIntegration:async(e,t={})=>{A("deleteIntegration","id",e);let a="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteMessage:async(e,t={})=>{A("deleteMessage","id",e);let a="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deletePersonalAccessToken:async(e,t={})=>{A("deletePersonalAccessToken","id",e);let a="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteUser:async(e,t={})=>{A("deleteUser","id",e);let a="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteWorkspace:async(e,t={})=>{A("deleteWorkspace","id",e);let a="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},deleteWorkspaceMember:async(e,t={})=>{A("deleteWorkspaceMember","id",e);let a="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"DELETE",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},downloadFile:async(e,t={})=>{A("downloadFile","id",e);let a="/v1/storage/files/{id}/download".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getAccount:async(e={})=>{let t="/v1/admin/account/me",a=new URL(t,x),n;s&&(n=s.baseOptions);let o={method:"GET",...n,...e},i={};h(a,{});let c=n&&n.headers?n.headers:{};return o.headers={...i,...c,...e.headers},{url:y(a),options:o}},getAllWorkspaceQuotaCompletion:async(e={})=>{let t="/v1/admin/workspaces/usages/quota-completion",a=new URL(t,x),n;s&&(n=s.baseOptions);let o={method:"GET",...n,...e},i={};h(a,{});let c=n&&n.headers?n.headers:{};return o.headers={...i,...c,...e.headers},{url:y(a),options:o}},getAuditRecords:async(e,t,a={})=>{A("getAuditRecords","id",e);let n="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getBot:async(e,t={})=>{A("getBot","id",e);let a="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getBotAnalytics:async(e,t,a,n={})=>{A("getBotAnalytics","id",e),A("getBotAnalytics","startDate",t),A("getBotAnalytics","endDate",a);let o="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.startDate=t),a!==void 0&&(p.endDate=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},getBotLogs:async(e,t,a,n,o={})=>{A("getBotLogs","id",e),A("getBotLogs","timeStart",t),A("getBotLogs","timeEnd",a);let i="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(e))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"GET",...c,...o},p={},d={};t!==void 0&&(d.timeStart=t),a!==void 0&&(d.timeEnd=a),n!==void 0&&(d.nextToken=n),h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},{url:y(r),options:l}},getBotWebchat:async(e,t,a={})=>{A("getBotWebchat","id",e),A("getBotWebchat","type",t);let n="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.type=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getConversation:async(e,t={})=>{A("getConversation","id",e);let a="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getEvent:async(e,t={})=>{A("getEvent","id",e);let a="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getFile:async(e,t={})=>{A("getFile","id",e);let a="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getIntegration:async(e,t={})=>{A("getIntegration","id",e);let a="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getIntegrationByName:async(e,t,a={})=>{A("getIntegrationByName","name",e),A("getIntegrationByName","version",t);let n="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getIntegrationLogs:async(e,t,a,n,o={})=>{A("getIntegrationLogs","id",e),A("getIntegrationLogs","timeStart",t),A("getIntegrationLogs","timeEnd",a);let i="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(e))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"GET",...c,...o},p={},d={};t!==void 0&&(d.timeStart=t),a!==void 0&&(d.timeEnd=a),n!==void 0&&(d.nextToken=n),h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},{url:y(r),options:l}},getMessage:async(e,t={})=>{A("getMessage","id",e);let a="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getOrCreateConversation:async(e,t={})=>{let a="/v1/chat/conversations/get-or-create",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},getOrCreateMessage:async(e,t={})=>{let a="/v1/chat/messages/get-or-create",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},getOrCreateUser:async(e,t={})=>{let a="/v1/chat/users/get-or-create",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},getParticipant:async(e,t,a={})=>{A("getParticipant","id",e),A("getParticipant","userId",t);let n="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(e))).replace("{userId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getPublicIntegration:async(e,t,a={})=>{A("getPublicIntegration","name",e),A("getPublicIntegration","version",t);let n="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},getPublicIntegrationById:async(e,t={})=>{A("getPublicIntegrationById","id",e);let a="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getState:async(e,t,a,n={})=>{A("getState","type",e),A("getState","id",t),A("getState","name",a);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(a))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={};h(i,{});let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},getUsage:async(e,t,a,n={})=>{A("getUsage","type",e),A("getUsage","id",t);let o="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.type=e),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},getUser:async(e,t={})=>{A("getUser","id",e);let a="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getWorkspace:async(e,t={})=>{A("getWorkspace","id",e);let a="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getWorkspaceBillingDetails:async(e,t={})=>{A("getWorkspaceBillingDetails","id",e);let a="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},getWorkspaceQuota:async(e,t,a,n={})=>{A("getWorkspaceQuota","id",e),A("getWorkspaceQuota","type",t);let o="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.type=t),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},introspect:async(e,t={})=>{let a="/v1/admin/introspect",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},listBotIssueEvents:async(e,t,a={})=>{A("listBotIssueEvents","id",e),A("listBotIssueEvents","issueId",t);let n="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(e))).replace("{issueId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listBotIssues:async(e,t,a={})=>{A("listBotIssues","id",e);let n="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listBots:async(e,t,a={})=>{let n="/v1/admin/bots",o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};e!==void 0&&(l.dev=e),t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listConversations:async(e,t,a,n={})=>{let o="/v1/chat/conversations",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.tags=t),a&&(p.participantIds=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listEvents:async(e,t,a,n,o,i={})=>{let r="/v1/chat/events",c=new URL(r,x),l;s&&(l=s.baseOptions);let p={method:"GET",...l,...i},d={},C={};e!==void 0&&(C.nextToken=e),t!==void 0&&(C.type=t),a!==void 0&&(C.conversationId=a),n!==void 0&&(C.userId=n),o!==void 0&&(C.messageId=o),h(c,C);let q=l&&l.headers?l.headers:{};return p.headers={...d,...q,...i.headers},{url:y(c),options:p}},listFiles:async(e,t,a={})=>{A("listFiles","botId",e);let n="/v1/storage/files",o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),e!==void 0&&(l.botId=e),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listIntegrations:async(e,t,a,n,o={})=>{let i="/v1/admin/integrations",r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"GET",...c,...o},p={},d={};e!==void 0&&(d.nextToken=e),t!==void 0&&(d.name=t),a!==void 0&&(d.version=a),n!==void 0&&(d.dev=n),h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},{url:y(r),options:l}},listMessages:async(e,t,a,n={})=>{let o="/v1/chat/messages",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.conversationId=t),a!==void 0&&(p.tags=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listParticipants:async(e,t,a={})=>{A("listParticipants","id",e);let n="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.nextToken=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listPersonalAccessTokens:async(e={})=>{let t="/v1/admin/account/pats",a=new URL(t,x),n;s&&(n=s.baseOptions);let o={method:"GET",...n,...e},i={};h(a,{});let c=n&&n.headers?n.headers:{};return o.headers={...i,...c,...e.headers},{url:y(a),options:o}},listPublicIntegrations:async(e,t,a,n={})=>{let o="/v1/admin/hub/integrations",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.name=t),a!==void 0&&(p.version=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listUsageHistory:async(e,t,a={})=>{A("listUsageHistory","type",e),A("listUsageHistory","id",t);let n="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};e!==void 0&&(l.type=e),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listUsers:async(e,t,a,n={})=>{let o="/v1/chat/users",i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};e!==void 0&&(p.nextToken=e),t!==void 0&&(p.conversationId=t),a!==void 0&&(p.tags=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listWorkspaceInvoices:async(e,t={})=>{A("listWorkspaceInvoices","id",e);let a="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(e))),n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={};h(n,{});let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},listWorkspaceMembers:async(e,t={})=>{let a="/v1/admin/workspace-members",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={},c={};e!==void 0&&(c.nextToken=e),h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},listWorkspaceQuotas:async(e,t,a={})=>{A("listWorkspaceQuotas","id",e);let n="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"GET",...i,...a},c={},l={};t!==void 0&&(l.period=t),h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},listWorkspaceUsages:async(e,t,a,n={})=>{A("listWorkspaceUsages","id",e),A("listWorkspaceUsages","type",t);let o="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(e))),i=new URL(o,x),r;s&&(r=s.baseOptions);let c={method:"GET",...r,...n},l={},p={};t!==void 0&&(p.type=t),a!==void 0&&(p.period=a),h(i,p);let d=r&&r.headers?r.headers:{};return c.headers={...l,...d,...n.headers},{url:y(i),options:c}},listWorkspaces:async(e,t={})=>{let a="/v1/admin/workspaces",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"GET",...o,...t},r={},c={};e!==void 0&&(c.nextToken=e),h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},{url:y(n),options:i}},patchState:async(e,t,a,n,o={})=>{A("patchState","type",e),A("patchState","id",t),A("patchState","name",a);let i="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(a))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"PATCH",...c,...o},p={},d={};p["Content-Type"]="application/json",h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},l.data=E(n,l,s),{url:y(r),options:l}},removeParticipant:async(e,t,a={})=>{A("removeParticipant","id",e),A("removeParticipant","userId",t);let n="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(e))).replace("{userId}",encodeURIComponent(String(t))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"DELETE",...i,...a},c={};h(o,{});let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},{url:y(o),options:r}},runVrl:async(e,t={})=>{let a="/v1/admin/helper/vrl",n=new URL(a,x),o;s&&(o=s.baseOptions);let i={method:"POST",...o,...t},r={},c={};r["Content-Type"]="application/json",h(n,c);let l=o&&o.headers?o.headers:{};return i.headers={...r,...l,...t.headers},i.data=E(e,i,s),{url:y(n),options:i}},setState:async(e,t,a,n,o={})=>{A("setState","type",e),A("setState","id",t),A("setState","name",a);let i="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(a))),r=new URL(i,x),c;s&&(c=s.baseOptions);let l={method:"POST",...c,...o},p={},d={};p["Content-Type"]="application/json",h(r,d);let C=c&&c.headers?c.headers:{};return l.headers={...p,...C,...o.headers},l.data=E(n,l,s),{url:y(r),options:l}},setWorkspacePaymentMethod:async(e,t,a={})=>{A("setWorkspacePaymentMethod","id",e);let n="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},transferBot:async(e,t,a={})=>{A("transferBot","id",e);let n="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"POST",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateBot:async(e,t,a={})=>{A("updateBot","id",e);let n="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateConversation:async(e,t,a={})=>{A("updateConversation","id",e);let n="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateIntegration:async(e,t,a={})=>{A("updateIntegration","id",e);let n="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateMessage:async(e,t,a={})=>{A("updateMessage","id",e);let n="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateUser:async(e,t,a={})=>{A("updateUser","id",e);let n="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateWorkspace:async(e,t,a={})=>{A("updateWorkspace","id",e);let n="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}},updateWorkspaceMember:async(e,t,a={})=>{A("updateWorkspaceMember","id",e);let n="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,x),i;s&&(i=s.baseOptions);let r={method:"PUT",...i,...a},c={},l={};c["Content-Type"]="application/json",h(o,l);let p=i&&i.headers?i.headers:{};return r.headers={...c,...p,...a.headers},r.data=E(t,r,s),{url:y(o),options:r}}}},v=function(s){let e=Ac(s);return{async addParticipant(t,a,n){let o=await e.addParticipant(t,a,n);return b(o,f,g,s)},async breakDownWorkspaceUsageByBot(t,a,n,o){let i=await e.breakDownWorkspaceUsageByBot(t,a,n,o);return b(i,f,g,s)},async callAction(t,a){let n=await e.callAction(t,a);return b(n,f,g,s)},async changeAISpendQuota(t,a){let n=await e.changeAISpendQuota(t,a);return b(n,f,g,s)},async changeWorkspacePlan(t,a,n){let o=await e.changeWorkspacePlan(t,a,n);return b(o,f,g,s)},async chargeWorkspaceUnpaidInvoices(t,a,n){let o=await e.chargeWorkspaceUnpaidInvoices(t,a,n);return b(o,f,g,s)},async configureIntegration(t,a){let n=await e.configureIntegration(t,a);return b(n,f,g,s)},async createBot(t,a){let n=await e.createBot(t,a);return b(n,f,g,s)},async createConversation(t,a){let n=await e.createConversation(t,a);return b(n,f,g,s)},async createEvent(t,a){let n=await e.createEvent(t,a);return b(n,f,g,s)},async createFile(t,a){let n=await e.createFile(t,a);return b(n,f,g,s)},async createIntegration(t,a){let n=await e.createIntegration(t,a);return b(n,f,g,s)},async createMessage(t,a){let n=await e.createMessage(t,a);return b(n,f,g,s)},async createPersonalAccessToken(t,a){let n=await e.createPersonalAccessToken(t,a);return b(n,f,g,s)},async createUser(t,a){let n=await e.createUser(t,a);return b(n,f,g,s)},async createWorkspace(t,a){let n=await e.createWorkspace(t,a);return b(n,f,g,s)},async createWorkspaceMember(t,a){let n=await e.createWorkspaceMember(t,a);return b(n,f,g,s)},async deleteBot(t,a){let n=await e.deleteBot(t,a);return b(n,f,g,s)},async deleteBotIssue(t,a,n){let o=await e.deleteBotIssue(t,a,n);return b(o,f,g,s)},async deleteConversation(t,a){let n=await e.deleteConversation(t,a);return b(n,f,g,s)},async deleteFile(t,a){let n=await e.deleteFile(t,a);return b(n,f,g,s)},async deleteIntegration(t,a){let n=await e.deleteIntegration(t,a);return b(n,f,g,s)},async deleteMessage(t,a){let n=await e.deleteMessage(t,a);return b(n,f,g,s)},async deletePersonalAccessToken(t,a){let n=await e.deletePersonalAccessToken(t,a);return b(n,f,g,s)},async deleteUser(t,a){let n=await e.deleteUser(t,a);return b(n,f,g,s)},async deleteWorkspace(t,a){let n=await e.deleteWorkspace(t,a);return b(n,f,g,s)},async deleteWorkspaceMember(t,a){let n=await e.deleteWorkspaceMember(t,a);return b(n,f,g,s)},async downloadFile(t,a){let n=await e.downloadFile(t,a);return b(n,f,g,s)},async getAccount(t){let a=await e.getAccount(t);return b(a,f,g,s)},async getAllWorkspaceQuotaCompletion(t){let a=await e.getAllWorkspaceQuotaCompletion(t);return b(a,f,g,s)},async getAuditRecords(t,a,n){let o=await e.getAuditRecords(t,a,n);return b(o,f,g,s)},async getBot(t,a){let n=await e.getBot(t,a);return b(n,f,g,s)},async getBotAnalytics(t,a,n,o){let i=await e.getBotAnalytics(t,a,n,o);return b(i,f,g,s)},async getBotLogs(t,a,n,o,i){let r=await e.getBotLogs(t,a,n,o,i);return b(r,f,g,s)},async getBotWebchat(t,a,n){let o=await e.getBotWebchat(t,a,n);return b(o,f,g,s)},async getConversation(t,a){let n=await e.getConversation(t,a);return b(n,f,g,s)},async getEvent(t,a){let n=await e.getEvent(t,a);return b(n,f,g,s)},async getFile(t,a){let n=await e.getFile(t,a);return b(n,f,g,s)},async getIntegration(t,a){let n=await e.getIntegration(t,a);return b(n,f,g,s)},async getIntegrationByName(t,a,n){let o=await e.getIntegrationByName(t,a,n);return b(o,f,g,s)},async getIntegrationLogs(t,a,n,o,i){let r=await e.getIntegrationLogs(t,a,n,o,i);return b(r,f,g,s)},async getMessage(t,a){let n=await e.getMessage(t,a);return b(n,f,g,s)},async getOrCreateConversation(t,a){let n=await e.getOrCreateConversation(t,a);return b(n,f,g,s)},async getOrCreateMessage(t,a){let n=await e.getOrCreateMessage(t,a);return b(n,f,g,s)},async getOrCreateUser(t,a){let n=await e.getOrCreateUser(t,a);return b(n,f,g,s)},async getParticipant(t,a,n){let o=await e.getParticipant(t,a,n);return b(o,f,g,s)},async getPublicIntegration(t,a,n){let o=await e.getPublicIntegration(t,a,n);return b(o,f,g,s)},async getPublicIntegrationById(t,a){let n=await e.getPublicIntegrationById(t,a);return b(n,f,g,s)},async getState(t,a,n,o){let i=await e.getState(t,a,n,o);return b(i,f,g,s)},async getUsage(t,a,n,o){let i=await e.getUsage(t,a,n,o);return b(i,f,g,s)},async getUser(t,a){let n=await e.getUser(t,a);return b(n,f,g,s)},async getWorkspace(t,a){let n=await e.getWorkspace(t,a);return b(n,f,g,s)},async getWorkspaceBillingDetails(t,a){let n=await e.getWorkspaceBillingDetails(t,a);return b(n,f,g,s)},async getWorkspaceQuota(t,a,n,o){let i=await e.getWorkspaceQuota(t,a,n,o);return b(i,f,g,s)},async introspect(t,a){let n=await e.introspect(t,a);return b(n,f,g,s)},async listBotIssueEvents(t,a,n){let o=await e.listBotIssueEvents(t,a,n);return b(o,f,g,s)},async listBotIssues(t,a,n){let o=await e.listBotIssues(t,a,n);return b(o,f,g,s)},async listBots(t,a,n){let o=await e.listBots(t,a,n);return b(o,f,g,s)},async listConversations(t,a,n,o){let i=await e.listConversations(t,a,n,o);return b(i,f,g,s)},async listEvents(t,a,n,o,i,r){let c=await e.listEvents(t,a,n,o,i,r);return b(c,f,g,s)},async listFiles(t,a,n){let o=await e.listFiles(t,a,n);return b(o,f,g,s)},async listIntegrations(t,a,n,o,i){let r=await e.listIntegrations(t,a,n,o,i);return b(r,f,g,s)},async listMessages(t,a,n,o){let i=await e.listMessages(t,a,n,o);return b(i,f,g,s)},async listParticipants(t,a,n){let o=await e.listParticipants(t,a,n);return b(o,f,g,s)},async listPersonalAccessTokens(t){let a=await e.listPersonalAccessTokens(t);return b(a,f,g,s)},async listPublicIntegrations(t,a,n,o){let i=await e.listPublicIntegrations(t,a,n,o);return b(i,f,g,s)},async listUsageHistory(t,a,n){let o=await e.listUsageHistory(t,a,n);return b(o,f,g,s)},async listUsers(t,a,n,o){let i=await e.listUsers(t,a,n,o);return b(i,f,g,s)},async listWorkspaceInvoices(t,a){let n=await e.listWorkspaceInvoices(t,a);return b(n,f,g,s)},async listWorkspaceMembers(t,a){let n=await e.listWorkspaceMembers(t,a);return b(n,f,g,s)},async listWorkspaceQuotas(t,a,n){let o=await e.listWorkspaceQuotas(t,a,n);return b(o,f,g,s)},async listWorkspaceUsages(t,a,n,o){let i=await e.listWorkspaceUsages(t,a,n,o);return b(i,f,g,s)},async listWorkspaces(t,a){let n=await e.listWorkspaces(t,a);return b(n,f,g,s)},async patchState(t,a,n,o,i){let r=await e.patchState(t,a,n,o,i);return b(r,f,g,s)},async removeParticipant(t,a,n){let o=await e.removeParticipant(t,a,n);return b(o,f,g,s)},async runVrl(t,a){let n=await e.runVrl(t,a);return b(n,f,g,s)},async setState(t,a,n,o,i){let r=await e.setState(t,a,n,o,i);return b(r,f,g,s)},async setWorkspacePaymentMethod(t,a,n){let o=await e.setWorkspacePaymentMethod(t,a,n);return b(o,f,g,s)},async transferBot(t,a,n){let o=await e.transferBot(t,a,n);return b(o,f,g,s)},async updateBot(t,a,n){let o=await e.updateBot(t,a,n);return b(o,f,g,s)},async updateConversation(t,a,n){let o=await e.updateConversation(t,a,n);return b(o,f,g,s)},async updateIntegration(t,a,n){let o=await e.updateIntegration(t,a,n);return b(o,f,g,s)},async updateMessage(t,a,n){let o=await e.updateMessage(t,a,n);return b(o,f,g,s)},async updateUser(t,a,n){let o=await e.updateUser(t,a,n);return b(o,f,g,s)},async updateWorkspace(t,a,n){let o=await e.updateWorkspace(t,a,n);return b(o,f,g,s)},async updateWorkspaceMember(t,a,n){let o=await e.updateWorkspaceMember(t,a,n);return b(o,f,g,s)}}};var Ct=class extends Rt{addParticipant(e,t){return v(this.configuration).addParticipant(e.id,e.addParticipantBody,t).then(a=>a(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(e,t){return v(this.configuration).breakDownWorkspaceUsageByBot(e.id,e.type,e.period,t).then(a=>a(this.axios,this.basePath))}callAction(e={},t){return v(this.configuration).callAction(e.callActionBody,t).then(a=>a(this.axios,this.basePath))}changeAISpendQuota(e={},t){return v(this.configuration).changeAISpendQuota(e.changeAISpendQuotaBody,t).then(a=>a(this.axios,this.basePath))}changeWorkspacePlan(e,t){return v(this.configuration).changeWorkspacePlan(e.id,e.changeWorkspacePlanBody,t).then(a=>a(this.axios,this.basePath))}chargeWorkspaceUnpaidInvoices(e,t){return v(this.configuration).chargeWorkspaceUnpaidInvoices(e.id,e.chargeWorkspaceUnpaidInvoicesBody,t).then(a=>a(this.axios,this.basePath))}configureIntegration(e={},t){return v(this.configuration).configureIntegration(e.configureIntegrationBody,t).then(a=>a(this.axios,this.basePath))}createBot(e={},t){return v(this.configuration).createBot(e.createBotBody,t).then(a=>a(this.axios,this.basePath))}createConversation(e={},t){return v(this.configuration).createConversation(e.createConversationBody,t).then(a=>a(this.axios,this.basePath))}createEvent(e={},t){return v(this.configuration).createEvent(e.createEventBody,t).then(a=>a(this.axios,this.basePath))}createFile(e={},t){return v(this.configuration).createFile(e.createFileBody,t).then(a=>a(this.axios,this.basePath))}createIntegration(e={},t){return v(this.configuration).createIntegration(e.createIntegrationBody,t).then(a=>a(this.axios,this.basePath))}createMessage(e={},t){return v(this.configuration).createMessage(e.createMessageBody,t).then(a=>a(this.axios,this.basePath))}createPersonalAccessToken(e={},t){return v(this.configuration).createPersonalAccessToken(e.createPersonalAccessTokenBody,t).then(a=>a(this.axios,this.basePath))}createUser(e={},t){return v(this.configuration).createUser(e.createUserBody,t).then(a=>a(this.axios,this.basePath))}createWorkspace(e={},t){return v(this.configuration).createWorkspace(e.createWorkspaceBody,t).then(a=>a(this.axios,this.basePath))}createWorkspaceMember(e={},t){return v(this.configuration).createWorkspaceMember(e.createWorkspaceMemberBody,t).then(a=>a(this.axios,this.basePath))}deleteBot(e,t){return v(this.configuration).deleteBot(e.id,t).then(a=>a(this.axios,this.basePath))}deleteBotIssue(e,t){return v(this.configuration).deleteBotIssue(e.id,e.issueId,t).then(a=>a(this.axios,this.basePath))}deleteConversation(e,t){return v(this.configuration).deleteConversation(e.id,t).then(a=>a(this.axios,this.basePath))}deleteFile(e,t){return v(this.configuration).deleteFile(e.id,t).then(a=>a(this.axios,this.basePath))}deleteIntegration(e,t){return v(this.configuration).deleteIntegration(e.id,t).then(a=>a(this.axios,this.basePath))}deleteMessage(e,t){return v(this.configuration).deleteMessage(e.id,t).then(a=>a(this.axios,this.basePath))}deletePersonalAccessToken(e,t){return v(this.configuration).deletePersonalAccessToken(e.id,t).then(a=>a(this.axios,this.basePath))}deleteUser(e,t){return v(this.configuration).deleteUser(e.id,t).then(a=>a(this.axios,this.basePath))}deleteWorkspace(e,t){return v(this.configuration).deleteWorkspace(e.id,t).then(a=>a(this.axios,this.basePath))}deleteWorkspaceMember(e,t){return v(this.configuration).deleteWorkspaceMember(e.id,t).then(a=>a(this.axios,this.basePath))}downloadFile(e,t){return v(this.configuration).downloadFile(e.id,t).then(a=>a(this.axios,this.basePath))}getAccount(e){return v(this.configuration).getAccount(e).then(t=>t(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(e){return v(this.configuration).getAllWorkspaceQuotaCompletion(e).then(t=>t(this.axios,this.basePath))}getAuditRecords(e,t){return v(this.configuration).getAuditRecords(e.id,e.nextToken,t).then(a=>a(this.axios,this.basePath))}getBot(e,t){return v(this.configuration).getBot(e.id,t).then(a=>a(this.axios,this.basePath))}getBotAnalytics(e,t){return v(this.configuration).getBotAnalytics(e.id,e.startDate,e.endDate,t).then(a=>a(this.axios,this.basePath))}getBotLogs(e,t){return v(this.configuration).getBotLogs(e.id,e.timeStart,e.timeEnd,e.nextToken,t).then(a=>a(this.axios,this.basePath))}getBotWebchat(e,t){return v(this.configuration).getBotWebchat(e.id,e.type,t).then(a=>a(this.axios,this.basePath))}getConversation(e,t){return v(this.configuration).getConversation(e.id,t).then(a=>a(this.axios,this.basePath))}getEvent(e,t){return v(this.configuration).getEvent(e.id,t).then(a=>a(this.axios,this.basePath))}getFile(e,t){return v(this.configuration).getFile(e.id,t).then(a=>a(this.axios,this.basePath))}getIntegration(e,t){return v(this.configuration).getIntegration(e.id,t).then(a=>a(this.axios,this.basePath))}getIntegrationByName(e,t){return v(this.configuration).getIntegrationByName(e.name,e.version,t).then(a=>a(this.axios,this.basePath))}getIntegrationLogs(e,t){return v(this.configuration).getIntegrationLogs(e.id,e.timeStart,e.timeEnd,e.nextToken,t).then(a=>a(this.axios,this.basePath))}getMessage(e,t){return v(this.configuration).getMessage(e.id,t).then(a=>a(this.axios,this.basePath))}getOrCreateConversation(e={},t){return v(this.configuration).getOrCreateConversation(e.getOrCreateConversationBody,t).then(a=>a(this.axios,this.basePath))}getOrCreateMessage(e={},t){return v(this.configuration).getOrCreateMessage(e.getOrCreateMessageBody,t).then(a=>a(this.axios,this.basePath))}getOrCreateUser(e={},t){return v(this.configuration).getOrCreateUser(e.getOrCreateUserBody,t).then(a=>a(this.axios,this.basePath))}getParticipant(e,t){return v(this.configuration).getParticipant(e.id,e.userId,t).then(a=>a(this.axios,this.basePath))}getPublicIntegration(e,t){return v(this.configuration).getPublicIntegration(e.name,e.version,t).then(a=>a(this.axios,this.basePath))}getPublicIntegrationById(e,t){return v(this.configuration).getPublicIntegrationById(e.id,t).then(a=>a(this.axios,this.basePath))}getState(e,t){return v(this.configuration).getState(e.type,e.id,e.name,t).then(a=>a(this.axios,this.basePath))}getUsage(e,t){return v(this.configuration).getUsage(e.type,e.id,e.period,t).then(a=>a(this.axios,this.basePath))}getUser(e,t){return v(this.configuration).getUser(e.id,t).then(a=>a(this.axios,this.basePath))}getWorkspace(e,t){return v(this.configuration).getWorkspace(e.id,t).then(a=>a(this.axios,this.basePath))}getWorkspaceBillingDetails(e,t){return v(this.configuration).getWorkspaceBillingDetails(e.id,t).then(a=>a(this.axios,this.basePath))}getWorkspaceQuota(e,t){return v(this.configuration).getWorkspaceQuota(e.id,e.type,e.period,t).then(a=>a(this.axios,this.basePath))}introspect(e={},t){return v(this.configuration).introspect(e.introspectBody,t).then(a=>a(this.axios,this.basePath))}listBotIssueEvents(e,t){return v(this.configuration).listBotIssueEvents(e.id,e.issueId,t).then(a=>a(this.axios,this.basePath))}listBotIssues(e,t){return v(this.configuration).listBotIssues(e.id,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listBots(e={},t){return v(this.configuration).listBots(e.dev,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listConversations(e={},t){return v(this.configuration).listConversations(e.nextToken,e.tags,e.participantIds,t).then(a=>a(this.axios,this.basePath))}listEvents(e={},t){return v(this.configuration).listEvents(e.nextToken,e.type,e.conversationId,e.userId,e.messageId,t).then(a=>a(this.axios,this.basePath))}listFiles(e,t){return v(this.configuration).listFiles(e.botId,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listIntegrations(e={},t){return v(this.configuration).listIntegrations(e.nextToken,e.name,e.version,e.dev,t).then(a=>a(this.axios,this.basePath))}listMessages(e={},t){return v(this.configuration).listMessages(e.nextToken,e.conversationId,e.tags,t).then(a=>a(this.axios,this.basePath))}listParticipants(e,t){return v(this.configuration).listParticipants(e.id,e.nextToken,t).then(a=>a(this.axios,this.basePath))}listPersonalAccessTokens(e){return v(this.configuration).listPersonalAccessTokens(e).then(t=>t(this.axios,this.basePath))}listPublicIntegrations(e={},t){return v(this.configuration).listPublicIntegrations(e.nextToken,e.name,e.version,t).then(a=>a(this.axios,this.basePath))}listUsageHistory(e,t){return v(this.configuration).listUsageHistory(e.type,e.id,t).then(a=>a(this.axios,this.basePath))}listUsers(e={},t){return v(this.configuration).listUsers(e.nextToken,e.conversationId,e.tags,t).then(a=>a(this.axios,this.basePath))}listWorkspaceInvoices(e,t){return v(this.configuration).listWorkspaceInvoices(e.id,t).then(a=>a(this.axios,this.basePath))}listWorkspaceMembers(e={},t){return v(this.configuration).listWorkspaceMembers(e.nextToken,t).then(a=>a(this.axios,this.basePath))}listWorkspaceQuotas(e,t){return v(this.configuration).listWorkspaceQuotas(e.id,e.period,t).then(a=>a(this.axios,this.basePath))}listWorkspaceUsages(e,t){return v(this.configuration).listWorkspaceUsages(e.id,e.type,e.period,t).then(a=>a(this.axios,this.basePath))}listWorkspaces(e={},t){return v(this.configuration).listWorkspaces(e.nextToken,t).then(a=>a(this.axios,this.basePath))}patchState(e,t){return v(this.configuration).patchState(e.type,e.id,e.name,e.patchStateBody,t).then(a=>a(this.axios,this.basePath))}removeParticipant(e,t){return v(this.configuration).removeParticipant(e.id,e.userId,t).then(a=>a(this.axios,this.basePath))}runVrl(e={},t){return v(this.configuration).runVrl(e.runVrlBody,t).then(a=>a(this.axios,this.basePath))}setState(e,t){return v(this.configuration).setState(e.type,e.id,e.name,e.setStateBody,t).then(a=>a(this.axios,this.basePath))}setWorkspacePaymentMethod(e,t){return v(this.configuration).setWorkspacePaymentMethod(e.id,e.setWorkspacePaymentMethodBody,t).then(a=>a(this.axios,this.basePath))}transferBot(e,t){return v(this.configuration).transferBot(e.id,e.transferBotBody,t).then(a=>a(this.axios,this.basePath))}updateBot(e,t){return v(this.configuration).updateBot(e.id,e.updateBotBody,t).then(a=>a(this.axios,this.basePath))}updateConversation(e,t){return v(this.configuration).updateConversation(e.id,e.updateConversationBody,t).then(a=>a(this.axios,this.basePath))}updateIntegration(e,t){return v(this.configuration).updateIntegration(e.id,e.updateIntegrationBody,t).then(a=>a(this.axios,this.basePath))}updateMessage(e,t){return v(this.configuration).updateMessage(e.id,e.updateMessageBody,t).then(a=>a(this.axios,this.basePath))}updateUser(e,t){return v(this.configuration).updateUser(e.id,e.updateUserBody,t).then(a=>a(this.axios,this.basePath))}updateWorkspace(e,t){return v(this.configuration).updateWorkspace(e.id,e.updateWorkspaceBody,t).then(a=>a(this.axios,this.basePath))}updateWorkspaceMember(e,t){return v(this.configuration).updateWorkspaceMember(e.id,e.updateWorkspaceMemberBody,t).then(a=>a(this.axios,this.basePath))}};var to=K(require("crypto"));var Cc={getRandomValues:s=>new Uint8Array(s.map(()=>Math.floor(Math.random()*256)))},js=typeof window<"u"&&typeof window.document<"u"?window.crypto:to.default;js.getRandomValues||(js=Cc);var S=class extends Error{constructor(t,a,n,o,i,r){super(o);this.code=t;this.description=a;this.type=n;this.message=o;this.error=i;this.id=r;this.id||(this.id=S.generateId())}isApiError=!0;format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let t=this.getPrefix(),a=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],n=4,o=Array.from(js.getRandomValues(new Uint8Array(n))).map(i=>i.toString(16).padStart(2,"0")).join("").toUpperCase();return`${t}_${a}x${o}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},kc=s=>typeof s=="object"&&!Array.isArray(s)&&s!==null,so=s=>s instanceof S||kc(s)&&s.isApiError===!0,fe=class extends S{constructor(e,t,a){super(500,"An unknown error occurred","Unknown",e,t,a)}},kt=class extends S{constructor(e,t,a){super(500,"An internal error occurred","Internal",e,t,a)}},Pt=class extends S{constructor(e,t,a){super(401,"The request requires to be authenticated.","Unauthorized",e,t,a)}},Bt=class extends S{constructor(e,t,a){super(403,"The requested action can't be peform by this resource.","Forbidden",e,t,a)}},wt=class extends S{constructor(e,t,a){super(413,"The request payload is too large.","PayloadTooLarge",e,t,a)}},It=class extends S{constructor(e,t,a){super(400,"The request payload is invalid.","InvalidPayload",e,t,a)}},qt=class extends S{constructor(e,t,a){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",e,t,a)}},Ut=class extends S{constructor(e,t,a){super(405,"The requested method does not exist.","MethodNotFound",e,t,a)}},Et=class extends S{constructor(e,t,a){super(404,"The requested resource does not exist.","ResourceNotFound",e,t,a)}},Tt=class extends S{constructor(e,t,a){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",e,t,a)}},Ot=class extends S{constructor(e,t,a){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",e,t,a)}},Dt=class extends S{constructor(e,t,a){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",e,t,a)}},St=class extends S{constructor(e,t,a){super(409,"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.","RelationConflict",e,t,a)}},Vt=class extends S{constructor(e,t,a){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",e,t,a)}},_t=class extends S{constructor(e,t,a){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",e,t,a)}},Wt=class extends S{constructor(e,t,a){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",e,t,a)}},Lt=class extends S{constructor(e,t,a){super(409,"The record attempted to be created already exists.","AlreadyExists",e,t,a)}},Mt=class extends S{constructor(e,t,a){super(429,"The request has been rate limited.","RateLimited",e,t,a)}},jt=class extends S{constructor(e,t,a){super(402,"A payment is required to perform this request.","PaymentRequired",e,t,a)}},Ft=class extends S{constructor(e,t,a){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",e,t,a)}},Gt=class extends S{constructor(e,t,a){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",e,t,a)}},Pc={Unknown:fe,Internal:kt,Unauthorized:Pt,Forbidden:Bt,PayloadTooLarge:wt,InvalidPayload:It,UnsupportedMediaType:qt,MethodNotFound:Ut,ResourceNotFound:Et,InvalidJsonSchema:Tt,InvalidDataFormat:Ot,InvalidIdentifier:Dt,RelationConflict:St,ReferenceNotFound:Vt,InvalidQuery:_t,Runtime:Wt,AlreadyExists:Lt,RateLimited:Mt,PaymentRequired:jt,QuotaExceeded:Ft,LimitExceeded:Gt},Nt=s=>so(s)?s:s instanceof Error?new fe(s.message,s):typeof s=="string"?new fe(s):Bc(s);function Bc(s){if(typeof s=="object"&&"code"in s&&"type"in s&&"id"in s&&"message"in s&&typeof s.type=="string"&&typeof s.message=="string"){let e=Pc[s.type];return e?new e(s.message,void 0,s.id||"UNKNOWN"):new fe(`An unclassified API error occurred: ${s.message} (Type: ${s.type}, Code: ${s.code})`)}return new fe("An invalid error occurred: "+JSON.stringify(s))}var Qt=class{_innerClient;constructor(e,t,a){this._innerClient=new Ct(e,t,a)}createConversation=e=>this._innerClient.createConversation({createConversationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getConversation=e=>this._innerClient.getConversation(e).then(t=>t.data).catch(t=>{throw R(t)});listConversations=e=>this._innerClient.listConversations(e).then(t=>t.data).catch(t=>{throw R(t)});getOrCreateConversation=e=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateConversation=({id:e,...t})=>this._innerClient.updateConversation({id:e,updateConversationBody:t}).then(a=>a.data).catch(a=>{throw R(a)});deleteConversation=e=>this._innerClient.deleteConversation(e).then(t=>t.data).catch(t=>{throw R(t)});listParticipants=e=>this._innerClient.listParticipants(e).then(t=>t.data).catch(t=>{throw R(t)});addParticipant=({id:e,...t})=>this._innerClient.addParticipant({id:e,addParticipantBody:t}).then(a=>a.data).catch(a=>{throw R(a)});getParticipant=e=>this._innerClient.getParticipant(e).then(t=>t.data).catch(t=>{throw R(t)});removeParticipant=e=>this._innerClient.removeParticipant(e).then(t=>t.data).catch(t=>{throw R(t)});createEvent=e=>this._innerClient.createEvent({createEventBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getEvent=e=>this._innerClient.getEvent(e).then(t=>t.data).catch(t=>{throw R(t)});listEvents=e=>this._innerClient.listEvents(e).then(t=>t.data).catch(t=>{throw R(t)});createMessage=e=>this._innerClient.createMessage({createMessageBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getOrCreateMessage=e=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getMessage=e=>this._innerClient.getMessage(e).then(t=>t.data).catch(t=>{throw R(t)});updateMessage=({id:e,...t})=>this._innerClient.updateMessage({id:e,updateMessageBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listMessages=e=>this._innerClient.listMessages(e).then(t=>t.data).catch(t=>{throw R(t)});deleteMessage=e=>this._innerClient.deleteMessage(e).then(t=>t.data).catch(t=>{throw R(t)});createUser=e=>this._innerClient.createUser({createUserBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getUser=e=>this._innerClient.getUser(e).then(t=>t.data).catch(t=>{throw R(t)});listUsers=e=>this._innerClient.listUsers(e).then(t=>t.data).catch(t=>{throw R(t)});getOrCreateUser=e=>this._innerClient.getOrCreateUser({getOrCreateUserBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateUser=({id:e,...t})=>this._innerClient.updateUser({id:e,updateUserBody:t}).then(a=>a.data).catch(a=>{throw R(a)});deleteUser=e=>this._innerClient.deleteUser(e).then(t=>t.data).catch(t=>{throw R(t)});getState=e=>this._innerClient.getState(e).then(t=>t.data).catch(t=>{throw R(t)});setState=({type:e,id:t,name:a,...n})=>this._innerClient.setState({type:e,id:t,name:a,setStateBody:n}).then(o=>o.data).catch(o=>{throw R(o)});patchState=({type:e,id:t,name:a,...n})=>this._innerClient.patchState({type:e,id:t,name:a,patchStateBody:n}).then(o=>o.data).catch(o=>{throw R(o)});callAction=e=>this._innerClient.callAction({callActionBody:e}).then(t=>t.data).catch(t=>{throw R(t)});configureIntegration=e=>this._innerClient.configureIntegration({configureIntegrationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});runVrl=e=>this._innerClient.runVrl({runVrlBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getAccount=()=>this._innerClient.getAccount().then(e=>e.data).catch(e=>{throw R(e)});listPersonalAccessTokens=()=>this._innerClient.listPersonalAccessTokens().then(e=>e.data).catch(e=>{throw R(e)});createPersonalAccessToken=e=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:e}).then(t=>t.data).catch(t=>{throw R(t)});deletePersonalAccessToken=e=>this._innerClient.deletePersonalAccessToken(e).then(t=>t.data).catch(t=>{throw R(t)});listPublicIntegrations=e=>this._innerClient.listPublicIntegrations(e).then(t=>t.data).catch(t=>{throw R(t)});getPublicIntegrationById=e=>this._innerClient.getPublicIntegrationById(e).then(t=>t.data).catch(t=>{throw R(t)});getPublicIntegration=e=>this._innerClient.getPublicIntegration(e).then(t=>t.data).catch(t=>{throw R(t)});createBot=e=>this._innerClient.createBot({createBotBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateBot=({id:e,...t})=>this._innerClient.updateBot({id:e,updateBotBody:t}).then(a=>a.data).catch(a=>{throw R(a)});transferBot=({id:e,...t})=>this._innerClient.transferBot({id:e,transferBotBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listBots=e=>this._innerClient.listBots(e).then(t=>t.data).catch(t=>{throw R(t)});getBot=e=>this._innerClient.getBot(e).then(t=>t.data).catch(t=>{throw R(t)});deleteBot=e=>this._innerClient.deleteBot(e).then(t=>t.data).catch(t=>{throw R(t)});getBotLogs=e=>this._innerClient.getBotLogs(e).then(t=>t.data).catch(t=>{throw R(t)});getBotWebchat=e=>this._innerClient.getBotWebchat(e).then(t=>t.data).catch(t=>{throw R(t)});getBotAnalytics=e=>this._innerClient.getBotAnalytics(e).then(t=>t.data).catch(t=>{throw R(t)});listBotIssues=e=>this._innerClient.listBotIssues(e).then(t=>t.data).catch(t=>{throw R(t)});deleteBotIssue=e=>this._innerClient.deleteBotIssue(e).then(t=>t.data).catch(t=>{throw R(t)});listBotIssueEvents=e=>this._innerClient.listBotIssueEvents(e).then(t=>t.data).catch(t=>{throw R(t)});getWorkspaceBillingDetails=e=>this._innerClient.getWorkspaceBillingDetails(e).then(t=>t.data).catch(t=>{throw R(t)});setWorkspacePaymentMethod=({id:e,...t})=>this._innerClient.setWorkspacePaymentMethod({id:e,setWorkspacePaymentMethodBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listWorkspaceInvoices=e=>this._innerClient.listWorkspaceInvoices(e).then(t=>t.data).catch(t=>{throw R(t)});chargeWorkspaceUnpaidInvoices=({id:e,...t})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:e,chargeWorkspaceUnpaidInvoicesBody:t}).then(a=>a.data).catch(a=>{throw R(a)});createWorkspace=e=>this._innerClient.createWorkspace({createWorkspaceBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getWorkspace=e=>this._innerClient.getWorkspace(e).then(t=>t.data).catch(t=>{throw R(t)});listWorkspaceUsages=e=>this._innerClient.listWorkspaceUsages(e).then(t=>t.data).catch(t=>{throw R(t)});breakDownWorkspaceUsageByBot=e=>this._innerClient.breakDownWorkspaceUsageByBot(e).then(t=>t.data).catch(t=>{throw R(t)});getAllWorkspaceQuotaCompletion=()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(e=>e.data).catch(e=>{throw R(e)});getWorkspaceQuota=e=>this._innerClient.getWorkspaceQuota(e).then(t=>t.data).catch(t=>{throw R(t)});listWorkspaceQuotas=e=>this._innerClient.listWorkspaceQuotas(e).then(t=>t.data).catch(t=>{throw R(t)});updateWorkspace=({id:e,...t})=>this._innerClient.updateWorkspace({id:e,updateWorkspaceBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listWorkspaces=e=>this._innerClient.listWorkspaces(e).then(t=>t.data).catch(t=>{throw R(t)});changeWorkspacePlan=({id:e,...t})=>this._innerClient.changeWorkspacePlan({id:e,changeWorkspacePlanBody:t}).then(a=>a.data).catch(a=>{throw R(a)});deleteWorkspace=e=>this._innerClient.deleteWorkspace(e).then(t=>t.data).catch(t=>{throw R(t)});getAuditRecords=e=>this._innerClient.getAuditRecords(e).then(t=>t.data).catch(t=>{throw R(t)});listWorkspaceMembers=e=>this._innerClient.listWorkspaceMembers(e).then(t=>t.data).catch(t=>{throw R(t)});deleteWorkspaceMember=e=>this._innerClient.deleteWorkspaceMember(e).then(t=>t.data).catch(t=>{throw R(t)});createWorkspaceMember=e=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateWorkspaceMember=({id:e,...t})=>this._innerClient.updateWorkspaceMember({id:e,updateWorkspaceMemberBody:t}).then(a=>a.data).catch(a=>{throw R(a)});createIntegration=e=>this._innerClient.createIntegration({createIntegrationBody:e}).then(t=>t.data).catch(t=>{throw R(t)});updateIntegration=({id:e,...t})=>this._innerClient.updateIntegration({id:e,updateIntegrationBody:t}).then(a=>a.data).catch(a=>{throw R(a)});listIntegrations=e=>this._innerClient.listIntegrations(e).then(t=>t.data).catch(t=>{throw R(t)});getIntegration=e=>this._innerClient.getIntegration(e).then(t=>t.data).catch(t=>{throw R(t)});getIntegrationLogs=e=>this._innerClient.getIntegrationLogs(e).then(t=>t.data).catch(t=>{throw R(t)});getIntegrationByName=e=>this._innerClient.getIntegrationByName(e).then(t=>t.data).catch(t=>{throw R(t)});deleteIntegration=e=>this._innerClient.deleteIntegration(e).then(t=>t.data).catch(t=>{throw R(t)});getUsage=e=>this._innerClient.getUsage(e).then(t=>t.data).catch(t=>{throw R(t)});listUsageHistory=e=>this._innerClient.listUsageHistory(e).then(t=>t.data).catch(t=>{throw R(t)});changeAISpendQuota=e=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:e}).then(t=>t.data).catch(t=>{throw R(t)});introspect=e=>this._innerClient.introspect({introspectBody:e}).then(t=>t.data).catch(t=>{throw R(t)});createFile=e=>this._innerClient.createFile({createFileBody:e}).then(t=>t.data).catch(t=>{throw R(t)});getFile=e=>this._innerClient.getFile(e).then(t=>t.data).catch(t=>{throw R(t)});downloadFile=e=>this._innerClient.downloadFile(e).then(t=>t.data).catch(t=>{throw R(t)});deleteFile=e=>this._innerClient.deleteFile(e).then(t=>t.data).catch(t=>{throw R(t)});listFiles=e=>this._innerClient.listFiles(e).then(t=>t.data).catch(t=>{throw R(t)})};function R(s){return f.isAxiosError(s)&&s.response?.data?Nt(s.response.data):Nt(s)}var ao=100*1024*1024,wc=ao,Ic=ao,Fs=class extends Qt{config;constructor(e={}){let t=eo(e),{apiUrl:a,headers:n,withCredentials:o,timeout:i}=t,r=f.create({headers:n,withCredentials:o,timeout:i,maxBodyLength:wc,maxContentLength:Ic});super(void 0,a,r),this.config=t}};0&&(module.exports={AlreadyExistsError,Client,ForbiddenError,InternalError,InvalidDataFormatError,InvalidIdentifierError,InvalidJsonSchemaError,InvalidPayloadError,InvalidQueryError,LimitExceededError,MethodNotFoundError,PayloadTooLargeError,PaymentRequiredError,QuotaExceededError,RateLimitedError,ReferenceNotFoundError,RelationConflictError,ResourceNotFoundError,RuntimeError,UnauthorizedError,UnknownError,UnsupportedMediaTypeError,axios,errorFrom,isApiError});
|
|
12
12
|
/*! Bundled license information:
|
|
13
13
|
|
|
14
14
|
mime-db/index.js:
|