@kadoa/node-sdk 0.24.0 → 0.24.2

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.
@@ -1,10 +1,10 @@
1
- var KadoaSDK=(function(exports,L){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var L__default=/*#__PURE__*/_interopDefault(L);var Xs=Object.create;var $t=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var ea=Object.getOwnPropertyNames;var ta=Object.getPrototypeOf,oa=Object.prototype.hasOwnProperty;var sa=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var zt=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),aa=(o,e)=>{for(var t in e)$t(o,t,{get:e[t],enumerable:true});},ia=(o,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ea(e))!oa.call(o,a)&&a!==t&&$t(o,a,{get:()=>e[a],enumerable:!(s=Zs(e,a))||s.enumerable});return o};var na=(o,e,t)=>(t=o!=null?Xs(ta(o)):{},ia(!o||!o.__esModule?$t(t,"default",{value:o,enumerable:true}):t,o));var Ss=zt((lp,vs)=>{var Ge=1e3,Te=Ge*60,Fe=Te*60,Ce=Fe*24,qi=Ce*7,Ni=Ce*365.25;vs.exports=function(o,e){e=e||{};var t=typeof o;if(t==="string"&&o.length>0)return Gi(o);if(t==="number"&&isFinite(o))return e.long?Fi(o):Ti(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function Gi(o){if(o=String(o),!(o.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(e){var t=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case "years":case "year":case "yrs":case "yr":case "y":return t*Ni;case "weeks":case "week":case "w":return t*qi;case "days":case "day":case "d":return t*Ce;case "hours":case "hour":case "hrs":case "hr":case "h":return t*Fe;case "minutes":case "minute":case "mins":case "min":case "m":return t*Te;case "seconds":case "second":case "secs":case "sec":case "s":return t*Ge;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return t;default:return}}}}function Ti(o){var e=Math.abs(o);return e>=Ce?Math.round(o/Ce)+"d":e>=Fe?Math.round(o/Fe)+"h":e>=Te?Math.round(o/Te)+"m":e>=Ge?Math.round(o/Ge)+"s":o+"ms"}function Fi(o){var e=Math.abs(o);return e>=Ce?Ft(o,e,Ce,"day"):e>=Fe?Ft(o,e,Fe,"hour"):e>=Te?Ft(o,e,Te,"minute"):e>=Ge?Ft(o,e,Ge,"second"):o+" ms"}function Ft(o,e,t,s){var a=e>=t*1.5;return Math.round(o/t)+" "+s+(a?"s":"")}});var Ws=zt((dp,Ps)=>{function Bi(o){t.debug=t,t.default=t,t.coerce=l,t.disable=n,t.enable=a,t.enabled=r,t.humanize=Ss(),t.destroy=d,Object.keys(o).forEach(c=>{t[c]=o[c];}),t.names=[],t.skips=[],t.formatters={};function e(c){let p=0;for(let m=0;m<c.length;m++)p=(p<<5)-p+c.charCodeAt(m),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(c){let p,m=null,R,u;function w(...h){if(!w.enabled)return;let b=w,G=Number(new Date),q=G-(p||G);b.diff=q,b.prev=p,b.curr=G,p=G,h[0]=t.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let D=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(X,H)=>{if(X==="%%")return "%";D++;let ke=t.formatters[H];if(typeof ke=="function"){let Ve=h[D];X=ke.call(b,Ve),h.splice(D,1),D--;}return X}),t.formatArgs.call(b,h),(b.log||t.log).apply(b,h);}return w.namespace=c,w.useColors=t.useColors(),w.color=t.selectColor(c),w.extend=s,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:true,configurable:false,get:()=>m!==null?m:(R!==t.namespaces&&(R=t.namespaces,u=t.enabled(c)),u),set:h=>{m=h;}}),typeof t.init=="function"&&t.init(w),w}function s(c,p){let m=t(this.namespace+(typeof p>"u"?":":p)+c);return m.log=this.log,m}function a(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let p=(typeof c=="string"?c:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of p)m[0]==="-"?t.skips.push(m.slice(1)):t.names.push(m);}function i(c,p){let m=0,R=0,u=-1,w=0;for(;m<c.length;)if(R<p.length&&(p[R]===c[m]||p[R]==="*"))p[R]==="*"?(u=R,w=m,R++):(m++,R++);else if(u!==-1)R=u+1,w++,m=w;else return false;for(;R<p.length&&p[R]==="*";)R++;return R===p.length}function n(){let c=[...t.names,...t.skips.map(p=>"-"+p)].join(",");return t.enable(""),c}function r(c){for(let p of t.skips)if(i(c,p))return false;for(let p of t.names)if(i(c,p))return true;return false}function l(c){return c instanceof Error?c.stack||c.message:c}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");}return t.enable(t.load()),t}Ps.exports=Bi;});var bs=zt((Q,Bt)=>{Q.formatArgs=_i;Q.save=Li;Q.load=ji;Q.useColors=Ui;Q.storage=Mi();Q.destroy=(()=>{let o=false;return ()=>{o||(o=true,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));}})();Q.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ui(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return true;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return false;let o;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(o=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(o[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function _i(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+Bt.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;o.splice(1,0,e,"color: inherit");let t=0,s=0;o[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(t++,a==="%c"&&(s=t));}),o.splice(s,0,e);}Q.log=console.debug||console.log||(()=>{});function Li(o){try{o?Q.storage.setItem("debug",o):Q.storage.removeItem("debug");}catch{}}function ji(){let o;try{o=Q.storage.getItem("debug")||Q.storage.getItem("DEBUG");}catch{}return !o&&typeof process<"u"&&"env"in process&&(o=process.env.DEBUG),o}function Mi(){try{return localStorage}catch{}}Bt.exports=Ws()(Q);var{formatters:Ji}=Bt.exports;Ji.j=function(o){try{return JSON.stringify(o)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};});function Le(o,e){return function(){return o.apply(e,arguments)}}var{toString:ra}=Object.prototype,{getPrototypeOf:Yt}=Object,{iterator:It,toStringTag:Mo}=Symbol,kt=(o=>e=>{let t=ra.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),se=o=>(o=o.toLowerCase(),e=>kt(e)===o),Vt=o=>e=>typeof e===o,{isArray:Pe}=Array,Se=Vt("undefined");function je(o){return o!==null&&!Se(o)&&o.constructor!==null&&!Se(o.constructor)&&$(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}var Jo=se("ArrayBuffer");function la(o){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&Jo(o.buffer),e}var da=Vt("string"),$=Vt("function"),Ho=Vt("number"),Me=o=>o!==null&&typeof o=="object",ca=o=>o===true||o===false,xt=o=>{if(kt(o)!=="object")return false;let e=Yt(o);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Mo in o)&&!(It in o)},pa=o=>{if(!Me(o)||je(o))return false;try{return Object.keys(o).length===0&&Object.getPrototypeOf(o)===Object.prototype}catch{return false}},fa=se("Date"),ua=se("File"),ma=o=>!!(o&&typeof o.uri<"u"),wa=o=>o&&typeof o.getParts<"u",ha=se("Blob"),Ra=se("FileList"),ga=o=>Me(o)&&$(o.pipe);function ya(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"||typeof window<"u"?window:{}}var _o=ya(),Lo=typeof _o.FormData<"u"?_o.FormData:void 0,Aa=o=>{let e;return o&&(Lo&&o instanceof Lo||$(o.append)&&((e=kt(o))==="formdata"||e==="object"&&$(o.toString)&&o.toString()==="[object FormData]"))},Ca=se("URLSearchParams"),[xa,Ia,ka,Va]=["ReadableStream","Request","Response","Headers"].map(se),va=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Je(o,e,{allOwnKeys:t=false}={}){if(o===null||typeof o>"u")return;let s,a;if(typeof o!="object"&&(o=[o]),Pe(o))for(s=0,a=o.length;s<a;s++)e.call(null,o[s],s,o);else {if(je(o))return;let i=t?Object.getOwnPropertyNames(o):Object.keys(o),n=i.length,r;for(s=0;s<n;s++)r=i[s],e.call(null,o[r],r,o);}}function Ko(o,e){if(je(o))return null;e=e.toLowerCase();let t=Object.keys(o),s=t.length,a;for(;s-- >0;)if(a=t[s],e===a.toLowerCase())return a;return null}var Ae=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,$o=o=>!Se(o)&&o!==Ae;function Qt(){let{caseless:o,skipUndefined:e}=$o(this)&&this||{},t={},s=(a,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;let n=o&&Ko(t,i)||i;xt(t[n])&&xt(a)?t[n]=Qt(t[n],a):xt(a)?t[n]=Qt({},a):Pe(a)?t[n]=a.slice():(!e||!Se(a))&&(t[n]=a);};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&Je(arguments[a],s);return t}var Sa=(o,e,t,{allOwnKeys:s}={})=>(Je(e,(a,i)=>{t&&$(a)?Object.defineProperty(o,i,{value:Le(a,t),writable:true,enumerable:true,configurable:true}):Object.defineProperty(o,i,{value:a,writable:true,enumerable:true,configurable:true});},{allOwnKeys:s}),o),Pa=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),Wa=(o,e,t,s)=>{o.prototype=Object.create(e.prototype,s),Object.defineProperty(o.prototype,"constructor",{value:o,writable:true,enumerable:false,configurable:true}),Object.defineProperty(o,"super",{value:e.prototype}),t&&Object.assign(o.prototype,t);},ba=(o,e,t,s)=>{let a,i,n,r={};if(e=e||{},o==null)return e;do{for(a=Object.getOwnPropertyNames(o),i=a.length;i-- >0;)n=a[i],(!s||s(n,o,e))&&!r[n]&&(e[n]=o[n],r[n]=true);o=t!==false&&Yt(o);}while(o&&(!t||t(o,e))&&o!==Object.prototype);return e},Da=(o,e,t)=>{o=String(o),(t===void 0||t>o.length)&&(t=o.length),t-=e.length;let s=o.indexOf(e,t);return s!==-1&&s===t},Ea=o=>{if(!o)return null;if(Pe(o))return o;let e=o.length;if(!Ho(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=o[e];return t},Oa=(o=>e=>o&&e instanceof o)(typeof Uint8Array<"u"&&Yt(Uint8Array)),qa=(o,e)=>{let s=(o&&o[It]).call(o),a;for(;(a=s.next())&&!a.done;){let i=a.value;e.call(o,i[0],i[1]);}},Na=(o,e)=>{let t,s=[];for(;(t=o.exec(e))!==null;)s.push(t);return s},Ga=se("HTMLFormElement"),Ta=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,a){return s.toUpperCase()+a}),jo=(({hasOwnProperty:o})=>(e,t)=>o.call(e,t))(Object.prototype),Fa=se("RegExp"),zo=(o,e)=>{let t=Object.getOwnPropertyDescriptors(o),s={};Je(t,(a,i)=>{let n;(n=e(a,i,o))!==false&&(s[i]=n||a);}),Object.defineProperties(o,s);},Ba=o=>{zo(o,(e,t)=>{if($(o)&&["arguments","caller","callee"].indexOf(t)!==-1)return false;let s=o[t];if($(s)){if(e.enumerable=false,"writable"in e){e.writable=false;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")});}});},Ua=(o,e)=>{let t={},s=a=>{a.forEach(i=>{t[i]=true;});};return Pe(o)?s(o):s(String(o).split(e)),t},_a=()=>{},La=(o,e)=>o!=null&&Number.isFinite(o=+o)?o:e;function ja(o){return !!(o&&$(o.append)&&o[Mo]==="FormData"&&o[It])}var Ma=o=>{let e=new Array(10),t=(s,a)=>{if(Me(s)){if(e.indexOf(s)>=0)return;if(je(s))return s;if(!("toJSON"in s)){e[a]=s;let i=Pe(s)?[]:{};return Je(s,(n,r)=>{let l=t(n,a+1);!Se(l)&&(i[r]=l);}),e[a]=void 0,i}}return s};return t(o,0)},Ja=se("AsyncFunction"),Ha=o=>o&&(Me(o)||$(o))&&$(o.then)&&$(o.catch),Qo=((o,e)=>o?setImmediate:e?((t,s)=>(Ae.addEventListener("message",({source:a,data:i})=>{a===Ae&&i===t&&s.length&&s.shift()();},false),a=>{s.push(a),Ae.postMessage(t,"*");}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",$(Ae.postMessage)),Ka=typeof queueMicrotask<"u"?queueMicrotask.bind(Ae):typeof process<"u"&&process.nextTick||Qo,$a=o=>o!=null&&$(o[It]),f={isArray:Pe,isArrayBuffer:Jo,isBuffer:je,isFormData:Aa,isArrayBufferView:la,isString:da,isNumber:Ho,isBoolean:ca,isObject:Me,isPlainObject:xt,isEmptyObject:pa,isReadableStream:xa,isRequest:Ia,isResponse:ka,isHeaders:Va,isUndefined:Se,isDate:fa,isFile:ua,isReactNativeBlob:ma,isReactNative:wa,isBlob:ha,isRegExp:Fa,isFunction:$,isStream:ga,isURLSearchParams:Ca,isTypedArray:Oa,isFileList:Ra,forEach:Je,merge:Qt,extend:Sa,trim:va,stripBOM:Pa,inherits:Wa,toFlatObject:ba,kindOf:kt,kindOfTest:se,endsWith:Da,toArray:Ea,forEachEntry:qa,matchAll:Na,isHTMLForm:Ga,hasOwnProperty:jo,hasOwnProp:jo,reduceDescriptors:zo,freezeMethods:Ba,toObjectSet:Ua,toCamelCase:Ta,noop:_a,toFiniteNumber:La,findKey:Ko,global:Ae,isContextDefined:$o,isSpecCompliantForm:ja,toJSONObject:Ma,isAsyncFn:Ja,isThenable:Ha,setImmediate:Qo,asap:Ka,isIterable:$a};var J=class o extends Error{static from(e,t,s,a,i,n){let r=new o(e.message,t||e.code,s,a,i);return r.cause=e,r.name=e.name,e.status!=null&&r.status==null&&(r.status=e.status),n&&Object.assign(r,n),r}constructor(e,t,s,a,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:true,writable:true,configurable:true}),this.name="AxiosError",this.isAxiosError=true,t&&(this.code=t),s&&(this.config=s),a&&(this.request=a),i&&(this.response=i,this.status=i.status);}toJSON(){return {message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:f.toJSONObject(this.config),code:this.code,status:this.status}}};J.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";J.ERR_BAD_OPTION="ERR_BAD_OPTION";J.ECONNABORTED="ECONNABORTED";J.ETIMEDOUT="ETIMEDOUT";J.ERR_NETWORK="ERR_NETWORK";J.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";J.ERR_DEPRECATED="ERR_DEPRECATED";J.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";J.ERR_BAD_REQUEST="ERR_BAD_REQUEST";J.ERR_CANCELED="ERR_CANCELED";J.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";J.ERR_INVALID_URL="ERR_INVALID_URL";var W=J;var vt=null;function Zt(o){return f.isPlainObject(o)||f.isArray(o)}function Yo(o){return f.endsWith(o,"[]")?o.slice(0,-2):o}function Xt(o,e,t){return o?o.concat(e).map(function(a,i){return a=Yo(a),!t&&i?"["+a+"]":a}).join(t?".":""):e}function za(o){return f.isArray(o)&&!o.some(Zt)}var Qa=f.toFlatObject(f,{},null,function(e){return /^is[A-Z]/.test(e)});function Ya(o,e,t){if(!f.isObject(o))throw new TypeError("target must be an object");e=e||new(FormData),t=f.toFlatObject(t,{metaTokens:true,dots:false,indexes:false},false,function(w,h){return !f.isUndefined(h[w])});let s=t.metaTokens,a=t.visitor||c,i=t.dots,n=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&f.isSpecCompliantForm(e);if(!f.isFunction(a))throw new TypeError("visitor must be a function");function d(u){if(u===null)return "";if(f.isDate(u))return u.toISOString();if(f.isBoolean(u))return u.toString();if(!l&&f.isBlob(u))throw new W("Blob is not supported. Use a Buffer instead.");return f.isArrayBuffer(u)||f.isTypedArray(u)?l&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function c(u,w,h){let b=u;if(f.isReactNative(e)&&f.isReactNativeBlob(u))return e.append(Xt(h,w,i),d(u)),false;if(u&&!h&&typeof u=="object"){if(f.endsWith(w,"{}"))w=s?w:w.slice(0,-2),u=JSON.stringify(u);else if(f.isArray(u)&&za(u)||(f.isFileList(u)||f.endsWith(w,"[]"))&&(b=f.toArray(u)))return w=Yo(w),b.forEach(function(q,D){!(f.isUndefined(q)||q===null)&&e.append(n===true?Xt([w],D,i):n===null?w:w+"[]",d(q));}),false}return Zt(u)?true:(e.append(Xt(h,w,i),d(u)),false)}let p=[],m=Object.assign(Qa,{defaultVisitor:c,convertValue:d,isVisitable:Zt});function R(u,w){if(!f.isUndefined(u)){if(p.indexOf(u)!==-1)throw Error("Circular reference detected in "+w.join("."));p.push(u),f.forEach(u,function(b,G){(!(f.isUndefined(b)||b===null)&&a.call(e,b,f.isString(G)?G.trim():G,w,m))===true&&R(b,w?w.concat(G):[G]);}),p.pop();}}if(!f.isObject(o))throw new TypeError("data must be an object");return R(o),e}var we=Ya;function Xo(o){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Zo(o,e){this._pairs=[],o&&we(o,this,e);}var es=Zo.prototype;es.append=function(e,t){this._pairs.push([e,t]);};es.toString=function(e){let t=e?function(s){return e.call(this,s,Xo)}:Xo;return this._pairs.map(function(a){return t(a[0])+"="+t(a[1])},"").join("&")};var St=Zo;function Xa(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function He(o,e,t){if(!e)return o;let s=t&&t.encode||Xa,a=f.isFunction(t)?{serialize:t}:t,i=a&&a.serialize,n;if(i?n=i(e,a):n=f.isURLSearchParams(e)?e.toString():new St(e,a).toString(s),n){let r=o.indexOf("#");r!==-1&&(o=o.slice(0,r)),o+=(o.indexOf("?")===-1?"?":"&")+n;}return o}var eo=class{constructor(){this.handlers=[];}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:false,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null);}clear(){this.handlers&&(this.handlers=[]);}forEach(e){f.forEach(this.handlers,function(s){s!==null&&e(s);});}},to=eo;var We={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false,legacyInterceptorReqResOrdering:true};var ts=typeof URLSearchParams<"u"?URLSearchParams:St;var os=typeof FormData<"u"?FormData:null;var ss=typeof Blob<"u"?Blob:null;var as={isBrowser:true,classes:{URLSearchParams:ts,FormData:os,Blob:ss},protocols:["http","https","file","blob","url","data"]};var ao={};aa(ao,{hasBrowserEnv:()=>so,hasStandardBrowserEnv:()=>Za,hasStandardBrowserWebWorkerEnv:()=>ei,navigator:()=>oo,origin:()=>ti});var so=typeof window<"u"&&typeof document<"u",oo=typeof navigator=="object"&&navigator||void 0,Za=so&&(!oo||["ReactNative","NativeScript","NS"].indexOf(oo.product)<0),ei=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ti=so&&window.location.href||"http://localhost";var T={...ao,...as};function io(o,e){return we(o,new T.classes.URLSearchParams,{visitor:function(t,s,a,i){return T.isNode&&f.isBuffer(t)?(this.append(s,t.toString("base64")),false):i.defaultVisitor.apply(this,arguments)},...e})}function oi(o){return f.matchAll(/\w+|\[(\w*)]/g,o).map(e=>e[0]==="[]"?"":e[1]||e[0])}function si(o){let e={},t=Object.keys(o),s,a=t.length,i;for(s=0;s<a;s++)i=t[s],e[i]=o[i];return e}function ai(o){function e(t,s,a,i){let n=t[i++];if(n==="__proto__")return true;let r=Number.isFinite(+n),l=i>=t.length;return n=!n&&f.isArray(a)?a.length:n,l?(f.hasOwnProp(a,n)?a[n]=[a[n],s]:a[n]=s,!r):((!a[n]||!f.isObject(a[n]))&&(a[n]=[]),e(t,s,a[n],i)&&f.isArray(a[n])&&(a[n]=si(a[n])),!r)}if(f.isFormData(o)&&f.isFunction(o.entries)){let t={};return f.forEachEntry(o,(s,a)=>{e(oi(s),a,t,0);}),t}return null}var Pt=ai;function ii(o,e,t){if(f.isString(o))try{return (e||JSON.parse)(o),f.trim(o)}catch(s){if(s.name!=="SyntaxError")throw s}return (t||JSON.stringify)(o)}var no={transitional:We,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let s=t.getContentType()||"",a=s.indexOf("application/json")>-1,i=f.isObject(e);if(i&&f.isHTMLForm(e)&&(e=new FormData(e)),f.isFormData(e))return a?JSON.stringify(Pt(e)):e;if(f.isArrayBuffer(e)||f.isBuffer(e)||f.isStream(e)||f.isFile(e)||f.isBlob(e)||f.isReadableStream(e))return e;if(f.isArrayBufferView(e))return e.buffer;if(f.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",false),e.toString();let r;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return io(e,this.formSerializer).toString();if((r=f.isFileList(e))||s.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return we(r?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||a?(t.setContentType("application/json",false),ii(e)):e}],transformResponse:[function(e){let t=this.transitional||no.transitional,s=t&&t.forcedJSONParsing,a=this.responseType==="json";if(f.isResponse(e)||f.isReadableStream(e))return e;if(e&&f.isString(e)&&(s&&!this.responseType||a)){let n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(r){if(n)throw r.name==="SyntaxError"?W.from(r,W.ERR_BAD_RESPONSE,this,null,this.response):r}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};f.forEach(["delete","get","head","post","put","patch"],o=>{no.headers[o]={};});var be=no;var ni=f.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),is=o=>{let e={},t,s,a;return o&&o.split(`
2
- `).forEach(function(n){a=n.indexOf(":"),t=n.substring(0,a).trim().toLowerCase(),s=n.substring(a+1).trim(),!(!t||e[t]&&ni[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s);}),e};var ns=Symbol("internals");function Ke(o){return o&&String(o).trim().toLowerCase()}function Wt(o){return o===false||o==null?o:f.isArray(o)?o.map(Wt):String(o)}function ri(o){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,s;for(;s=t.exec(o);)e[s[1]]=s[2];return e}var li=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function ro(o,e,t,s,a){if(f.isFunction(s))return s.call(this,e,t);if(a&&(e=t),!!f.isString(e)){if(f.isString(s))return e.indexOf(s)!==-1;if(f.isRegExp(s))return s.test(e)}}function di(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function ci(o,e){let t=f.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(o,s+t,{value:function(a,i,n){return this[s].call(this,e,a,i,n)},configurable:true});});}var De=class{constructor(e){e&&this.set(e);}set(e,t,s){let a=this;function i(r,l,d){let c=Ke(l);if(!c)throw new Error("header name must be a non-empty string");let p=f.findKey(a,c);(!p||a[p]===void 0||d===true||d===void 0&&a[p]!==false)&&(a[p||l]=Wt(r));}let n=(r,l)=>f.forEach(r,(d,c)=>i(d,c,l));if(f.isPlainObject(e)||e instanceof this.constructor)n(e,t);else if(f.isString(e)&&(e=e.trim())&&!li(e))n(is(e),t);else if(f.isObject(e)&&f.isIterable(e)){let r={},l,d;for(let c of e){if(!f.isArray(c))throw TypeError("Object iterator must return a key-value pair");r[d=c[0]]=(l=r[d])?f.isArray(l)?[...l,c[1]]:[l,c[1]]:c[1];}n(r,t);}else e!=null&&i(t,e,s);return this}get(e,t){if(e=Ke(e),e){let s=f.findKey(this,e);if(s){let a=this[s];if(!t)return a;if(t===true)return ri(a);if(f.isFunction(t))return t.call(this,a,s);if(f.isRegExp(t))return t.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ke(e),e){let s=f.findKey(this,e);return !!(s&&this[s]!==void 0&&(!t||ro(this,this[s],s,t)))}return false}delete(e,t){let s=this,a=false;function i(n){if(n=Ke(n),n){let r=f.findKey(s,n);r&&(!t||ro(s,s[r],r,t))&&(delete s[r],a=true);}}return f.isArray(e)?e.forEach(i):i(e),a}clear(e){let t=Object.keys(this),s=t.length,a=false;for(;s--;){let i=t[s];(!e||ro(this,this[i],i,e,true))&&(delete this[i],a=true);}return a}normalize(e){let t=this,s={};return f.forEach(this,(a,i)=>{let n=f.findKey(s,i);if(n){t[n]=Wt(a),delete t[i];return}let r=e?di(i):String(i).trim();r!==i&&delete t[i],t[r]=Wt(a),s[r]=true;}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return f.forEach(this,(s,a)=>{s!=null&&s!==false&&(t[a]=e&&f.isArray(s)?s.join(", "):s);}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return "AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let s=new this(e);return t.forEach(a=>s.set(a)),s}static accessor(e){let s=(this[ns]=this[ns]={accessors:{}}).accessors,a=this.prototype;function i(n){let r=Ke(n);s[r]||(ci(a,n),s[r]=true);}return f.isArray(e)?e.forEach(i):i(e),this}};De.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);f.reduceDescriptors(De.prototype,({value:o},e)=>{let t=e[0].toUpperCase()+e.slice(1);return {get:()=>o,set(s){this[t]=s;}}});f.freezeMethods(De);var _=De;function $e(o,e){let t=this||be,s=e||t,a=_.from(s.headers),i=s.data;return f.forEach(o,function(r){i=r.call(t,i,a.normalize(),e?e.status:void 0);}),a.normalize(),i}function ze(o){return !!(o&&o.__CANCEL__)}var lo=class extends W{constructor(e,t,s){super(e??"canceled",W.ERR_CANCELED,t,s),this.name="CanceledError",this.__CANCEL__=true;}},ie=lo;function Qe(o,e,t){let s=t.config.validateStatus;!t.status||!s||s(t.status)?o(t):e(new W("Request failed with status code "+t.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t));}function co(o){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return e&&e[1]||""}function pi(o,e){o=o||10;let t=new Array(o),s=new Array(o),a=0,i=0,n;return e=e!==void 0?e:1e3,function(l){let d=Date.now(),c=s[i];n||(n=d),t[a]=l,s[a]=d;let p=i,m=0;for(;p!==a;)m+=t[p++],p=p%o;if(a=(a+1)%o,a===i&&(i=(i+1)%o),d-n<e)return;let R=c&&d-c;return R?Math.round(m*1e3/R):void 0}}var rs=pi;function fi(o,e){let t=0,s=1e3/e,a,i,n=(d,c=Date.now())=>{t=c,a=null,i&&(clearTimeout(i),i=null),o(...d);};return [(...d)=>{let c=Date.now(),p=c-t;p>=s?n(d,c):(a=d,i||(i=setTimeout(()=>{i=null,n(a);},s-p)));},()=>a&&n(a)]}var ls=fi;var Ee=(o,e,t=3)=>{let s=0,a=rs(50,250);return ls(i=>{let n=i.loaded,r=i.lengthComputable?i.total:void 0,l=n-s,d=a(l),c=n<=r;s=n;let p={loaded:n,total:r,progress:r?n/r:void 0,bytes:l,rate:d||void 0,estimated:d&&r&&c?(r-n)/d:void 0,event:i,lengthComputable:r!=null,[e?"download":"upload"]:true};o(p);},t)},po=(o,e)=>{let t=o!=null;return [s=>e[0]({lengthComputable:t,total:o,loaded:s}),e[1]]},fo=o=>(...e)=>f.asap(()=>o(...e));var ds=T.hasStandardBrowserEnv?((o,e)=>t=>(t=new URL(t,T.origin),o.protocol===t.protocol&&o.host===t.host&&(e||o.port===t.port)))(new URL(T.origin),T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent)):()=>true;var cs=T.hasStandardBrowserEnv?{write(o,e,t,s,a,i,n){if(typeof document>"u")return;let r=[`${o}=${encodeURIComponent(e)}`];f.isNumber(t)&&r.push(`expires=${new Date(t).toUTCString()}`),f.isString(s)&&r.push(`path=${s}`),f.isString(a)&&r.push(`domain=${a}`),i===true&&r.push("secure"),f.isString(n)&&r.push(`SameSite=${n}`),document.cookie=r.join("; ");},read(o){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+o+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(o){this.write(o,"",Date.now()-864e5,"/");}}:{write(){},read(){return null},remove(){}};function uo(o){return typeof o!="string"?false:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function mo(o,e){return e?o.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):o}function Ye(o,e,t){let s=!uo(e);return o&&(s||t==false)?mo(o,e):e}var ps=o=>o instanceof _?{...o}:o;function ae(o,e){e=e||{};let t={};function s(d,c,p,m){return f.isPlainObject(d)&&f.isPlainObject(c)?f.merge.call({caseless:m},d,c):f.isPlainObject(c)?f.merge({},c):f.isArray(c)?c.slice():c}function a(d,c,p,m){if(f.isUndefined(c)){if(!f.isUndefined(d))return s(void 0,d,p,m)}else return s(d,c,p,m)}function i(d,c){if(!f.isUndefined(c))return s(void 0,c)}function n(d,c){if(f.isUndefined(c)){if(!f.isUndefined(d))return s(void 0,d)}else return s(void 0,c)}function r(d,c,p){if(p in e)return s(d,c);if(p in o)return s(void 0,d)}let l={url:i,method:i,data:i,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:r,headers:(d,c,p)=>a(ps(d),ps(c),p,true)};return f.forEach(Object.keys({...o,...e}),function(c){if(c==="__proto__"||c==="constructor"||c==="prototype")return;let p=f.hasOwnProp(l,c)?l[c]:a,m=p(o[c],e[c],c);f.isUndefined(m)&&p!==r||(t[c]=m);}),t}var bt=o=>{let e=ae({},o),{data:t,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:i,headers:n,auth:r}=e;if(e.headers=n=_.from(n),e.url=He(Ye(e.baseURL,e.url,e.allowAbsoluteUrls),o.params,o.paramsSerializer),r&&n.set("Authorization","Basic "+btoa((r.username||"")+":"+(r.password?unescape(encodeURIComponent(r.password)):""))),f.isFormData(t)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if(f.isFunction(t.getHeaders)){let l=t.getHeaders(),d=["content-type","content-length"];Object.entries(l).forEach(([c,p])=>{d.includes(c.toLowerCase())&&n.set(c,p);});}}if(T.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(e)),s||s!==false&&ds(e.url))){let l=a&&i&&cs.read(i);l&&n.set(a,l);}return e};var ui=typeof XMLHttpRequest<"u",fs=ui&&function(o){return new Promise(function(t,s){let a=bt(o),i=a.data,n=_.from(a.headers).normalize(),{responseType:r,onUploadProgress:l,onDownloadProgress:d}=a,c,p,m,R,u;function w(){R&&R(),u&&u(),a.cancelToken&&a.cancelToken.unsubscribe(c),a.signal&&a.signal.removeEventListener("abort",c);}let h=new XMLHttpRequest;h.open(a.method.toUpperCase(),a.url,true),h.timeout=a.timeout;function b(){if(!h)return;let q=_.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),N={data:!r||r==="text"||r==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:q,config:o,request:h};Qe(function(H){t(H),w();},function(H){s(H),w();},N),h=null;}"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(b);},h.onabort=function(){h&&(s(new W("Request aborted",W.ECONNABORTED,o,h)),h=null);},h.onerror=function(D){let N=D&&D.message?D.message:"Network Error",X=new W(N,W.ERR_NETWORK,o,h);X.event=D||null,s(X),h=null;},h.ontimeout=function(){let D=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",N=a.transitional||We;a.timeoutErrorMessage&&(D=a.timeoutErrorMessage),s(new W(D,N.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,o,h)),h=null;},i===void 0&&n.setContentType(null),"setRequestHeader"in h&&f.forEach(n.toJSON(),function(D,N){h.setRequestHeader(N,D);}),f.isUndefined(a.withCredentials)||(h.withCredentials=!!a.withCredentials),r&&r!=="json"&&(h.responseType=a.responseType),d&&([m,u]=Ee(d,true),h.addEventListener("progress",m)),l&&h.upload&&([p,R]=Ee(l),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",R)),(a.cancelToken||a.signal)&&(c=q=>{h&&(s(!q||q.type?new ie(null,o,h):q),h.abort(),h=null);},a.cancelToken&&a.cancelToken.subscribe(c),a.signal&&(a.signal.aborted?c():a.signal.addEventListener("abort",c)));let G=co(a.url);if(G&&T.protocols.indexOf(G)===-1){s(new W("Unsupported protocol "+G+":",W.ERR_BAD_REQUEST,o));return}h.send(i||null);})};var mi=(o,e)=>{let{length:t}=o=o?o.filter(Boolean):[];if(e||t){let s=new AbortController,a,i=function(d){if(!a){a=true,r();let c=d instanceof Error?d:this.reason;s.abort(c instanceof W?c:new ie(c instanceof Error?c.message:c));}},n=e&&setTimeout(()=>{n=null,i(new W(`timeout of ${e}ms exceeded`,W.ETIMEDOUT));},e),r=()=>{o&&(n&&clearTimeout(n),n=null,o.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i);}),o=null);};o.forEach(d=>d.addEventListener("abort",i));let{signal:l}=s;return l.unsubscribe=()=>f.asap(r),l}},us=mi;var wi=function*(o,e){let t=o.byteLength;if(t<e){yield o;return}let s=0,a;for(;s<t;)a=s+e,yield o.slice(s,a),s=a;},hi=async function*(o,e){for await(let t of Ri(o))yield*wi(t,e);},Ri=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}let e=o.getReader();try{for(;;){let{done:t,value:s}=await e.read();if(t)break;yield s;}}finally{await e.cancel();}},wo=(o,e,t,s)=>{let a=hi(o,e),i=0,n,r=l=>{n||(n=true,s&&s(l));};return new ReadableStream({async pull(l){try{let{done:d,value:c}=await a.next();if(d){r(),l.close();return}let p=c.byteLength;if(t){let m=i+=p;t(m);}l.enqueue(new Uint8Array(c));}catch(d){throw r(d),d}},cancel(l){return r(l),a.return()}},{highWaterMark:2})};var ms=64*1024,{isFunction:Dt}=f,gi=(({Request:o,Response:e})=>({Request:o,Response:e}))(f.global),{ReadableStream:ws,TextEncoder:hs}=f.global,Rs=(o,...e)=>{try{return !!o(...e)}catch{return false}},yi=o=>{o=f.merge.call({skipUndefined:true},gi,o);let{fetch:e,Request:t,Response:s}=o,a=e?Dt(e):typeof fetch=="function",i=Dt(t),n=Dt(s);if(!a)return false;let r=a&&Dt(ws),l=a&&(typeof hs=="function"?(u=>w=>u.encode(w))(new hs):async u=>new Uint8Array(await new t(u).arrayBuffer())),d=i&&r&&Rs(()=>{let u=!1,w=new t(T.origin,{body:new ws,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!w}),c=n&&r&&Rs(()=>f.isReadableStream(new s("").body)),p={stream:c&&(u=>u.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!p[u]&&(p[u]=(w,h)=>{let b=w&&w[u];if(b)return b.call(w);throw new W(`Response type '${u}' is not supported`,W.ERR_NOT_SUPPORT,h)});});let m=async u=>{if(u==null)return 0;if(f.isBlob(u))return u.size;if(f.isSpecCompliantForm(u))return (await new t(T.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(f.isArrayBufferView(u)||f.isArrayBuffer(u))return u.byteLength;if(f.isURLSearchParams(u)&&(u=u+""),f.isString(u))return (await l(u)).byteLength},R=async(u,w)=>{let h=f.toFiniteNumber(u.getContentLength());return h??m(w)};return async u=>{let{url:w,method:h,data:b,signal:G,cancelToken:q,timeout:D,onDownloadProgress:N,onUploadProgress:X,responseType:H,headers:ke,withCredentials:Ve="same-origin",fetchOptions:No}=bt(u),Go=e||fetch;H=H?(H+"").toLowerCase():"text";let At=us([G,q&&q.toAbortSignal()],D),_e=null,ye=At&&At.unsubscribe&&(()=>{At.unsubscribe();}),To;try{if(X&&d&&h!=="get"&&h!=="head"&&(To=await R(ke,b))!==0){let me=new t(w,{method:"POST",body:b,duplex:"half"}),ve;if(f.isFormData(b)&&(ve=me.headers.get("content-type"))&&ke.setContentType(ve),me.body){let[Kt,Ct]=po(To,Ee(fo(X)));b=wo(me.body,ms,Kt,Ct);}}f.isString(Ve)||(Ve=Ve?"include":"omit");let K=i&&"credentials"in t.prototype,Fo={...No,signal:At,method:h.toUpperCase(),headers:ke.normalize().toJSON(),body:b,duplex:"half",credentials:K?Ve:void 0};_e=i&&new t(w,Fo);let ue=await(i?Go(_e,No):Go(w,Fo)),Bo=c&&(H==="stream"||H==="response");if(c&&(N||Bo&&ye)){let me={};["status","statusText","headers"].forEach(Uo=>{me[Uo]=ue[Uo];});let ve=f.toFiniteNumber(ue.headers.get("content-length")),[Kt,Ct]=N&&po(ve,Ee(fo(N),!0))||[];ue=new s(wo(ue.body,ms,Kt,()=>{Ct&&Ct(),ye&&ye();}),me);}H=H||"text";let Ys=await p[f.findKey(p,H)||"text"](ue,u);return !Bo&&ye&&ye(),await new Promise((me,ve)=>{Qe(me,ve,{data:Ys,headers:_.from(ue.headers),status:ue.status,statusText:ue.statusText,config:u,request:_e});})}catch(K){throw ye&&ye(),K&&K.name==="TypeError"&&/Load failed|fetch/i.test(K.message)?Object.assign(new W("Network Error",W.ERR_NETWORK,u,_e,K&&K.response),{cause:K.cause||K}):W.from(K,K&&K.code,u,_e,K&&K.response)}}},Ai=new Map,ho=o=>{let e=o&&o.env||{},{fetch:t,Request:s,Response:a}=e,i=[s,a,t],n=i.length,r=n,l,d,c=Ai;for(;r--;)l=i[r],d=c.get(l),d===void 0&&c.set(l,d=r?new Map:yi(e)),c=d;return d};ho();var Ro={http:vt,xhr:fs,fetch:{get:ho}};f.forEach(Ro,(o,e)=>{if(o){try{Object.defineProperty(o,"name",{value:e});}catch{}Object.defineProperty(o,"adapterName",{value:e});}});var gs=o=>`- ${o}`,xi=o=>f.isFunction(o)||o===null||o===false;function Ii(o,e){o=f.isArray(o)?o:[o];let{length:t}=o,s,a,i={};for(let n=0;n<t;n++){s=o[n];let r;if(a=s,!xi(s)&&(a=Ro[(r=String(s)).toLowerCase()],a===void 0))throw new W(`Unknown adapter '${r}'`);if(a&&(f.isFunction(a)||(a=a.get(e))))break;i[r||"#"+n]=a;}if(!a){let n=Object.entries(i).map(([l,d])=>`adapter ${l} `+(d===false?"is not supported by the environment":"is not available in the build")),r=t?n.length>1?`since :
4
- `+n.map(gs).join(`
5
- `):" "+gs(n[0]):"as no adapter specified";throw new W("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return a}var Et={getAdapter:Ii,adapters:Ro};function go(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new ie(null,o)}function Ot(o){return go(o),o.headers=_.from(o.headers),o.data=$e.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",false),Et.getAdapter(o.adapter||be.adapter,o)(o).then(function(s){return go(o),s.data=$e.call(o,o.transformResponse,s),s.headers=_.from(s.headers),s},function(s){return ze(s)||(go(o),s&&s.response&&(s.response.data=$e.call(o,o.transformResponse,s.response),s.response.headers=_.from(s.response.headers))),Promise.reject(s)})}var qt="1.13.6";var Nt={};["object","boolean","number","function","string","symbol"].forEach((o,e)=>{Nt[o]=function(s){return typeof s===o||"a"+(e<1?"n ":" ")+o};});var ys={};Nt.transitional=function(e,t,s){function a(i,n){return "[Axios v"+qt+"] Transitional option '"+i+"'"+n+(s?". "+s:"")}return (i,n,r)=>{if(e===false)throw new W(a(n," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!ys[n]&&(ys[n]=true,console.warn(a(n," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,n,r):true}};Nt.spelling=function(e){return (t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),true)};function ki(o,e,t){if(typeof o!="object")throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);let s=Object.keys(o),a=s.length;for(;a-- >0;){let i=s[a],n=e[i];if(n){let r=o[i],l=r===void 0||n(r,i,o);if(l!==true)throw new W("option "+i+" must be "+l,W.ERR_BAD_OPTION_VALUE);continue}if(t!==true)throw new W("Unknown option "+i,W.ERR_BAD_OPTION)}}var Xe={assertOptions:ki,validators:Nt};var te=Xe.validators,Oe=class{constructor(e){this.defaults=e||{},this.interceptors={request:new to,response:new to};}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;let i=a.stack?a.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+i):s.stack=i;}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ae(this.defaults,t);let{transitional:s,paramsSerializer:a,headers:i}=t;s!==void 0&&Xe.assertOptions(s,{silentJSONParsing:te.transitional(te.boolean),forcedJSONParsing:te.transitional(te.boolean),clarifyTimeoutError:te.transitional(te.boolean),legacyInterceptorReqResOrdering:te.transitional(te.boolean)},false),a!=null&&(f.isFunction(a)?t.paramsSerializer={serialize:a}:Xe.assertOptions(a,{encode:te.function,serialize:te.function},true)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=true),Xe.assertOptions(t,{baseUrl:te.spelling("baseURL"),withXsrfToken:te.spelling("withXSRFToken")},true),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=i&&f.merge(i.common,i[t.method]);i&&f.forEach(["delete","get","head","post","put","patch","common"],u=>{delete i[u];}),t.headers=_.concat(n,i);let r=[],l=true;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(t)===false)return;l=l&&w.synchronous;let h=t.transitional||We;h&&h.legacyInterceptorReqResOrdering?r.unshift(w.fulfilled,w.rejected):r.push(w.fulfilled,w.rejected);});let d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected);});let c,p=0,m;if(!l){let u=[Ot.bind(this),void 0];for(u.unshift(...r),u.push(...d),m=u.length,c=Promise.resolve(t);p<m;)c=c.then(u[p++],u[p++]);return c}m=r.length;let R=t;for(;p<m;){let u=r[p++],w=r[p++];try{R=u(R);}catch(h){w.call(this,h);break}}try{c=Ot.call(this,R);}catch(u){return Promise.reject(u)}for(p=0,m=d.length;p<m;)c=c.then(d[p++],d[p++]);return c}getUri(e){e=ae(this.defaults,e);let t=Ye(e.baseURL,e.url,e.allowAbsoluteUrls);return He(t,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){Oe.prototype[e]=function(t,s){return this.request(ae(s||{},{method:e,url:t,data:(s||{}).data}))};});f.forEach(["post","put","patch"],function(e){function t(s){return function(i,n,r){return this.request(ae(r||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}Oe.prototype[e]=t(),Oe.prototype[e+"Form"]=t(true);});var Ze=Oe;var yo=class o{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i;});let s=this;this.promise.then(a=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](a);s._listeners=null;}),this.promise.then=a=>{let i,n=new Promise(r=>{s.subscribe(r),i=r;}).then(a);return n.cancel=function(){s.unsubscribe(i);},n},e(function(i,n,r){s.reason||(s.reason=new ie(i,n,r),t(s.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);}toAbortSignal(){let e=new AbortController,t=s=>{e.abort(s);};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return {token:new o(function(a){e=a;}),cancel:e}}},As=yo;function Ao(o){return function(t){return o.apply(null,t)}}function Co(o){return f.isObject(o)&&o.isAxiosError===true}var xo={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(xo).forEach(([o,e])=>{xo[e]=o;});var Cs=xo;function xs(o){let e=new Ze(o),t=Le(Ze.prototype.request,e);return f.extend(t,Ze.prototype,e,{allOwnKeys:true}),f.extend(t,e,null,{allOwnKeys:true}),t.create=function(a){return xs(ae(o,a))},t}var B=xs(be);B.Axios=Ze;B.CanceledError=ie;B.CancelToken=As;B.isCancel=ze;B.VERSION=qt;B.toFormData=we;B.AxiosError=W;B.Cancel=B.CanceledError;B.all=function(e){return Promise.all(e)};B.spread=Ao;B.isAxiosError=Co;B.mergeConfig=ae;B.AxiosHeaders=_;B.formToJSON=o=>Pt(f.isHTMLForm(o)?new FormData(o):o);B.getAdapter=Et.getAdapter;B.HttpStatusCode=Cs;B.default=B;var g=B;var{Axios:rd,AxiosError:Is,CanceledError:ld,isCancel:dd,CancelToken:cd,VERSION:pd,all:fd,Cancel:ud,isAxiosError:ks,spread:md,toFormData:wd,AxiosHeaders:hd,HttpStatusCode:Rd,formToJSON:gd,getAdapter:yd,mergeConfig:Ad}=g;var A=globalThis.URL,Vs=globalThis.URLSearchParams;var y="https://api.kadoa.com".replace(/\/+$/,"");var oe=class{constructor(e,t=y,s=g){this.basePath=t;this.axios=s;e&&(this.configuration=e,this.basePath=e.basePath??t);}},Gt=class extends Error{constructor(t,s){super(s);this.field=t;this.name="RequiredError";}},C={};var x="https://example.com",S=function(o,e,t){if(t==null)throw new Gt(e,`Required parameter ${e} was null or undefined when calling ${o}.`)},I=async function(o,e,t){if(t&&t.apiKey){let s=typeof t.apiKey=="function"?await t.apiKey(e):await t.apiKey;o[e]=s;}};var re=async function(o,e){if(e&&e.accessToken){let t=typeof e.accessToken=="function"?await e.accessToken():await e.accessToken;o.Authorization="Bearer "+t;}};function Io(o,e,t=""){e!=null&&(typeof e=="object"?Array.isArray(e)||e instanceof Set?e.forEach(s=>Io(o,s,t)):Object.keys(e).forEach(s=>Io(o,e[s],`${t}${t!==""?".":""}${s}`)):o.has(t)?o.append(t,e):o.set(t,e));}var k=function(o,...e){let t=new Vs(o.search);Io(t,e),o.search=t.toString();},Vi=function(o,e){return e instanceof Set?Array.from(e):e},O=function(o,e,t){let s=typeof o!="string";return (s&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):s)?JSON.stringify(o!==void 0?o:{},Vi):o||""},V=function(o){return o.pathname+o.search+o.hash},v=function(o,e,t,s){return (a=e,i=t)=>{let n={...o.options,url:(a.defaults.baseURL?"":s?.basePath??i)+o.url};return a.request(n)}};var vi=function(o){return {v4CrawlBucketDataFilenameb64Get:async(e,t,s,a={})=>{S("v4CrawlBucketDataFilenameb64Get","filenameb64",e);let i="/v4/crawl/bucket/data/{filenameb64}".replace("{filenameb64}",encodeURIComponent(String(e))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),d.Accept="application/json",t!=null&&(d["Content-Type"]=String(t)),s!=null&&(d["Cache-Control"]=String(s)),k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4CrawlConfigConfigIdGet:async(e,t={})=>{S("v4CrawlConfigConfigIdGet","configId",e);let s="/v4/crawl/config/{configId}".replace("{configId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4CrawlConfigDelete:async(e,t={})=>{let s="/v4/crawl/config",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlConfigPost:async(e,t={})=>{let s="/v4/crawl/config",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlPausePost:async(e,t={})=>{let s="/v4/crawl/pause",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlPost:async(e,t={})=>{let s="/v4/crawl/",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlResumePost:async(e,t={})=>{let s="/v4/crawl/resume",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlSessionIdListGet:async(e,t,s={})=>{S("v4CrawlSessionIdListGet","sessionId",e);let a="/v4/crawl/{sessionId}/list".replace("{sessionId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),t!==void 0&&(d.includeAll=t),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v4CrawlSessionIdPagesGet:async(e,t,s,a={})=>{S("v4CrawlSessionIdPagesGet","sessionId",e);let i="/v4/crawl/{sessionId}/pages".replace("{sessionId}",encodeURIComponent(String(e))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),t!==void 0&&(c.currentPage=t),s!==void 0&&(c.pageSize=s),d.Accept="application/json",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4CrawlSessionIdPagesPageIdGet:async(e,t,s,a={})=>{S("v4CrawlSessionIdPagesPageIdGet","sessionId",e),S("v4CrawlSessionIdPagesPageIdGet","pageId",t);let i="/v4/crawl/{sessionId}/pages/{pageId}".replace("{sessionId}",encodeURIComponent(String(e))).replace("{pageId}",encodeURIComponent(String(t))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),s!==void 0&&(c.format=s),d.Accept="application/json",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4CrawlSessionIdStatusGet:async(e,t={})=>{S("v4CrawlSessionIdStatusGet","sessionId",e);let s="/v4/crawl/{sessionId}/status".replace("{sessionId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4CrawlSessionsGet:async(e,t,s,a={})=>{let i="/v4/crawl/sessions",n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),e!==void 0&&(c.page=e),t!==void 0&&(c.pageSize=t),s!==void 0&&(c.userId=s),d.Accept="application/json",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4CrawlStartPost:async(e,t={})=>{let s="/v4/crawl/start",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}}}},Z=function(o){let e=vi(o);return {async v4CrawlBucketDataFilenameb64Get(t,s,a,i){let n=await e.v4CrawlBucketDataFilenameb64Get(t,s,a,i),r=o?.serverIndex??0,l=C["CrawlerApi.v4CrawlBucketDataFilenameb64Get"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4CrawlConfigConfigIdGet(t,s){let a=await e.v4CrawlConfigConfigIdGet(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlConfigConfigIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlConfigDelete(t,s){let a=await e.v4CrawlConfigDelete(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlConfigDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlConfigPost(t,s){let a=await e.v4CrawlConfigPost(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlConfigPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlPausePost(t,s){let a=await e.v4CrawlPausePost(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlPausePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlPost(t,s){let a=await e.v4CrawlPost(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlResumePost(t,s){let a=await e.v4CrawlResumePost(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlResumePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlSessionIdListGet(t,s,a){let i=await e.v4CrawlSessionIdListGet(t,s,a),n=o?.serverIndex??0,r=C["CrawlerApi.v4CrawlSessionIdListGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4CrawlSessionIdPagesGet(t,s,a,i){let n=await e.v4CrawlSessionIdPagesGet(t,s,a,i),r=o?.serverIndex??0,l=C["CrawlerApi.v4CrawlSessionIdPagesGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4CrawlSessionIdPagesPageIdGet(t,s,a,i){let n=await e.v4CrawlSessionIdPagesPageIdGet(t,s,a,i),r=o?.serverIndex??0,l=C["CrawlerApi.v4CrawlSessionIdPagesPageIdGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4CrawlSessionIdStatusGet(t,s){let a=await e.v4CrawlSessionIdStatusGet(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlSessionIdStatusGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlSessionsGet(t,s,a,i){let n=await e.v4CrawlSessionsGet(t,s,a,i),r=o?.serverIndex??0,l=C["CrawlerApi.v4CrawlSessionsGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4CrawlStartPost(t,s){let a=await e.v4CrawlStartPost(t,s),i=o?.serverIndex??0,n=C["CrawlerApi.v4CrawlStartPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)}}};var et=class extends oe{v4CrawlBucketDataFilenameb64Get(e,t){return Z(this.configuration).v4CrawlBucketDataFilenameb64Get(e.filenameb64,e.contentType,e.cacheControl,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigConfigIdGet(e,t){return Z(this.configuration).v4CrawlConfigConfigIdGet(e.configId,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigDelete(e={},t){return Z(this.configuration).v4CrawlConfigDelete(e.deleteCrawlerConfigRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigPost(e={},t){return Z(this.configuration).v4CrawlConfigPost(e.createCrawlerConfigRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlPausePost(e={},t){return Z(this.configuration).v4CrawlPausePost(e.pauseCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlPost(e={},t){return Z(this.configuration).v4CrawlPost(e.startCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlResumePost(e={},t){return Z(this.configuration).v4CrawlResumePost(e.resumeCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdListGet(e,t){return Z(this.configuration).v4CrawlSessionIdListGet(e.sessionId,e.includeAll,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdPagesGet(e,t){return Z(this.configuration).v4CrawlSessionIdPagesGet(e.sessionId,e.currentPage,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdPagesPageIdGet(e,t){return Z(this.configuration).v4CrawlSessionIdPagesPageIdGet(e.sessionId,e.pageId,e.format,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdStatusGet(e,t){return Z(this.configuration).v4CrawlSessionIdStatusGet(e.sessionId,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionsGet(e={},t){return Z(this.configuration).v4CrawlSessionsGet(e.page,e.pageSize,e.userId,t).then(s=>s(this.axios,this.basePath))}v4CrawlStartPost(e={},t){return Z(this.configuration).v4CrawlStartPost(e.startSessionWithConfigRequest,t).then(s=>s(this.axios,this.basePath))}};var Si=function(o){return {v4DataValidationRulesActionsBulkApprovePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/bulk-approve",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsBulkDeletePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/bulk-delete",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsDeleteAllDelete:async(e,t={})=>{let s="/v4/data-validation/rules/actions/delete-all",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsGeneratePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/generate",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsGenerateRulesPost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/generate-rules",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesGet:async(e,t,s,a,i,n,r={})=>{let l="/v4/data-validation/rules",d=new A(l,x),c;o&&(c=o.baseOptions);let p={method:"GET",...c,...r},m={},R={};if(await I(m,"x-api-key",o),e!==void 0&&(R.groupId=e),t!==void 0&&(R.workflowId=t),s!==void 0&&(R.status=s),a!==void 0&&(R.page=a),i!==void 0&&(R.pageSize=i),n!==void 0)for(let[w,h]of Object.entries(n))R[w]=h;m.Accept="application/json",k(d,R);let u=c&&c.headers?c.headers:{};return p.headers={...m,...u,...r.headers},{url:V(d),options:p}},v4DataValidationRulesRuleIdDelete:async(e,t,s={})=>{S("v4DataValidationRulesRuleIdDelete","ruleId",e);let a="/v4/data-validation/rules/{ruleId}".replace("{ruleId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"DELETE",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationRulesRuleIdDisablePost:async(e,t,s={})=>{S("v4DataValidationRulesRuleIdDisablePost","ruleId",e);let a="/v4/data-validation/rules/{ruleId}/disable".replace("{ruleId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"POST",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationRulesRuleIdGet:async(e,t,s={})=>{S("v4DataValidationRulesRuleIdGet","ruleId",e);let a="/v4/data-validation/rules/{ruleId}".replace("{ruleId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),t!==void 0&&(d.includeDeleted=t),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v4DataValidationValidationsValidationIdAnomaliesGet:async(e,t,s,a={})=>{S("v4DataValidationValidationsValidationIdAnomaliesGet","validationId",e);let i="/v4/data-validation/validations/{validationId}/anomalies".replace("{validationId}",encodeURIComponent(String(e))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),t!==void 0&&(c.page=t),s!==void 0&&(c.pageSize=s),d.Accept="application/json",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet:async(e,t,s,a,i={})=>{S("v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet","validationId",e),S("v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet","ruleName",t);let n="/v4/data-validation/validations/{validationId}/anomalies/rules/{ruleName}".replace("{validationId}",encodeURIComponent(String(e))).replace("{ruleName}",encodeURIComponent(String(t))),r=new A(n,x),l;o&&(l=o.baseOptions);let d={method:"GET",...l,...i},c={},p={};await I(c,"x-api-key",o),s!==void 0&&(p.page=s),a!==void 0&&(p.pageSize=a),c.Accept="application/json",k(r,p);let m=l&&l.headers?l.headers:{};return d.headers={...c,...m,...i.headers},{url:V(r),options:d}},v4DataValidationValidationsValidationIdGet:async(e,t,s={})=>{S("v4DataValidationValidationsValidationIdGet","validationId",e);let a="/v4/data-validation/validations/{validationId}".replace("{validationId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),t!==void 0&&(d.includeDryRun=t),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v4DataValidationWorkflowIdJobsJobIdValidatePost:async(e,t,s,a={})=>{S("v4DataValidationWorkflowIdJobsJobIdValidatePost","workflowId",e),S("v4DataValidationWorkflowIdJobsJobIdValidatePost","jobId",t);let i="/v4/data-validation/{workflowId}/jobs/{jobId}/validate".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"POST",...r,...a},d={},c={};await I(d,"x-api-key",o),d["Content-Type"]="application/json",d.Accept="application/json",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},l.data=O(s,l,o),{url:V(n),options:l}},v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost:async(e,t,s,a={})=>{S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost","workflowId",e),S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost","jobId",t);let i="/v4/data-validation/workflows/{workflowId}/jobs/{jobId}/validate".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"POST",...r,...a},d={},c={};await I(d,"x-api-key",o),d["Content-Type"]="application/json",d.Accept="application/json",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},l.data=O(s,l,o),{url:V(n),options:l}},v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet:async(e,t,s,a,i,n={})=>{S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet","workflowId",e),S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet","jobId",t);let r="/v4/data-validation/workflows/{workflowId}/jobs/{jobId}/validations".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),l=new A(r,x),d;o&&(d=o.baseOptions);let c={method:"GET",...d,...n},p={},m={};await I(p,"x-api-key",o),s!==void 0&&(m.page=s),a!==void 0&&(m.pageSize=a),i!==void 0&&(m.includeDryRun=i),p.Accept="application/json",k(l,m);let R=d&&d.headers?d.headers:{};return c.headers={...p,...R,...n.headers},{url:V(l),options:c}},v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet:async(e,t,s,a={})=>{S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet","workflowId",e),S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet","jobId",t);let i="/v4/data-validation/workflows/{workflowId}/jobs/{jobId}/validations/latest".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),s!==void 0&&(c.includeDryRun=s),d.Accept="application/json",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4DataValidationWorkflowsWorkflowIdValidationConfigGet:async(e,t={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationConfigGet","workflowId",e);let s="/v4/data-validation/workflows/{workflowId}/validation/config".replace("{workflowId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4DataValidationWorkflowsWorkflowIdValidationConfigPut:async(e,t,s={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationConfigPut","workflowId",e);let a="/v4/data-validation/workflows/{workflowId}/validation/config".replace("{workflowId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationWorkflowsWorkflowIdValidationTogglePut:async(e,t,s={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationTogglePut","workflowId",e);let a="/v4/data-validation/workflows/{workflowId}/validation/toggle".replace("{workflowId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationWorkflowsWorkflowIdValidationsLatestGet:async(e,t,s={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationsLatestGet","workflowId",e);let a="/v4/data-validation/workflows/{workflowId}/validations/latest".replace("{workflowId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),t!==void 0&&(d.includeDryRun=t),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}}}},U=function(o){let e=Si(o);return {async v4DataValidationRulesActionsBulkApprovePost(t,s){let a=await e.v4DataValidationRulesActionsBulkApprovePost(t,s),i=o?.serverIndex??0,n=C["DataValidationApi.v4DataValidationRulesActionsBulkApprovePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsBulkDeletePost(t,s){let a=await e.v4DataValidationRulesActionsBulkDeletePost(t,s),i=o?.serverIndex??0,n=C["DataValidationApi.v4DataValidationRulesActionsBulkDeletePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsDeleteAllDelete(t,s){let a=await e.v4DataValidationRulesActionsDeleteAllDelete(t,s),i=o?.serverIndex??0,n=C["DataValidationApi.v4DataValidationRulesActionsDeleteAllDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsGeneratePost(t,s){let a=await e.v4DataValidationRulesActionsGeneratePost(t,s),i=o?.serverIndex??0,n=C["DataValidationApi.v4DataValidationRulesActionsGeneratePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsGenerateRulesPost(t,s){let a=await e.v4DataValidationRulesActionsGenerateRulesPost(t,s),i=o?.serverIndex??0,n=C["DataValidationApi.v4DataValidationRulesActionsGenerateRulesPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesGet(t,s,a,i,n,r,l){let d=await e.v4DataValidationRulesGet(t,s,a,i,n,r,l),c=o?.serverIndex??0,p=C["DataValidationApi.v4DataValidationRulesGet"]?.[c]?.url;return (m,R)=>v(d,g,y,o)(m,p||R)},async v4DataValidationRulesRuleIdDelete(t,s,a){let i=await e.v4DataValidationRulesRuleIdDelete(t,s,a),n=o?.serverIndex??0,r=C["DataValidationApi.v4DataValidationRulesRuleIdDelete"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4DataValidationRulesRuleIdDisablePost(t,s,a){let i=await e.v4DataValidationRulesRuleIdDisablePost(t,s,a),n=o?.serverIndex??0,r=C["DataValidationApi.v4DataValidationRulesRuleIdDisablePost"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4DataValidationRulesRuleIdGet(t,s,a){let i=await e.v4DataValidationRulesRuleIdGet(t,s,a),n=o?.serverIndex??0,r=C["DataValidationApi.v4DataValidationRulesRuleIdGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4DataValidationValidationsValidationIdAnomaliesGet(t,s,a,i){let n=await e.v4DataValidationValidationsValidationIdAnomaliesGet(t,s,a,i),r=o?.serverIndex??0,l=C["DataValidationApi.v4DataValidationValidationsValidationIdAnomaliesGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(t,s,a,i,n){let r=await e.v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(t,s,a,i,n),l=o?.serverIndex??0,d=C["DataValidationApi.v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet"]?.[l]?.url;return (c,p)=>v(r,g,y,o)(c,d||p)},async v4DataValidationValidationsValidationIdGet(t,s,a){let i=await e.v4DataValidationValidationsValidationIdGet(t,s,a),n=o?.serverIndex??0,r=C["DataValidationApi.v4DataValidationValidationsValidationIdGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4DataValidationWorkflowIdJobsJobIdValidatePost(t,s,a,i){let n=await e.v4DataValidationWorkflowIdJobsJobIdValidatePost(t,s,a,i),r=o?.serverIndex??0,l=C["DataValidationApi.v4DataValidationWorkflowIdJobsJobIdValidatePost"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(t,s,a,i){let n=await e.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(t,s,a,i),r=o?.serverIndex??0,l=C["DataValidationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(t,s,a,i,n,r){let l=await e.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(t,s,a,i,n,r),d=o?.serverIndex??0,c=C["DataValidationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet"]?.[d]?.url;return (p,m)=>v(l,g,y,o)(p,c||m)},async v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(t,s,a,i){let n=await e.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(t,s,a,i),r=o?.serverIndex??0,l=C["DataValidationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4DataValidationWorkflowsWorkflowIdValidationConfigGet(t,s){let a=await e.v4DataValidationWorkflowsWorkflowIdValidationConfigGet(t,s),i=o?.serverIndex??0,n=C["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationConfigGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationWorkflowsWorkflowIdValidationConfigPut(t,s,a){let i=await e.v4DataValidationWorkflowsWorkflowIdValidationConfigPut(t,s,a),n=o?.serverIndex??0,r=C["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationConfigPut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4DataValidationWorkflowsWorkflowIdValidationTogglePut(t,s,a){let i=await e.v4DataValidationWorkflowsWorkflowIdValidationTogglePut(t,s,a),n=o?.serverIndex??0,r=C["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationTogglePut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(t,s,a){let i=await e.v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(t,s,a),n=o?.serverIndex??0,r=C["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationsLatestGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)}}};var tt=class extends oe{v4DataValidationRulesActionsBulkApprovePost(e={},t){return U(this.configuration).v4DataValidationRulesActionsBulkApprovePost(e.bulkApproveRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsBulkDeletePost(e={},t){return U(this.configuration).v4DataValidationRulesActionsBulkDeletePost(e.bulkDeleteRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsDeleteAllDelete(e={},t){return U(this.configuration).v4DataValidationRulesActionsDeleteAllDelete(e.deleteRuleWithReason,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsGeneratePost(e={},t){return U(this.configuration).v4DataValidationRulesActionsGeneratePost(e.generateRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsGenerateRulesPost(e={},t){return U(this.configuration).v4DataValidationRulesActionsGenerateRulesPost(e.generateRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesGet(e={},t){return U(this.configuration).v4DataValidationRulesGet(e.groupId,e.workflowId,e.status,e.page,e.pageSize,e.includeDeleted,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdDelete(e,t){return U(this.configuration).v4DataValidationRulesRuleIdDelete(e.ruleId,e.deleteRuleWithReason,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdDisablePost(e,t){return U(this.configuration).v4DataValidationRulesRuleIdDisablePost(e.ruleId,e.disableRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdGet(e,t){return U(this.configuration).v4DataValidationRulesRuleIdGet(e.ruleId,e.includeDeleted,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdAnomaliesGet(e,t){return U(this.configuration).v4DataValidationValidationsValidationIdAnomaliesGet(e.validationId,e.page,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(e,t){return U(this.configuration).v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(e.validationId,e.ruleName,e.page,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdGet(e,t){return U(this.configuration).v4DataValidationValidationsValidationIdGet(e.validationId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowIdJobsJobIdValidatePost(e,t){return U(this.configuration).v4DataValidationWorkflowIdJobsJobIdValidatePost(e.workflowId,e.jobId,e.dataValidationRequestBody,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(e.workflowId,e.jobId,e.dataValidationRequestBody,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e.workflowId,e.jobId,e.page,e.pageSize,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(e.workflowId,e.jobId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationConfigGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationConfigGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationConfigPut(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationConfigPut(e.workflowId,e.v4DataValidationWorkflowsWorkflowIdValidationConfigPutRequest,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationTogglePut(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationTogglePut(e.workflowId,e.v4DataValidationWorkflowsWorkflowIdValidationTogglePutRequest,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(e.workflowId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}};var Pi=function(o){return {v5NotificationsChannelsChannelIdDelete:async(e,t={})=>{S("v5NotificationsChannelsChannelIdDelete","channelId",e);let s="/v5/notifications/channels/{channelId}".replace("{channelId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v5NotificationsChannelsChannelIdGet:async(e,t,s={})=>{S("v5NotificationsChannelsChannelIdGet","channelId",e);let a="/v5/notifications/channels/{channelId}".replace("{channelId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),t!==void 0&&(d.includeConfigurations=t),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v5NotificationsChannelsChannelIdPut:async(e,t,s={})=>{S("v5NotificationsChannelsChannelIdPut","channelId",e),S("v5NotificationsChannelsChannelIdPut","v5NotificationsChannelsPostRequest",t);let a="/v5/notifications/channels/{channelId}".replace("{channelId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v5NotificationsChannelsGet:async(e,t,s={})=>{let a="/v5/notifications/channels",i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),e!==void 0&&(d.workflowId=e),t!==void 0&&(d.includeConfigurations=t),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v5NotificationsChannelsPost:async(e,t={})=>{S("v5NotificationsChannelsPost","v5NotificationsChannelsPostRequest",e);let s="/v5/notifications/channels",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v5NotificationsEventTypesEventTypeGet:async(e,t={})=>{S("v5NotificationsEventTypesEventTypeGet","eventType",e);let s="/v5/notifications/event-types/{eventType}".replace("{eventType}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v5NotificationsEventTypesGet:async(e={})=>{let t="/v5/notifications/event-types",s=new A(t,x),a;o&&(a=o.baseOptions);let i={method:"GET",...a,...e},n={},r={};await I(n,"x-api-key",o),n.Accept="application/json",k(s,r);let l=a&&a.headers?a.headers:{};return i.headers={...n,...l,...e.headers},{url:V(s),options:i}},v5NotificationsLogsGet:async(e,t,s,a,i,n,r={})=>{let l="/v5/notifications/logs",d=new A(l,x),c;o&&(c=o.baseOptions);let p={method:"GET",...c,...r},m={},R={};await I(m,"x-api-key",o),e!==void 0&&(R.workflowId=e),t!==void 0&&(R.eventType=t),s!==void 0&&(R.startDate=s instanceof Date?s.toISOString():s),a!==void 0&&(R.endDate=a instanceof Date?a.toISOString():a),i!==void 0&&(R.limit=i),n!==void 0&&(R.offset=n),m.Accept="application/json",k(d,R);let u=c&&c.headers?c.headers:{};return p.headers={...m,...u,...r.headers},{url:V(d),options:p}},v5NotificationsSettingsGet:async(e,t,s={})=>{let a="/v5/notifications/settings",i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),e!==void 0&&(d.workflowId=e),t!==void 0&&(d.eventType=t),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v5NotificationsSettingsPost:async(e,t={})=>{S("v5NotificationsSettingsPost","v5NotificationsSettingsPostRequest",e);let s="/v5/notifications/settings",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v5NotificationsSettingsSettingsIdDelete:async(e,t={})=>{S("v5NotificationsSettingsSettingsIdDelete","settingsId",e);let s="/v5/notifications/settings/{settingsId}".replace("{settingsId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v5NotificationsSettingsSettingsIdGet:async(e,t={})=>{S("v5NotificationsSettingsSettingsIdGet","settingsId",e);let s="/v5/notifications/settings/{settingsId}".replace("{settingsId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v5NotificationsSettingsSettingsIdPut:async(e,t,s={})=>{S("v5NotificationsSettingsSettingsIdPut","settingsId",e),S("v5NotificationsSettingsSettingsIdPut","v5NotificationsSettingsSettingsIdPutRequest",t);let a="/v5/notifications/settings/{settingsId}".replace("{settingsId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v5NotificationsTestPost:async(e,t={})=>{S("v5NotificationsTestPost","v5NotificationsTestPostRequest",e);let s="/v5/notifications/test",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}}}},z=function(o){let e=Pi(o);return {async v5NotificationsChannelsChannelIdDelete(t,s){let a=await e.v5NotificationsChannelsChannelIdDelete(t,s),i=o?.serverIndex??0,n=C["NotificationsApi.v5NotificationsChannelsChannelIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsChannelsChannelIdGet(t,s,a){let i=await e.v5NotificationsChannelsChannelIdGet(t,s,a),n=o?.serverIndex??0,r=C["NotificationsApi.v5NotificationsChannelsChannelIdGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v5NotificationsChannelsChannelIdPut(t,s,a){let i=await e.v5NotificationsChannelsChannelIdPut(t,s,a),n=o?.serverIndex??0,r=C["NotificationsApi.v5NotificationsChannelsChannelIdPut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v5NotificationsChannelsGet(t,s,a){let i=await e.v5NotificationsChannelsGet(t,s,a),n=o?.serverIndex??0,r=C["NotificationsApi.v5NotificationsChannelsGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v5NotificationsChannelsPost(t,s){let a=await e.v5NotificationsChannelsPost(t,s),i=o?.serverIndex??0,n=C["NotificationsApi.v5NotificationsChannelsPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsEventTypesEventTypeGet(t,s){let a=await e.v5NotificationsEventTypesEventTypeGet(t,s),i=o?.serverIndex??0,n=C["NotificationsApi.v5NotificationsEventTypesEventTypeGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsEventTypesGet(t){let s=await e.v5NotificationsEventTypesGet(t),a=o?.serverIndex??0,i=C["NotificationsApi.v5NotificationsEventTypesGet"]?.[a]?.url;return (n,r)=>v(s,g,y,o)(n,i||r)},async v5NotificationsLogsGet(t,s,a,i,n,r,l){let d=await e.v5NotificationsLogsGet(t,s,a,i,n,r,l),c=o?.serverIndex??0,p=C["NotificationsApi.v5NotificationsLogsGet"]?.[c]?.url;return (m,R)=>v(d,g,y,o)(m,p||R)},async v5NotificationsSettingsGet(t,s,a){let i=await e.v5NotificationsSettingsGet(t,s,a),n=o?.serverIndex??0,r=C["NotificationsApi.v5NotificationsSettingsGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v5NotificationsSettingsPost(t,s){let a=await e.v5NotificationsSettingsPost(t,s),i=o?.serverIndex??0,n=C["NotificationsApi.v5NotificationsSettingsPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsSettingsSettingsIdDelete(t,s){let a=await e.v5NotificationsSettingsSettingsIdDelete(t,s),i=o?.serverIndex??0,n=C["NotificationsApi.v5NotificationsSettingsSettingsIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsSettingsSettingsIdGet(t,s){let a=await e.v5NotificationsSettingsSettingsIdGet(t,s),i=o?.serverIndex??0,n=C["NotificationsApi.v5NotificationsSettingsSettingsIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsSettingsSettingsIdPut(t,s,a){let i=await e.v5NotificationsSettingsSettingsIdPut(t,s,a),n=o?.serverIndex??0,r=C["NotificationsApi.v5NotificationsSettingsSettingsIdPut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v5NotificationsTestPost(t,s){let a=await e.v5NotificationsTestPost(t,s),i=o?.serverIndex??0,n=C["NotificationsApi.v5NotificationsTestPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)}}};var qe=class extends oe{v5NotificationsChannelsChannelIdDelete(e,t){return z(this.configuration).v5NotificationsChannelsChannelIdDelete(e.channelId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsChannelIdGet(e,t){return z(this.configuration).v5NotificationsChannelsChannelIdGet(e.channelId,e.includeConfigurations,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsChannelIdPut(e,t){return z(this.configuration).v5NotificationsChannelsChannelIdPut(e.channelId,e.v5NotificationsChannelsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsGet(e={},t){return z(this.configuration).v5NotificationsChannelsGet(e.workflowId,e.includeConfigurations,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsPost(e,t){return z(this.configuration).v5NotificationsChannelsPost(e.v5NotificationsChannelsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsEventTypesEventTypeGet(e,t){return z(this.configuration).v5NotificationsEventTypesEventTypeGet(e.eventType,t).then(s=>s(this.axios,this.basePath))}v5NotificationsEventTypesGet(e){return z(this.configuration).v5NotificationsEventTypesGet(e).then(t=>t(this.axios,this.basePath))}v5NotificationsLogsGet(e={},t){return z(this.configuration).v5NotificationsLogsGet(e.workflowId,e.eventType,e.startDate,e.endDate,e.limit,e.offset,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsGet(e={},t){return z(this.configuration).v5NotificationsSettingsGet(e.workflowId,e.eventType,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsPost(e,t){return z(this.configuration).v5NotificationsSettingsPost(e.v5NotificationsSettingsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdDelete(e,t){return z(this.configuration).v5NotificationsSettingsSettingsIdDelete(e.settingsId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdGet(e,t){return z(this.configuration).v5NotificationsSettingsSettingsIdGet(e.settingsId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdPut(e,t){return z(this.configuration).v5NotificationsSettingsSettingsIdPut(e.settingsId,e.v5NotificationsSettingsSettingsIdPutRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsTestPost(e,t){return z(this.configuration).v5NotificationsTestPost(e.v5NotificationsTestPostRequest,t).then(s=>s(this.axios,this.basePath))}},Tt={WorkflowStarted:"workflow_started",WorkflowFinished:"workflow_finished",WorkflowFailed:"workflow_failed",WorkflowSampleFinished:"workflow_sample_finished",WorkflowDataChange:"workflow_data_change",SystemMaintenance:"system_maintenance",ServiceDegradation:"service_degradation",CreditsLow:"credits_low",FreeTrialEnding:"free_trial_ending"};var Wi=function(o){return {v4SchemasGet:async(e={})=>{let t="/v4/schemas/",s=new A(t,x),a;o&&(a=o.baseOptions);let i={method:"GET",...a,...e},n={},r={};await I(n,"x-api-key",o),n.Accept="application/json",k(s,r);let l=a&&a.headers?a.headers:{};return i.headers={...n,...l,...e.headers},{url:V(s),options:i}},v4SchemasPost:async(e,t={})=>{let s="/v4/schemas/",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4SchemasSchemaIdDelete:async(e,t={})=>{S("v4SchemasSchemaIdDelete","schemaId",e);let s="/v4/schemas/{schemaId}".replace("{schemaId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4SchemasSchemaIdGet:async(e,t={})=>{S("v4SchemasSchemaIdGet","schemaId",e);let s="/v4/schemas/{schemaId}".replace("{schemaId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4SchemasSchemaIdPut:async(e,t,s={})=>{S("v4SchemasSchemaIdPut","schemaId",e);let a="/v4/schemas/{schemaId}".replace("{schemaId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}}}},ot=function(o){let e=Wi(o);return {async v4SchemasGet(t){let s=await e.v4SchemasGet(t),a=o?.serverIndex??0,i=C["SchemasApi.v4SchemasGet"]?.[a]?.url;return (n,r)=>v(s,g,y,o)(n,i||r)},async v4SchemasPost(t,s){let a=await e.v4SchemasPost(t,s),i=o?.serverIndex??0,n=C["SchemasApi.v4SchemasPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4SchemasSchemaIdDelete(t,s){let a=await e.v4SchemasSchemaIdDelete(t,s),i=o?.serverIndex??0,n=C["SchemasApi.v4SchemasSchemaIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4SchemasSchemaIdGet(t,s){let a=await e.v4SchemasSchemaIdGet(t,s),i=o?.serverIndex??0,n=C["SchemasApi.v4SchemasSchemaIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4SchemasSchemaIdPut(t,s,a){let i=await e.v4SchemasSchemaIdPut(t,s,a),n=o?.serverIndex??0,r=C["SchemasApi.v4SchemasSchemaIdPut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)}}};var st=class extends oe{v4SchemasGet(e){return ot(this.configuration).v4SchemasGet(e).then(t=>t(this.axios,this.basePath))}v4SchemasPost(e={},t){return ot(this.configuration).v4SchemasPost(e.createSchemaBody,t).then(s=>s(this.axios,this.basePath))}v4SchemasSchemaIdDelete(e,t){return ot(this.configuration).v4SchemasSchemaIdDelete(e.schemaId,t).then(s=>s(this.axios,this.basePath))}v4SchemasSchemaIdGet(e,t){return ot(this.configuration).v4SchemasSchemaIdGet(e.schemaId,t).then(s=>s(this.axios,this.basePath))}v4SchemasSchemaIdPut(e,t){return ot(this.configuration).v4SchemasSchemaIdPut(e.schemaId,e.updateSchemaBody,t).then(s=>s(this.axios,this.basePath))}};var bi=function(o){return {v4ChangesChangeIdGet:async(e,t,s,a={})=>{S("v4ChangesChangeIdGet","changeId",e);let i="/v4/changes/{changeId}".replace("{changeId}",encodeURIComponent(String(e))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),await re(d,o),d.Accept="application/json",t!=null&&(d["x-api-key"]=String(t)),s!=null&&(d.Authorization=String(s)),k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4ChangesFilesEncodedPathGet:async(e,t,s,a={})=>{S("v4ChangesFilesEncodedPathGet","encodedPath",e);let i="/v4/changes/files/{encodedPath}".replace("{encodedPath}",encodeURIComponent(String(e))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),await re(d,o),d.Accept="application/pdf",t!=null&&(d["x-api-key"]=String(t)),s!=null&&(d.Authorization=String(s)),k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4ChangesGet:async(e,t,s,a,i,n,r,l,d={})=>{let c="/v4/changes",p=new A(c,x),m;o&&(m=o.baseOptions);let R={method:"GET",...m,...d},u={},w={};await I(u,"x-api-key",o),await re(u,o),s!==void 0&&(w.workflowIds=s),a!==void 0&&(w.startDate=a instanceof Date?a.toISOString():a),i!==void 0&&(w.endDate=i instanceof Date?i.toISOString():i),n!==void 0&&(w.skip=n),r!==void 0&&(w.limit=r),l!==void 0&&(w.exclude=l),u.Accept="application/json",e!=null&&(u["x-api-key"]=String(e)),t!=null&&(u.Authorization=String(t)),k(p,w);let h=m&&m.headers?m.headers:{};return R.headers={...u,...h,...d.headers},{url:V(p),options:R}},v4WorkflowsBulkPost:async(e,t={})=>{S("v4WorkflowsBulkPost","v4WorkflowsBulkPostRequest",e);let s="/v4/workflows/bulk",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4WorkflowsGet:async(e,t,s,a,i,n,r,l,d,c,p,m,R,u,w={})=>{let h="/v4/workflows",b=new A(h,x),G;o&&(G=o.baseOptions);let q={method:"GET",...G,...w},D={},N={};await I(D,"x-api-key",o),e!==void 0&&(N.search=e),t!==void 0&&(N.skip=t),s!==void 0&&(N.limit=s),a!==void 0&&(N.state=a),i!==void 0&&(N.runState=i),n!==void 0&&(N.displayState=n),r!==void 0&&(N.inSupport=r),l&&(N.tags=l),d!==void 0&&(N.userId=d),c!==void 0&&(N.monitoring=c),p!==void 0&&(N.updateInterval=p),m!==void 0&&(N.templateId=m),R!==void 0&&(N.includeDeleted=R),u!==void 0&&(N.format=u),D.Accept="application/json",k(b,N);let X=G&&G.headers?G.headers:{};return q.headers={...D,...X,...w.headers},{url:V(b),options:q}},v4WorkflowsPost:async(e,t={})=>{let s="/v4/workflows/",a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await I(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4WorkflowsWorkflowIdAuditlogGet:async(e,t,s,a,i,n={})=>{S("v4WorkflowsWorkflowIdAuditlogGet","workflowId",e);let r="/v4/workflows/{workflowId}/auditlog".replace("{workflowId}",encodeURIComponent(String(e))),l=new A(r,x),d;o&&(d=o.baseOptions);let c={method:"GET",...d,...n},p={},m={};await I(p,"x-api-key",o),await re(p,o),a!==void 0&&(m.page=a),i!==void 0&&(m.limit=i),p.Accept="application/json",t!=null&&(p["x-api-key"]=String(t)),s!=null&&(p.Authorization=String(s)),k(l,m);let R=d&&d.headers?d.headers:{};return c.headers={...p,...R,...n.headers},{url:V(l),options:c}},v4WorkflowsWorkflowIdComplianceApprovePut:async(e,t,s,a={})=>{S("v4WorkflowsWorkflowIdComplianceApprovePut","workflowId",e);let i="/v4/workflows/{workflowId}/compliance-approve".replace("{workflowId}",encodeURIComponent(String(e))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"PUT",...r,...a},d={},c={};await I(d,"x-api-key",o),d.Accept="application/json",t!=null&&(d["x-api-key"]=String(t)),s!=null&&(d.Authorization=String(s)),k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v4WorkflowsWorkflowIdComplianceRejectPut:async(e,t,s,a,i={})=>{S("v4WorkflowsWorkflowIdComplianceRejectPut","workflowId",e),S("v4WorkflowsWorkflowIdComplianceRejectPut","v4WorkflowsWorkflowIdComplianceRejectPutRequest",t);let n="/v4/workflows/{workflowId}/compliance-reject".replace("{workflowId}",encodeURIComponent(String(e))),r=new A(n,x),l;o&&(l=o.baseOptions);let d={method:"PUT",...l,...i},c={},p={};await I(c,"x-api-key",o),c["Content-Type"]="application/json",c.Accept="application/json",s!=null&&(c["x-api-key"]=String(s)),a!=null&&(c.Authorization=String(a)),k(r,p);let m=l&&l.headers?l.headers:{};return d.headers={...c,...m,...i.headers},d.data=O(t,d,o),{url:V(r),options:d}},v4WorkflowsWorkflowIdDataGet:async(e,t,s,a,i,n,r,l,d,c,p,m,R,u={})=>{S("v4WorkflowsWorkflowIdDataGet","workflowId",e);let w="/v4/workflows/{workflowId}/data".replace("{workflowId}",encodeURIComponent(String(e))),h=new A(w,x),b;o&&(b=o.baseOptions);let G={method:"GET",...b,...u},q={},D={};await I(q,"x-api-key",o),await re(q,o),a!==void 0&&(D.runId=a),i!==void 0&&(D.format=i),n!==void 0&&(D.sortBy=n),r!==void 0&&(D.order=r),l!==void 0&&(D.filters=l),d!==void 0&&(D.page=d),c!==void 0&&(D.limit=c),p!==void 0&&(D.gzip=p),m!==void 0&&(D.rowIds=m),R!==void 0&&(D.includeAnomalies=R),q.Accept="application/json,text/csv",t!=null&&(q["x-api-key"]=String(t)),s!=null&&(q.Authorization=String(s)),k(h,D);let N=b&&b.headers?b.headers:{};return G.headers={...q,...N,...u.headers},{url:V(h),options:G}},v4WorkflowsWorkflowIdDelete:async(e,t={})=>{S("v4WorkflowsWorkflowIdDelete","workflowId",e);let s="/v4/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="text/plain",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdGet:async(e,t={})=>{S("v4WorkflowsWorkflowIdGet","workflowId",e);let s="/v4/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdHistoryGet:async(e,t={})=>{S("v4WorkflowsWorkflowIdHistoryGet","workflowId",e);let s="/v4/workflows/{workflowId}/history".replace("{workflowId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdJobsJobIdGet:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdJobsJobIdGet","workflowId",e),S("v4WorkflowsWorkflowIdJobsJobIdGet","jobId",t);let a="/v4/workflows/{workflowId}/jobs/{jobId}".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v4WorkflowsWorkflowIdMetadataPut:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdMetadataPut","workflowId",e),S("v4WorkflowsWorkflowIdMetadataPut","v4WorkflowsWorkflowIdMetadataPutRequest",t);let a="/v4/workflows/{workflowId}/metadata".replace("{workflowId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4WorkflowsWorkflowIdPausePut:async(e,t={})=>{S("v4WorkflowsWorkflowIdPausePut","workflowId",e);let s="/v4/workflows/{workflowId}/pause".replace("{workflowId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"PUT",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="text/plain",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdResumePut:async(e,t={})=>{S("v4WorkflowsWorkflowIdResumePut","workflowId",e);let s="/v4/workflows/{workflowId}/resume".replace("{workflowId}",encodeURIComponent(String(e))),a=new A(s,x),i;o&&(i=o.baseOptions);let n={method:"PUT",...i,...t},r={},l={};await I(r,"x-api-key",o),r.Accept="application/json",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdRunPut:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdRunPut","workflowId",e);let a="/v4/workflows/{workflowId}/run".replace("{workflowId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4WorkflowsWorkflowIdSchedulePut:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdSchedulePut","workflowId",e),S("v4WorkflowsWorkflowIdSchedulePut","v4WorkflowsWorkflowIdSchedulePutRequest",t);let a="/v4/workflows/{workflowId}/schedule".replace("{workflowId}",encodeURIComponent(String(e))),i=new A(a,x),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},d={};await I(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="text/plain",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v5ChangesChangeIdGet:async(e,t,s,a={})=>{S("v5ChangesChangeIdGet","changeId",e);let i="/v5/changes/{changeId}".replace("{changeId}",encodeURIComponent(String(e))),n=new A(i,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),await re(d,o),d.Accept="application/json",t!=null&&(d["x-api-key"]=String(t)),s!=null&&(d.Authorization=String(s)),k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},{url:V(n),options:l}},v5ChangesGet:async(e,t,s,a,i,n,r,l={})=>{let d="/v5/changes",c=new A(d,x),p;o&&(p=o.baseOptions);let m={method:"GET",...p,...l},R={},u={};await I(R,"x-api-key",o),await re(R,o),s!==void 0&&(u.workflowIds=s),a!==void 0&&(u.startDate=a instanceof Date?a.toISOString():a),i!==void 0&&(u.endDate=i instanceof Date?i.toISOString():i),n!==void 0&&(u.skip=n),r!==void 0&&(u.limit=r),R.Accept="application/json",e!=null&&(R["x-api-key"]=String(e)),t!=null&&(R.Authorization=String(t)),k(c,u);let w=p&&p.headers?p.headers:{};return m.headers={...R,...w,...l.headers},{url:V(c),options:m}},v5WorkflowsWorkflowIdAuditlogGet:async(e,t,s,a,i,n={})=>{S("v5WorkflowsWorkflowIdAuditlogGet","workflowId",e);let r="/v5/workflows/{workflowId}/auditlog".replace("{workflowId}",encodeURIComponent(String(e))),l=new A(r,x),d;o&&(d=o.baseOptions);let c={method:"GET",...d,...n},p={},m={};await I(p,"x-api-key",o),await re(p,o),a!==void 0&&(m.page=a),i!==void 0&&(m.limit=i),p.Accept="application/json",t!=null&&(p["x-api-key"]=String(t)),s!=null&&(p.Authorization=String(s)),k(l,m);let R=d&&d.headers?d.headers:{};return c.headers={...p,...R,...n.headers},{url:V(l),options:c}}}},F=function(o){let e=bi(o);return {async v4ChangesChangeIdGet(t,s,a,i){let n=await e.v4ChangesChangeIdGet(t,s,a,i),r=o?.serverIndex??0,l=C["WorkflowsApi.v4ChangesChangeIdGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4ChangesFilesEncodedPathGet(t,s,a,i){let n=await e.v4ChangesFilesEncodedPathGet(t,s,a,i),r=o?.serverIndex??0,l=C["WorkflowsApi.v4ChangesFilesEncodedPathGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4ChangesGet(t,s,a,i,n,r,l,d,c){let p=await e.v4ChangesGet(t,s,a,i,n,r,l,d,c),m=o?.serverIndex??0,R=C["WorkflowsApi.v4ChangesGet"]?.[m]?.url;return (u,w)=>v(p,g,y,o)(u,R||w)},async v4WorkflowsBulkPost(t,s){let a=await e.v4WorkflowsBulkPost(t,s),i=o?.serverIndex??0,n=C["WorkflowsApi.v4WorkflowsBulkPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsGet(t,s,a,i,n,r,l,d,c,p,m,R,u,w,h){let b=await e.v4WorkflowsGet(t,s,a,i,n,r,l,d,c,p,m,R,u,w,h),G=o?.serverIndex??0,q=C["WorkflowsApi.v4WorkflowsGet"]?.[G]?.url;return (D,N)=>v(b,g,y,o)(D,q||N)},async v4WorkflowsPost(t,s){let a=await e.v4WorkflowsPost(t,s),i=o?.serverIndex??0,n=C["WorkflowsApi.v4WorkflowsPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r){let l=await e.v4WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r),d=o?.serverIndex??0,c=C["WorkflowsApi.v4WorkflowsWorkflowIdAuditlogGet"]?.[d]?.url;return (p,m)=>v(l,g,y,o)(p,c||m)},async v4WorkflowsWorkflowIdComplianceApprovePut(t,s,a,i){let n=await e.v4WorkflowsWorkflowIdComplianceApprovePut(t,s,a,i),r=o?.serverIndex??0,l=C["WorkflowsApi.v4WorkflowsWorkflowIdComplianceApprovePut"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v4WorkflowsWorkflowIdComplianceRejectPut(t,s,a,i,n){let r=await e.v4WorkflowsWorkflowIdComplianceRejectPut(t,s,a,i,n),l=o?.serverIndex??0,d=C["WorkflowsApi.v4WorkflowsWorkflowIdComplianceRejectPut"]?.[l]?.url;return (c,p)=>v(r,g,y,o)(c,d||p)},async v4WorkflowsWorkflowIdDataGet(t,s,a,i,n,r,l,d,c,p,m,R,u,w){let h=await e.v4WorkflowsWorkflowIdDataGet(t,s,a,i,n,r,l,d,c,p,m,R,u,w),b=o?.serverIndex??0,G=C["WorkflowsApi.v4WorkflowsWorkflowIdDataGet"]?.[b]?.url;return (q,D)=>v(h,g,y,o)(q,G||D)},async v4WorkflowsWorkflowIdDelete(t,s){let a=await e.v4WorkflowsWorkflowIdDelete(t,s),i=o?.serverIndex??0,n=C["WorkflowsApi.v4WorkflowsWorkflowIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdGet(t,s){let a=await e.v4WorkflowsWorkflowIdGet(t,s),i=o?.serverIndex??0,n=C["WorkflowsApi.v4WorkflowsWorkflowIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdHistoryGet(t,s){let a=await e.v4WorkflowsWorkflowIdHistoryGet(t,s),i=o?.serverIndex??0,n=C["WorkflowsApi.v4WorkflowsWorkflowIdHistoryGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdJobsJobIdGet(t,s,a){let i=await e.v4WorkflowsWorkflowIdJobsJobIdGet(t,s,a),n=o?.serverIndex??0,r=C["WorkflowsApi.v4WorkflowsWorkflowIdJobsJobIdGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4WorkflowsWorkflowIdMetadataPut(t,s,a){let i=await e.v4WorkflowsWorkflowIdMetadataPut(t,s,a),n=o?.serverIndex??0,r=C["WorkflowsApi.v4WorkflowsWorkflowIdMetadataPut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4WorkflowsWorkflowIdPausePut(t,s){let a=await e.v4WorkflowsWorkflowIdPausePut(t,s),i=o?.serverIndex??0,n=C["WorkflowsApi.v4WorkflowsWorkflowIdPausePut"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdResumePut(t,s){let a=await e.v4WorkflowsWorkflowIdResumePut(t,s),i=o?.serverIndex??0,n=C["WorkflowsApi.v4WorkflowsWorkflowIdResumePut"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdRunPut(t,s,a){let i=await e.v4WorkflowsWorkflowIdRunPut(t,s,a),n=o?.serverIndex??0,r=C["WorkflowsApi.v4WorkflowsWorkflowIdRunPut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4WorkflowsWorkflowIdSchedulePut(t,s,a){let i=await e.v4WorkflowsWorkflowIdSchedulePut(t,s,a),n=o?.serverIndex??0,r=C["WorkflowsApi.v4WorkflowsWorkflowIdSchedulePut"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v5ChangesChangeIdGet(t,s,a,i){let n=await e.v5ChangesChangeIdGet(t,s,a,i),r=o?.serverIndex??0,l=C["WorkflowsApi.v5ChangesChangeIdGet"]?.[r]?.url;return (d,c)=>v(n,g,y,o)(d,l||c)},async v5ChangesGet(t,s,a,i,n,r,l,d){let c=await e.v5ChangesGet(t,s,a,i,n,r,l,d),p=o?.serverIndex??0,m=C["WorkflowsApi.v5ChangesGet"]?.[p]?.url;return (R,u)=>v(c,g,y,o)(R,m||u)},async v5WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r){let l=await e.v5WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r),d=o?.serverIndex??0,c=C["WorkflowsApi.v5WorkflowsWorkflowIdAuditlogGet"]?.[d]?.url;return (p,m)=>v(l,g,y,o)(p,c||m)}}};var at=class extends oe{v4ChangesChangeIdGet(e,t){return F(this.configuration).v4ChangesChangeIdGet(e.changeId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4ChangesFilesEncodedPathGet(e,t){return F(this.configuration).v4ChangesFilesEncodedPathGet(e.encodedPath,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4ChangesGet(e={},t){return F(this.configuration).v4ChangesGet(e.xApiKey,e.authorization,e.workflowIds,e.startDate,e.endDate,e.skip,e.limit,e.exclude,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsBulkPost(e,t){return F(this.configuration).v4WorkflowsBulkPost(e.v4WorkflowsBulkPostRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsGet(e={},t){return F(this.configuration).v4WorkflowsGet(e.search,e.skip,e.limit,e.state,e.runState,e.displayState,e.inSupport,e.tags,e.userId,e.monitoring,e.updateInterval,e.templateId,e.includeDeleted,e.format,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsPost(e={},t){return F(this.configuration).v4WorkflowsPost(e.createWorkflowBody,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdAuditlogGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdAuditlogGet(e.workflowId,e.xApiKey,e.authorization,e.page,e.limit,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdComplianceApprovePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdComplianceApprovePut(e.workflowId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdComplianceRejectPut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdComplianceRejectPut(e.workflowId,e.v4WorkflowsWorkflowIdComplianceRejectPutRequest,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdDataGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdDataGet(e.workflowId,e.xApiKey,e.authorization,e.runId,e.format,e.sortBy,e.order,e.filters,e.page,e.limit,e.gzip,e.rowIds,e.includeAnomalies,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdDelete(e,t){return F(this.configuration).v4WorkflowsWorkflowIdDelete(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdHistoryGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdHistoryGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdJobsJobIdGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdJobsJobIdGet(e.workflowId,e.jobId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdMetadataPut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdMetadataPut(e.workflowId,e.v4WorkflowsWorkflowIdMetadataPutRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdPausePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdPausePut(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdResumePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdResumePut(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdRunPut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdRunPut(e.workflowId,e.v4WorkflowsWorkflowIdRunPutRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdSchedulePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdSchedulePut(e.workflowId,e.v4WorkflowsWorkflowIdSchedulePutRequest,t).then(s=>s(this.axios,this.basePath))}v5ChangesChangeIdGet(e,t){return F(this.configuration).v5ChangesChangeIdGet(e.changeId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v5ChangesGet(e={},t){return F(this.configuration).v5ChangesGet(e.xApiKey,e.authorization,e.workflowIds,e.startDate,e.endDate,e.skip,e.limit,t).then(s=>s(this.axios,this.basePath))}v5WorkflowsWorkflowIdAuditlogGet(e,t){return F(this.configuration).v5WorkflowsWorkflowIdAuditlogGet(e.workflowId,e.xApiKey,e.authorization,e.page,e.limit,t).then(s=>s(this.axios,this.basePath))}};var it=class{constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.awsv4=e.awsv4,this.basePath=e.basePath,this.serverIndex=e.serverIndex,this.baseOptions={...e.baseOptions,headers:{...e.baseOptions?.headers}},this.formDataCtor=e.formDataCtor;}isJsonMime(e){let t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(t.test(e)||e.toLowerCase()==="application/json-patch+json")}};var ee={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Date:"DATE",Datetime:"DATETIME",Money:"MONEY",Image:"IMAGE",Link:"LINK",Object:"OBJECT",Array:"ARRAY"};var Di={Done:"DONE",Crawling:"CRAWLING",Pending:"PENDING"};var nt=class{constructor(e){this.client=e;}get api(){return this.client.apis.crawler}async createConfig(e){return (await this.api.v4CrawlConfigPost({createCrawlerConfigRequest:e})).data}async getConfig(e){return (await this.api.v4CrawlConfigConfigIdGet({configId:e})).data}async deleteConfig(e){return (await this.api.v4CrawlConfigDelete({deleteCrawlerConfigRequest:{configId:e}})).data}};var rt=class{constructor(e){this.client=e;}get api(){return this.client.apis.crawler}async start(e){return (await this.api.v4CrawlPost({startCrawlerSessionRequest:e})).data}async startWithConfig(e){return (await this.api.v4CrawlStartPost({startSessionWithConfigRequest:e})).data}async pause(e){return (await this.api.v4CrawlPausePost({pauseCrawlerSessionRequest:{sessionId:e}})).data}async resume(e){return (await this.api.v4CrawlResumePost({resumeCrawlerSessionRequest:{sessionId:e}})).data}async listSessions(e){return (await this.api.v4CrawlSessionsGet({page:e?.page,pageSize:e?.pageSize,userId:e?.userId})).data.data??[]}async getSessionStatus(e){return (await this.api.v4CrawlSessionIdStatusGet({sessionId:e})).data}async getPages(e,t){return (await this.api.v4CrawlSessionIdPagesGet({sessionId:e,currentPage:t?.currentPage,pageSize:t?.pageSize})).data}async getPage(e,t,s){return (await this.api.v4CrawlSessionIdPagesPageIdGet({sessionId:e,pageId:t,format:s?.format})).data}async getAllSessionData(e,t){return (await this.api.v4CrawlSessionIdListGet({sessionId:e,includeAll:t?.includeAll})).data}async getBucketFile(e){return (await this.api.v4CrawlBucketDataFilenameb64Get({filenameb64:e})).data}};function ko(o){return {config:new nt(o),session:new rt(o)}}var Vo=class{},Ei={String:ee.String,Number:ee.Number,Boolean:ee.Boolean,Date:ee.Date,Datetime:ee.Datetime,Money:ee.Money,Image:ee.Image,Link:ee.Link,Object:ee.Object,Array:ee.Array},Oi={...Ei,Text:ee.String,Url:ee.Link};var Ne=class{constructor(e){this.fetchPage=e;}async fetchAll(e={}){let t=[],s=1,a=true;for(;a;){let i=await this.fetchPage({...e,page:s});t.push(...i.data);let n=i.pagination;a=n.page!==void 0&&n.totalPages!==void 0&&n.page<n.totalPages,s++;}return t}async*pages(e={}){let t=1,s=true;for(;s;){let a=await this.fetchPage({...e,page:t});yield a;let i=a.pagination;s=i.page!==void 0&&i.totalPages!==void 0&&i.page<i.totalPages,t++;}}async*items(e={}){for await(let t of this.pages(e))for(let s of t.data)yield s;}};var lt=class{constructor(e){this.workflowsApi=e;this.defaultLimit=100;}async fetchData(e){return (await this.workflowsApi.v4WorkflowsWorkflowIdDataGet({...e,page:e.page??1,limit:e.limit??this.defaultLimit})).data}async fetchAllData(e){return new Ne(s=>this.fetchData({...e,...s})).fetchAll({limit:e.limit??this.defaultLimit})}async*fetchDataPages(e){let t=new Ne(s=>this.fetchData({...e,...s}));for await(let s of t.pages({limit:e.limit??this.defaultLimit}))yield s;}};var de={VALIDATION_ERROR:"VALIDATION_ERROR",BAD_REQUEST:"BAD_REQUEST",NOT_FOUND:"NOT_FOUND",INTERNAL_ERROR:"INTERNAL_ERROR"},le=class le extends Error{constructor(e,t){super(e),this.name="KadoaSdkException",this.code=t?.code??"UNKNOWN",this.details=t?.details,t&&"cause"in t&&(this.cause=t.cause),Error.captureStackTrace?.(this,le);}static from(e,t){if(e instanceof le)return e;let s=e instanceof Error?e.message:typeof e=="string"?e:"Unexpected error";return new le(s,{code:"UNKNOWN",details:t,cause:e})}toJSON(){return {name:this.name,message:this.message,code:this.code,details:this.details}}toString(){return [this.name,this.code,this.message].filter(Boolean).join(": ")}toDetailedString(){let e=[`${this.name}: ${this.message}`,`Code: ${this.code}`];return this.details&&Object.keys(this.details).length>0&&e.push(`Details: ${JSON.stringify(this.details,null,2)}`),this.cause&&e.push(`Cause: ${this.cause}`),e.join(`
1
+ var KadoaSDK=(function(exports,L){'use strict';function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var L__default=/*#__PURE__*/_interopDefault(L);var Zs=Object.create;var zt=Object.defineProperty;var ea=Object.getOwnPropertyDescriptor;var ta=Object.getOwnPropertyNames;var oa=Object.getPrototypeOf,sa=Object.prototype.hasOwnProperty;var aa=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});var Qt=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports),ia=(o,e)=>{for(var t in e)zt(o,t,{get:e[t],enumerable:true});},na=(o,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of ta(e))!sa.call(o,a)&&a!==t&&zt(o,a,{get:()=>e[a],enumerable:!(s=ea(e,a))||s.enumerable});return o};var ra=(o,e,t)=>(t=o!=null?Zs(oa(o)):{},na(!o||!o.__esModule?zt(t,"default",{value:o,enumerable:true}):t,o));var Ps=Qt((pp,Ss)=>{var Te=1e3,Fe=Te*60,Be=Fe*60,Ae=Be*24,Ni=Ae*7,Gi=Ae*365.25;Ss.exports=function(o,e){e=e||{};var t=typeof o;if(t==="string"&&o.length>0)return Ti(o);if(t==="number"&&isFinite(o))return e.long?Bi(o):Fi(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function Ti(o){if(o=String(o),!(o.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(e){var t=parseFloat(e[1]),s=(e[2]||"ms").toLowerCase();switch(s){case "years":case "year":case "yrs":case "yr":case "y":return t*Gi;case "weeks":case "week":case "w":return t*Ni;case "days":case "day":case "d":return t*Ae;case "hours":case "hour":case "hrs":case "hr":case "h":return t*Be;case "minutes":case "minute":case "mins":case "min":case "m":return t*Fe;case "seconds":case "second":case "secs":case "sec":case "s":return t*Te;case "milliseconds":case "millisecond":case "msecs":case "msec":case "ms":return t;default:return}}}}function Fi(o){var e=Math.abs(o);return e>=Ae?Math.round(o/Ae)+"d":e>=Be?Math.round(o/Be)+"h":e>=Fe?Math.round(o/Fe)+"m":e>=Te?Math.round(o/Te)+"s":o+"ms"}function Bi(o){var e=Math.abs(o);return e>=Ae?Bt(o,e,Ae,"day"):e>=Be?Bt(o,e,Be,"hour"):e>=Fe?Bt(o,e,Fe,"minute"):e>=Te?Bt(o,e,Te,"second"):o+" ms"}function Bt(o,e,t,s){var a=e>=t*1.5;return Math.round(o/t)+" "+s+(a?"s":"")}});var bs=Qt((fp,Ws)=>{function Ui(o){t.debug=t,t.default=t,t.coerce=l,t.disable=n,t.enable=a,t.enabled=r,t.humanize=Ps(),t.destroy=c,Object.keys(o).forEach(d=>{t[d]=o[d];}),t.names=[],t.skips=[],t.formatters={};function e(d){let p=0;for(let m=0;m<d.length;m++)p=(p<<5)-p+d.charCodeAt(m),p|=0;return t.colors[Math.abs(p)%t.colors.length]}t.selectColor=e;function t(d){let p,m=null,R,u;function w(...h){if(!w.enabled)return;let b=w,G=Number(new Date),q=G-(p||G);b.diff=q,b.prev=p,b.curr=G,p=G,h[0]=t.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let D=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(X,H)=>{if(X==="%%")return "%";D++;let Ve=t.formatters[H];if(typeof Ve=="function"){let ve=h[D];X=Ve.call(b,ve),h.splice(D,1),D--;}return X}),t.formatArgs.call(b,h),(b.log||t.log).apply(b,h);}return w.namespace=d,w.useColors=t.useColors(),w.color=t.selectColor(d),w.extend=s,w.destroy=t.destroy,Object.defineProperty(w,"enabled",{enumerable:true,configurable:false,get:()=>m!==null?m:(R!==t.namespaces&&(R=t.namespaces,u=t.enabled(d)),u),set:h=>{m=h;}}),typeof t.init=="function"&&t.init(w),w}function s(d,p){let m=t(this.namespace+(typeof p>"u"?":":p)+d);return m.log=this.log,m}function a(d){t.save(d),t.namespaces=d,t.names=[],t.skips=[];let p=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of p)m[0]==="-"?t.skips.push(m.slice(1)):t.names.push(m);}function i(d,p){let m=0,R=0,u=-1,w=0;for(;m<d.length;)if(R<p.length&&(p[R]===d[m]||p[R]==="*"))p[R]==="*"?(u=R,w=m,R++):(m++,R++);else if(u!==-1)R=u+1,w++,m=w;else return false;for(;R<p.length&&p[R]==="*";)R++;return R===p.length}function n(){let d=[...t.names,...t.skips.map(p=>"-"+p)].join(",");return t.enable(""),d}function r(d){for(let p of t.skips)if(i(d,p))return false;for(let p of t.names)if(i(d,p))return true;return false}function l(d){return d instanceof Error?d.stack||d.message:d}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");}return t.enable(t.load()),t}Ws.exports=Ui;});var Ds=Qt((Q,Ut)=>{Q.formatArgs=Li;Q.save=ji;Q.load=Mi;Q.useColors=_i;Q.storage=Ji();Q.destroy=(()=>{let o=false;return ()=>{o||(o=true,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));}})();Q.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function _i(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return true;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return false;let o;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(o=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(o[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Li(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+Ut.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;o.splice(1,0,e,"color: inherit");let t=0,s=0;o[0].replace(/%[a-zA-Z%]/g,a=>{a!=="%%"&&(t++,a==="%c"&&(s=t));}),o.splice(s,0,e);}Q.log=console.debug||console.log||(()=>{});function ji(o){try{o?Q.storage.setItem("debug",o):Q.storage.removeItem("debug");}catch{}}function Mi(){let o;try{o=Q.storage.getItem("debug")||Q.storage.getItem("DEBUG");}catch{}return !o&&typeof process<"u"&&"env"in process&&(o=process.env.DEBUG),o}function Ji(){try{return localStorage}catch{}}Ut.exports=bs()(Q);var{formatters:Hi}=Ut.exports;Hi.j=function(o){try{return JSON.stringify(o)}catch(e){return "[UnexpectedJSONParseError]: "+e.message}};});function je(o,e){return function(){return o.apply(e,arguments)}}var{toString:la}=Object.prototype,{getPrototypeOf:Xt}=Object,{iterator:It,toStringTag:Jo}=Symbol,Vt=(o=>e=>{let t=la.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),ae=o=>(o=o.toLowerCase(),e=>Vt(e)===o),vt=o=>e=>typeof e===o,{isArray:We}=Array,Pe=vt("undefined");function Me(o){return o!==null&&!Pe(o)&&o.constructor!==null&&!Pe(o.constructor)&&$(o.constructor.isBuffer)&&o.constructor.isBuffer(o)}var Ho=ae("ArrayBuffer");function ca(o){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(o):e=o&&o.buffer&&Ho(o.buffer),e}var da=vt("string"),$=vt("function"),Ko=vt("number"),Je=o=>o!==null&&typeof o=="object",pa=o=>o===true||o===false,xt=o=>{if(Vt(o)!=="object")return false;let e=Xt(o);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Jo in o)&&!(It in o)},fa=o=>{if(!Je(o)||Me(o))return false;try{return Object.keys(o).length===0&&Object.getPrototypeOf(o)===Object.prototype}catch{return false}},ua=ae("Date"),ma=ae("File"),wa=o=>!!(o&&typeof o.uri<"u"),ha=o=>o&&typeof o.getParts<"u",Ra=ae("Blob"),ga=ae("FileList"),ya=o=>Je(o)&&$(o.pipe);function Ca(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"||typeof window<"u"?window:{}}var Lo=Ca(),jo=typeof Lo.FormData<"u"?Lo.FormData:void 0,Aa=o=>{let e;return o&&(jo&&o instanceof jo||$(o.append)&&((e=Vt(o))==="formdata"||e==="object"&&$(o.toString)&&o.toString()==="[object FormData]"))},ka=ae("URLSearchParams"),[xa,Ia,Va,va]=["ReadableStream","Request","Response","Headers"].map(ae),Sa=o=>o.trim?o.trim():o.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function He(o,e,{allOwnKeys:t=false}={}){if(o===null||typeof o>"u")return;let s,a;if(typeof o!="object"&&(o=[o]),We(o))for(s=0,a=o.length;s<a;s++)e.call(null,o[s],s,o);else {if(Me(o))return;let i=t?Object.getOwnPropertyNames(o):Object.keys(o),n=i.length,r;for(s=0;s<n;s++)r=i[s],e.call(null,o[r],r,o);}}function $o(o,e){if(Me(o))return null;e=e.toLowerCase();let t=Object.keys(o),s=t.length,a;for(;s-- >0;)if(a=t[s],e===a.toLowerCase())return a;return null}var Ce=typeof globalThis<"u"?globalThis:typeof self<"u"?self:window,zo=o=>!Pe(o)&&o!==Ce;function Yt(){let{caseless:o,skipUndefined:e}=zo(this)&&this||{},t={},s=(a,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;let n=o&&$o(t,i)||i;xt(t[n])&&xt(a)?t[n]=Yt(t[n],a):xt(a)?t[n]=Yt({},a):We(a)?t[n]=a.slice():(!e||!Pe(a))&&(t[n]=a);};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&He(arguments[a],s);return t}var Pa=(o,e,t,{allOwnKeys:s}={})=>(He(e,(a,i)=>{t&&$(a)?Object.defineProperty(o,i,{value:je(a,t),writable:true,enumerable:true,configurable:true}):Object.defineProperty(o,i,{value:a,writable:true,enumerable:true,configurable:true});},{allOwnKeys:s}),o),Wa=o=>(o.charCodeAt(0)===65279&&(o=o.slice(1)),o),ba=(o,e,t,s)=>{o.prototype=Object.create(e.prototype,s),Object.defineProperty(o.prototype,"constructor",{value:o,writable:true,enumerable:false,configurable:true}),Object.defineProperty(o,"super",{value:e.prototype}),t&&Object.assign(o.prototype,t);},Da=(o,e,t,s)=>{let a,i,n,r={};if(e=e||{},o==null)return e;do{for(a=Object.getOwnPropertyNames(o),i=a.length;i-- >0;)n=a[i],(!s||s(n,o,e))&&!r[n]&&(e[n]=o[n],r[n]=true);o=t!==false&&Xt(o);}while(o&&(!t||t(o,e))&&o!==Object.prototype);return e},Ea=(o,e,t)=>{o=String(o),(t===void 0||t>o.length)&&(t=o.length),t-=e.length;let s=o.indexOf(e,t);return s!==-1&&s===t},Oa=o=>{if(!o)return null;if(We(o))return o;let e=o.length;if(!Ko(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=o[e];return t},qa=(o=>e=>o&&e instanceof o)(typeof Uint8Array<"u"&&Xt(Uint8Array)),Na=(o,e)=>{let s=(o&&o[It]).call(o),a;for(;(a=s.next())&&!a.done;){let i=a.value;e.call(o,i[0],i[1]);}},Ga=(o,e)=>{let t,s=[];for(;(t=o.exec(e))!==null;)s.push(t);return s},Ta=ae("HTMLFormElement"),Fa=o=>o.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,a){return s.toUpperCase()+a}),Mo=(({hasOwnProperty:o})=>(e,t)=>o.call(e,t))(Object.prototype),Ba=ae("RegExp"),Qo=(o,e)=>{let t=Object.getOwnPropertyDescriptors(o),s={};He(t,(a,i)=>{let n;(n=e(a,i,o))!==false&&(s[i]=n||a);}),Object.defineProperties(o,s);},Ua=o=>{Qo(o,(e,t)=>{if($(o)&&["arguments","caller","callee"].indexOf(t)!==-1)return false;let s=o[t];if($(s)){if(e.enumerable=false,"writable"in e){e.writable=false;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")});}});},_a=(o,e)=>{let t={},s=a=>{a.forEach(i=>{t[i]=true;});};return We(o)?s(o):s(String(o).split(e)),t},La=()=>{},ja=(o,e)=>o!=null&&Number.isFinite(o=+o)?o:e;function Ma(o){return !!(o&&$(o.append)&&o[Jo]==="FormData"&&o[It])}var Ja=o=>{let e=new Array(10),t=(s,a)=>{if(Je(s)){if(e.indexOf(s)>=0)return;if(Me(s))return s;if(!("toJSON"in s)){e[a]=s;let i=We(s)?[]:{};return He(s,(n,r)=>{let l=t(n,a+1);!Pe(l)&&(i[r]=l);}),e[a]=void 0,i}}return s};return t(o,0)},Ha=ae("AsyncFunction"),Ka=o=>o&&(Je(o)||$(o))&&$(o.then)&&$(o.catch),Yo=((o,e)=>o?setImmediate:e?((t,s)=>(Ce.addEventListener("message",({source:a,data:i})=>{a===Ce&&i===t&&s.length&&s.shift()();},false),a=>{s.push(a),Ce.postMessage(t,"*");}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",$(Ce.postMessage)),$a=typeof queueMicrotask<"u"?queueMicrotask.bind(Ce):typeof process<"u"&&process.nextTick||Yo,za=o=>o!=null&&$(o[It]),f={isArray:We,isArrayBuffer:Ho,isBuffer:Me,isFormData:Aa,isArrayBufferView:ca,isString:da,isNumber:Ko,isBoolean:pa,isObject:Je,isPlainObject:xt,isEmptyObject:fa,isReadableStream:xa,isRequest:Ia,isResponse:Va,isHeaders:va,isUndefined:Pe,isDate:ua,isFile:ma,isReactNativeBlob:wa,isReactNative:ha,isBlob:Ra,isRegExp:Ba,isFunction:$,isStream:ya,isURLSearchParams:ka,isTypedArray:qa,isFileList:ga,forEach:He,merge:Yt,extend:Pa,trim:Sa,stripBOM:Wa,inherits:ba,toFlatObject:Da,kindOf:Vt,kindOfTest:ae,endsWith:Ea,toArray:Oa,forEachEntry:Na,matchAll:Ga,isHTMLForm:Ta,hasOwnProperty:Mo,hasOwnProp:Mo,reduceDescriptors:Qo,freezeMethods:Ua,toObjectSet:_a,toCamelCase:Fa,noop:La,toFiniteNumber:ja,findKey:$o,global:Ce,isContextDefined:zo,isSpecCompliantForm:Ma,toJSONObject:Ja,isAsyncFn:Ha,isThenable:Ka,setImmediate:Yo,asap:$a,isIterable:za};var J=class o extends Error{static from(e,t,s,a,i,n){let r=new o(e.message,t||e.code,s,a,i);return r.cause=e,r.name=e.name,e.status!=null&&r.status==null&&(r.status=e.status),n&&Object.assign(r,n),r}constructor(e,t,s,a,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:true,writable:true,configurable:true}),this.name="AxiosError",this.isAxiosError=true,t&&(this.code=t),s&&(this.config=s),a&&(this.request=a),i&&(this.response=i,this.status=i.status);}toJSON(){return {message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:f.toJSONObject(this.config),code:this.code,status:this.status}}};J.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";J.ERR_BAD_OPTION="ERR_BAD_OPTION";J.ECONNABORTED="ECONNABORTED";J.ETIMEDOUT="ETIMEDOUT";J.ERR_NETWORK="ERR_NETWORK";J.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";J.ERR_DEPRECATED="ERR_DEPRECATED";J.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";J.ERR_BAD_REQUEST="ERR_BAD_REQUEST";J.ERR_CANCELED="ERR_CANCELED";J.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";J.ERR_INVALID_URL="ERR_INVALID_URL";var W=J;var St=null;function eo(o){return f.isPlainObject(o)||f.isArray(o)}function Xo(o){return f.endsWith(o,"[]")?o.slice(0,-2):o}function Zt(o,e,t){return o?o.concat(e).map(function(a,i){return a=Xo(a),!t&&i?"["+a+"]":a}).join(t?".":""):e}function Qa(o){return f.isArray(o)&&!o.some(eo)}var Ya=f.toFlatObject(f,{},null,function(e){return /^is[A-Z]/.test(e)});function Xa(o,e,t){if(!f.isObject(o))throw new TypeError("target must be an object");e=e||new(FormData),t=f.toFlatObject(t,{metaTokens:true,dots:false,indexes:false},false,function(w,h){return !f.isUndefined(h[w])});let s=t.metaTokens,a=t.visitor||d,i=t.dots,n=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&f.isSpecCompliantForm(e);if(!f.isFunction(a))throw new TypeError("visitor must be a function");function c(u){if(u===null)return "";if(f.isDate(u))return u.toISOString();if(f.isBoolean(u))return u.toString();if(!l&&f.isBlob(u))throw new W("Blob is not supported. Use a Buffer instead.");return f.isArrayBuffer(u)||f.isTypedArray(u)?l&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function d(u,w,h){let b=u;if(f.isReactNative(e)&&f.isReactNativeBlob(u))return e.append(Zt(h,w,i),c(u)),false;if(u&&!h&&typeof u=="object"){if(f.endsWith(w,"{}"))w=s?w:w.slice(0,-2),u=JSON.stringify(u);else if(f.isArray(u)&&Qa(u)||(f.isFileList(u)||f.endsWith(w,"[]"))&&(b=f.toArray(u)))return w=Xo(w),b.forEach(function(q,D){!(f.isUndefined(q)||q===null)&&e.append(n===true?Zt([w],D,i):n===null?w:w+"[]",c(q));}),false}return eo(u)?true:(e.append(Zt(h,w,i),c(u)),false)}let p=[],m=Object.assign(Ya,{defaultVisitor:d,convertValue:c,isVisitable:eo});function R(u,w){if(!f.isUndefined(u)){if(p.indexOf(u)!==-1)throw Error("Circular reference detected in "+w.join("."));p.push(u),f.forEach(u,function(b,G){(!(f.isUndefined(b)||b===null)&&a.call(e,b,f.isString(G)?G.trim():G,w,m))===true&&R(b,w?w.concat(G):[G]);}),p.pop();}}if(!f.isObject(o))throw new TypeError("data must be an object");return R(o),e}var we=Xa;function Zo(o){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(o).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function es(o,e){this._pairs=[],o&&we(o,this,e);}var ts=es.prototype;ts.append=function(e,t){this._pairs.push([e,t]);};ts.toString=function(e){let t=e?function(s){return e.call(this,s,Zo)}:Zo;return this._pairs.map(function(a){return t(a[0])+"="+t(a[1])},"").join("&")};var Pt=es;function Za(o){return encodeURIComponent(o).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ke(o,e,t){if(!e)return o;let s=t&&t.encode||Za,a=f.isFunction(t)?{serialize:t}:t,i=a&&a.serialize,n;if(i?n=i(e,a):n=f.isURLSearchParams(e)?e.toString():new Pt(e,a).toString(s),n){let r=o.indexOf("#");r!==-1&&(o=o.slice(0,r)),o+=(o.indexOf("?")===-1?"?":"&")+n;}return o}var to=class{constructor(){this.handlers=[];}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:false,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null);}clear(){this.handlers&&(this.handlers=[]);}forEach(e){f.forEach(this.handlers,function(s){s!==null&&e(s);});}},oo=to;var be={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false,legacyInterceptorReqResOrdering:true};var os=typeof URLSearchParams<"u"?URLSearchParams:Pt;var ss=typeof FormData<"u"?FormData:null;var as=typeof Blob<"u"?Blob:null;var is={isBrowser:true,classes:{URLSearchParams:os,FormData:ss,Blob:as},protocols:["http","https","file","blob","url","data"]};var io={};ia(io,{hasBrowserEnv:()=>ao,hasStandardBrowserEnv:()=>ei,hasStandardBrowserWebWorkerEnv:()=>ti,navigator:()=>so,origin:()=>oi});var ao=typeof window<"u"&&typeof document<"u",so=typeof navigator=="object"&&navigator||void 0,ei=ao&&(!so||["ReactNative","NativeScript","NS"].indexOf(so.product)<0),ti=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",oi=ao&&window.location.href||"http://localhost";var T={...io,...is};function no(o,e){return we(o,new T.classes.URLSearchParams,{visitor:function(t,s,a,i){return T.isNode&&f.isBuffer(t)?(this.append(s,t.toString("base64")),false):i.defaultVisitor.apply(this,arguments)},...e})}function si(o){return f.matchAll(/\w+|\[(\w*)]/g,o).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ai(o){let e={},t=Object.keys(o),s,a=t.length,i;for(s=0;s<a;s++)i=t[s],e[i]=o[i];return e}function ii(o){function e(t,s,a,i){let n=t[i++];if(n==="__proto__")return true;let r=Number.isFinite(+n),l=i>=t.length;return n=!n&&f.isArray(a)?a.length:n,l?(f.hasOwnProp(a,n)?a[n]=[a[n],s]:a[n]=s,!r):((!a[n]||!f.isObject(a[n]))&&(a[n]=[]),e(t,s,a[n],i)&&f.isArray(a[n])&&(a[n]=ai(a[n])),!r)}if(f.isFormData(o)&&f.isFunction(o.entries)){let t={};return f.forEachEntry(o,(s,a)=>{e(si(s),a,t,0);}),t}return null}var Wt=ii;function ni(o,e,t){if(f.isString(o))try{return (e||JSON.parse)(o),f.trim(o)}catch(s){if(s.name!=="SyntaxError")throw s}return (t||JSON.stringify)(o)}var ro={transitional:be,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let s=t.getContentType()||"",a=s.indexOf("application/json")>-1,i=f.isObject(e);if(i&&f.isHTMLForm(e)&&(e=new FormData(e)),f.isFormData(e))return a?JSON.stringify(Wt(e)):e;if(f.isArrayBuffer(e)||f.isBuffer(e)||f.isStream(e)||f.isFile(e)||f.isBlob(e)||f.isReadableStream(e))return e;if(f.isArrayBufferView(e))return e.buffer;if(f.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",false),e.toString();let r;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return no(e,this.formSerializer).toString();if((r=f.isFileList(e))||s.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return we(r?{"files[]":e}:e,l&&new l,this.formSerializer)}}return i||a?(t.setContentType("application/json",false),ni(e)):e}],transformResponse:[function(e){let t=this.transitional||ro.transitional,s=t&&t.forcedJSONParsing,a=this.responseType==="json";if(f.isResponse(e)||f.isReadableStream(e))return e;if(e&&f.isString(e)&&(s&&!this.responseType||a)){let n=!(t&&t.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(r){if(n)throw r.name==="SyntaxError"?W.from(r,W.ERR_BAD_RESPONSE,this,null,this.response):r}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};f.forEach(["delete","get","head","post","put","patch"],o=>{ro.headers[o]={};});var De=ro;var ri=f.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ns=o=>{let e={},t,s,a;return o&&o.split(`
2
+ `).forEach(function(n){a=n.indexOf(":"),t=n.substring(0,a).trim().toLowerCase(),s=n.substring(a+1).trim(),!(!t||e[t]&&ri[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s);}),e};var rs=Symbol("internals");function $e(o){return o&&String(o).trim().toLowerCase()}function bt(o){return o===false||o==null?o:f.isArray(o)?o.map(bt):String(o)}function li(o){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,s;for(;s=t.exec(o);)e[s[1]]=s[2];return e}var ci=o=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(o.trim());function lo(o,e,t,s,a){if(f.isFunction(s))return s.call(this,e,t);if(a&&(e=t),!!f.isString(e)){if(f.isString(s))return e.indexOf(s)!==-1;if(f.isRegExp(s))return s.test(e)}}function di(o){return o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function pi(o,e){let t=f.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(o,s+t,{value:function(a,i,n){return this[s].call(this,e,a,i,n)},configurable:true});});}var Ee=class{constructor(e){e&&this.set(e);}set(e,t,s){let a=this;function i(r,l,c){let d=$e(l);if(!d)throw new Error("header name must be a non-empty string");let p=f.findKey(a,d);(!p||a[p]===void 0||c===true||c===void 0&&a[p]!==false)&&(a[p||l]=bt(r));}let n=(r,l)=>f.forEach(r,(c,d)=>i(c,d,l));if(f.isPlainObject(e)||e instanceof this.constructor)n(e,t);else if(f.isString(e)&&(e=e.trim())&&!ci(e))n(ns(e),t);else if(f.isObject(e)&&f.isIterable(e)){let r={},l,c;for(let d of e){if(!f.isArray(d))throw TypeError("Object iterator must return a key-value pair");r[c=d[0]]=(l=r[c])?f.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1];}n(r,t);}else e!=null&&i(t,e,s);return this}get(e,t){if(e=$e(e),e){let s=f.findKey(this,e);if(s){let a=this[s];if(!t)return a;if(t===true)return li(a);if(f.isFunction(t))return t.call(this,a,s);if(f.isRegExp(t))return t.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=$e(e),e){let s=f.findKey(this,e);return !!(s&&this[s]!==void 0&&(!t||lo(this,this[s],s,t)))}return false}delete(e,t){let s=this,a=false;function i(n){if(n=$e(n),n){let r=f.findKey(s,n);r&&(!t||lo(s,s[r],r,t))&&(delete s[r],a=true);}}return f.isArray(e)?e.forEach(i):i(e),a}clear(e){let t=Object.keys(this),s=t.length,a=false;for(;s--;){let i=t[s];(!e||lo(this,this[i],i,e,true))&&(delete this[i],a=true);}return a}normalize(e){let t=this,s={};return f.forEach(this,(a,i)=>{let n=f.findKey(s,i);if(n){t[n]=bt(a),delete t[i];return}let r=e?di(i):String(i).trim();r!==i&&delete t[i],t[r]=bt(a),s[r]=true;}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return f.forEach(this,(s,a)=>{s!=null&&s!==false&&(t[a]=e&&f.isArray(s)?s.join(", "):s);}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return "AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let s=new this(e);return t.forEach(a=>s.set(a)),s}static accessor(e){let s=(this[rs]=this[rs]={accessors:{}}).accessors,a=this.prototype;function i(n){let r=$e(n);s[r]||(pi(a,n),s[r]=true);}return f.isArray(e)?e.forEach(i):i(e),this}};Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);f.reduceDescriptors(Ee.prototype,({value:o},e)=>{let t=e[0].toUpperCase()+e.slice(1);return {get:()=>o,set(s){this[t]=s;}}});f.freezeMethods(Ee);var _=Ee;function ze(o,e){let t=this||De,s=e||t,a=_.from(s.headers),i=s.data;return f.forEach(o,function(r){i=r.call(t,i,a.normalize(),e?e.status:void 0);}),a.normalize(),i}function Qe(o){return !!(o&&o.__CANCEL__)}var co=class extends W{constructor(e,t,s){super(e??"canceled",W.ERR_CANCELED,t,s),this.name="CanceledError",this.__CANCEL__=true;}},ne=co;function Ye(o,e,t){let s=t.config.validateStatus;!t.status||!s||s(t.status)?o(t):e(new W("Request failed with status code "+t.status,[W.ERR_BAD_REQUEST,W.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t));}function po(o){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(o);return e&&e[1]||""}function fi(o,e){o=o||10;let t=new Array(o),s=new Array(o),a=0,i=0,n;return e=e!==void 0?e:1e3,function(l){let c=Date.now(),d=s[i];n||(n=c),t[a]=l,s[a]=c;let p=i,m=0;for(;p!==a;)m+=t[p++],p=p%o;if(a=(a+1)%o,a===i&&(i=(i+1)%o),c-n<e)return;let R=d&&c-d;return R?Math.round(m*1e3/R):void 0}}var ls=fi;function ui(o,e){let t=0,s=1e3/e,a,i,n=(c,d=Date.now())=>{t=d,a=null,i&&(clearTimeout(i),i=null),o(...c);};return [(...c)=>{let d=Date.now(),p=d-t;p>=s?n(c,d):(a=c,i||(i=setTimeout(()=>{i=null,n(a);},s-p)));},()=>a&&n(a)]}var cs=ui;var Oe=(o,e,t=3)=>{let s=0,a=ls(50,250);return cs(i=>{let n=i.loaded,r=i.lengthComputable?i.total:void 0,l=n-s,c=a(l),d=n<=r;s=n;let p={loaded:n,total:r,progress:r?n/r:void 0,bytes:l,rate:c||void 0,estimated:c&&r&&d?(r-n)/c:void 0,event:i,lengthComputable:r!=null,[e?"download":"upload"]:true};o(p);},t)},fo=(o,e)=>{let t=o!=null;return [s=>e[0]({lengthComputable:t,total:o,loaded:s}),e[1]]},uo=o=>(...e)=>f.asap(()=>o(...e));var ds=T.hasStandardBrowserEnv?((o,e)=>t=>(t=new URL(t,T.origin),o.protocol===t.protocol&&o.host===t.host&&(e||o.port===t.port)))(new URL(T.origin),T.navigator&&/(msie|trident)/i.test(T.navigator.userAgent)):()=>true;var ps=T.hasStandardBrowserEnv?{write(o,e,t,s,a,i,n){if(typeof document>"u")return;let r=[`${o}=${encodeURIComponent(e)}`];f.isNumber(t)&&r.push(`expires=${new Date(t).toUTCString()}`),f.isString(s)&&r.push(`path=${s}`),f.isString(a)&&r.push(`domain=${a}`),i===true&&r.push("secure"),f.isString(n)&&r.push(`SameSite=${n}`),document.cookie=r.join("; ");},read(o){if(typeof document>"u")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+o+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(o){this.write(o,"",Date.now()-864e5,"/");}}:{write(){},read(){return null},remove(){}};function mo(o){return typeof o!="string"?false:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(o)}function wo(o,e){return e?o.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):o}function Xe(o,e,t){let s=!mo(e);return o&&(s||t==false)?wo(o,e):e}var fs=o=>o instanceof _?{...o}:o;function ie(o,e){e=e||{};let t={};function s(c,d,p,m){return f.isPlainObject(c)&&f.isPlainObject(d)?f.merge.call({caseless:m},c,d):f.isPlainObject(d)?f.merge({},d):f.isArray(d)?d.slice():d}function a(c,d,p,m){if(f.isUndefined(d)){if(!f.isUndefined(c))return s(void 0,c,p,m)}else return s(c,d,p,m)}function i(c,d){if(!f.isUndefined(d))return s(void 0,d)}function n(c,d){if(f.isUndefined(d)){if(!f.isUndefined(c))return s(void 0,c)}else return s(void 0,d)}function r(c,d,p){if(p in e)return s(c,d);if(p in o)return s(void 0,c)}let l={url:i,method:i,data:i,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:r,headers:(c,d,p)=>a(fs(c),fs(d),p,true)};return f.forEach(Object.keys({...o,...e}),function(d){if(d==="__proto__"||d==="constructor"||d==="prototype")return;let p=f.hasOwnProp(l,d)?l[d]:a,m=p(o[d],e[d],d);f.isUndefined(m)&&p!==r||(t[d]=m);}),t}var Dt=o=>{let e=ie({},o),{data:t,withXSRFToken:s,xsrfHeaderName:a,xsrfCookieName:i,headers:n,auth:r}=e;if(e.headers=n=_.from(n),e.url=Ke(Xe(e.baseURL,e.url,e.allowAbsoluteUrls),o.params,o.paramsSerializer),r&&n.set("Authorization","Basic "+btoa((r.username||"")+":"+(r.password?unescape(encodeURIComponent(r.password)):""))),f.isFormData(t)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if(f.isFunction(t.getHeaders)){let l=t.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([d,p])=>{c.includes(d.toLowerCase())&&n.set(d,p);});}}if(T.hasStandardBrowserEnv&&(s&&f.isFunction(s)&&(s=s(e)),s||s!==false&&ds(e.url))){let l=a&&i&&ps.read(i);l&&n.set(a,l);}return e};var mi=typeof XMLHttpRequest<"u",us=mi&&function(o){return new Promise(function(t,s){let a=Dt(o),i=a.data,n=_.from(a.headers).normalize(),{responseType:r,onUploadProgress:l,onDownloadProgress:c}=a,d,p,m,R,u;function w(){R&&R(),u&&u(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d);}let h=new XMLHttpRequest;h.open(a.method.toUpperCase(),a.url,true),h.timeout=a.timeout;function b(){if(!h)return;let q=_.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),N={data:!r||r==="text"||r==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:q,config:o,request:h};Ye(function(H){t(H),w();},function(H){s(H),w();},N),h=null;}"onloadend"in h?h.onloadend=b:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(b);},h.onabort=function(){h&&(s(new W("Request aborted",W.ECONNABORTED,o,h)),h=null);},h.onerror=function(D){let N=D&&D.message?D.message:"Network Error",X=new W(N,W.ERR_NETWORK,o,h);X.event=D||null,s(X),h=null;},h.ontimeout=function(){let D=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",N=a.transitional||be;a.timeoutErrorMessage&&(D=a.timeoutErrorMessage),s(new W(D,N.clarifyTimeoutError?W.ETIMEDOUT:W.ECONNABORTED,o,h)),h=null;},i===void 0&&n.setContentType(null),"setRequestHeader"in h&&f.forEach(n.toJSON(),function(D,N){h.setRequestHeader(N,D);}),f.isUndefined(a.withCredentials)||(h.withCredentials=!!a.withCredentials),r&&r!=="json"&&(h.responseType=a.responseType),c&&([m,u]=Oe(c,true),h.addEventListener("progress",m)),l&&h.upload&&([p,R]=Oe(l),h.upload.addEventListener("progress",p),h.upload.addEventListener("loadend",R)),(a.cancelToken||a.signal)&&(d=q=>{h&&(s(!q||q.type?new ne(null,o,h):q),h.abort(),h=null);},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));let G=po(a.url);if(G&&T.protocols.indexOf(G)===-1){s(new W("Unsupported protocol "+G+":",W.ERR_BAD_REQUEST,o));return}h.send(i||null);})};var wi=(o,e)=>{let{length:t}=o=o?o.filter(Boolean):[];if(e||t){let s=new AbortController,a,i=function(c){if(!a){a=true,r();let d=c instanceof Error?c:this.reason;s.abort(d instanceof W?d:new ne(d instanceof Error?d.message:d));}},n=e&&setTimeout(()=>{n=null,i(new W(`timeout of ${e}ms exceeded`,W.ETIMEDOUT));},e),r=()=>{o&&(n&&clearTimeout(n),n=null,o.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i);}),o=null);};o.forEach(c=>c.addEventListener("abort",i));let{signal:l}=s;return l.unsubscribe=()=>f.asap(r),l}},ms=wi;var hi=function*(o,e){let t=o.byteLength;if(t<e){yield o;return}let s=0,a;for(;s<t;)a=s+e,yield o.slice(s,a),s=a;},Ri=async function*(o,e){for await(let t of gi(o))yield*hi(t,e);},gi=async function*(o){if(o[Symbol.asyncIterator]){yield*o;return}let e=o.getReader();try{for(;;){let{done:t,value:s}=await e.read();if(t)break;yield s;}}finally{await e.cancel();}},ho=(o,e,t,s)=>{let a=Ri(o,e),i=0,n,r=l=>{n||(n=true,s&&s(l));};return new ReadableStream({async pull(l){try{let{done:c,value:d}=await a.next();if(c){r(),l.close();return}let p=d.byteLength;if(t){let m=i+=p;t(m);}l.enqueue(new Uint8Array(d));}catch(c){throw r(c),c}},cancel(l){return r(l),a.return()}},{highWaterMark:2})};var ws=64*1024,{isFunction:Et}=f,yi=(({Request:o,Response:e})=>({Request:o,Response:e}))(f.global),{ReadableStream:hs,TextEncoder:Rs}=f.global,gs=(o,...e)=>{try{return !!o(...e)}catch{return false}},Ci=o=>{o=f.merge.call({skipUndefined:true},yi,o);let{fetch:e,Request:t,Response:s}=o,a=e?Et(e):typeof fetch=="function",i=Et(t),n=Et(s);if(!a)return false;let r=a&&Et(hs),l=a&&(typeof Rs=="function"?(u=>w=>u.encode(w))(new Rs):async u=>new Uint8Array(await new t(u).arrayBuffer())),c=i&&r&&gs(()=>{let u=!1,w=new t(T.origin,{body:new hs,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!w}),d=n&&r&&gs(()=>f.isReadableStream(new s("").body)),p={stream:d&&(u=>u.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!p[u]&&(p[u]=(w,h)=>{let b=w&&w[u];if(b)return b.call(w);throw new W(`Response type '${u}' is not supported`,W.ERR_NOT_SUPPORT,h)});});let m=async u=>{if(u==null)return 0;if(f.isBlob(u))return u.size;if(f.isSpecCompliantForm(u))return (await new t(T.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(f.isArrayBufferView(u)||f.isArrayBuffer(u))return u.byteLength;if(f.isURLSearchParams(u)&&(u=u+""),f.isString(u))return (await l(u)).byteLength},R=async(u,w)=>{let h=f.toFiniteNumber(u.getContentLength());return h??m(w)};return async u=>{let{url:w,method:h,data:b,signal:G,cancelToken:q,timeout:D,onDownloadProgress:N,onUploadProgress:X,responseType:H,headers:Ve,withCredentials:ve="same-origin",fetchOptions:Go}=Dt(u),To=e||fetch;H=H?(H+"").toLowerCase():"text";let At=ms([G,q&&q.toAbortSignal()],D),Le=null,ye=At&&At.unsubscribe&&(()=>{At.unsubscribe();}),Fo;try{if(X&&c&&h!=="get"&&h!=="head"&&(Fo=await R(Ve,b))!==0){let me=new t(w,{method:"POST",body:b,duplex:"half"}),Se;if(f.isFormData(b)&&(Se=me.headers.get("content-type"))&&Ve.setContentType(Se),me.body){let[$t,kt]=fo(Fo,Oe(uo(X)));b=ho(me.body,ws,$t,kt);}}f.isString(ve)||(ve=ve?"include":"omit");let K=i&&"credentials"in t.prototype,Bo={...Go,signal:At,method:h.toUpperCase(),headers:Ve.normalize().toJSON(),body:b,duplex:"half",credentials:K?ve:void 0};Le=i&&new t(w,Bo);let ue=await(i?To(Le,Go):To(w,Bo)),Uo=d&&(H==="stream"||H==="response");if(d&&(N||Uo&&ye)){let me={};["status","statusText","headers"].forEach(_o=>{me[_o]=ue[_o];});let Se=f.toFiniteNumber(ue.headers.get("content-length")),[$t,kt]=N&&fo(Se,Oe(uo(N),!0))||[];ue=new s(ho(ue.body,ws,$t,()=>{kt&&kt(),ye&&ye();}),me);}H=H||"text";let Xs=await p[f.findKey(p,H)||"text"](ue,u);return !Uo&&ye&&ye(),await new Promise((me,Se)=>{Ye(me,Se,{data:Xs,headers:_.from(ue.headers),status:ue.status,statusText:ue.statusText,config:u,request:Le});})}catch(K){throw ye&&ye(),K&&K.name==="TypeError"&&/Load failed|fetch/i.test(K.message)?Object.assign(new W("Network Error",W.ERR_NETWORK,u,Le,K&&K.response),{cause:K.cause||K}):W.from(K,K&&K.code,u,Le,K&&K.response)}}},Ai=new Map,Ro=o=>{let e=o&&o.env||{},{fetch:t,Request:s,Response:a}=e,i=[s,a,t],n=i.length,r=n,l,c,d=Ai;for(;r--;)l=i[r],c=d.get(l),c===void 0&&d.set(l,c=r?new Map:Ci(e)),d=c;return c};Ro();var go={http:St,xhr:us,fetch:{get:Ro}};f.forEach(go,(o,e)=>{if(o){try{Object.defineProperty(o,"name",{value:e});}catch{}Object.defineProperty(o,"adapterName",{value:e});}});var ys=o=>`- ${o}`,xi=o=>f.isFunction(o)||o===null||o===false;function Ii(o,e){o=f.isArray(o)?o:[o];let{length:t}=o,s,a,i={};for(let n=0;n<t;n++){s=o[n];let r;if(a=s,!xi(s)&&(a=go[(r=String(s)).toLowerCase()],a===void 0))throw new W(`Unknown adapter '${r}'`);if(a&&(f.isFunction(a)||(a=a.get(e))))break;i[r||"#"+n]=a;}if(!a){let n=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===false?"is not supported by the environment":"is not available in the build")),r=t?n.length>1?`since :
4
+ `+n.map(ys).join(`
5
+ `):" "+ys(n[0]):"as no adapter specified";throw new W("There is no suitable adapter to dispatch the request "+r,"ERR_NOT_SUPPORT")}return a}var Ot={getAdapter:Ii,adapters:go};function yo(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new ne(null,o)}function qt(o){return yo(o),o.headers=_.from(o.headers),o.data=ze.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",false),Ot.getAdapter(o.adapter||De.adapter,o)(o).then(function(s){return yo(o),s.data=ze.call(o,o.transformResponse,s),s.headers=_.from(s.headers),s},function(s){return Qe(s)||(yo(o),s&&s.response&&(s.response.data=ze.call(o,o.transformResponse,s.response),s.response.headers=_.from(s.response.headers))),Promise.reject(s)})}var Nt="1.13.6";var Gt={};["object","boolean","number","function","string","symbol"].forEach((o,e)=>{Gt[o]=function(s){return typeof s===o||"a"+(e<1?"n ":" ")+o};});var Cs={};Gt.transitional=function(e,t,s){function a(i,n){return "[Axios v"+Nt+"] Transitional option '"+i+"'"+n+(s?". "+s:"")}return (i,n,r)=>{if(e===false)throw new W(a(n," has been removed"+(t?" in "+t:"")),W.ERR_DEPRECATED);return t&&!Cs[n]&&(Cs[n]=true,console.warn(a(n," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,n,r):true}};Gt.spelling=function(e){return (t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),true)};function Vi(o,e,t){if(typeof o!="object")throw new W("options must be an object",W.ERR_BAD_OPTION_VALUE);let s=Object.keys(o),a=s.length;for(;a-- >0;){let i=s[a],n=e[i];if(n){let r=o[i],l=r===void 0||n(r,i,o);if(l!==true)throw new W("option "+i+" must be "+l,W.ERR_BAD_OPTION_VALUE);continue}if(t!==true)throw new W("Unknown option "+i,W.ERR_BAD_OPTION)}}var Ze={assertOptions:Vi,validators:Gt};var oe=Ze.validators,qe=class{constructor(e){this.defaults=e||{},this.interceptors={request:new oo,response:new oo};}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;let i=a.stack?a.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
+ `+i):s.stack=i;}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=ie(this.defaults,t);let{transitional:s,paramsSerializer:a,headers:i}=t;s!==void 0&&Ze.assertOptions(s,{silentJSONParsing:oe.transitional(oe.boolean),forcedJSONParsing:oe.transitional(oe.boolean),clarifyTimeoutError:oe.transitional(oe.boolean),legacyInterceptorReqResOrdering:oe.transitional(oe.boolean)},false),a!=null&&(f.isFunction(a)?t.paramsSerializer={serialize:a}:Ze.assertOptions(a,{encode:oe.function,serialize:oe.function},true)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=true),Ze.assertOptions(t,{baseUrl:oe.spelling("baseURL"),withXsrfToken:oe.spelling("withXSRFToken")},true),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=i&&f.merge(i.common,i[t.method]);i&&f.forEach(["delete","get","head","post","put","patch","common"],u=>{delete i[u];}),t.headers=_.concat(n,i);let r=[],l=true;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(t)===false)return;l=l&&w.synchronous;let h=t.transitional||be;h&&h.legacyInterceptorReqResOrdering?r.unshift(w.fulfilled,w.rejected):r.push(w.fulfilled,w.rejected);});let c=[];this.interceptors.response.forEach(function(w){c.push(w.fulfilled,w.rejected);});let d,p=0,m;if(!l){let u=[qt.bind(this),void 0];for(u.unshift(...r),u.push(...c),m=u.length,d=Promise.resolve(t);p<m;)d=d.then(u[p++],u[p++]);return d}m=r.length;let R=t;for(;p<m;){let u=r[p++],w=r[p++];try{R=u(R);}catch(h){w.call(this,h);break}}try{d=qt.call(this,R);}catch(u){return Promise.reject(u)}for(p=0,m=c.length;p<m;)d=d.then(c[p++],c[p++]);return d}getUri(e){e=ie(this.defaults,e);let t=Xe(e.baseURL,e.url,e.allowAbsoluteUrls);return Ke(t,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){qe.prototype[e]=function(t,s){return this.request(ie(s||{},{method:e,url:t,data:(s||{}).data}))};});f.forEach(["post","put","patch"],function(e){function t(s){return function(i,n,r){return this.request(ie(r||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:n}))}}qe.prototype[e]=t(),qe.prototype[e+"Form"]=t(true);});var et=qe;var Co=class o{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i;});let s=this;this.promise.then(a=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](a);s._listeners=null;}),this.promise.then=a=>{let i,n=new Promise(r=>{s.subscribe(r),i=r;}).then(a);return n.cancel=function(){s.unsubscribe(i);},n},e(function(i,n,r){s.reason||(s.reason=new ne(i,n,r),t(s.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);}toAbortSignal(){let e=new AbortController,t=s=>{e.abort(s);};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return {token:new o(function(a){e=a;}),cancel:e}}},As=Co;function Ao(o){return function(t){return o.apply(null,t)}}function ko(o){return f.isObject(o)&&o.isAxiosError===true}var xo={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(xo).forEach(([o,e])=>{xo[e]=o;});var ks=xo;function xs(o){let e=new et(o),t=je(et.prototype.request,e);return f.extend(t,et.prototype,e,{allOwnKeys:true}),f.extend(t,e,null,{allOwnKeys:true}),t.create=function(a){return xs(ie(o,a))},t}var B=xs(De);B.Axios=et;B.CanceledError=ne;B.CancelToken=As;B.isCancel=Qe;B.VERSION=Nt;B.toFormData=we;B.AxiosError=W;B.Cancel=B.CanceledError;B.all=function(e){return Promise.all(e)};B.spread=Ao;B.isAxiosError=ko;B.mergeConfig=ie;B.AxiosHeaders=_;B.formToJSON=o=>Wt(f.isHTMLForm(o)?new FormData(o):o);B.getAdapter=Ot.getAdapter;B.HttpStatusCode=ks;B.default=B;var g=B;var{Axios:dc,AxiosError:Is,CanceledError:pc,isCancel:fc,CancelToken:uc,VERSION:mc,all:wc,Cancel:hc,isAxiosError:Vs,spread:Rc,toFormData:gc,AxiosHeaders:yc,HttpStatusCode:Cc,formToJSON:Ac,getAdapter:kc,mergeConfig:xc}=g;var C=globalThis.URL,vs=globalThis.URLSearchParams;var y="https://api.kadoa.com".replace(/\/+$/,"");var se=class{constructor(e,t=y,s=g){this.basePath=t;this.axios=s;e&&(this.configuration=e,this.basePath=e.basePath??t);}},Tt=class extends Error{constructor(t,s){super(s);this.field=t;this.name="RequiredError";}},A={};var k="https://example.com",S=function(o,e,t){if(t==null)throw new Tt(e,`Required parameter ${e} was null or undefined when calling ${o}.`)},x=async function(o,e,t){if(t&&t.apiKey){let s=typeof t.apiKey=="function"?await t.apiKey(e):await t.apiKey;o[e]=s;}};var re=async function(o,e){if(e&&e.accessToken){let t=typeof e.accessToken=="function"?await e.accessToken():await e.accessToken;o.Authorization="Bearer "+t;}};function Io(o,e,t=""){e!=null&&(typeof e=="object"?Array.isArray(e)||e instanceof Set?e.forEach(s=>Io(o,s,t)):Object.keys(e).forEach(s=>Io(o,e[s],`${t}${t!==""?".":""}${s}`)):o.has(t)?o.append(t,e):o.set(t,e));}var I=function(o,...e){let t=new vs(o.search);Io(t,e),o.search=t.toString();},vi=function(o,e){return e instanceof Set?Array.from(e):e},O=function(o,e,t){let s=typeof o!="string";return (s&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):s)?JSON.stringify(o!==void 0?o:{},vi):o||""},V=function(o){return o.pathname+o.search+o.hash},v=function(o,e,t,s){return (a=e,i=t)=>{let n={...o.options,url:(a.defaults.baseURL?"":s?.basePath??i)+o.url};return a.request(n)}};var Si=function(o){return {v4CrawlBucketDataFilenameb64Get:async(e,t,s,a={})=>{S("v4CrawlBucketDataFilenameb64Get","filenameb64",e);let i="/v4/crawl/bucket/data/{filenameb64}".replace("{filenameb64}",encodeURIComponent(String(e))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),c.Accept="application/json",t!=null&&(c["Content-Type"]=String(t)),s!=null&&(c["Cache-Control"]=String(s)),I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4CrawlConfigConfigIdGet:async(e,t={})=>{S("v4CrawlConfigConfigIdGet","configId",e);let s="/v4/crawl/config/{configId}".replace("{configId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4CrawlConfigDelete:async(e,t={})=>{let s="/v4/crawl/config",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlConfigPost:async(e,t={})=>{let s="/v4/crawl/config",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlPausePost:async(e,t={})=>{let s="/v4/crawl/pause",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlPost:async(e,t={})=>{let s="/v4/crawl/",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlResumePost:async(e,t={})=>{let s="/v4/crawl/resume",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4CrawlSessionIdListGet:async(e,t,s={})=>{S("v4CrawlSessionIdListGet","sessionId",e);let a="/v4/crawl/{sessionId}/list".replace("{sessionId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),t!==void 0&&(c.includeAll=t),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}},v4CrawlSessionIdPagesGet:async(e,t,s,a={})=>{S("v4CrawlSessionIdPagesGet","sessionId",e);let i="/v4/crawl/{sessionId}/pages".replace("{sessionId}",encodeURIComponent(String(e))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),t!==void 0&&(d.currentPage=t),s!==void 0&&(d.pageSize=s),c.Accept="application/json",I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4CrawlSessionIdPagesPageIdGet:async(e,t,s,a={})=>{S("v4CrawlSessionIdPagesPageIdGet","sessionId",e),S("v4CrawlSessionIdPagesPageIdGet","pageId",t);let i="/v4/crawl/{sessionId}/pages/{pageId}".replace("{sessionId}",encodeURIComponent(String(e))).replace("{pageId}",encodeURIComponent(String(t))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),s!==void 0&&(d.format=s),c.Accept="application/json",I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4CrawlSessionIdStatusGet:async(e,t={})=>{S("v4CrawlSessionIdStatusGet","sessionId",e);let s="/v4/crawl/{sessionId}/status".replace("{sessionId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4CrawlSessionsGet:async(e,t,s,a={})=>{let i="/v4/crawl/sessions",n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),e!==void 0&&(d.page=e),t!==void 0&&(d.pageSize=t),s!==void 0&&(d.userId=s),c.Accept="application/json",I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4CrawlStartPost:async(e,t={})=>{let s="/v4/crawl/start",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}}}},Z=function(o){let e=Si(o);return {async v4CrawlBucketDataFilenameb64Get(t,s,a,i){let n=await e.v4CrawlBucketDataFilenameb64Get(t,s,a,i),r=o?.serverIndex??0,l=A["CrawlerApi.v4CrawlBucketDataFilenameb64Get"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4CrawlConfigConfigIdGet(t,s){let a=await e.v4CrawlConfigConfigIdGet(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlConfigConfigIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlConfigDelete(t,s){let a=await e.v4CrawlConfigDelete(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlConfigDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlConfigPost(t,s){let a=await e.v4CrawlConfigPost(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlConfigPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlPausePost(t,s){let a=await e.v4CrawlPausePost(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlPausePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlPost(t,s){let a=await e.v4CrawlPost(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlResumePost(t,s){let a=await e.v4CrawlResumePost(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlResumePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlSessionIdListGet(t,s,a){let i=await e.v4CrawlSessionIdListGet(t,s,a),n=o?.serverIndex??0,r=A["CrawlerApi.v4CrawlSessionIdListGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4CrawlSessionIdPagesGet(t,s,a,i){let n=await e.v4CrawlSessionIdPagesGet(t,s,a,i),r=o?.serverIndex??0,l=A["CrawlerApi.v4CrawlSessionIdPagesGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4CrawlSessionIdPagesPageIdGet(t,s,a,i){let n=await e.v4CrawlSessionIdPagesPageIdGet(t,s,a,i),r=o?.serverIndex??0,l=A["CrawlerApi.v4CrawlSessionIdPagesPageIdGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4CrawlSessionIdStatusGet(t,s){let a=await e.v4CrawlSessionIdStatusGet(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlSessionIdStatusGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4CrawlSessionsGet(t,s,a,i){let n=await e.v4CrawlSessionsGet(t,s,a,i),r=o?.serverIndex??0,l=A["CrawlerApi.v4CrawlSessionsGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4CrawlStartPost(t,s){let a=await e.v4CrawlStartPost(t,s),i=o?.serverIndex??0,n=A["CrawlerApi.v4CrawlStartPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)}}};var tt=class extends se{v4CrawlBucketDataFilenameb64Get(e,t){return Z(this.configuration).v4CrawlBucketDataFilenameb64Get(e.filenameb64,e.contentType,e.cacheControl,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigConfigIdGet(e,t){return Z(this.configuration).v4CrawlConfigConfigIdGet(e.configId,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigDelete(e={},t){return Z(this.configuration).v4CrawlConfigDelete(e.deleteCrawlerConfigRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigPost(e={},t){return Z(this.configuration).v4CrawlConfigPost(e.createCrawlerConfigRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlPausePost(e={},t){return Z(this.configuration).v4CrawlPausePost(e.pauseCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlPost(e={},t){return Z(this.configuration).v4CrawlPost(e.startCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlResumePost(e={},t){return Z(this.configuration).v4CrawlResumePost(e.resumeCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdListGet(e,t){return Z(this.configuration).v4CrawlSessionIdListGet(e.sessionId,e.includeAll,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdPagesGet(e,t){return Z(this.configuration).v4CrawlSessionIdPagesGet(e.sessionId,e.currentPage,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdPagesPageIdGet(e,t){return Z(this.configuration).v4CrawlSessionIdPagesPageIdGet(e.sessionId,e.pageId,e.format,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdStatusGet(e,t){return Z(this.configuration).v4CrawlSessionIdStatusGet(e.sessionId,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionsGet(e={},t){return Z(this.configuration).v4CrawlSessionsGet(e.page,e.pageSize,e.userId,t).then(s=>s(this.axios,this.basePath))}v4CrawlStartPost(e={},t){return Z(this.configuration).v4CrawlStartPost(e.startSessionWithConfigRequest,t).then(s=>s(this.axios,this.basePath))}};var Pi=function(o){return {v4DataValidationRulesActionsBulkApprovePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/bulk-approve",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsBulkDeletePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/bulk-delete",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsDeleteAllDelete:async(e,t={})=>{let s="/v4/data-validation/rules/actions/delete-all",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsGeneratePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/generate",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsGenerateRulesPost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/generate-rules",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4DataValidationRulesGet:async(e,t,s,a,i,n,r={})=>{let l="/v4/data-validation/rules",c=new C(l,k),d;o&&(d=o.baseOptions);let p={method:"GET",...d,...r},m={},R={};if(await x(m,"x-api-key",o),e!==void 0&&(R.groupId=e),t!==void 0&&(R.workflowId=t),s!==void 0&&(R.status=s),a!==void 0&&(R.page=a),i!==void 0&&(R.pageSize=i),n!==void 0)for(let[w,h]of Object.entries(n))R[w]=h;m.Accept="application/json",I(c,R);let u=d&&d.headers?d.headers:{};return p.headers={...m,...u,...r.headers},{url:V(c),options:p}},v4DataValidationRulesRuleIdDelete:async(e,t,s={})=>{S("v4DataValidationRulesRuleIdDelete","ruleId",e);let a="/v4/data-validation/rules/{ruleId}".replace("{ruleId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"DELETE",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationRulesRuleIdDisablePost:async(e,t,s={})=>{S("v4DataValidationRulesRuleIdDisablePost","ruleId",e);let a="/v4/data-validation/rules/{ruleId}/disable".replace("{ruleId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"POST",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationRulesRuleIdGet:async(e,t,s={})=>{S("v4DataValidationRulesRuleIdGet","ruleId",e);let a="/v4/data-validation/rules/{ruleId}".replace("{ruleId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),t!==void 0&&(c.includeDeleted=t),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}},v4DataValidationValidationsValidationIdAnomaliesGet:async(e,t,s,a={})=>{S("v4DataValidationValidationsValidationIdAnomaliesGet","validationId",e);let i="/v4/data-validation/validations/{validationId}/anomalies".replace("{validationId}",encodeURIComponent(String(e))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),t!==void 0&&(d.page=t),s!==void 0&&(d.pageSize=s),c.Accept="application/json",I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet:async(e,t,s,a,i={})=>{S("v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet","validationId",e),S("v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet","ruleName",t);let n="/v4/data-validation/validations/{validationId}/anomalies/rules/{ruleName}".replace("{validationId}",encodeURIComponent(String(e))).replace("{ruleName}",encodeURIComponent(String(t))),r=new C(n,k),l;o&&(l=o.baseOptions);let c={method:"GET",...l,...i},d={},p={};await x(d,"x-api-key",o),s!==void 0&&(p.page=s),a!==void 0&&(p.pageSize=a),d.Accept="application/json",I(r,p);let m=l&&l.headers?l.headers:{};return c.headers={...d,...m,...i.headers},{url:V(r),options:c}},v4DataValidationValidationsValidationIdGet:async(e,t,s={})=>{S("v4DataValidationValidationsValidationIdGet","validationId",e);let a="/v4/data-validation/validations/{validationId}".replace("{validationId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),t!==void 0&&(c.includeDryRun=t),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}},v4DataValidationWorkflowIdJobsJobIdValidatePost:async(e,t,s,a={})=>{S("v4DataValidationWorkflowIdJobsJobIdValidatePost","workflowId",e),S("v4DataValidationWorkflowIdJobsJobIdValidatePost","jobId",t);let i="/v4/data-validation/{workflowId}/jobs/{jobId}/validate".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"POST",...r,...a},c={},d={};await x(c,"x-api-key",o),c["Content-Type"]="application/json",c.Accept="application/json",I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},l.data=O(s,l,o),{url:V(n),options:l}},v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost:async(e,t,s,a={})=>{S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost","workflowId",e),S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost","jobId",t);let i="/v4/data-validation/workflows/{workflowId}/jobs/{jobId}/validate".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"POST",...r,...a},c={},d={};await x(c,"x-api-key",o),c["Content-Type"]="application/json",c.Accept="application/json",I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},l.data=O(s,l,o),{url:V(n),options:l}},v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet:async(e,t,s,a,i,n={})=>{S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet","workflowId",e),S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet","jobId",t);let r="/v4/data-validation/workflows/{workflowId}/jobs/{jobId}/validations".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),l=new C(r,k),c;o&&(c=o.baseOptions);let d={method:"GET",...c,...n},p={},m={};await x(p,"x-api-key",o),s!==void 0&&(m.page=s),a!==void 0&&(m.pageSize=a),i!==void 0&&(m.includeDryRun=i),p.Accept="application/json",I(l,m);let R=c&&c.headers?c.headers:{};return d.headers={...p,...R,...n.headers},{url:V(l),options:d}},v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet:async(e,t,s,a={})=>{S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet","workflowId",e),S("v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet","jobId",t);let i="/v4/data-validation/workflows/{workflowId}/jobs/{jobId}/validations/latest".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),s!==void 0&&(d.includeDryRun=s),c.Accept="application/json",I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4DataValidationWorkflowsWorkflowIdValidationConfigGet:async(e,t={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationConfigGet","workflowId",e);let s="/v4/data-validation/workflows/{workflowId}/validation/config".replace("{workflowId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4DataValidationWorkflowsWorkflowIdValidationConfigPut:async(e,t,s={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationConfigPut","workflowId",e);let a="/v4/data-validation/workflows/{workflowId}/validation/config".replace("{workflowId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationWorkflowsWorkflowIdValidationTogglePut:async(e,t,s={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationTogglePut","workflowId",e);let a="/v4/data-validation/workflows/{workflowId}/validation/toggle".replace("{workflowId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4DataValidationWorkflowsWorkflowIdValidationsLatestGet:async(e,t,s={})=>{S("v4DataValidationWorkflowsWorkflowIdValidationsLatestGet","workflowId",e);let a="/v4/data-validation/workflows/{workflowId}/validations/latest".replace("{workflowId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),t!==void 0&&(c.includeDryRun=t),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}}}},U=function(o){let e=Pi(o);return {async v4DataValidationRulesActionsBulkApprovePost(t,s){let a=await e.v4DataValidationRulesActionsBulkApprovePost(t,s),i=o?.serverIndex??0,n=A["DataValidationApi.v4DataValidationRulesActionsBulkApprovePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsBulkDeletePost(t,s){let a=await e.v4DataValidationRulesActionsBulkDeletePost(t,s),i=o?.serverIndex??0,n=A["DataValidationApi.v4DataValidationRulesActionsBulkDeletePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsDeleteAllDelete(t,s){let a=await e.v4DataValidationRulesActionsDeleteAllDelete(t,s),i=o?.serverIndex??0,n=A["DataValidationApi.v4DataValidationRulesActionsDeleteAllDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsGeneratePost(t,s){let a=await e.v4DataValidationRulesActionsGeneratePost(t,s),i=o?.serverIndex??0,n=A["DataValidationApi.v4DataValidationRulesActionsGeneratePost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesActionsGenerateRulesPost(t,s){let a=await e.v4DataValidationRulesActionsGenerateRulesPost(t,s),i=o?.serverIndex??0,n=A["DataValidationApi.v4DataValidationRulesActionsGenerateRulesPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationRulesGet(t,s,a,i,n,r,l){let c=await e.v4DataValidationRulesGet(t,s,a,i,n,r,l),d=o?.serverIndex??0,p=A["DataValidationApi.v4DataValidationRulesGet"]?.[d]?.url;return (m,R)=>v(c,g,y,o)(m,p||R)},async v4DataValidationRulesRuleIdDelete(t,s,a){let i=await e.v4DataValidationRulesRuleIdDelete(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationRulesRuleIdDelete"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4DataValidationRulesRuleIdDisablePost(t,s,a){let i=await e.v4DataValidationRulesRuleIdDisablePost(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationRulesRuleIdDisablePost"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4DataValidationRulesRuleIdGet(t,s,a){let i=await e.v4DataValidationRulesRuleIdGet(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationRulesRuleIdGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4DataValidationValidationsValidationIdAnomaliesGet(t,s,a,i){let n=await e.v4DataValidationValidationsValidationIdAnomaliesGet(t,s,a,i),r=o?.serverIndex??0,l=A["DataValidationApi.v4DataValidationValidationsValidationIdAnomaliesGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(t,s,a,i,n){let r=await e.v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(t,s,a,i,n),l=o?.serverIndex??0,c=A["DataValidationApi.v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet"]?.[l]?.url;return (d,p)=>v(r,g,y,o)(d,c||p)},async v4DataValidationValidationsValidationIdGet(t,s,a){let i=await e.v4DataValidationValidationsValidationIdGet(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationValidationsValidationIdGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4DataValidationWorkflowIdJobsJobIdValidatePost(t,s,a,i){let n=await e.v4DataValidationWorkflowIdJobsJobIdValidatePost(t,s,a,i),r=o?.serverIndex??0,l=A["DataValidationApi.v4DataValidationWorkflowIdJobsJobIdValidatePost"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(t,s,a,i){let n=await e.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(t,s,a,i),r=o?.serverIndex??0,l=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(t,s,a,i,n,r){let l=await e.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(t,s,a,i,n,r),c=o?.serverIndex??0,d=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet"]?.[c]?.url;return (p,m)=>v(l,g,y,o)(p,d||m)},async v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(t,s,a,i){let n=await e.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(t,s,a,i),r=o?.serverIndex??0,l=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4DataValidationWorkflowsWorkflowIdValidationConfigGet(t,s){let a=await e.v4DataValidationWorkflowsWorkflowIdValidationConfigGet(t,s),i=o?.serverIndex??0,n=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationConfigGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4DataValidationWorkflowsWorkflowIdValidationConfigPut(t,s,a){let i=await e.v4DataValidationWorkflowsWorkflowIdValidationConfigPut(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationConfigPut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4DataValidationWorkflowsWorkflowIdValidationTogglePut(t,s,a){let i=await e.v4DataValidationWorkflowsWorkflowIdValidationTogglePut(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationTogglePut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(t,s,a){let i=await e.v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationsLatestGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)}}};var ot=class extends se{v4DataValidationRulesActionsBulkApprovePost(e={},t){return U(this.configuration).v4DataValidationRulesActionsBulkApprovePost(e.bulkApproveRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsBulkDeletePost(e={},t){return U(this.configuration).v4DataValidationRulesActionsBulkDeletePost(e.bulkDeleteRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsDeleteAllDelete(e={},t){return U(this.configuration).v4DataValidationRulesActionsDeleteAllDelete(e.deleteRuleWithReason,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsGeneratePost(e={},t){return U(this.configuration).v4DataValidationRulesActionsGeneratePost(e.generateRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsGenerateRulesPost(e={},t){return U(this.configuration).v4DataValidationRulesActionsGenerateRulesPost(e.generateRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesGet(e={},t){return U(this.configuration).v4DataValidationRulesGet(e.groupId,e.workflowId,e.status,e.page,e.pageSize,e.includeDeleted,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdDelete(e,t){return U(this.configuration).v4DataValidationRulesRuleIdDelete(e.ruleId,e.deleteRuleWithReason,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdDisablePost(e,t){return U(this.configuration).v4DataValidationRulesRuleIdDisablePost(e.ruleId,e.disableRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdGet(e,t){return U(this.configuration).v4DataValidationRulesRuleIdGet(e.ruleId,e.includeDeleted,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdAnomaliesGet(e,t){return U(this.configuration).v4DataValidationValidationsValidationIdAnomaliesGet(e.validationId,e.page,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(e,t){return U(this.configuration).v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(e.validationId,e.ruleName,e.page,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdGet(e,t){return U(this.configuration).v4DataValidationValidationsValidationIdGet(e.validationId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowIdJobsJobIdValidatePost(e,t){return U(this.configuration).v4DataValidationWorkflowIdJobsJobIdValidatePost(e.workflowId,e.jobId,e.dataValidationRequestBody,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(e.workflowId,e.jobId,e.dataValidationRequestBody,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e.workflowId,e.jobId,e.page,e.pageSize,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(e.workflowId,e.jobId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationConfigGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationConfigGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationConfigPut(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationConfigPut(e.workflowId,e.v4DataValidationWorkflowsWorkflowIdValidationConfigPutRequest,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationTogglePut(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationTogglePut(e.workflowId,e.v4DataValidationWorkflowsWorkflowIdValidationTogglePutRequest,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(e,t){return U(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(e.workflowId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}};var Wi=function(o){return {v5NotificationsChannelsChannelIdDelete:async(e,t={})=>{S("v5NotificationsChannelsChannelIdDelete","channelId",e);let s="/v5/notifications/channels/{channelId}".replace("{channelId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v5NotificationsChannelsChannelIdGet:async(e,t,s={})=>{S("v5NotificationsChannelsChannelIdGet","channelId",e);let a="/v5/notifications/channels/{channelId}".replace("{channelId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),t!==void 0&&(c.includeConfigurations=t),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}},v5NotificationsChannelsChannelIdPut:async(e,t,s={})=>{S("v5NotificationsChannelsChannelIdPut","channelId",e),S("v5NotificationsChannelsChannelIdPut","v5NotificationsChannelsPostRequest",t);let a="/v5/notifications/channels/{channelId}".replace("{channelId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v5NotificationsChannelsGet:async(e,t,s={})=>{let a="/v5/notifications/channels",i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),e!==void 0&&(c.workflowId=e),t!==void 0&&(c.includeConfigurations=t),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}},v5NotificationsChannelsPost:async(e,t={})=>{S("v5NotificationsChannelsPost","v5NotificationsChannelsPostRequest",e);let s="/v5/notifications/channels",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v5NotificationsEventTypesEventTypeGet:async(e,t={})=>{S("v5NotificationsEventTypesEventTypeGet","eventType",e);let s="/v5/notifications/event-types/{eventType}".replace("{eventType}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v5NotificationsEventTypesGet:async(e={})=>{let t="/v5/notifications/event-types",s=new C(t,k),a;o&&(a=o.baseOptions);let i={method:"GET",...a,...e},n={},r={};await x(n,"x-api-key",o),n.Accept="application/json",I(s,r);let l=a&&a.headers?a.headers:{};return i.headers={...n,...l,...e.headers},{url:V(s),options:i}},v5NotificationsLogsGet:async(e,t,s,a,i,n,r={})=>{let l="/v5/notifications/logs",c=new C(l,k),d;o&&(d=o.baseOptions);let p={method:"GET",...d,...r},m={},R={};await x(m,"x-api-key",o),e!==void 0&&(R.workflowId=e),t!==void 0&&(R.eventType=t),s!==void 0&&(R.startDate=s instanceof Date?s.toISOString():s),a!==void 0&&(R.endDate=a instanceof Date?a.toISOString():a),i!==void 0&&(R.limit=i),n!==void 0&&(R.offset=n),m.Accept="application/json",I(c,R);let u=d&&d.headers?d.headers:{};return p.headers={...m,...u,...r.headers},{url:V(c),options:p}},v5NotificationsSettingsGet:async(e,t,s={})=>{let a="/v5/notifications/settings",i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),e!==void 0&&(c.workflowId=e),t!==void 0&&(c.eventType=t),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}},v5NotificationsSettingsPost:async(e,t={})=>{S("v5NotificationsSettingsPost","v5NotificationsSettingsPostRequest",e);let s="/v5/notifications/settings",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v5NotificationsSettingsSettingsIdDelete:async(e,t={})=>{S("v5NotificationsSettingsSettingsIdDelete","settingsId",e);let s="/v5/notifications/settings/{settingsId}".replace("{settingsId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v5NotificationsSettingsSettingsIdGet:async(e,t={})=>{S("v5NotificationsSettingsSettingsIdGet","settingsId",e);let s="/v5/notifications/settings/{settingsId}".replace("{settingsId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v5NotificationsSettingsSettingsIdPut:async(e,t,s={})=>{S("v5NotificationsSettingsSettingsIdPut","settingsId",e),S("v5NotificationsSettingsSettingsIdPut","v5NotificationsSettingsSettingsIdPutRequest",t);let a="/v5/notifications/settings/{settingsId}".replace("{settingsId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v5NotificationsTestPost:async(e,t={})=>{S("v5NotificationsTestPost","v5NotificationsTestPostRequest",e);let s="/v5/notifications/test",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}}}},z=function(o){let e=Wi(o);return {async v5NotificationsChannelsChannelIdDelete(t,s){let a=await e.v5NotificationsChannelsChannelIdDelete(t,s),i=o?.serverIndex??0,n=A["NotificationsApi.v5NotificationsChannelsChannelIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsChannelsChannelIdGet(t,s,a){let i=await e.v5NotificationsChannelsChannelIdGet(t,s,a),n=o?.serverIndex??0,r=A["NotificationsApi.v5NotificationsChannelsChannelIdGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v5NotificationsChannelsChannelIdPut(t,s,a){let i=await e.v5NotificationsChannelsChannelIdPut(t,s,a),n=o?.serverIndex??0,r=A["NotificationsApi.v5NotificationsChannelsChannelIdPut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v5NotificationsChannelsGet(t,s,a){let i=await e.v5NotificationsChannelsGet(t,s,a),n=o?.serverIndex??0,r=A["NotificationsApi.v5NotificationsChannelsGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v5NotificationsChannelsPost(t,s){let a=await e.v5NotificationsChannelsPost(t,s),i=o?.serverIndex??0,n=A["NotificationsApi.v5NotificationsChannelsPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsEventTypesEventTypeGet(t,s){let a=await e.v5NotificationsEventTypesEventTypeGet(t,s),i=o?.serverIndex??0,n=A["NotificationsApi.v5NotificationsEventTypesEventTypeGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsEventTypesGet(t){let s=await e.v5NotificationsEventTypesGet(t),a=o?.serverIndex??0,i=A["NotificationsApi.v5NotificationsEventTypesGet"]?.[a]?.url;return (n,r)=>v(s,g,y,o)(n,i||r)},async v5NotificationsLogsGet(t,s,a,i,n,r,l){let c=await e.v5NotificationsLogsGet(t,s,a,i,n,r,l),d=o?.serverIndex??0,p=A["NotificationsApi.v5NotificationsLogsGet"]?.[d]?.url;return (m,R)=>v(c,g,y,o)(m,p||R)},async v5NotificationsSettingsGet(t,s,a){let i=await e.v5NotificationsSettingsGet(t,s,a),n=o?.serverIndex??0,r=A["NotificationsApi.v5NotificationsSettingsGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v5NotificationsSettingsPost(t,s){let a=await e.v5NotificationsSettingsPost(t,s),i=o?.serverIndex??0,n=A["NotificationsApi.v5NotificationsSettingsPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsSettingsSettingsIdDelete(t,s){let a=await e.v5NotificationsSettingsSettingsIdDelete(t,s),i=o?.serverIndex??0,n=A["NotificationsApi.v5NotificationsSettingsSettingsIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsSettingsSettingsIdGet(t,s){let a=await e.v5NotificationsSettingsSettingsIdGet(t,s),i=o?.serverIndex??0,n=A["NotificationsApi.v5NotificationsSettingsSettingsIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v5NotificationsSettingsSettingsIdPut(t,s,a){let i=await e.v5NotificationsSettingsSettingsIdPut(t,s,a),n=o?.serverIndex??0,r=A["NotificationsApi.v5NotificationsSettingsSettingsIdPut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v5NotificationsTestPost(t,s){let a=await e.v5NotificationsTestPost(t,s),i=o?.serverIndex??0,n=A["NotificationsApi.v5NotificationsTestPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)}}};var Ne=class extends se{v5NotificationsChannelsChannelIdDelete(e,t){return z(this.configuration).v5NotificationsChannelsChannelIdDelete(e.channelId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsChannelIdGet(e,t){return z(this.configuration).v5NotificationsChannelsChannelIdGet(e.channelId,e.includeConfigurations,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsChannelIdPut(e,t){return z(this.configuration).v5NotificationsChannelsChannelIdPut(e.channelId,e.v5NotificationsChannelsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsGet(e={},t){return z(this.configuration).v5NotificationsChannelsGet(e.workflowId,e.includeConfigurations,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsPost(e,t){return z(this.configuration).v5NotificationsChannelsPost(e.v5NotificationsChannelsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsEventTypesEventTypeGet(e,t){return z(this.configuration).v5NotificationsEventTypesEventTypeGet(e.eventType,t).then(s=>s(this.axios,this.basePath))}v5NotificationsEventTypesGet(e){return z(this.configuration).v5NotificationsEventTypesGet(e).then(t=>t(this.axios,this.basePath))}v5NotificationsLogsGet(e={},t){return z(this.configuration).v5NotificationsLogsGet(e.workflowId,e.eventType,e.startDate,e.endDate,e.limit,e.offset,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsGet(e={},t){return z(this.configuration).v5NotificationsSettingsGet(e.workflowId,e.eventType,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsPost(e,t){return z(this.configuration).v5NotificationsSettingsPost(e.v5NotificationsSettingsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdDelete(e,t){return z(this.configuration).v5NotificationsSettingsSettingsIdDelete(e.settingsId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdGet(e,t){return z(this.configuration).v5NotificationsSettingsSettingsIdGet(e.settingsId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdPut(e,t){return z(this.configuration).v5NotificationsSettingsSettingsIdPut(e.settingsId,e.v5NotificationsSettingsSettingsIdPutRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsTestPost(e,t){return z(this.configuration).v5NotificationsTestPost(e.v5NotificationsTestPostRequest,t).then(s=>s(this.axios,this.basePath))}},Ft={WorkflowStarted:"workflow_started",WorkflowFinished:"workflow_finished",WorkflowFailed:"workflow_failed",WorkflowSampleFinished:"workflow_sample_finished",WorkflowDataChange:"workflow_data_change",SystemMaintenance:"system_maintenance",ServiceDegradation:"service_degradation",CreditsLow:"credits_low",FreeTrialEnding:"free_trial_ending"};var bi=function(o){return {v4SchemasGet:async(e={})=>{let t="/v4/schemas/",s=new C(t,k),a;o&&(a=o.baseOptions);let i={method:"GET",...a,...e},n={},r={};await x(n,"x-api-key",o),n.Accept="application/json",I(s,r);let l=a&&a.headers?a.headers:{};return i.headers={...n,...l,...e.headers},{url:V(s),options:i}},v4SchemasPost:async(e,t={})=>{let s="/v4/schemas/",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4SchemasSchemaIdDelete:async(e,t={})=>{S("v4SchemasSchemaIdDelete","schemaId",e);let s="/v4/schemas/{schemaId}".replace("{schemaId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4SchemasSchemaIdGet:async(e,t={})=>{S("v4SchemasSchemaIdGet","schemaId",e);let s="/v4/schemas/{schemaId}".replace("{schemaId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4SchemasSchemaIdPut:async(e,t,s={})=>{S("v4SchemasSchemaIdPut","schemaId",e);let a="/v4/schemas/{schemaId}".replace("{schemaId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}}}},st=function(o){let e=bi(o);return {async v4SchemasGet(t){let s=await e.v4SchemasGet(t),a=o?.serverIndex??0,i=A["SchemasApi.v4SchemasGet"]?.[a]?.url;return (n,r)=>v(s,g,y,o)(n,i||r)},async v4SchemasPost(t,s){let a=await e.v4SchemasPost(t,s),i=o?.serverIndex??0,n=A["SchemasApi.v4SchemasPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4SchemasSchemaIdDelete(t,s){let a=await e.v4SchemasSchemaIdDelete(t,s),i=o?.serverIndex??0,n=A["SchemasApi.v4SchemasSchemaIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4SchemasSchemaIdGet(t,s){let a=await e.v4SchemasSchemaIdGet(t,s),i=o?.serverIndex??0,n=A["SchemasApi.v4SchemasSchemaIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4SchemasSchemaIdPut(t,s,a){let i=await e.v4SchemasSchemaIdPut(t,s,a),n=o?.serverIndex??0,r=A["SchemasApi.v4SchemasSchemaIdPut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)}}};var at=class extends se{v4SchemasGet(e){return st(this.configuration).v4SchemasGet(e).then(t=>t(this.axios,this.basePath))}v4SchemasPost(e={},t){return st(this.configuration).v4SchemasPost(e.createSchemaBody,t).then(s=>s(this.axios,this.basePath))}v4SchemasSchemaIdDelete(e,t){return st(this.configuration).v4SchemasSchemaIdDelete(e.schemaId,t).then(s=>s(this.axios,this.basePath))}v4SchemasSchemaIdGet(e,t){return st(this.configuration).v4SchemasSchemaIdGet(e.schemaId,t).then(s=>s(this.axios,this.basePath))}v4SchemasSchemaIdPut(e,t){return st(this.configuration).v4SchemasSchemaIdPut(e.schemaId,e.updateSchemaBody,t).then(s=>s(this.axios,this.basePath))}};var Di=function(o){return {v4ChangesChangeIdGet:async(e,t,s,a={})=>{S("v4ChangesChangeIdGet","changeId",e);let i="/v4/changes/{changeId}".replace("{changeId}",encodeURIComponent(String(e))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),await re(c,o),c.Accept="application/json",t!=null&&(c["x-api-key"]=String(t)),s!=null&&(c.Authorization=String(s)),I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4ChangesFilesEncodedPathGet:async(e,t,s,a={})=>{S("v4ChangesFilesEncodedPathGet","encodedPath",e);let i="/v4/changes/files/{encodedPath}".replace("{encodedPath}",encodeURIComponent(String(e))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),await re(c,o),c.Accept="application/pdf",t!=null&&(c["x-api-key"]=String(t)),s!=null&&(c.Authorization=String(s)),I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4ChangesGet:async(e,t,s,a,i,n,r,l,c={})=>{let d="/v4/changes",p=new C(d,k),m;o&&(m=o.baseOptions);let R={method:"GET",...m,...c},u={},w={};await x(u,"x-api-key",o),await re(u,o),s!==void 0&&(w.workflowIds=s),a!==void 0&&(w.startDate=a instanceof Date?a.toISOString():a),i!==void 0&&(w.endDate=i instanceof Date?i.toISOString():i),n!==void 0&&(w.skip=n),r!==void 0&&(w.limit=r),l!==void 0&&(w.exclude=l),u.Accept="application/json",e!=null&&(u["x-api-key"]=String(e)),t!=null&&(u.Authorization=String(t)),I(p,w);let h=m&&m.headers?m.headers:{};return R.headers={...u,...h,...c.headers},{url:V(p),options:R}},v4WorkflowsBulkPost:async(e,t={})=>{S("v4WorkflowsBulkPost","v4WorkflowsBulkPostRequest",e);let s="/v4/workflows/bulk",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4WorkflowsGet:async(e,t,s,a,i,n,r,l,c,d,p,m,R,u,w={})=>{let h="/v4/workflows",b=new C(h,k),G;o&&(G=o.baseOptions);let q={method:"GET",...G,...w},D={},N={};await x(D,"x-api-key",o),e!==void 0&&(N.search=e),t!==void 0&&(N.skip=t),s!==void 0&&(N.limit=s),a!==void 0&&(N.state=a),i!==void 0&&(N.runState=i),n!==void 0&&(N.displayState=n),r!==void 0&&(N.inSupport=r),l&&(N.tags=l),c!==void 0&&(N.userId=c),d!==void 0&&(N.monitoring=d),p!==void 0&&(N.updateInterval=p),m!==void 0&&(N.templateId=m),R!==void 0&&(N.includeDeleted=R),u!==void 0&&(N.format=u),D.Accept="application/json",I(b,N);let X=G&&G.headers?G.headers:{};return q.headers={...D,...X,...w.headers},{url:V(b),options:q}},v4WorkflowsPost:async(e,t={})=>{let s="/v4/workflows/",a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"POST",...i,...t},r={},l={};await x(r,"x-api-key",o),r["Content-Type"]="application/json",r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},n.data=O(e,n,o),{url:V(a),options:n}},v4WorkflowsWorkflowIdAuditlogGet:async(e,t,s,a,i,n={})=>{S("v4WorkflowsWorkflowIdAuditlogGet","workflowId",e);let r="/v4/workflows/{workflowId}/auditlog".replace("{workflowId}",encodeURIComponent(String(e))),l=new C(r,k),c;o&&(c=o.baseOptions);let d={method:"GET",...c,...n},p={},m={};await x(p,"x-api-key",o),await re(p,o),a!==void 0&&(m.page=a),i!==void 0&&(m.limit=i),p.Accept="application/json",t!=null&&(p["x-api-key"]=String(t)),s!=null&&(p.Authorization=String(s)),I(l,m);let R=c&&c.headers?c.headers:{};return d.headers={...p,...R,...n.headers},{url:V(l),options:d}},v4WorkflowsWorkflowIdComplianceApprovePut:async(e,t,s,a={})=>{S("v4WorkflowsWorkflowIdComplianceApprovePut","workflowId",e);let i="/v4/workflows/{workflowId}/compliance-approve".replace("{workflowId}",encodeURIComponent(String(e))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"PUT",...r,...a},c={},d={};await x(c,"x-api-key",o),c.Accept="application/json",t!=null&&(c["x-api-key"]=String(t)),s!=null&&(c.Authorization=String(s)),I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v4WorkflowsWorkflowIdComplianceRejectPut:async(e,t,s,a,i={})=>{S("v4WorkflowsWorkflowIdComplianceRejectPut","workflowId",e),S("v4WorkflowsWorkflowIdComplianceRejectPut","v4WorkflowsWorkflowIdComplianceRejectPutRequest",t);let n="/v4/workflows/{workflowId}/compliance-reject".replace("{workflowId}",encodeURIComponent(String(e))),r=new C(n,k),l;o&&(l=o.baseOptions);let c={method:"PUT",...l,...i},d={},p={};await x(d,"x-api-key",o),d["Content-Type"]="application/json",d.Accept="application/json",s!=null&&(d["x-api-key"]=String(s)),a!=null&&(d.Authorization=String(a)),I(r,p);let m=l&&l.headers?l.headers:{};return c.headers={...d,...m,...i.headers},c.data=O(t,c,o),{url:V(r),options:c}},v4WorkflowsWorkflowIdDataGet:async(e,t,s,a,i,n,r,l,c,d,p,m,R,u={})=>{S("v4WorkflowsWorkflowIdDataGet","workflowId",e);let w="/v4/workflows/{workflowId}/data".replace("{workflowId}",encodeURIComponent(String(e))),h=new C(w,k),b;o&&(b=o.baseOptions);let G={method:"GET",...b,...u},q={},D={};await x(q,"x-api-key",o),await re(q,o),a!==void 0&&(D.runId=a),i!==void 0&&(D.format=i),n!==void 0&&(D.sortBy=n),r!==void 0&&(D.order=r),l!==void 0&&(D.filters=l),c!==void 0&&(D.page=c),d!==void 0&&(D.limit=d),p!==void 0&&(D.gzip=p),m!==void 0&&(D.rowIds=m),R!==void 0&&(D.includeAnomalies=R),q.Accept="application/json,text/csv",t!=null&&(q["x-api-key"]=String(t)),s!=null&&(q.Authorization=String(s)),I(h,D);let N=b&&b.headers?b.headers:{};return G.headers={...q,...N,...u.headers},{url:V(h),options:G}},v4WorkflowsWorkflowIdDelete:async(e,t={})=>{S("v4WorkflowsWorkflowIdDelete","workflowId",e);let s="/v4/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="text/plain",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdGet:async(e,t={})=>{S("v4WorkflowsWorkflowIdGet","workflowId",e);let s="/v4/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdHistoryGet:async(e,t={})=>{S("v4WorkflowsWorkflowIdHistoryGet","workflowId",e);let s="/v4/workflows/{workflowId}/history".replace("{workflowId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdJobsJobIdGet:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdJobsJobIdGet","workflowId",e),S("v4WorkflowsWorkflowIdJobsJobIdGet","jobId",t);let a="/v4/workflows/{workflowId}/jobs/{jobId}".replace("{workflowId}",encodeURIComponent(String(e))).replace("{jobId}",encodeURIComponent(String(t))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},c={};await x(l,"x-api-key",o),l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},{url:V(i),options:r}},v4WorkflowsWorkflowIdMetadataPut:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdMetadataPut","workflowId",e),S("v4WorkflowsWorkflowIdMetadataPut","v4WorkflowsWorkflowIdMetadataPutRequest",t);let a="/v4/workflows/{workflowId}/metadata".replace("{workflowId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4WorkflowsWorkflowIdPausePut:async(e,t={})=>{S("v4WorkflowsWorkflowIdPausePut","workflowId",e);let s="/v4/workflows/{workflowId}/pause".replace("{workflowId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"PUT",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="text/plain",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdResumePut:async(e,t={})=>{S("v4WorkflowsWorkflowIdResumePut","workflowId",e);let s="/v4/workflows/{workflowId}/resume".replace("{workflowId}",encodeURIComponent(String(e))),a=new C(s,k),i;o&&(i=o.baseOptions);let n={method:"PUT",...i,...t},r={},l={};await x(r,"x-api-key",o),r.Accept="application/json",I(a,l);let c=i&&i.headers?i.headers:{};return n.headers={...r,...c,...t.headers},{url:V(a),options:n}},v4WorkflowsWorkflowIdRunPut:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdRunPut","workflowId",e);let a="/v4/workflows/{workflowId}/run".replace("{workflowId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="application/json",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v4WorkflowsWorkflowIdSchedulePut:async(e,t,s={})=>{S("v4WorkflowsWorkflowIdSchedulePut","workflowId",e),S("v4WorkflowsWorkflowIdSchedulePut","v4WorkflowsWorkflowIdSchedulePutRequest",t);let a="/v4/workflows/{workflowId}/schedule".replace("{workflowId}",encodeURIComponent(String(e))),i=new C(a,k),n;o&&(n=o.baseOptions);let r={method:"PUT",...n,...s},l={},c={};await x(l,"x-api-key",o),l["Content-Type"]="application/json",l.Accept="text/plain",I(i,c);let d=n&&n.headers?n.headers:{};return r.headers={...l,...d,...s.headers},r.data=O(t,r,o),{url:V(i),options:r}},v5ChangesChangeIdGet:async(e,t,s,a={})=>{S("v5ChangesChangeIdGet","changeId",e);let i="/v5/changes/{changeId}".replace("{changeId}",encodeURIComponent(String(e))),n=new C(i,k),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},c={},d={};await x(c,"x-api-key",o),await re(c,o),c.Accept="application/json",t!=null&&(c["x-api-key"]=String(t)),s!=null&&(c.Authorization=String(s)),I(n,d);let p=r&&r.headers?r.headers:{};return l.headers={...c,...p,...a.headers},{url:V(n),options:l}},v5ChangesGet:async(e,t,s,a,i,n,r,l={})=>{let c="/v5/changes",d=new C(c,k),p;o&&(p=o.baseOptions);let m={method:"GET",...p,...l},R={},u={};await x(R,"x-api-key",o),await re(R,o),s!==void 0&&(u.workflowIds=s),a!==void 0&&(u.startDate=a instanceof Date?a.toISOString():a),i!==void 0&&(u.endDate=i instanceof Date?i.toISOString():i),n!==void 0&&(u.skip=n),r!==void 0&&(u.limit=r),R.Accept="application/json",e!=null&&(R["x-api-key"]=String(e)),t!=null&&(R.Authorization=String(t)),I(d,u);let w=p&&p.headers?p.headers:{};return m.headers={...R,...w,...l.headers},{url:V(d),options:m}},v5WorkflowsWorkflowIdAuditlogGet:async(e,t,s,a,i,n={})=>{S("v5WorkflowsWorkflowIdAuditlogGet","workflowId",e);let r="/v5/workflows/{workflowId}/auditlog".replace("{workflowId}",encodeURIComponent(String(e))),l=new C(r,k),c;o&&(c=o.baseOptions);let d={method:"GET",...c,...n},p={},m={};await x(p,"x-api-key",o),await re(p,o),a!==void 0&&(m.page=a),i!==void 0&&(m.limit=i),p.Accept="application/json",t!=null&&(p["x-api-key"]=String(t)),s!=null&&(p.Authorization=String(s)),I(l,m);let R=c&&c.headers?c.headers:{};return d.headers={...p,...R,...n.headers},{url:V(l),options:d}}}},F=function(o){let e=Di(o);return {async v4ChangesChangeIdGet(t,s,a,i){let n=await e.v4ChangesChangeIdGet(t,s,a,i),r=o?.serverIndex??0,l=A["WorkflowsApi.v4ChangesChangeIdGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4ChangesFilesEncodedPathGet(t,s,a,i){let n=await e.v4ChangesFilesEncodedPathGet(t,s,a,i),r=o?.serverIndex??0,l=A["WorkflowsApi.v4ChangesFilesEncodedPathGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4ChangesGet(t,s,a,i,n,r,l,c,d){let p=await e.v4ChangesGet(t,s,a,i,n,r,l,c,d),m=o?.serverIndex??0,R=A["WorkflowsApi.v4ChangesGet"]?.[m]?.url;return (u,w)=>v(p,g,y,o)(u,R||w)},async v4WorkflowsBulkPost(t,s){let a=await e.v4WorkflowsBulkPost(t,s),i=o?.serverIndex??0,n=A["WorkflowsApi.v4WorkflowsBulkPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsGet(t,s,a,i,n,r,l,c,d,p,m,R,u,w,h){let b=await e.v4WorkflowsGet(t,s,a,i,n,r,l,c,d,p,m,R,u,w,h),G=o?.serverIndex??0,q=A["WorkflowsApi.v4WorkflowsGet"]?.[G]?.url;return (D,N)=>v(b,g,y,o)(D,q||N)},async v4WorkflowsPost(t,s){let a=await e.v4WorkflowsPost(t,s),i=o?.serverIndex??0,n=A["WorkflowsApi.v4WorkflowsPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r){let l=await e.v4WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r),c=o?.serverIndex??0,d=A["WorkflowsApi.v4WorkflowsWorkflowIdAuditlogGet"]?.[c]?.url;return (p,m)=>v(l,g,y,o)(p,d||m)},async v4WorkflowsWorkflowIdComplianceApprovePut(t,s,a,i){let n=await e.v4WorkflowsWorkflowIdComplianceApprovePut(t,s,a,i),r=o?.serverIndex??0,l=A["WorkflowsApi.v4WorkflowsWorkflowIdComplianceApprovePut"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v4WorkflowsWorkflowIdComplianceRejectPut(t,s,a,i,n){let r=await e.v4WorkflowsWorkflowIdComplianceRejectPut(t,s,a,i,n),l=o?.serverIndex??0,c=A["WorkflowsApi.v4WorkflowsWorkflowIdComplianceRejectPut"]?.[l]?.url;return (d,p)=>v(r,g,y,o)(d,c||p)},async v4WorkflowsWorkflowIdDataGet(t,s,a,i,n,r,l,c,d,p,m,R,u,w){let h=await e.v4WorkflowsWorkflowIdDataGet(t,s,a,i,n,r,l,c,d,p,m,R,u,w),b=o?.serverIndex??0,G=A["WorkflowsApi.v4WorkflowsWorkflowIdDataGet"]?.[b]?.url;return (q,D)=>v(h,g,y,o)(q,G||D)},async v4WorkflowsWorkflowIdDelete(t,s){let a=await e.v4WorkflowsWorkflowIdDelete(t,s),i=o?.serverIndex??0,n=A["WorkflowsApi.v4WorkflowsWorkflowIdDelete"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdGet(t,s){let a=await e.v4WorkflowsWorkflowIdGet(t,s),i=o?.serverIndex??0,n=A["WorkflowsApi.v4WorkflowsWorkflowIdGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdHistoryGet(t,s){let a=await e.v4WorkflowsWorkflowIdHistoryGet(t,s),i=o?.serverIndex??0,n=A["WorkflowsApi.v4WorkflowsWorkflowIdHistoryGet"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdJobsJobIdGet(t,s,a){let i=await e.v4WorkflowsWorkflowIdJobsJobIdGet(t,s,a),n=o?.serverIndex??0,r=A["WorkflowsApi.v4WorkflowsWorkflowIdJobsJobIdGet"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4WorkflowsWorkflowIdMetadataPut(t,s,a){let i=await e.v4WorkflowsWorkflowIdMetadataPut(t,s,a),n=o?.serverIndex??0,r=A["WorkflowsApi.v4WorkflowsWorkflowIdMetadataPut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4WorkflowsWorkflowIdPausePut(t,s){let a=await e.v4WorkflowsWorkflowIdPausePut(t,s),i=o?.serverIndex??0,n=A["WorkflowsApi.v4WorkflowsWorkflowIdPausePut"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdResumePut(t,s){let a=await e.v4WorkflowsWorkflowIdResumePut(t,s),i=o?.serverIndex??0,n=A["WorkflowsApi.v4WorkflowsWorkflowIdResumePut"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},async v4WorkflowsWorkflowIdRunPut(t,s,a){let i=await e.v4WorkflowsWorkflowIdRunPut(t,s,a),n=o?.serverIndex??0,r=A["WorkflowsApi.v4WorkflowsWorkflowIdRunPut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v4WorkflowsWorkflowIdSchedulePut(t,s,a){let i=await e.v4WorkflowsWorkflowIdSchedulePut(t,s,a),n=o?.serverIndex??0,r=A["WorkflowsApi.v4WorkflowsWorkflowIdSchedulePut"]?.[n]?.url;return (l,c)=>v(i,g,y,o)(l,r||c)},async v5ChangesChangeIdGet(t,s,a,i){let n=await e.v5ChangesChangeIdGet(t,s,a,i),r=o?.serverIndex??0,l=A["WorkflowsApi.v5ChangesChangeIdGet"]?.[r]?.url;return (c,d)=>v(n,g,y,o)(c,l||d)},async v5ChangesGet(t,s,a,i,n,r,l,c){let d=await e.v5ChangesGet(t,s,a,i,n,r,l,c),p=o?.serverIndex??0,m=A["WorkflowsApi.v5ChangesGet"]?.[p]?.url;return (R,u)=>v(d,g,y,o)(R,m||u)},async v5WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r){let l=await e.v5WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r),c=o?.serverIndex??0,d=A["WorkflowsApi.v5WorkflowsWorkflowIdAuditlogGet"]?.[c]?.url;return (p,m)=>v(l,g,y,o)(p,d||m)}}};var it=class extends se{v4ChangesChangeIdGet(e,t){return F(this.configuration).v4ChangesChangeIdGet(e.changeId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4ChangesFilesEncodedPathGet(e,t){return F(this.configuration).v4ChangesFilesEncodedPathGet(e.encodedPath,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4ChangesGet(e={},t){return F(this.configuration).v4ChangesGet(e.xApiKey,e.authorization,e.workflowIds,e.startDate,e.endDate,e.skip,e.limit,e.exclude,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsBulkPost(e,t){return F(this.configuration).v4WorkflowsBulkPost(e.v4WorkflowsBulkPostRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsGet(e={},t){return F(this.configuration).v4WorkflowsGet(e.search,e.skip,e.limit,e.state,e.runState,e.displayState,e.inSupport,e.tags,e.userId,e.monitoring,e.updateInterval,e.templateId,e.includeDeleted,e.format,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsPost(e={},t){return F(this.configuration).v4WorkflowsPost(e.createWorkflowBody,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdAuditlogGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdAuditlogGet(e.workflowId,e.xApiKey,e.authorization,e.page,e.limit,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdComplianceApprovePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdComplianceApprovePut(e.workflowId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdComplianceRejectPut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdComplianceRejectPut(e.workflowId,e.v4WorkflowsWorkflowIdComplianceRejectPutRequest,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdDataGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdDataGet(e.workflowId,e.xApiKey,e.authorization,e.runId,e.format,e.sortBy,e.order,e.filters,e.page,e.limit,e.gzip,e.rowIds,e.includeAnomalies,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdDelete(e,t){return F(this.configuration).v4WorkflowsWorkflowIdDelete(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdHistoryGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdHistoryGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdJobsJobIdGet(e,t){return F(this.configuration).v4WorkflowsWorkflowIdJobsJobIdGet(e.workflowId,e.jobId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdMetadataPut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdMetadataPut(e.workflowId,e.v4WorkflowsWorkflowIdMetadataPutRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdPausePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdPausePut(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdResumePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdResumePut(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdRunPut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdRunPut(e.workflowId,e.v4WorkflowsWorkflowIdRunPutRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdSchedulePut(e,t){return F(this.configuration).v4WorkflowsWorkflowIdSchedulePut(e.workflowId,e.v4WorkflowsWorkflowIdSchedulePutRequest,t).then(s=>s(this.axios,this.basePath))}v5ChangesChangeIdGet(e,t){return F(this.configuration).v5ChangesChangeIdGet(e.changeId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v5ChangesGet(e={},t){return F(this.configuration).v5ChangesGet(e.xApiKey,e.authorization,e.workflowIds,e.startDate,e.endDate,e.skip,e.limit,t).then(s=>s(this.axios,this.basePath))}v5WorkflowsWorkflowIdAuditlogGet(e,t){return F(this.configuration).v5WorkflowsWorkflowIdAuditlogGet(e.workflowId,e.xApiKey,e.authorization,e.page,e.limit,t).then(s=>s(this.axios,this.basePath))}};var nt=class{constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.awsv4=e.awsv4,this.basePath=e.basePath,this.serverIndex=e.serverIndex,this.baseOptions={...e.baseOptions,headers:{...e.baseOptions?.headers}},this.formDataCtor=e.formDataCtor;}isJsonMime(e){let t=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return e!==null&&(t.test(e)||e.toLowerCase()==="application/json-patch+json")}};var ee={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Date:"DATE",Datetime:"DATETIME",Money:"MONEY",Image:"IMAGE",Link:"LINK",Object:"OBJECT",Array:"ARRAY"};var Ei={Done:"DONE",Crawling:"CRAWLING",Pending:"PENDING"};var rt=class{constructor(e){this.client=e;}get api(){return this.client.apis.crawler}async createConfig(e){return (await this.api.v4CrawlConfigPost({createCrawlerConfigRequest:e})).data}async getConfig(e){return (await this.api.v4CrawlConfigConfigIdGet({configId:e})).data}async deleteConfig(e){return (await this.api.v4CrawlConfigDelete({deleteCrawlerConfigRequest:{configId:e}})).data}};var lt=class{constructor(e){this.client=e;}get api(){return this.client.apis.crawler}async start(e){return (await this.api.v4CrawlPost({startCrawlerSessionRequest:e})).data}async startWithConfig(e){return (await this.api.v4CrawlStartPost({startSessionWithConfigRequest:e})).data}async pause(e){return (await this.api.v4CrawlPausePost({pauseCrawlerSessionRequest:{sessionId:e}})).data}async resume(e){return (await this.api.v4CrawlResumePost({resumeCrawlerSessionRequest:{sessionId:e}})).data}async listSessions(e){return (await this.api.v4CrawlSessionsGet({page:e?.page,pageSize:e?.pageSize,userId:e?.userId})).data.data??[]}async getSessionStatus(e){return (await this.api.v4CrawlSessionIdStatusGet({sessionId:e})).data}async getPages(e,t){return (await this.api.v4CrawlSessionIdPagesGet({sessionId:e,currentPage:t?.currentPage,pageSize:t?.pageSize})).data}async getPage(e,t,s){return (await this.api.v4CrawlSessionIdPagesPageIdGet({sessionId:e,pageId:t,format:s?.format})).data}async getAllSessionData(e,t){return (await this.api.v4CrawlSessionIdListGet({sessionId:e,includeAll:t?.includeAll})).data}async getBucketFile(e){return (await this.api.v4CrawlBucketDataFilenameb64Get({filenameb64:e})).data}};function Vo(o){return {config:new rt(o),session:new lt(o)}}var vo=class{},Oi={String:ee.String,Number:ee.Number,Boolean:ee.Boolean,Date:ee.Date,Datetime:ee.Datetime,Money:ee.Money,Image:ee.Image,Link:ee.Link,Object:ee.Object,Array:ee.Array},qi={...Oi,Text:ee.String,Url:ee.Link};var Ge=class{constructor(e){this.fetchPage=e;}async fetchAll(e={}){let t=[],s=1,a=true;for(;a;){let i=await this.fetchPage({...e,page:s});t.push(...i.data);let n=i.pagination;a=n.page!==void 0&&n.totalPages!==void 0&&n.page<n.totalPages,s++;}return t}async*pages(e={}){let t=1,s=true;for(;s;){let a=await this.fetchPage({...e,page:t});yield a;let i=a.pagination;s=i.page!==void 0&&i.totalPages!==void 0&&i.page<i.totalPages,t++;}}async*items(e={}){for await(let t of this.pages(e))for(let s of t.data)yield s;}};var ct=class{constructor(e){this.workflowsApi=e;this.defaultLimit=100;}async fetchData(e){return (await this.workflowsApi.v4WorkflowsWorkflowIdDataGet({...e,page:e.page??1,limit:e.limit??this.defaultLimit})).data}async fetchAllData(e){return new Ge(s=>this.fetchData({...e,...s})).fetchAll({limit:e.limit??this.defaultLimit})}async*fetchDataPages(e){let t=new Ge(s=>this.fetchData({...e,...s}));for await(let s of t.pages({limit:e.limit??this.defaultLimit}))yield s;}};var ce={VALIDATION_ERROR:"VALIDATION_ERROR",BAD_REQUEST:"BAD_REQUEST",NOT_FOUND:"NOT_FOUND",INTERNAL_ERROR:"INTERNAL_ERROR"},le=class le extends Error{constructor(e,t){super(e),this.name="KadoaSdkException",this.code=t?.code??"UNKNOWN",this.details=t?.details,t&&"cause"in t&&(this.cause=t.cause),Error.captureStackTrace?.(this,le);}static from(e,t){if(e instanceof le)return e;let s=e instanceof Error?e.message:typeof e=="string"?e:"Unexpected error";return new le(s,{code:"UNKNOWN",details:t,cause:e})}toJSON(){return {name:this.name,message:this.message,code:this.code,details:this.details}}toString(){return [this.name,this.code,this.message].filter(Boolean).join(": ")}toDetailedString(){let e=[`${this.name}: ${this.message}`,`Code: ${this.code}`];return this.details&&Object.keys(this.details).length>0&&e.push(`Details: ${JSON.stringify(this.details,null,2)}`),this.cause&&e.push(`Cause: ${this.cause}`),e.join(`
7
7
  `)}static isInstance(e){return e instanceof le}static wrap(e,t){if(e instanceof le)return e;let s=t?.message||(e instanceof Error?e.message:typeof e=="string"?e:"Unexpected error");return new le(s,{code:"UNKNOWN",details:t?.details,cause:e})}};le.ERROR_MESSAGES={CONFIG_ERROR:"Invalid configuration provided",AUTH_FAILED:"Authentication failed. Please check your API key",RATE_LIMITED:"Rate limit exceeded. Please try again later",NETWORK_ERROR:"Network error occurred",SERVER_ERROR:"Server error occurred",PARSE_ERROR:"Failed to parse response",BAD_REQUEST:"Bad request",ABORTED:"Aborted",NOT_FOUND:"Not found",NO_WORKFLOW_ID:"Failed to start extraction process - no ID received",WORKFLOW_CREATE_FAILED:"Failed to create workflow",WORKFLOW_TIMEOUT:"Workflow processing timed out",WORKFLOW_UNEXPECTED_STATUS:"Extraction completed with unexpected status",PROGRESS_CHECK_FAILED:"Failed to check extraction progress",DATA_FETCH_FAILED:"Failed to retrieve extracted data from workflow",NO_URLS:"At least one URL is required for extraction",NO_API_KEY:"API key is required for entity detection",LINK_REQUIRED:"Link is required for entity field detection",NO_PREDICTIONS:"No entity predictions returned from the API",EXTRACTION_FAILED:"Data extraction failed for the provided URLs",ENTITY_FETCH_FAILED:"Failed to fetch entity fields",ENTITY_INVARIANT_VIOLATION:"No valid entity provided",SCHEMA_NOT_FOUND:"Schema not found",SCHEMA_FETCH_ERROR:"Failed to fetch schema",SCHEMAS_FETCH_ERROR:"Failed to fetch schemas",SCHEMA_CREATE_FAILED:"Failed to create schema",SCHEMA_UPDATE_FAILED:"Failed to update schema",SCHEMA_DELETE_FAILED:"Failed to delete schema"};var P=le,j=P.ERROR_MESSAGES;var E=class o extends P{constructor(e,t){super(e,{code:t?.code,details:t?.details,cause:t?.cause}),this.name="KadoaHttpException",this.httpStatus=t?.httpStatus,this.requestId=t?.requestId,this.endpoint=t?.endpoint,this.method=t?.method,this.responseBody=t?.responseBody;}static fromAxiosError(e,t){let s=e.response?.status,a=e.response?.headers?.["x-request-id"]||e.response?.headers?.["x-amzn-requestid"],i=e.config?.method?.toUpperCase(),n=e.config?.url;return new o(t?.message||e.message,{code:o.mapStatusToCode(e),httpStatus:s,requestId:a,endpoint:n,method:i,responseBody:e.response?.data,details:t?.details})}toJSON(){return {...super.toJSON(),httpStatus:this.httpStatus,requestId:this.requestId,endpoint:this.endpoint,method:this.method,responseBody:this.responseBody}}toDetailedString(){let e=[`${this.name}: ${this.message}`,`Code: ${this.code}`];return this.httpStatus&&e.push(`HTTP Status: ${this.httpStatus}`),this.method&&this.endpoint&&e.push(`Request: ${this.method} ${this.endpoint}`),this.requestId&&e.push(`Request ID: ${this.requestId}`),this.responseBody&&e.push(`Response Body: ${JSON.stringify(this.responseBody,null,2)}`),this.details&&Object.keys(this.details).length>0&&e.push(`Details: ${JSON.stringify(this.details,null,2)}`),this.cause&&e.push(`Cause: ${this.cause}`),e.join(`
8
- `)}static wrap(e,t){return e instanceof o||e instanceof P?e:ks(e)?o.fromAxiosError(e,t):P.wrap(e,t)}static mapStatusToCode(e){let t=typeof e=="number"?e:e.response?.status;return t?t===401||t===403?"AUTH_ERROR":t===404?"NOT_FOUND":t===408?"TIMEOUT":t===429?"RATE_LIMITED":t>=400&&t<500?"VALIDATION_ERROR":t>=500?"HTTP_ERROR":"UNKNOWN":typeof e=="number"?"UNKNOWN":e.code==="ECONNABORTED"?"TIMEOUT":e.request?"NETWORK_ERROR":"UNKNOWN"}};var Ds=na(bs()),ce=o=>(0, Ds.default)(`kadoa:${o}`),Y={client:ce("client"),wss:ce("wss"),extraction:ce("extraction"),http:ce("http"),workflow:ce("workflow"),crawl:ce("crawl"),notifications:ce("notifications"),schemas:ce("schemas"),validation:ce("validation")};function vo(o){if(!o||typeof o!="object")return false;let e=Object.getPrototypeOf(o);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(o)==="[object Object]":false}function Es(o){return o==="__proto__"}function pe(o,e){let t=Object.keys(e);for(let s=0;s<t.length;s++){let a=t[s];if(Es(a))continue;let i=e[a],n=o[a];Os(i)&&Os(n)?o[a]=pe(n,i):Array.isArray(i)?o[a]=pe([],i):vo(i)?o[a]=pe({},i):(n===void 0||i!==void 0)&&(o[a]=i);}return o}function Os(o){return vo(o)||Array.isArray(o)}function qs(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}var Hi=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function Ns(o){return Array.from(o.match(Hi)??[])}function So(o){let e=Ns(o);if(e.length===0)return "";let[t,...s]=e;return `${t.toLowerCase()}${s.map(a=>qs(a)).join("")}`}function Po(o){return o.substring(0,1).toUpperCase()+o.substring(1)}var Be=class Be{constructor(){this.fields=[];}hasSchemaFields(){return this.fields.some(e=>e.fieldType==="SCHEMA")}entity(e){return this.entityName=e,this}field(e,t,s,a){if(this.validateFieldName(e),Be.TYPES_REQUIRING_EXAMPLE.includes(s)&&!a?.example)throw new P(`Field "${e}" with type ${s} requires an example`,{code:"VALIDATION_ERROR",details:{name:e,dataType:s}});return this.fields.push({name:e,description:t,dataType:s,fieldType:"SCHEMA",example:a?.example,isKey:a?.isKey}),this}classify(e,t,s){return this.validateFieldName(e),this.fields.push({name:e,description:t,fieldType:"CLASSIFICATION",categories:s}),this}raw(e){let t=Array.isArray(e)?e:[e];for(let s of t){let a=`raw${Po(So(s))}`;this.fields.some(i=>i.name===a)||this.fields.push({name:a,description:`Raw page content in ${s.toUpperCase()} format`,fieldType:"METADATA",metadataKey:s});}return this}build(){if(this.hasSchemaFields()&&!this.entityName)throw new P("Entity name is required when schema fields are present",{code:"VALIDATION_ERROR",details:{entityName:this.entityName}});return {entityName:this.entityName,fields:this.fields}}validateFieldName(e){if(!Be.FIELD_NAME_PATTERN.test(e))throw new P(`Field name "${e}" must be alphanumeric only (no underscores or special characters)`,{code:"VALIDATION_ERROR",details:{name:e,pattern:"^[A-Za-z0-9]+$"}});let t=e.toLowerCase();if(this.fields.some(s=>s.name.toLowerCase()===t))throw new P(`Duplicate field name: "${e}"`,{code:"VALIDATION_ERROR",details:{name:e}})}};Be.FIELD_NAME_PATTERN=/^[A-Za-z0-9]+$/,Be.TYPES_REQUIRING_EXAMPLE=["STRING","IMAGE","LINK","OBJECT","ARRAY"];var xe=Be;var Ut=Y.schemas,Ie=class{constructor(e){this.client=e;}get schemasApi(){return this.client.apis.schemas}builder(e){let t=this;return new class extends xe{constructor(){super(),e&&this.entity(e);}async create(s){let a=this.build(),i=s??a.entityName;if(!i)throw new P("Schema name is required when entity name is not provided",{code:"VALIDATION_ERROR",details:{name:s}});let n={name:i,fields:a.fields,...a.entityName?{entity:a.entityName}:{}};return t.createSchema(n)}}}async getSchema(e){Ut("Fetching schema with ID: %s",e);let s=(await this.schemasApi.v4SchemasSchemaIdGet({schemaId:e})).data.data;if(!s)throw new P(`${j.SCHEMA_NOT_FOUND}: ${e}`,{code:de.NOT_FOUND,details:{schemaId:e}});return s}async listSchemas(){return (await this.schemasApi.v4SchemasGet()).data.data}async createSchema(e){Ut("Creating schema with name: %s",e.name);let s=(await this.schemasApi.v4SchemasPost({createSchemaBody:e})).data.schemaId;if(!s)throw new P(j.SCHEMA_CREATE_FAILED,{code:de.INTERNAL_ERROR});return this.getSchema(s)}async updateSchema(e,t){return Ut("Updating schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdPut({schemaId:e,updateSchemaBody:t}),this.getSchema(e)}async deleteSchema(e){Ut("Deleting schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdDelete({schemaId:e});}};var Ki="/v4/entity",dt=class{constructor(e){this.client=e;this.schemasService=new Ie(e);}async resolveEntity(e,t){if(e==="ai-detection"){if(!t?.link)throw new P(j.LINK_REQUIRED,{code:"VALIDATION_ERROR",details:{entityConfig:e,options:t}});let s=await this.fetchEntityFields({link:t.link,location:t.location,navigationMode:t.navigationMode,selectorMode:t.selectorMode??false});return {entity:s.entity,fields:s.fields}}else if(e){if("schemaId"in e){let s=await this.schemasService.getSchema(e.schemaId);return {entity:s.entity??void 0,fields:s.schema}}else if("fields"in e)return {entity:e.name,fields:e.fields}}throw new P(j.ENTITY_INVARIANT_VIOLATION,{details:{entity:e}})}async fetchEntityFields(e){this.validateEntityOptions(e);let t=`${this.client.baseUrl}${Ki}`,s=e,i=(await this.client.axiosInstance.post(t,s,{headers:{"Content-Type":"application/json",Accept:"application/json","x-api-key":this.client.apiKey}})).data;if(!i.success||!i.entityPrediction||i.entityPrediction.length===0)throw new P(j.NO_PREDICTIONS,{code:"NOT_FOUND",details:{success:i.success,hasPredictions:!!i.entityPrediction,predictionCount:i.entityPrediction?.length||0,link:e.link}});return i.entityPrediction[0]}validateEntityOptions(e){if(!e.link)throw new P(j.LINK_REQUIRED,{code:"VALIDATION_ERROR",details:{options:e}})}};var $i=Y.extraction,zi=new Set(["FINISHED","SUCCESS"]),Wo={mode:"run",pollingInterval:5e3,maxWaitTime:3e5,navigationMode:"single-page",location:{type:"auto"},bypassPreview:true,autoStart:true},ct=class{constructor(e,t,s,a,i,n){this.workflowsCoreService=e;this.dataFetcherService=t;this.entityResolverService=s;this.notificationSetupService=a;this.notificationChannelsService=i;this.notificationSettingsService=n;}async run(e){return await this.executeExtraction({...e,mode:"run"})}async submit(e){return await this.executeExtraction({...e,mode:"submit"})}async runJob(e,t){return await this.workflowsCoreService.runWorkflow(e,t)}async runJobAndWait(e,t){let s=await this.workflowsCoreService.runWorkflow(e,t);return await this.workflowsCoreService.waitForJobCompletion(e,s.jobId||"")}async fetchData(e){return await this.dataFetcherService.fetchData(e)}async fetchAllData(e){return await this.dataFetcherService.fetchAllData(e)}fetchDataPages(e){return this.dataFetcherService.fetchDataPages(e)}async getNotificationChannels(e){return await this.notificationChannelsService.listChannels({workflowId:e})}async getNotificationSettings(e){return await this.notificationSettingsService.listSettings({workflowId:e})}async executeExtraction(e){this.validateOptions(e);let t=pe(Wo,e);if(t.interval==="REAL_TIME")throw new P("extraction.run()/submit() are not supported for real-time workflows. Use the builder API, call waitForReady(), and subscribe via client.realtime.onEvent(...).",{code:"BAD_REQUEST",details:{interval:"REAL_TIME"}});let a,i=t.navigationMode==="agentic-navigation";if(i&&!t.userPrompt)throw new P("userPrompt is required when navigationMode is 'agentic-navigation'",{code:"VALIDATION_ERROR",details:{navigationMode:t.navigationMode}});let n;if(i){let u=e.entity||"ai-detection";n={entity:typeof u=="object"&&"name"in u?u.name:void 0,fields:typeof u=="object"&&"fields"in u?u.fields:[]};}else n=await this.entityResolverService.resolveEntity(e.entity||"ai-detection",{link:t.urls[0],location:t.location,navigationMode:t.navigationMode});let r=!!t.notifications,l={...t,fields:n.fields,...n.entity!==void 0?{entity:n.entity}:{},...t.userPrompt?{userPrompt:t.userPrompt}:{}};if(a=(await this.workflowsCoreService.create(l)).id,r){let u=await this.notificationSetupService.setup({workflowId:a,events:t.notifications?.events,channels:t.notifications?.channels});$i("Notifications setup: %O",u.map(w=>({id:w.id,eventType:w.eventType})));}if(t.mode==="submit")return {workflowId:a};let c=await this.workflowsCoreService.wait(a,{pollIntervalMs:t.pollingInterval,timeoutMs:t.maxWaitTime}),p,m;if(this.isExtractionSuccessful(c.runState)){let u=await this.dataFetcherService.fetchData({workflowId:a});p=u.data,m=u.pagination;}else throw new P(`${j.WORKFLOW_UNEXPECTED_STATUS}: ${c.runState}`,{code:"INTERNAL_ERROR",details:{workflowId:a,runState:c.runState,state:c.state}});return {workflowId:a,workflow:c,data:p,pagination:m}}validateOptions(e){if(!e.urls||e.urls.length===0)throw new P(j.NO_URLS,{code:"VALIDATION_ERROR"})}async resumeWorkflow(e){await this.workflowsCoreService.resume(e);let t=await this.workflowsCoreService.wait(e,{pollIntervalMs:Wo.pollingInterval,timeoutMs:Wo.maxWaitTime}),s,a;if(this.isExtractionSuccessful(t.runState)){let n=await this.dataFetcherService.fetchData({workflowId:e});s=n.data,a=n.pagination;}else throw new P(`${j.WORKFLOW_UNEXPECTED_STATUS}: ${t.runState}`,{code:"INTERNAL_ERROR",details:{workflowId:e,runState:t.runState,state:t.state}});return {workflowId:e,workflow:t,data:s,pagination:a}}isExtractionSuccessful(e){return e?zi.has(e.toUpperCase()):false}};var bo=Y.extraction,pt=class{constructor(e,t,s,a){this.workflowsCoreService=e;this.entityResolverService=t;this.dataFetcherService=s;this.notificationSetupService=a;}get options(){return L__default.default(this._options,"Options are not set"),this._options}get notificationOptions(){return this._notificationOptions}get monitoringOptions(){return this._monitoringOptions}get workflowId(){return L__default.default(this._workflowId,"Workflow ID is not set"),this._workflowId}get jobId(){return L__default.default(this._jobId,"Job ID is not set"),this._jobId}extract({urls:e,name:t,description:s,navigationMode:a,extraction:i,additionalData:n,bypassPreview:r,userPrompt:l,interval:d,schedules:c,location:p}){let m="ai-detection";if(i){let R=i(new xe);if("schemaId"in R)m={schemaId:R.schemaId};else {let u=R.build();m=u.entityName?{name:u.entityName,fields:u.fields}:{fields:u.fields};}}return l&&(this._userPrompt=l),this._options={urls:e,name:t,description:s,navigationMode:a||"single-page",entity:m,bypassPreview:r??false,additionalData:n,userPrompt:l,interval:d,schedules:c,location:p},this}withNotifications(e){return this._notificationOptions=e,this}withMonitoring(e){return this._monitoringOptions=e,this}bypassPreview(){return L__default.default(this._options,"Options are not set"),this._options.bypassPreview=true,this}setInterval(e){return L__default.default(this._options,"Options are not set"),"interval"in e?this._options.interval=e.interval:(this._options.interval="CUSTOM",this._options.schedules=e.schedules),this}setLocation(e){return L__default.default(this._options,"Options are not set"),this._options.location=e,this}withPrompt(e){return L__default.default(this._options,"Options are not set"),this._userPrompt=e,this._options.userPrompt=e,this}async create(){L__default.default(this._options,"Options are not set");let{urls:e,name:t,description:s,navigationMode:a,entity:i}=this.options,n=a==="agentic-navigation";if(n&&!this._userPrompt)throw new P("userPrompt is required when navigationMode is 'agentic-navigation'",{code:"VALIDATION_ERROR",details:{navigationMode:a}});let l=this._options.interval==="REAL_TIME"&&i==="ai-detection",d;n?d={entity:typeof i=="object"&&"name"in i?i.name:void 0,fields:typeof i=="object"&&"fields"in i?i.fields:[]}:d=await this.entityResolverService.resolveEntity(i,{link:e[0],location:this._options.location,navigationMode:a,selectorMode:l});let c=typeof i=="object"&&"schemaId"in i&&i.schemaId,p=await this.workflowsCoreService.create({urls:e,name:t,description:s,navigationMode:a,monitoring:this._monitoringOptions,...c?{schemaId:i.schemaId,entity:d.entity,fields:d.fields}:{entity:d.entity,fields:d.fields},autoStart:false,interval:this._options.interval,schedules:this._options.schedules,additionalData:this._options.additionalData,bypassPreview:this._options.bypassPreview,userPrompt:this._userPrompt});return this._notificationOptions&&await this.notificationSetupService.setup({...this._notificationOptions,workflowId:p.id}),this._workflowId=p.id,this}async waitForReady(e){L__default.default(this._workflowId,"Workflow ID is not set");let t=e?.targetState??"PREVIEW",s=await this.workflowsCoreService.get(this._workflowId);return s.state===t||t==="PREVIEW"&&s.state==="ACTIVE"?s:await this.workflowsCoreService.wait(this._workflowId,{targetState:t,pollIntervalMs:e?.pollIntervalMs,timeoutMs:e?.timeoutMs})}async run(e){if(L__default.default(this._options,"Options are not set"),L__default.default(this._workflowId,"Workflow ID is not set"),this._options.interval==="REAL_TIME")throw new P("run() is not supported for real-time workflows. Use waitForReady() and subscribe via client.realtime.onEvent(...).",{code:"BAD_REQUEST",details:{interval:"REAL_TIME",workflowId:this._workflowId}});let t=await this.workflowsCoreService.runWorkflow(this._workflowId,{variables:e?.variables,limit:e?.limit});L__default.default(t.jobId,"Job ID is not set"),bo("Job started: %O",t),this._jobId=t.jobId;let s=await this.workflowsCoreService.waitForJobCompletion(this._workflowId,t.jobId);return bo("Job finished: %O",s),this}async submit(e){if(L__default.default(this._options,"Options are not set"),L__default.default(this._workflowId,"Workflow ID is not set"),this._options.interval==="REAL_TIME")throw new P("submit() is not supported for real-time workflows. Use waitForReady() and subscribe via client.realtime.onEvent(...).",{code:"BAD_REQUEST",details:{interval:"REAL_TIME",workflowId:this._workflowId}});let t=await this.workflowsCoreService.runWorkflow(this._workflowId,{variables:e?.variables,limit:e?.limit});return L__default.default(t.jobId,"Job ID is not set"),bo("Job submitted: %O",t),this._jobId=t.jobId,{workflowId:this._workflowId,jobId:this._jobId}}async fetchData(e){return L__default.default(this._workflowId,"Workflow ID is not set"),L__default.default(this._jobId,"Job ID is not set"),this.dataFetcherService.fetchData({workflowId:this._workflowId,runId:this._jobId,page:e.page??1,limit:e.limit??100,...e})}async fetchAllData(e){return L__default.default(this._jobId,"Job ID is not set"),L__default.default(this._workflowId,"Workflow ID is not set"),this.dataFetcherService.fetchAllData({workflowId:this._workflowId,runId:this._jobId,...e})}};var he={EMAIL:"EMAIL",SLACK:"SLACK",WEBHOOK:"WEBHOOK",WEBSOCKET:"WEBSOCKET"};var Gs=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Qi(o){let e=[];if(!o.recipients?.length)e.push({message:"Recipients are required for email channel"});else for(let t of o.recipients)Gs.test(t)||e.push({message:`Invalid email address: ${t}`});if(o.from!==void 0&&(Gs.test(o.from)?o.from.endsWith("@kadoa.com")||e.push({message:"From email address must end with @kadoa.com"}):e.push({message:`Invalid from email address: ${o.from}`})),e.length>0)throw new P("Invalid email channel config",{code:de.VALIDATION_ERROR,details:{issues:e}});return o}var _t=class _t{constructor(e,t){this.api=e,this.userService=t;}async listChannels(e){let t=await this.api.v5NotificationsChannelsGet(e),s=t.data.data?.channels;if(!s)throw E.wrap(t,{message:"Failed to list channels"});return s}async listAllChannels(e){if(!e)return this.listChannels({});let[t,s]=await Promise.all([this.listChannels({workflowId:e}),this.listChannels({})]),a=[...t];return s.forEach(i=>{a.find(n=>n.id===i.id)||a.push(i);}),a}async deleteChannel(e){let t=await this.api.v5NotificationsChannelsChannelIdDelete({channelId:e});if(t.status!==200)throw E.wrap(t,{message:"Failed to delete channel"})}async createChannel(e,t){let s=await this.buildPayload(pe({name:_t.DEFAULT_CHANNEL_NAME,channelType:e,config:{}},t||{})),a=await this.api.v5NotificationsChannelsPost({v5NotificationsChannelsPostRequest:s});if(a.status===201){let i=a.data.data?.channel;if(!i)throw E.wrap(a,{message:"Failed to create default channels"});return i}throw E.wrap(a,{message:"Failed to create default channels"})}async buildPayload(e){let t;switch(e.channelType){case he.EMAIL:t=await this.buildEmailChannelConfig(e.config);break;case he.SLACK:t=await this.buildSlackChannelConfig(e.config);break;case he.WEBHOOK:t=await this.buildWebhookChannelConfig(e.config);break;case he.WEBSOCKET:t=await this.buildWebsocketChannelConfig(e.config);break;default:t={};}return {name:e.name||"Default Channel",channelType:e.channelType,config:t}}async buildEmailChannelConfig(e){let t=e.recipients;e.recipients?.length||(t=[(await this.userService.getCurrentUser()).email]);let s=pe(e,{recipients:t});return Qi(s)}async buildSlackChannelConfig(e){return e}async buildWebhookChannelConfig(e){return e}async buildWebsocketChannelConfig(e){return e}};_t.DEFAULT_CHANNEL_NAME="default";var fe=_t;var ft=class{constructor(e){this.api=e;}async createSettings(e){let t=await this.api.v5NotificationsSettingsPost({v5NotificationsSettingsPostRequest:e}),s=t.data.data?.settings;if(!s)throw E.wrap(t,{message:"Failed to create notification settings"});return s}async listSettings(e){let t=await this.api.v5NotificationsSettingsGet(e),s=t.data.data?.settings;if(!s)throw E.wrap(t,{message:"Failed to list notification settings"});return s}async listAllEvents(){return Object.values(Tt)}async updateSettings(e,t){let s=await this.api.v5NotificationsSettingsSettingsIdPut({settingsId:e,v5NotificationsSettingsSettingsIdPutRequest:t}),a=s.data.data?.settings;if(!a)throw E.wrap(s,{message:"Failed to update notification settings"});return a}async deleteSettings(e){let t=await this.api.v5NotificationsSettingsSettingsIdDelete({settingsId:e});if(t.status!==200)throw E.wrap(t,{message:"Failed to delete notification settings"})}};var Re=Y.notifications,ut=class{constructor(e,t){this.channelsService=e;this.settingsService=t;}async setupForWorkflow(e){return this.setup({workflowId:e.workflowId,events:e.events,channels:e.channels})}async setupForWorkspace(e){if((await this.settingsService.listSettings({})).length>0)throw new P("Workspace settings already exist",{code:de.BAD_REQUEST});return this.setup({events:e.events,channels:e.channels})}async setup(e){e.workflowId?Re("Setting up notifications for workflow %s",e.workflowId):Re("Setting up notifications for workspace");let t=await this.setupChannels({workflowId:e.workflowId,channels:e.channels||{}}),s=e.events||"all",a=s==="all"?await this.settingsService.listAllEvents():s,i=t.map(l=>l.id).filter(Boolean);Re("Creating notification settings for workflow %s: %O",e.workflowId,{events:a,channels:i});let n=await this.settingsService.listSettings({workflowId:e.workflowId}),r=await Promise.all(a.map(async l=>{let d=n.find(c=>c.eventType===l);if(d?.id){let c=(d.channels||[]).map(m=>m.id).filter(Boolean),p=[...new Set([...c,...i])];return await this.settingsService.updateSettings(d.id,{channelIds:p,enabled:d.enabled??true})}return await this.settingsService.createSettings({workflowId:e.workflowId,channelIds:i,eventType:l,enabled:true,eventConfiguration:{}})}));return Re(e.workflowId?"Successfully setup notifications for workflow %s":"Successfully setup notifications for workspace",e.workflowId),r}async setupChannels(e){let t=await this.channelsService.listAllChannels(e.workflowId),s=Object.entries(e.channels).filter(([,d])=>d===true),a=Object.entries(e.channels).filter(([d,c])=>typeof c=="object"&&"channelId"in c),i=Object.entries(e.channels).filter(([,d])=>typeof d=="object"&&!("channelId"in d)),n=await this.handleChannelsById({channelsById:a,existingChannels:t,workflowId:e.workflowId}),r=await this.handleDefaultChannels({channelsByName:s,existingChannels:t,workflowId:e.workflowId}),l=await this.handleChannelsByConfig({channelsByConfig:i,existingChannels:t,workflowId:e.workflowId});return [...n,...r,...l]}async handleChannelsById({channelsById:e,existingChannels:t,workflowId:s}){let a=e.map(([l,d])=>d.channelId),i=t.filter(l=>l.id&&a.includes(l.id)),n=i.map(l=>l.id),r=a.filter(l=>!n.includes(l));if(r.length>0)throw new P(`Channels not found: ${r.join(", ")}`,{code:de.NOT_FOUND,details:{workflowId:s,missingChannelIds:r}});return i}async handleDefaultChannels({channelsByName:e,existingChannels:t,workflowId:s}){return await Promise.all(e.map(async([i])=>{let n=i===he.WEBSOCKET?t.find(l=>l.channelType===i):t.find(l=>l.channelType===i&&l.name===fe.DEFAULT_CHANNEL_NAME);if(n)return Re("Using existing default channel: %O",{workflowId:s,channelType:i,channelId:n.id}),n;let r=await this.channelsService.createChannel(i);return Re("Created default channel %O",{workflowId:s,channelType:i,channel:r}),r}))}async handleChannelsByConfig({channelsByConfig:e,existingChannels:t,workflowId:s}){return e.length===0?[]:await Promise.all(e.map(async([i,n])=>{let r=n.name||fe.DEFAULT_CHANNEL_NAME,l=t.find(m=>m.channelType===i&&(m.name||fe.DEFAULT_CHANNEL_NAME)===r);if(l)return Re("Using existing channel: %O",{workflowId:s,channelType:i,channelName:r,channelId:l.id}),l;let{name:d,...c}=n,p=await this.channelsService.createChannel(i,{name:r,config:c});return Re("Created channel with custom config %O",{workflowId:s,channelType:i,channelName:r,channel:p}),p}))}};var Lt="https://api.kadoa.com",Ts="wss://realtime.kadoa.com";process.env.KADOA_WSS_NEO_API_URI??"wss://events.kadoa.com/events/ws";var Fs="https://realtime.kadoa.com";var ge="0.24.0",jt="kadoa-node-sdk",Bs="node";var ne=Y.wss;typeof WebSocket>"u"&&(window.WebSocket=sa("ws"));var mt=class{constructor(e){this.lastHeartbeat=Date.now();this.isConnecting=false;this.eventListeners=new Set;this.connectionListeners=new Set;this.errorListeners=new Set;this.apiKey=e.apiKey,this.heartbeatInterval=e.heartbeatInterval||1e4,this.reconnectDelay=e.reconnectDelay||5e3,this.missedHeartbeatsLimit=e.missedHeartbeatsLimit||3e4;}async connect(){if(!this.isConnecting){this.isConnecting=true;try{let e=await fetch(`${Lt}/v4/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":`${this.apiKey}`,"x-sdk-version":ge}}),{access_token:t,team_id:s}=await e.json();await new Promise((a,i)=>{this.socket=new WebSocket(`${Ts}?access_token=${t}`),this.socket.onopen=()=>{this.isConnecting=!1,this.lastHeartbeat=Date.now(),this.socket?.readyState===WebSocket.OPEN&&(this.socket.send(JSON.stringify({action:"subscribe",channel:s})),ne("Connected to WebSocket"),this.notifyConnectionListeners(!0)),this.startHeartbeatCheck(),a();},this.socket.onmessage=n=>{try{let r=JSON.parse(n.data);r.type==="heartbeat"?this.handleHeartbeat():(r?.id&&fetch(`${Fs}/api/v1/events/ack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:r.id})}),this.notifyEventListeners(r));}catch(r){ne("Failed to parse incoming message: %O",r);}},this.socket.onclose=()=>{ne("WebSocket disconnected. Attempting to reconnect..."),this.isConnecting=!1,this.stopHeartbeatCheck(),this.notifyConnectionListeners(!1,"Connection closed"),setTimeout(()=>this.connect(),this.reconnectDelay);},this.socket.onerror=n=>{ne("WebSocket error: %O",n),this.isConnecting=!1,this.notifyErrorListeners(n),i(n);};});}catch(e){ne("Failed to connect: %O",e),this.isConnecting=false,setTimeout(()=>this.connect(),this.reconnectDelay);}}}handleHeartbeat(){ne("Heartbeat received"),this.lastHeartbeat=Date.now();}notifyEventListeners(e){this.eventListeners.forEach(t=>{try{t(e);}catch(s){ne("Error in event listener: %O",s);}});}notifyConnectionListeners(e,t){this.connectionListeners.forEach(s=>{try{s(e,t);}catch(a){ne("Error in connection listener: %O",a);}});}notifyErrorListeners(e){this.errorListeners.forEach(t=>{try{t(e);}catch(s){ne("Error in error listener: %O",s);}});}startHeartbeatCheck(){this.missedHeartbeatCheckTimer=setInterval(()=>{Date.now()-this.lastHeartbeat>this.missedHeartbeatsLimit&&(ne("No heartbeat received in 30 seconds! Closing connection."),this.socket?.close());},this.heartbeatInterval);}stopHeartbeatCheck(){this.missedHeartbeatCheckTimer&&clearInterval(this.missedHeartbeatCheckTimer);}onEvent(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e);}}onConnection(e){return this.connectionListeners.add(e),()=>{this.connectionListeners.delete(e);}}onError(e){return this.errorListeners.add(e),()=>{this.errorListeners.delete(e);}}close(){this.socket&&(this.stopHeartbeatCheck(),this.socket.close(),this.socket=void 0),this.eventListeners.clear(),this.connectionListeners.clear(),this.errorListeners.clear();}isConnected(){return this.socket?.readyState===WebSocket.OPEN}};var wt=class{constructor(e){this.client=e;}async getCurrentUser(){let t=(await this.client.axiosInstance.get("/v5/user",{baseURL:this.client.baseUrl,headers:{"x-api-key":this.client.apiKey,"Content-Type":"application/json"}})).data;if(!t||!t.userId)throw new P("Invalid user data received");return {userId:t.userId,email:t.email,featureFlags:t.featureFlags||[]}}};var Yi={pollIntervalMs:1e4,timeoutMs:300*1e3},Us={ABORTED:"ABORTED",TIMEOUT:"TIMEOUT"};async function Ue(o,e,t={}){let s={...Yi,...t},a=Math.max(1e4,s.pollIntervalMs),i=s.timeoutMs,n=Date.now(),r=0;for(;Date.now()-n<i;){if(s.abortSignal?.aborted)throw new P("Polling operation was aborted",{code:Us.ABORTED});r++;let l=await o();if(e(l))return {result:l,attempts:r,duration:Date.now()-n};await new Promise(d=>setTimeout(d,a));}throw new P(`Polling operation timed out after ${i}ms`,{code:Us.TIMEOUT,details:{timeoutMs:i,attempts:r,duration:Date.now()-n}})}function Mt(o){if(o!==void 0){if(o===null||typeof o!="object"||Array.isArray(o))throw new P("additionalData must be a plain object",{code:"VALIDATION_ERROR"});try{JSON.stringify(o).length>100*1024&&console.warn("[Kadoa SDK] additionalData exceeds 100KB, consider reducing size");}catch{throw new P("additionalData must be JSON-serializable",{code:"VALIDATION_ERROR"})}}}var Xi="https://registry.npmjs.org",_s="@kadoa/node-sdk";async function Ls(){try{let o=await fetch(`${Xi}/${_s}`,{headers:{Accept:"application/json"}});if(!o.ok)return;let t=(await o.json())["dist-tags"]?.latest;if(!t)return;Zi(t,ge)&&console.warn(`\u26A0\uFE0F A new version of ${jt} is available: ${t} (current: ${ge}). Update with: npm install ${_s}@latest`);}catch{}}function Zi(o,e){let t=o.split(".").map(Number),s=e.split(".").map(Number);for(let a=0;a<Math.max(t.length,s.length);a++){let i=t[a]||0,n=s[a]||0;if(i>n)return true;if(i<n)return false}return false}var ht=class{constructor(e){this.client=e;}get validationApi(){return this.client.apis.validation}async listWorkflowValidations(e){let t=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e);if(t.status!==200)throw E.wrap(t.data,{message:"Failed to list workflow validations"});return t.data}async getValidationDetails(e){let t=await this.validationApi.v4DataValidationValidationsValidationIdGet({validationId:e});if(t.status!==200||t.data.error)throw E.wrap(t.data,{message:"Failed to get validation details"});return t.data}async scheduleValidation(e,t){let s=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost({workflowId:e,jobId:t});if(s.status!==200||s.data.error)throw E.wrap(s.data,{message:s.data.message||"Failed to schedule validation"});return s.data}async toggleValidationEnabled(e){let t=await this.validationApi.v4DataValidationWorkflowsWorkflowIdValidationTogglePut({workflowId:e});if(t.status!==200||t.data.error)throw E.wrap(t.data,{message:t.data.message||"Failed to toggle validation"});return t.data}async getLatestValidation(e,t){let s;if(t?s=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet({workflowId:e,jobId:t}):s=await this.validationApi.v4DataValidationWorkflowsWorkflowIdValidationsLatestGet({workflowId:e}),s.status!==200||s.data?.error)throw E.wrap(s.data,{message:"Failed to get latest validation"});return s.data}async getValidationAnomalies(e){let t=await this.validationApi.v4DataValidationValidationsValidationIdAnomaliesGet({validationId:e});if(t.status!==200)throw E.wrap(t.data,{message:"Failed to get validation anomalies"});return t.data}async getValidationAnomaliesByRule(e,t){let s=await this.validationApi.v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet({validationId:e,ruleName:t});if(s.status!==200)throw E.wrap(s.data,{message:"Failed to get validation anomalies by rule"});return s.data}async waitUntilCompleted(e,t){return await new Promise(a=>setTimeout(a,1e3)),(await Ue(async()=>{let a=await this.getValidationDetails(e);if(a.error)throw new P(`Validation failed: ${a.error}`,{code:"VALIDATION_ERROR",details:{validationId:e,error:a.error}});return a},a=>a.completedAt!=null,t)).result}};var Rt=class{constructor(e){this.client=e;}get validationApi(){return this.client.apis.validation}async listRules(e){let t=await this.validationApi.v4DataValidationRulesGet(e);if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:"Failed to list validation rules"});return t.data}async getRuleById(e){let t=await this.validationApi.v4DataValidationRulesRuleIdGet({ruleId:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:"Failed to get validation rule by id"});return t.data.data}async getRuleByName(e){let t=await this.validationApi.v4DataValidationRulesGet();if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:"Failed to get validation rule by name"});return t.data.data?.find(s=>s.name===e)}async deleteRule(e){let t=await this.validationApi.v4DataValidationRulesRuleIdDelete({ruleId:e.ruleId,...e.workflowId!=null&&{deleteRuleWithReason:{workflowId:e.workflowId,...e.reason!=null&&{reason:e.reason}}}});if(t.status!==200||t.data.error)throw E.wrap(t.data,{message:t.data.message||"Failed to delete validation rule"});return t.data}async disableRule(e){let t=await this.validationApi.v4DataValidationRulesRuleIdDisablePost(e);if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to disable validation rule"});return t.data.data}async generateRule(e){let t=await this.validationApi.v4DataValidationRulesActionsGeneratePost({generateRule:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to generate validation rule"});return t.data.data}async generateRules(e){let t=await this.validationApi.v4DataValidationRulesActionsGenerateRulesPost({generateRules:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to generate validation rules"});return t.data.data}async bulkApproveRules(e){let t=await this.validationApi.v4DataValidationRulesActionsBulkApprovePost({bulkApproveRules:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to bulk approve validation rules"});return t.data.data}async bulkDeleteRules(e){let t=await this.validationApi.v4DataValidationRulesActionsBulkDeletePost({bulkDeleteRules:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to bulk delete validation rules"});return t.data.data}async deleteAllRules(e){let t=await this.validationApi.v4DataValidationRulesActionsDeleteAllDelete({deleteRuleWithReason:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to delete all validation rules"});return t.data.data}};var gt={Finished:"FINISHED",Failed:"FAILED",NotSupported:"NOT_SUPPORTED",FailedInsufficientFunds:"FAILED_INSUFFICIENT_FUNDS"};var Ms=new Set([gt.Finished,gt.Failed,gt.NotSupported,gt.FailedInsufficientFunds]),Js=new Set(["FINISHED","SUCCESS","FAILED","ERROR","STOPPED","CANCELLED"]),js=Y.workflow,yt=class{constructor(e){this.workflowsApi=e;}async create(e){Mt(e.additionalData);let t=new URL(e.urls[0]).hostname;if(e.navigationMode==="agentic-navigation"){if(!e.userPrompt)throw new P("userPrompt is required when navigationMode is 'agentic-navigation'",{code:"VALIDATION_ERROR",details:{navigationMode:e.navigationMode}});let n={urls:e.urls,navigationMode:"agentic-navigation",name:e.name??t,description:e.description,userPrompt:e.userPrompt,schemaId:e.schemaId,entity:e.entity,fields:e.fields,bypassPreview:e.bypassPreview??true,tags:e.tags,interval:e.interval,monitoring:e.monitoring,location:e.location,autoStart:e.autoStart,schedules:e.schedules,additionalData:e.additionalData,limit:e.limit},r=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:n}),l=r.data?.workflowId;if(!l)throw new P(j.NO_WORKFLOW_ID,{code:"INTERNAL_ERROR",details:{response:r.data}});return {id:l}}let s={urls:e.urls,name:e.name??t,schemaId:e.schemaId,description:e.description,navigationMode:e.navigationMode,...e.entity!=null&&{entity:e.entity},fields:e.fields,bypassPreview:e.bypassPreview??true,tags:e.tags,interval:e.interval,monitoring:e.monitoring,location:e.location,autoStart:e.autoStart,schedules:e.schedules,additionalData:e.additionalData,limit:e.limit},a=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:s}),i=a.data?.workflowId;if(!i)throw new P(j.NO_WORKFLOW_ID,{code:"INTERNAL_ERROR",details:{response:a.data}});return {id:i}}async get(e){return (await this.workflowsApi.v4WorkflowsWorkflowIdGet({workflowId:e})).data}async list(e){return (await this.workflowsApi.v4WorkflowsGet(e)).data?.workflows??[]}async getByName(e){return (await this.workflowsApi.v4WorkflowsGet({search:e})).data?.workflows?.[0]}async delete(e){await this.workflowsApi.v4WorkflowsWorkflowIdDelete({workflowId:e});}async update(e,t){return Mt(t.additionalData),(await this.workflowsApi.v4WorkflowsWorkflowIdMetadataPut({workflowId:e,v4WorkflowsWorkflowIdMetadataPutRequest:t})).data}async resume(e){await this.workflowsApi.v4WorkflowsWorkflowIdResumePut({workflowId:e});}async wait(e,t){return (await Ue(async()=>{let a=await this.get(e);return js("workflow %s state: %s",e,a.runState),a},a=>!!(t?.targetState&&a.state===t.targetState||a.runState&&Js.has(a.runState.toUpperCase())&&a.state!=="QUEUED"),t)).result}async runWorkflow(e,t){let s=await this.workflowsApi.v4WorkflowsWorkflowIdRunPut({workflowId:e,v4WorkflowsWorkflowIdRunPutRequest:{variables:t.variables,limit:t.limit}}),a=s.data?.jobId;if(!a)throw new P(j.NO_WORKFLOW_ID,{code:"INTERNAL_ERROR",details:{response:s.data}});return {jobId:a,message:s.data?.message,status:s.data?.status}}async getJobStatus(e,t){return (await this.workflowsApi.v4WorkflowsWorkflowIdJobsJobIdGet({workflowId:e,jobId:t})).data}async waitForJobCompletion(e,t,s){return (await Ue(async()=>{let i=await this.getJobStatus(e,t);return js("workflow run %s state: %s",t,i.state),i},i=>!!(s?.targetStatus&&i.state===s.targetStatus||i.state&&Ms.has(i.state)),s)).result}};var Jt=class{constructor(e,t,s,a){this.baseUrl=t;this.axios=s;this.cache=new Map;this.configuration=new it({apiKey:e,basePath:t,baseOptions:{headers:a}});}get(e){return this.cache.has(e)||this.cache.set(e,new e(this.configuration,this.baseUrl,this.axios)),this.cache.get(e)}get schemas(){return this.get(st)}get validation(){return this.get(tt)}get crawler(){return this.get(et)}get workflows(){return this.get(at)}get notifications(){return this.get(qe)}};var M=[];for(let o=0;o<256;++o)M.push((o+256).toString(16).slice(1));function Hs(o,e=0){return (M[o[e+0]]+M[o[e+1]]+M[o[e+2]]+M[o[e+3]]+"-"+M[o[e+4]]+M[o[e+5]]+"-"+M[o[e+6]]+M[o[e+7]]+"-"+M[o[e+8]]+M[o[e+9]]+"-"+M[o[e+10]]+M[o[e+11]]+M[o[e+12]]+M[o[e+13]]+M[o[e+14]]+M[o[e+15]]).toLowerCase()}var Do,en=new Uint8Array(16);function Eo(){if(!Do){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Do=crypto.getRandomValues.bind(crypto);}return Do(en)}var tn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Oo={randomUUID:tn};function on(o,e,t){o=o||{};let s=o.random??o.rng?.()??Eo();if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let a=0;a<16;++a)e[t+a]=s[a];return e}return Hs(s)}function sn(o,e,t){return Oo.randomUUID&&!e&&!o?Oo.randomUUID():on(o,e,t)}var qo=sn;function Ks(o,e){return {rules:e,schedule:(t,s)=>o.scheduleValidation(t,s),listWorkflowValidations:t=>o.listWorkflowValidations(t),getValidationDetails:t=>o.getValidationDetails(t),toggleEnabled:t=>o.toggleValidationEnabled(t),getLatest:(t,s)=>o.getLatestValidation(t,s),getAnomalies:t=>o.getValidationAnomalies(t),getAnomaliesByRule:(t,s)=>o.getValidationAnomaliesByRule(t,s),waitUntilCompleted:(t,s)=>o.waitUntilCompleted(t,s)}}function $s(){return {"User-Agent":`${jt}/${ge}`,"X-SDK-Version":ge,"X-SDK-Language":Bs}}function zs(o){let e=g.create({timeout:o.timeout,headers:o.headers});return e.interceptors.request.use(t=>(t.headers["x-request-id"]=qo(),t)),e.interceptors.response.use(t=>t,t=>{if(t instanceof Is){let s=t.response?.status;if(s===401||s===403)throw E.wrap(t,{message:"Unauthorized"})}throw E.wrap(t)}),e}function Qs(o){let{client:e}=o,t=new wt(e),s=new lt(e.apis.workflows),a=new fe(e.apis.notifications,t),i=new ft(e.apis.notifications),n=new dt(e),r=new yt(e.apis.workflows),l=new Ie(e),d=new ut(a,i),c=new ht(e),p=new Rt(e),m=new ct(r,s,n,d,a,i),R=new pt(r,n,s,d),u=an({notificationsApi:e.apis.notifications,channelsService:a,settingsService:i,channelSetupService:d}),w=Ks(c,p),h=ko(e);return {extractionBuilderService:R,extraction:m,workflow:r,notification:u,schema:l,user:t,validation:w,crawler:h}}function an(o){let{notificationsApi:e,channelsService:t,settingsService:s,channelSetupService:a}=o;return {channels:t,settings:s,setup:a,configure:i=>a.setup(i),setupForWorkflow:i=>a.setupForWorkflow(i),setupForWorkspace:i=>a.setupForWorkspace(i),testNotification:async i=>{let n=await e.v5NotificationsTestPost({v5NotificationsTestPostRequest:{eventType:i.eventType,...i.workflowId!=null&&{workflowId:i.workflowId}}}),r=n.data.data;if(!r?.eventId||!r?.eventType)throw E.wrap(n,{message:"Failed to test notification"});return {eventId:r.eventId,eventType:r.eventType,...r.workflowId!=null&&{workflowId:r.workflowId}}}}}var Ht=class{constructor(e){if(!e.apiKey&&!e.bearerToken)throw new P("Either apiKey or bearerToken must be provided",{code:"VALIDATION_ERROR"});this._baseUrl=e.baseUrl??Lt,this._apiKey=e.apiKey??"",this._bearerToken=e.bearerToken;let t=e.timeout??3e4,s=$s();this._axiosInstance=zs({timeout:t,headers:s}),this._axiosInstance.interceptors.request.use(i=>(this._bearerToken&&(i.headers.Authorization||(i.headers.Authorization=`Bearer ${this._bearerToken}`),delete i.headers["x-api-key"]),i)),this.apis=new Jt(this._apiKey,this._baseUrl,this._axiosInstance,s);let a=Qs({client:this});this.user=a.user,this.extraction=a.extraction,this.workflow=a.workflow,this.schema=a.schema,this.notification=a.notification,this.validation=a.validation,this.crawler=a.crawler,this._extractionBuilderService=a.extractionBuilderService,Ls().catch(()=>{});}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}get apiKey(){return this._apiKey}setBearerToken(e){this._bearerToken=e;}get realtime(){return this._realtime}extract(e){return this._extractionBuilderService.extract(e)}async connectRealtime(e){if(!this._apiKey)throw new P("Realtime requires an API key. Bearer-only auth is not supported for WebSocket connections.",{code:"VALIDATION_ERROR"});return this._realtime||(this._realtime=new mt({apiKey:this._apiKey,...e}),await this._realtime.connect()),this._realtime}disconnectRealtime(){this._realtime&&(this._realtime.close(),this._realtime=void 0);}isRealtimeConnected(){return this._realtime?.isConnected()??false}async status(){return {baseUrl:this._baseUrl,user:await this.user.getCurrentUser(),realtimeConnected:this.isRealtimeConnected()}}async listTeams(e){let t=e?.bearerToken?{Authorization:`Bearer ${e.bearerToken}`}:void 0;return (await this._axiosInstance.get("/v5/user",{baseURL:this._baseUrl,...t&&{headers:t}})).data?.teams??[]}async setActiveTeam(e){if(!e?.trim())throw new P("teamId is required",{code:"VALIDATION_ERROR"});await this._axiosInstance.post("/v5/auth/active-team",{teamId:e},{baseURL:this._baseUrl});}dispose(){this.disconnectRealtime();}close(){this.dispose();}};
9
- exports.CrawlerConfigService=nt;exports.CrawlerSessionService=rt;exports.DataFetcherService=lt;exports.ERROR_MESSAGES=j;exports.EntityResolverService=dt;exports.ExtractionBuilderService=pt;exports.ExtractionService=ct;exports.FetchDataOptions=Vo;exports.KadoaClient=Ht;exports.KadoaHttpException=E;exports.KadoaSdkException=P;exports.NotificationChannelType=he;exports.NotificationChannelsService=fe;exports.NotificationSettingsEventTypeEnum=Tt;exports.NotificationSettingsService=ft;exports.NotificationSetupService=ut;exports.PageStatus=Di;exports.Realtime=mt;exports.SchemaBuilder=xe;exports.SchemaFieldDataType=Oi;exports.SchemasService=Ie;exports.TERMINAL_JOB_STATES=Ms;exports.TERMINAL_RUN_STATES=Js;exports.UserService=wt;exports.ValidationCoreService=ht;exports.ValidationRulesService=Rt;exports.WorkflowsCoreService=yt;exports.createCrawlerDomain=ko;exports.pollUntil=Ue;exports.validateAdditionalData=Mt;return exports;})({},L);//# sourceMappingURL=index.global.js.map
8
+ `)}static wrap(e,t){return e instanceof o||e instanceof P?e:Vs(e)?o.fromAxiosError(e,t):P.wrap(e,t)}static mapStatusToCode(e){let t=typeof e=="number"?e:e.response?.status;return t?t===401||t===403?"AUTH_ERROR":t===404?"NOT_FOUND":t===408?"TIMEOUT":t===429?"RATE_LIMITED":t>=400&&t<500?"VALIDATION_ERROR":t>=500?"HTTP_ERROR":"UNKNOWN":typeof e=="number"?"UNKNOWN":e.code==="ECONNABORTED"?"TIMEOUT":e.request?"NETWORK_ERROR":"UNKNOWN"}};var Es=ra(Ds()),de=o=>(0, Es.default)(`kadoa:${o}`),Y={client:de("client"),wss:de("wss"),extraction:de("extraction"),http:de("http"),workflow:de("workflow"),crawl:de("crawl"),notifications:de("notifications"),schemas:de("schemas"),validation:de("validation")};function So(o){if(!o||typeof o!="object")return false;let e=Object.getPrototypeOf(o);return e===null||e===Object.prototype||Object.getPrototypeOf(e)===null?Object.prototype.toString.call(o)==="[object Object]":false}function Os(o){return o==="__proto__"}function pe(o,e){let t=Object.keys(e);for(let s=0;s<t.length;s++){let a=t[s];if(Os(a))continue;let i=e[a],n=o[a];qs(i)&&qs(n)?o[a]=pe(n,i):Array.isArray(i)?o[a]=pe([],i):So(i)?o[a]=pe({},i):(n===void 0||i!==void 0)&&(o[a]=i);}return o}function qs(o){return So(o)||Array.isArray(o)}function Ns(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}var Ki=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function Gs(o){return Array.from(o.match(Ki)??[])}function Po(o){let e=Gs(o);if(e.length===0)return "";let[t,...s]=e;return `${t.toLowerCase()}${s.map(a=>Ns(a)).join("")}`}function Wo(o){return o.substring(0,1).toUpperCase()+o.substring(1)}var Ue=class Ue{constructor(){this.fields=[];}hasSchemaFields(){return this.fields.some(e=>e.fieldType==="SCHEMA")}entity(e){return this.entityName=e,this}field(e,t,s,a){if(this.validateFieldName(e),Ue.TYPES_REQUIRING_EXAMPLE.includes(s)&&!a?.example)throw new P(`Field "${e}" with type ${s} requires an example`,{code:"VALIDATION_ERROR",details:{name:e,dataType:s}});return this.fields.push({name:e,description:t,dataType:s,fieldType:"SCHEMA",example:a?.example,isKey:a?.isKey}),this}classify(e,t,s){return this.validateFieldName(e),this.fields.push({name:e,description:t,fieldType:"CLASSIFICATION",categories:s}),this}raw(e){let t=Array.isArray(e)?e:[e];for(let s of t){let a=`raw${Wo(Po(s))}`;this.fields.some(i=>i.name===a)||this.fields.push({name:a,description:`Raw page content in ${s.toUpperCase()} format`,fieldType:"METADATA",metadataKey:s});}return this}build(){if(this.hasSchemaFields()&&!this.entityName)throw new P("Entity name is required when schema fields are present",{code:"VALIDATION_ERROR",details:{entityName:this.entityName}});return {entityName:this.entityName,fields:this.fields}}validateFieldName(e){if(!Ue.FIELD_NAME_PATTERN.test(e))throw new P(`Field name "${e}" must be alphanumeric only (no underscores or special characters)`,{code:"VALIDATION_ERROR",details:{name:e,pattern:"^[A-Za-z0-9]+$"}});let t=e.toLowerCase();if(this.fields.some(s=>s.name.toLowerCase()===t))throw new P(`Duplicate field name: "${e}"`,{code:"VALIDATION_ERROR",details:{name:e}})}};Ue.FIELD_NAME_PATTERN=/^[A-Za-z0-9]+$/,Ue.TYPES_REQUIRING_EXAMPLE=["STRING","IMAGE","LINK","OBJECT","ARRAY"];var ke=Ue;var _t=Y.schemas,xe=class{constructor(e){this.client=e;}get schemasApi(){return this.client.apis.schemas}builder(e){let t=this;return new class extends ke{constructor(){super(),e&&this.entity(e);}async create(s){let a=this.build(),i=s??a.entityName;if(!i)throw new P("Schema name is required when entity name is not provided",{code:"VALIDATION_ERROR",details:{name:s}});let n={name:i,fields:a.fields,...a.entityName?{entity:a.entityName}:{}};return t.createSchema(n)}}}async getSchema(e){_t("Fetching schema with ID: %s",e);let s=(await this.schemasApi.v4SchemasSchemaIdGet({schemaId:e})).data.data;if(!s)throw new P(`${j.SCHEMA_NOT_FOUND}: ${e}`,{code:ce.NOT_FOUND,details:{schemaId:e}});return s}async listSchemas(){return (await this.schemasApi.v4SchemasGet()).data.data}async createSchema(e){_t("Creating schema with name: %s",e.name);let s=(await this.schemasApi.v4SchemasPost({createSchemaBody:e})).data.schemaId;if(!s)throw new P(j.SCHEMA_CREATE_FAILED,{code:ce.INTERNAL_ERROR});return this.getSchema(s)}async updateSchema(e,t){return _t("Updating schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdPut({schemaId:e,updateSchemaBody:t}),this.getSchema(e)}async deleteSchema(e){_t("Deleting schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdDelete({schemaId:e});}};var $i="/v4/entity",dt=class{constructor(e){this.client=e;this.schemasService=new xe(e);}async resolveEntity(e,t){if(e==="ai-detection"){if(!t?.link)throw new P(j.LINK_REQUIRED,{code:"VALIDATION_ERROR",details:{entityConfig:e,options:t}});let s=await this.fetchEntityFields({link:t.link,location:t.location,navigationMode:t.navigationMode,selectorMode:t.selectorMode??false});return {entity:s.entity,fields:s.fields}}else if(e){if("schemaId"in e){let s=await this.schemasService.getSchema(e.schemaId);return {entity:s.entity??void 0,fields:s.schema}}else if("fields"in e)return {entity:e.name,fields:e.fields}}throw new P(j.ENTITY_INVARIANT_VIOLATION,{details:{entity:e}})}async fetchEntityFields(e){this.validateEntityOptions(e);let t=`${this.client.baseUrl}${$i}`,s=e,i=(await this.client.axiosInstance.post(t,s,{headers:{"Content-Type":"application/json",Accept:"application/json","x-api-key":this.client.apiKey}})).data;if(!i.success||!i.entityPrediction||i.entityPrediction.length===0)throw new P(j.NO_PREDICTIONS,{code:"NOT_FOUND",details:{success:i.success,hasPredictions:!!i.entityPrediction,predictionCount:i.entityPrediction?.length||0,link:e.link}});return i.entityPrediction[0]}validateEntityOptions(e){if(!e.link)throw new P(j.LINK_REQUIRED,{code:"VALIDATION_ERROR",details:{options:e}})}};var zi=Y.extraction,Qi=new Set(["FINISHED","SUCCESS"]),bo={mode:"run",pollingInterval:5e3,maxWaitTime:3e5,navigationMode:"single-page",location:{type:"auto"},bypassPreview:true,autoStart:true},pt=class{constructor(e,t,s,a,i,n){this.workflowsCoreService=e;this.dataFetcherService=t;this.entityResolverService=s;this.notificationSetupService=a;this.notificationChannelsService=i;this.notificationSettingsService=n;}async run(e){return await this.executeExtraction({...e,mode:"run"})}async submit(e){return await this.executeExtraction({...e,mode:"submit"})}async runJob(e,t){return await this.workflowsCoreService.runWorkflow(e,t)}async runJobAndWait(e,t){let s=await this.workflowsCoreService.runWorkflow(e,t);return await this.workflowsCoreService.waitForJobCompletion(e,s.jobId||"")}async fetchData(e){return await this.dataFetcherService.fetchData(e)}async fetchAllData(e){return await this.dataFetcherService.fetchAllData(e)}fetchDataPages(e){return this.dataFetcherService.fetchDataPages(e)}async getNotificationChannels(e){return await this.notificationChannelsService.listChannels({workflowId:e})}async getNotificationSettings(e){return await this.notificationSettingsService.listSettings({workflowId:e})}async executeExtraction(e){this.validateOptions(e);let t=pe(bo,e);if(t.interval==="REAL_TIME")throw new P("extraction.run()/submit() are not supported for real-time workflows. Use the builder API, call waitForReady(), and subscribe via client.realtime.onEvent(...).",{code:"BAD_REQUEST",details:{interval:"REAL_TIME"}});let a,i=t.navigationMode==="agentic-navigation";if(i&&!t.userPrompt)throw new P("userPrompt is required when navigationMode is 'agentic-navigation'",{code:"VALIDATION_ERROR",details:{navigationMode:t.navigationMode}});let n;if(i){let u=e.entity||"ai-detection";n={entity:typeof u=="object"&&"name"in u?u.name:void 0,fields:typeof u=="object"&&"fields"in u?u.fields:[]};}else n=await this.entityResolverService.resolveEntity(e.entity||"ai-detection",{link:t.urls[0],location:t.location,navigationMode:t.navigationMode});let r=!!t.notifications,l={...t,fields:n.fields,...n.entity!==void 0?{entity:n.entity}:{},...t.userPrompt?{userPrompt:t.userPrompt}:{}};if(a=(await this.workflowsCoreService.create(l)).id,r){let u=await this.notificationSetupService.setup({workflowId:a,events:t.notifications?.events,channels:t.notifications?.channels});zi("Notifications setup: %O",u.map(w=>({id:w.id,eventType:w.eventType})));}if(t.mode==="submit")return {workflowId:a};let d=await this.workflowsCoreService.wait(a,{pollIntervalMs:t.pollingInterval,timeoutMs:t.maxWaitTime}),p,m;if(this.isExtractionSuccessful(d.runState)){let u=await this.dataFetcherService.fetchData({workflowId:a});p=u.data,m=u.pagination;}else throw new P(`${j.WORKFLOW_UNEXPECTED_STATUS}: ${d.runState}`,{code:"INTERNAL_ERROR",details:{workflowId:a,runState:d.runState,state:d.state}});return {workflowId:a,workflow:d,data:p,pagination:m}}validateOptions(e){if(!e.urls||e.urls.length===0)throw new P(j.NO_URLS,{code:"VALIDATION_ERROR"})}async resumeWorkflow(e){await this.workflowsCoreService.resume(e);let t=await this.workflowsCoreService.wait(e,{pollIntervalMs:bo.pollingInterval,timeoutMs:bo.maxWaitTime}),s,a;if(this.isExtractionSuccessful(t.runState)){let n=await this.dataFetcherService.fetchData({workflowId:e});s=n.data,a=n.pagination;}else throw new P(`${j.WORKFLOW_UNEXPECTED_STATUS}: ${t.runState}`,{code:"INTERNAL_ERROR",details:{workflowId:e,runState:t.runState,state:t.state}});return {workflowId:e,workflow:t,data:s,pagination:a}}isExtractionSuccessful(e){return e?Qi.has(e.toUpperCase()):false}};var Do=Y.extraction,ft=class{constructor(e,t,s,a){this.workflowsCoreService=e;this.entityResolverService=t;this.dataFetcherService=s;this.notificationSetupService=a;}get options(){return L__default.default(this._options,"Options are not set"),this._options}get notificationOptions(){return this._notificationOptions}get monitoringOptions(){return this._monitoringOptions}get workflowId(){return L__default.default(this._workflowId,"Workflow ID is not set"),this._workflowId}get jobId(){return L__default.default(this._jobId,"Job ID is not set"),this._jobId}extract({urls:e,name:t,description:s,navigationMode:a,extraction:i,additionalData:n,bypassPreview:r,userPrompt:l,interval:c,schedules:d,location:p}){let m="ai-detection";if(i){let R=i(new ke);if("schemaId"in R)m={schemaId:R.schemaId};else {let u=R.build();m=u.entityName?{name:u.entityName,fields:u.fields}:{fields:u.fields};}}return l&&(this._userPrompt=l),this._options={urls:e,name:t,description:s,navigationMode:a||"single-page",entity:m,bypassPreview:r??false,additionalData:n,userPrompt:l,interval:c,schedules:d,location:p},this}withNotifications(e){return this._notificationOptions=e,this}withMonitoring(e){return this._monitoringOptions=e,this}bypassPreview(){return L__default.default(this._options,"Options are not set"),this._options.bypassPreview=true,this}setInterval(e){return L__default.default(this._options,"Options are not set"),"interval"in e?this._options.interval=e.interval:(this._options.interval="CUSTOM",this._options.schedules=e.schedules),this}setLocation(e){return L__default.default(this._options,"Options are not set"),this._options.location=e,this}withPrompt(e){return L__default.default(this._options,"Options are not set"),this._userPrompt=e,this._options.userPrompt=e,this}async create(){L__default.default(this._options,"Options are not set");let{urls:e,name:t,description:s,navigationMode:a,entity:i}=this.options,n=a==="agentic-navigation";if(n&&!this._userPrompt)throw new P("userPrompt is required when navigationMode is 'agentic-navigation'",{code:"VALIDATION_ERROR",details:{navigationMode:a}});let l=this._options.interval==="REAL_TIME"&&i==="ai-detection",c;n?c={entity:typeof i=="object"&&"name"in i?i.name:void 0,fields:typeof i=="object"&&"fields"in i?i.fields:[]}:c=await this.entityResolverService.resolveEntity(i,{link:e[0],location:this._options.location,navigationMode:a,selectorMode:l});let d=typeof i=="object"&&"schemaId"in i&&i.schemaId,p=await this.workflowsCoreService.create({urls:e,name:t,description:s,navigationMode:a,monitoring:this._monitoringOptions,...d?{schemaId:i.schemaId,entity:c.entity,fields:c.fields}:{entity:c.entity,fields:c.fields},autoStart:false,interval:this._options.interval,schedules:this._options.schedules,additionalData:this._options.additionalData,bypassPreview:this._options.bypassPreview,userPrompt:this._userPrompt});return this._notificationOptions&&await this.notificationSetupService.setup({...this._notificationOptions,workflowId:p.id}),this._workflowId=p.id,this}async waitForReady(e){L__default.default(this._workflowId,"Workflow ID is not set");let t=e?.targetState??"PREVIEW",s=await this.workflowsCoreService.get(this._workflowId);return s.state===t||t==="PREVIEW"&&s.state==="ACTIVE"?s:await this.workflowsCoreService.wait(this._workflowId,{targetState:t,pollIntervalMs:e?.pollIntervalMs,timeoutMs:e?.timeoutMs})}async run(e){if(L__default.default(this._options,"Options are not set"),L__default.default(this._workflowId,"Workflow ID is not set"),this._options.interval==="REAL_TIME")throw new P("run() is not supported for real-time workflows. Use waitForReady() and subscribe via client.realtime.onEvent(...).",{code:"BAD_REQUEST",details:{interval:"REAL_TIME",workflowId:this._workflowId}});let t=await this.workflowsCoreService.runWorkflow(this._workflowId,{variables:e?.variables,limit:e?.limit});L__default.default(t.jobId,"Job ID is not set"),Do("Job started: %O",t),this._jobId=t.jobId;let s=await this.workflowsCoreService.waitForJobCompletion(this._workflowId,t.jobId);return Do("Job finished: %O",s),this}async submit(e){if(L__default.default(this._options,"Options are not set"),L__default.default(this._workflowId,"Workflow ID is not set"),this._options.interval==="REAL_TIME")throw new P("submit() is not supported for real-time workflows. Use waitForReady() and subscribe via client.realtime.onEvent(...).",{code:"BAD_REQUEST",details:{interval:"REAL_TIME",workflowId:this._workflowId}});let t=await this.workflowsCoreService.runWorkflow(this._workflowId,{variables:e?.variables,limit:e?.limit});return L__default.default(t.jobId,"Job ID is not set"),Do("Job submitted: %O",t),this._jobId=t.jobId,{workflowId:this._workflowId,jobId:this._jobId}}async fetchData(e){return L__default.default(this._workflowId,"Workflow ID is not set"),L__default.default(this._jobId,"Job ID is not set"),this.dataFetcherService.fetchData({workflowId:this._workflowId,runId:this._jobId,page:e.page??1,limit:e.limit??100,...e})}async fetchAllData(e){return L__default.default(this._jobId,"Job ID is not set"),L__default.default(this._workflowId,"Workflow ID is not set"),this.dataFetcherService.fetchAllData({workflowId:this._workflowId,runId:this._jobId,...e})}};var he={EMAIL:"EMAIL",SLACK:"SLACK",WEBHOOK:"WEBHOOK",WEBSOCKET:"WEBSOCKET"};var Ts=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Yi(o){let e=[];if(!o.recipients?.length)e.push({message:"Recipients are required for email channel"});else for(let t of o.recipients)Ts.test(t)||e.push({message:`Invalid email address: ${t}`});if(o.from!==void 0&&(Ts.test(o.from)?o.from.endsWith("@kadoa.com")||e.push({message:"From email address must end with @kadoa.com"}):e.push({message:`Invalid from email address: ${o.from}`})),e.length>0)throw new P("Invalid email channel config",{code:ce.VALIDATION_ERROR,details:{issues:e}});return o}var Lt=class Lt{constructor(e,t){this.api=e,this.userService=t;}async listChannels(e){let t=await this.api.v5NotificationsChannelsGet(e),s=t.data.data?.channels;if(!s)throw E.wrap(t,{message:"Failed to list channels"});return s}async listAllChannels(e){if(!e)return this.listChannels({});let[t,s]=await Promise.all([this.listChannels({workflowId:e}),this.listChannels({})]),a=[...t];return s.forEach(i=>{a.find(n=>n.id===i.id)||a.push(i);}),a}async deleteChannel(e){let t=await this.api.v5NotificationsChannelsChannelIdDelete({channelId:e});if(t.status!==200)throw E.wrap(t,{message:"Failed to delete channel"})}async createChannel(e,t){let s=await this.buildPayload(pe({name:Lt.DEFAULT_CHANNEL_NAME,channelType:e,config:{}},t||{})),a=await this.api.v5NotificationsChannelsPost({v5NotificationsChannelsPostRequest:s});if(a.status===201){let i=a.data.data?.channel;if(!i)throw E.wrap(a,{message:"Failed to create default channels"});return i}throw E.wrap(a,{message:"Failed to create default channels"})}async buildPayload(e){let t;switch(e.channelType){case he.EMAIL:t=await this.buildEmailChannelConfig(e.config);break;case he.SLACK:t=await this.buildSlackChannelConfig(e.config);break;case he.WEBHOOK:t=await this.buildWebhookChannelConfig(e.config);break;case he.WEBSOCKET:t=await this.buildWebsocketChannelConfig(e.config);break;default:t={};}return {name:e.name||"Default Channel",channelType:e.channelType,config:t}}async buildEmailChannelConfig(e){let t=e.recipients;e.recipients?.length||(t=[(await this.userService.getCurrentUser()).email]);let s=pe(e,{recipients:t});return Yi(s)}async buildSlackChannelConfig(e){return e}async buildWebhookChannelConfig(e){return e}async buildWebsocketChannelConfig(e){return e}};Lt.DEFAULT_CHANNEL_NAME="default";var fe=Lt;var ut=class{constructor(e){this.api=e;}async createSettings(e){let t=await this.api.v5NotificationsSettingsPost({v5NotificationsSettingsPostRequest:e}),s=t.data.data?.settings;if(!s)throw E.wrap(t,{message:"Failed to create notification settings"});return s}async listSettings(e){let t=await this.api.v5NotificationsSettingsGet(e),s=t.data.data?.settings;if(!s)throw E.wrap(t,{message:"Failed to list notification settings"});return s}async listAllEvents(){return Object.values(Ft)}async updateSettings(e,t){let s=await this.api.v5NotificationsSettingsSettingsIdPut({settingsId:e,v5NotificationsSettingsSettingsIdPutRequest:t}),a=s.data.data?.settings;if(!a)throw E.wrap(s,{message:"Failed to update notification settings"});return a}async deleteSettings(e){let t=await this.api.v5NotificationsSettingsSettingsIdDelete({settingsId:e});if(t.status!==200)throw E.wrap(t,{message:"Failed to delete notification settings"})}};var Re=Y.notifications,mt=class{constructor(e,t){this.channelsService=e;this.settingsService=t;}async setupForWorkflow(e){return this.setup({workflowId:e.workflowId,events:e.events,channels:e.channels})}async setupForWorkspace(e){if((await this.settingsService.listSettings({})).length>0)throw new P("Workspace settings already exist",{code:ce.BAD_REQUEST});return this.setup({events:e.events,channels:e.channels})}async setup(e){e.workflowId?Re("Setting up notifications for workflow %s",e.workflowId):Re("Setting up notifications for workspace");let t=await this.setupChannels({workflowId:e.workflowId,channels:e.channels||{}}),s=e.events||"all",a=s==="all"?await this.settingsService.listAllEvents():s,i=t.map(l=>l.id).filter(Boolean);Re("Creating notification settings for workflow %s: %O",e.workflowId,{events:a,channels:i});let n=await this.settingsService.listSettings({workflowId:e.workflowId}),r=await Promise.all(a.map(async l=>{let c=n.find(d=>d.eventType===l);if(c?.id){let d=(c.channels||[]).map(m=>m.id).filter(Boolean),p=[...new Set([...d,...i])];return await this.settingsService.updateSettings(c.id,{channelIds:p,enabled:c.enabled??true})}return await this.settingsService.createSettings({workflowId:e.workflowId,channelIds:i,eventType:l,enabled:true,eventConfiguration:{}})}));return Re(e.workflowId?"Successfully setup notifications for workflow %s":"Successfully setup notifications for workspace",e.workflowId),r}async setupChannels(e){let t=await this.channelsService.listAllChannels(e.workflowId),s=Object.entries(e.channels).filter(([,c])=>c===true),a=Object.entries(e.channels).filter(([c,d])=>typeof d=="object"&&"channelId"in d),i=Object.entries(e.channels).filter(([,c])=>typeof c=="object"&&!("channelId"in c)),n=await this.handleChannelsById({channelsById:a,existingChannels:t,workflowId:e.workflowId}),r=await this.handleDefaultChannels({channelsByName:s,existingChannels:t,workflowId:e.workflowId}),l=await this.handleChannelsByConfig({channelsByConfig:i,existingChannels:t,workflowId:e.workflowId});return [...n,...r,...l]}async handleChannelsById({channelsById:e,existingChannels:t,workflowId:s}){let a=e.map(([l,c])=>c.channelId),i=t.filter(l=>l.id&&a.includes(l.id)),n=i.map(l=>l.id),r=a.filter(l=>!n.includes(l));if(r.length>0)throw new P(`Channels not found: ${r.join(", ")}`,{code:ce.NOT_FOUND,details:{workflowId:s,missingChannelIds:r}});return i}async handleDefaultChannels({channelsByName:e,existingChannels:t,workflowId:s}){return await Promise.all(e.map(async([i])=>{let n=i===he.WEBSOCKET?t.find(l=>l.channelType===i):t.find(l=>l.channelType===i&&l.name===fe.DEFAULT_CHANNEL_NAME);if(n)return Re("Using existing default channel: %O",{workflowId:s,channelType:i,channelId:n.id}),n;let r=await this.channelsService.createChannel(i);return Re("Created default channel %O",{workflowId:s,channelType:i,channel:r}),r}))}async handleChannelsByConfig({channelsByConfig:e,existingChannels:t,workflowId:s}){return e.length===0?[]:await Promise.all(e.map(async([i,n])=>{let r=n.name||fe.DEFAULT_CHANNEL_NAME,l=t.find(m=>m.channelType===i&&(m.name||fe.DEFAULT_CHANNEL_NAME)===r);if(l)return Re("Using existing channel: %O",{workflowId:s,channelType:i,channelName:r,channelId:l.id}),l;let{name:c,...d}=n,p=await this.channelsService.createChannel(i,{name:r,config:d});return Re("Created channel with custom config %O",{workflowId:s,channelType:i,channelName:r,channel:p}),p}))}};var jt="https://api.kadoa.com",Fs="wss://realtime.kadoa.com";process.env.KADOA_WSS_NEO_API_URI??"wss://events.kadoa.com/events/ws";var Bs="https://realtime.kadoa.com";var ge="0.24.2",Mt="kadoa-node-sdk",Us="node";var te=Y.wss;typeof WebSocket>"u"&&(window.WebSocket=aa("ws"));var Xi=o=>o.type==="control.draining",Zi=o=>o.type!=="heartbeat"&&o.type!=="control.draining",Ie=class Ie{constructor(e){this.drainingSockets=new Set;this.lastHeartbeat=Date.now();this.isConnecting=false;this.eventListeners=new Set;this.connectionListeners=new Set;this.errorListeners=new Set;this.isClosed=false;this.hasConnectedOnce=false;this.recentEventIds=new Set;this.recentEventIdQueue=[];this.maxRecentEventIds=1e3;this.apiKey=e.apiKey,this.heartbeatInterval=e.heartbeatInterval||1e4,this.reconnectDelay=this.normalizeReconnectDelay(e.reconnectDelay),this.missedHeartbeatsLimit=e.missedHeartbeatsLimit||3e4;}async connect(){if(!(this.isClosed||this.isConnecting||this.activeSocket)){this.isConnecting=true;try{let{access_token:e,team_id:t}=await this.getOAuthToken();await this.openSocket(e,t,"active"),this.hasConnectedOnce=!0;}catch(e){if(te("Failed to connect: %O",e),this.isConnecting=false,this.notifyErrorListeners(e),!this.hasConnectedOnce)throw e;this.scheduleReconnect();}}}async getOAuthToken(){return await(await fetch(`${jt}/v4/oauth2/token`,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":`${this.apiKey}`,"x-sdk-version":ge}})).json()}async openSocket(e,t,s){await new Promise((a,i)=>{let n=new WebSocket(`${Fs}?access_token=${e}`),r=false;n.onopen=()=>{let l={action:"subscribe",channel:t};this.lastCursor&&(l.lastCursor=this.lastCursor),n.send(JSON.stringify(l)),this.promoteSocket(n,s),this.isConnecting=false,this.lastHeartbeat=Date.now(),this.startHeartbeatCheck(),te("Connected to WebSocket"),r||(r=true,a());},n.onmessage=l=>{this.handleSocketMessage(n,l.data);},n.onclose=()=>{this.handleSocketClose(n),r||(r=true,i(new Error("WebSocket closed before opening")));},n.onerror=l=>{if(this.notifyErrorListeners(l),!r){r=true,i(l);return}n===this.activeSocket&&this.handleUnexpectedDisconnect("Socket error");};});}promoteSocket(e,t){t==="replacement"&&this.activeSocket&&this.activeSocket!==e&&this.drainingSockets.add(this.activeSocket),this.activeSocket=e,this.drainingSockets.delete(e),(t==="active"||!this.hasConnectedOnce)&&this.notifyConnectionListeners(true);}handleSocketMessage(e,t){try{let s=typeof t=="string"?t:t.toString?.()??"",a=JSON.parse(s);if(a.type==="heartbeat"){e===this.activeSocket&&this.handleHeartbeat();return}if(Xi(a)){this.handleDrainSignal(e,a);return}if(!Zi(a)||(typeof a._cursor=="string"&&(this.lastCursor=a._cursor),typeof a.id=="string"&&fetch(`${Bs}/api/v1/events/ack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a.id})}).catch(i=>{te("Failed to acknowledge event %s: %O",a.id,i);}),this.isDuplicateEvent(a.id)))return;this.notifyEventListeners(a);}catch(s){te("Failed to parse incoming message: %O",s);}}handleDrainSignal(e,t){e!==this.activeSocket||this.isClosed||(te("Received drain signal, preparing replacement socket"),this.drainingSockets.add(e),this.scheduleDrainReconnect(t.retryAfterMs));}handleSocketClose(e){let t=e===this.activeSocket;if(this.drainingSockets.delete(e),!!t&&(this.activeSocket=void 0,this.stopHeartbeatCheck(),!this.isClosed)){if(this.drainingSockets.size>0){te("Draining socket closed after replacement was scheduled");return}this.handleUnexpectedDisconnect("Connection closed");}}handleUnexpectedDisconnect(e){this.isConnecting=false,this.notifyConnectionListeners(false,e),this.scheduleReconnect();}scheduleReconnect(e=false){this.isClosed||this.reconnectTimer||(this.reconnectTimer=setTimeout(async()=>{if(this.reconnectTimer=void 0,!(this.isClosed||this.isConnecting||!e&&this.activeSocket)){this.isConnecting=true;try{let{access_token:t,team_id:s}=await this.getOAuthToken();await this.openSocket(t,s,e?"replacement":"active");}catch(t){te("Reconnect failed: %O",t),this.isConnecting=false,this.notifyErrorListeners(t),this.scheduleReconnect(e);}}},this.reconnectDelay));}scheduleDrainReconnect(e){if(this.isClosed||this.reconnectTimer)return;let t=this.reconnectDelay;typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=Ie.MAX_RECONNECT_DELAY_MS&&(t=Math.trunc(e)),this.reconnectTimer=setTimeout(async()=>{if(this.reconnectTimer=void 0,!(this.isClosed||this.isConnecting)){this.isConnecting=true;try{let{access_token:s,team_id:a}=await this.getOAuthToken();await this.openSocket(s,a,"replacement");}catch(s){te("Reconnect failed: %O",s),this.isConnecting=false,this.notifyErrorListeners(s),this.scheduleReconnect(true);}}},t);}normalizeReconnectDelay(e){return typeof e!="number"||!Number.isFinite(e)?Ie.DEFAULT_RECONNECT_DELAY_MS:Math.min(Math.max(0,Math.trunc(e)),Ie.MAX_RECONNECT_DELAY_MS)}isDuplicateEvent(e){if(!e)return false;if(this.recentEventIds.has(e))return true;if(this.recentEventIds.add(e),this.recentEventIdQueue.push(e),this.recentEventIdQueue.length>this.maxRecentEventIds){let t=this.recentEventIdQueue.shift();t&&this.recentEventIds.delete(t);}return false}handleHeartbeat(){te("Heartbeat received"),this.lastHeartbeat=Date.now();}notifyEventListeners(e){this.eventListeners.forEach(t=>{try{t(e);}catch(s){te("Error in event listener: %O",s);}});}notifyConnectionListeners(e,t){this.connectionListeners.forEach(s=>{try{s(e,t);}catch(a){te("Error in connection listener: %O",a);}});}notifyErrorListeners(e){this.errorListeners.forEach(t=>{try{t(e);}catch(s){te("Error in error listener: %O",s);}});}startHeartbeatCheck(){this.stopHeartbeatCheck(),this.missedHeartbeatCheckTimer=setInterval(()=>{this.activeSocket&&Date.now()-this.lastHeartbeat>this.missedHeartbeatsLimit&&(te("No heartbeat received in 30 seconds! Closing connection."),this.activeSocket.close());},this.heartbeatInterval);}stopHeartbeatCheck(){this.missedHeartbeatCheckTimer&&(clearInterval(this.missedHeartbeatCheckTimer),this.missedHeartbeatCheckTimer=void 0);}onEvent(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e);}}onConnection(e){return this.connectionListeners.add(e),this.isConnected()&&e(true),()=>{this.connectionListeners.delete(e);}}onError(e){return this.errorListeners.add(e),()=>{this.errorListeners.delete(e);}}close(){this.isClosed=true,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=void 0),this.stopHeartbeatCheck(),this.activeSocket?.close(),this.activeSocket=void 0,this.drainingSockets.forEach(e=>{e.close();}),this.drainingSockets.clear(),this.isConnecting=false,this.eventListeners.clear(),this.connectionListeners.clear(),this.errorListeners.clear();}isConnected(){return this.activeSocket?.readyState===WebSocket.OPEN}};Ie.DEFAULT_RECONNECT_DELAY_MS=5e3,Ie.MAX_RECONNECT_DELAY_MS=6e4;var wt=Ie;var ht=class{constructor(e){this.client=e;}async getCurrentUser(){let t=(await this.client.axiosInstance.get("/v5/user",{baseURL:this.client.baseUrl,headers:{"x-api-key":this.client.apiKey,"Content-Type":"application/json"}})).data;if(!t||!t.userId)throw new P("Invalid user data received");return {userId:t.userId,email:t.email,featureFlags:t.featureFlags||[]}}};var en={pollIntervalMs:1e4,timeoutMs:300*1e3},_s={ABORTED:"ABORTED",TIMEOUT:"TIMEOUT"};async function _e(o,e,t={}){let s={...en,...t},a=Math.max(1e4,s.pollIntervalMs),i=s.timeoutMs,n=Date.now(),r=0;for(;Date.now()-n<i;){if(s.abortSignal?.aborted)throw new P("Polling operation was aborted",{code:_s.ABORTED});r++;let l=await o();if(e(l))return {result:l,attempts:r,duration:Date.now()-n};await new Promise(c=>setTimeout(c,a));}throw new P(`Polling operation timed out after ${i}ms`,{code:_s.TIMEOUT,details:{timeoutMs:i,attempts:r,duration:Date.now()-n}})}function Jt(o){if(o!==void 0){if(o===null||typeof o!="object"||Array.isArray(o))throw new P("additionalData must be a plain object",{code:"VALIDATION_ERROR"});try{JSON.stringify(o).length>100*1024&&console.warn("[Kadoa SDK] additionalData exceeds 100KB, consider reducing size");}catch{throw new P("additionalData must be JSON-serializable",{code:"VALIDATION_ERROR"})}}}var tn="https://registry.npmjs.org",Ls="@kadoa/node-sdk";async function js(){try{let o=await fetch(`${tn}/${Ls}`,{headers:{Accept:"application/json"}});if(!o.ok)return;let t=(await o.json())["dist-tags"]?.latest;if(!t)return;on(t,ge)&&console.warn(`\u26A0\uFE0F A new version of ${Mt} is available: ${t} (current: ${ge}). Update with: npm install ${Ls}@latest`);}catch{}}function on(o,e){let t=o.split(".").map(Number),s=e.split(".").map(Number);for(let a=0;a<Math.max(t.length,s.length);a++){let i=t[a]||0,n=s[a]||0;if(i>n)return true;if(i<n)return false}return false}var Rt=class{constructor(e){this.client=e;}get validationApi(){return this.client.apis.validation}async listWorkflowValidations(e){let t=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e);if(t.status!==200)throw E.wrap(t.data,{message:"Failed to list workflow validations"});return t.data}async getValidationDetails(e){let t=await this.validationApi.v4DataValidationValidationsValidationIdGet({validationId:e});if(t.status!==200||t.data.error)throw E.wrap(t.data,{message:"Failed to get validation details"});return t.data}async scheduleValidation(e,t){let s=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost({workflowId:e,jobId:t});if(s.status!==200||s.data.error)throw E.wrap(s.data,{message:s.data.message||"Failed to schedule validation"});return s.data}async toggleValidationEnabled(e){let t=await this.validationApi.v4DataValidationWorkflowsWorkflowIdValidationTogglePut({workflowId:e});if(t.status!==200||t.data.error)throw E.wrap(t.data,{message:t.data.message||"Failed to toggle validation"});return t.data}async getLatestValidation(e,t){let s;if(t?s=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet({workflowId:e,jobId:t}):s=await this.validationApi.v4DataValidationWorkflowsWorkflowIdValidationsLatestGet({workflowId:e}),s.status!==200||s.data?.error)throw E.wrap(s.data,{message:"Failed to get latest validation"});return s.data}async getValidationAnomalies(e){let t=await this.validationApi.v4DataValidationValidationsValidationIdAnomaliesGet({validationId:e});if(t.status!==200)throw E.wrap(t.data,{message:"Failed to get validation anomalies"});return t.data}async getValidationAnomaliesByRule(e,t){let s=await this.validationApi.v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet({validationId:e,ruleName:t});if(s.status!==200)throw E.wrap(s.data,{message:"Failed to get validation anomalies by rule"});return s.data}async waitUntilCompleted(e,t){return await new Promise(a=>setTimeout(a,1e3)),(await _e(async()=>{let a=await this.getValidationDetails(e);if(a.error)throw new P(`Validation failed: ${a.error}`,{code:"VALIDATION_ERROR",details:{validationId:e,error:a.error}});return a},a=>a.completedAt!=null,t)).result}};var gt=class{constructor(e){this.client=e;}get validationApi(){return this.client.apis.validation}async listRules(e){let t=await this.validationApi.v4DataValidationRulesGet(e);if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:"Failed to list validation rules"});return t.data}async getRuleById(e){let t=await this.validationApi.v4DataValidationRulesRuleIdGet({ruleId:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:"Failed to get validation rule by id"});return t.data.data}async getRuleByName(e){let t=await this.validationApi.v4DataValidationRulesGet();if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:"Failed to get validation rule by name"});return t.data.data?.find(s=>s.name===e)}async deleteRule(e){let t=await this.validationApi.v4DataValidationRulesRuleIdDelete({ruleId:e.ruleId,...e.workflowId!=null&&{deleteRuleWithReason:{workflowId:e.workflowId,...e.reason!=null&&{reason:e.reason}}}});if(t.status!==200||t.data.error)throw E.wrap(t.data,{message:t.data.message||"Failed to delete validation rule"});return t.data}async disableRule(e){let t=await this.validationApi.v4DataValidationRulesRuleIdDisablePost(e);if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to disable validation rule"});return t.data.data}async generateRule(e){let t=await this.validationApi.v4DataValidationRulesActionsGeneratePost({generateRule:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to generate validation rule"});return t.data.data}async generateRules(e){let t=await this.validationApi.v4DataValidationRulesActionsGenerateRulesPost({generateRules:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to generate validation rules"});return t.data.data}async bulkApproveRules(e){let t=await this.validationApi.v4DataValidationRulesActionsBulkApprovePost({bulkApproveRules:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to bulk approve validation rules"});return t.data.data}async bulkDeleteRules(e){let t=await this.validationApi.v4DataValidationRulesActionsBulkDeletePost({bulkDeleteRules:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to bulk delete validation rules"});return t.data.data}async deleteAllRules(e){let t=await this.validationApi.v4DataValidationRulesActionsDeleteAllDelete({deleteRuleWithReason:e});if(t.status!==200||t.data.error)throw E.wrap(t.data.data,{message:t.data.message||"Failed to delete all validation rules"});return t.data.data}};var yt={Finished:"FINISHED",Failed:"FAILED",NotSupported:"NOT_SUPPORTED",FailedInsufficientFunds:"FAILED_INSUFFICIENT_FUNDS"};var Js=new Set([yt.Finished,yt.Failed,yt.NotSupported,yt.FailedInsufficientFunds]),Hs=new Set(["FINISHED","SUCCESS","FAILED","ERROR","STOPPED","CANCELLED"]),Ms=Y.workflow,Ct=class{constructor(e){this.workflowsApi=e;}async create(e){Jt(e.additionalData);let t=new URL(e.urls[0]).hostname;if(e.navigationMode==="agentic-navigation"){if(!e.userPrompt)throw new P("userPrompt is required when navigationMode is 'agentic-navigation'",{code:"VALIDATION_ERROR",details:{navigationMode:e.navigationMode}});let n={urls:e.urls,navigationMode:"agentic-navigation",name:e.name??t,description:e.description,userPrompt:e.userPrompt,schemaId:e.schemaId,entity:e.entity,fields:e.fields,bypassPreview:e.bypassPreview??true,tags:e.tags,interval:e.interval,monitoring:e.monitoring,location:e.location,autoStart:e.autoStart,schedules:e.schedules,additionalData:e.additionalData,limit:e.limit},r=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:n}),l=r.data?.workflowId;if(!l)throw new P(j.NO_WORKFLOW_ID,{code:"INTERNAL_ERROR",details:{response:r.data}});return {id:l}}let s={urls:e.urls,name:e.name??t,schemaId:e.schemaId,description:e.description,navigationMode:e.navigationMode,...e.entity!=null&&{entity:e.entity},fields:e.fields,bypassPreview:e.bypassPreview??true,tags:e.tags,interval:e.interval,monitoring:e.monitoring,location:e.location,autoStart:e.autoStart,schedules:e.schedules,additionalData:e.additionalData,limit:e.limit},a=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:s}),i=a.data?.workflowId;if(!i)throw new P(j.NO_WORKFLOW_ID,{code:"INTERNAL_ERROR",details:{response:a.data}});return {id:i}}async get(e){return (await this.workflowsApi.v4WorkflowsWorkflowIdGet({workflowId:e})).data}async list(e){return (await this.workflowsApi.v4WorkflowsGet(e)).data?.workflows??[]}async getByName(e){return (await this.workflowsApi.v4WorkflowsGet({search:e})).data?.workflows?.[0]}async delete(e){await this.workflowsApi.v4WorkflowsWorkflowIdDelete({workflowId:e});}async update(e,t){return Jt(t.additionalData),(await this.workflowsApi.v4WorkflowsWorkflowIdMetadataPut({workflowId:e,v4WorkflowsWorkflowIdMetadataPutRequest:t})).data}async resume(e){await this.workflowsApi.v4WorkflowsWorkflowIdResumePut({workflowId:e});}async wait(e,t){return (await _e(async()=>{let a=await this.get(e);return Ms("workflow %s state: %s",e,a.runState),a},a=>!!(t?.targetState&&a.state===t.targetState||a.runState&&Hs.has(a.runState.toUpperCase())&&a.state!=="QUEUED"),t)).result}async runWorkflow(e,t){let s=await this.workflowsApi.v4WorkflowsWorkflowIdRunPut({workflowId:e,v4WorkflowsWorkflowIdRunPutRequest:{variables:t.variables,limit:t.limit}}),a=s.data?.jobId;if(!a)throw new P(j.NO_WORKFLOW_ID,{code:"INTERNAL_ERROR",details:{response:s.data}});return {jobId:a,message:s.data?.message,status:s.data?.status}}async getJobStatus(e,t){return (await this.workflowsApi.v4WorkflowsWorkflowIdJobsJobIdGet({workflowId:e,jobId:t})).data}async waitForJobCompletion(e,t,s){return (await _e(async()=>{let i=await this.getJobStatus(e,t);return Ms("workflow run %s state: %s",t,i.state),i},i=>!!(s?.targetStatus&&i.state===s.targetStatus||i.state&&Js.has(i.state)),s)).result}};var Ht=class{constructor(e,t,s,a){this.baseUrl=t;this.axios=s;this.cache=new Map;this.configuration=new nt({apiKey:e,basePath:t,baseOptions:{headers:a}});}get(e){return this.cache.has(e)||this.cache.set(e,new e(this.configuration,this.baseUrl,this.axios)),this.cache.get(e)}get schemas(){return this.get(at)}get validation(){return this.get(ot)}get crawler(){return this.get(tt)}get workflows(){return this.get(it)}get notifications(){return this.get(Ne)}};var M=[];for(let o=0;o<256;++o)M.push((o+256).toString(16).slice(1));function Ks(o,e=0){return (M[o[e+0]]+M[o[e+1]]+M[o[e+2]]+M[o[e+3]]+"-"+M[o[e+4]]+M[o[e+5]]+"-"+M[o[e+6]]+M[o[e+7]]+"-"+M[o[e+8]]+M[o[e+9]]+"-"+M[o[e+10]]+M[o[e+11]]+M[o[e+12]]+M[o[e+13]]+M[o[e+14]]+M[o[e+15]]).toLowerCase()}var Eo,sn=new Uint8Array(16);function Oo(){if(!Eo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Eo=crypto.getRandomValues.bind(crypto);}return Eo(sn)}var an=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qo={randomUUID:an};function nn(o,e,t){o=o||{};let s=o.random??o.rng?.()??Oo();if(s.length<16)throw new Error("Random bytes length must be >= 16");if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let a=0;a<16;++a)e[t+a]=s[a];return e}return Ks(s)}function rn(o,e,t){return qo.randomUUID&&!e&&!o?qo.randomUUID():nn(o,e,t)}var No=rn;function $s(o,e){return {rules:e,schedule:(t,s)=>o.scheduleValidation(t,s),listWorkflowValidations:t=>o.listWorkflowValidations(t),getValidationDetails:t=>o.getValidationDetails(t),toggleEnabled:t=>o.toggleValidationEnabled(t),getLatest:(t,s)=>o.getLatestValidation(t,s),getAnomalies:t=>o.getValidationAnomalies(t),getAnomaliesByRule:(t,s)=>o.getValidationAnomaliesByRule(t,s),waitUntilCompleted:(t,s)=>o.waitUntilCompleted(t,s)}}function zs(){return {"User-Agent":`${Mt}/${ge}`,"X-SDK-Version":ge,"X-SDK-Language":Us}}function Qs(o){let e=g.create({timeout:o.timeout,headers:o.headers});return e.interceptors.request.use(t=>(t.headers["x-request-id"]=No(),t)),e.interceptors.response.use(t=>t,t=>{if(t instanceof Is){let s=t.response?.status;if(s===401||s===403)throw E.wrap(t,{message:"Unauthorized"})}throw E.wrap(t)}),e}function Ys(o){let{client:e}=o,t=new ht(e),s=new ct(e.apis.workflows),a=new fe(e.apis.notifications,t),i=new ut(e.apis.notifications),n=new dt(e),r=new Ct(e.apis.workflows),l=new xe(e),c=new mt(a,i),d=new Rt(e),p=new gt(e),m=new pt(r,s,n,c,a,i),R=new ft(r,n,s,c),u=ln({notificationsApi:e.apis.notifications,channelsService:a,settingsService:i,channelSetupService:c}),w=$s(d,p),h=Vo(e);return {extractionBuilderService:R,extraction:m,workflow:r,notification:u,schema:l,user:t,validation:w,crawler:h}}function ln(o){let{notificationsApi:e,channelsService:t,settingsService:s,channelSetupService:a}=o;return {channels:t,settings:s,setup:a,configure:i=>a.setup(i),setupForWorkflow:i=>a.setupForWorkflow(i),setupForWorkspace:i=>a.setupForWorkspace(i),testNotification:async i=>{let n=await e.v5NotificationsTestPost({v5NotificationsTestPostRequest:{eventType:i.eventType,...i.workflowId!=null&&{workflowId:i.workflowId}}}),r=n.data.data;if(!r?.eventId||!r?.eventType)throw E.wrap(n,{message:"Failed to test notification"});return {eventId:r.eventId,eventType:r.eventType,...r.workflowId!=null&&{workflowId:r.workflowId}}}}}var Kt=class{constructor(e){if(!e.apiKey&&!e.bearerToken)throw new P("Either apiKey or bearerToken must be provided",{code:"VALIDATION_ERROR"});this._baseUrl=e.baseUrl??jt,this._apiKey=e.apiKey??"",this._bearerToken=e.bearerToken;let t=e.timeout??3e4,s=zs();this._axiosInstance=Qs({timeout:t,headers:s}),this._axiosInstance.interceptors.request.use(i=>(this._bearerToken&&(i.headers.Authorization||(i.headers.Authorization=`Bearer ${this._bearerToken}`),delete i.headers["x-api-key"]),i)),this.apis=new Ht(this._apiKey,this._baseUrl,this._axiosInstance,s);let a=Ys({client:this});this.user=a.user,this.extraction=a.extraction,this.workflow=a.workflow,this.schema=a.schema,this.notification=a.notification,this.validation=a.validation,this.crawler=a.crawler,this._extractionBuilderService=a.extractionBuilderService,js().catch(()=>{});}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}get apiKey(){return this._apiKey}setBearerToken(e){this._bearerToken=e;}get realtime(){return this._realtime}extract(e){return this._extractionBuilderService.extract(e)}async connectRealtime(e){if(!this._apiKey)throw new P("Realtime requires an API key. Bearer-only auth is not supported for WebSocket connections.",{code:"VALIDATION_ERROR"});return this._realtime||(this._realtime=new wt({apiKey:this._apiKey,...e}),await this._realtime.connect()),this._realtime}disconnectRealtime(){this._realtime&&(this._realtime.close(),this._realtime=void 0);}isRealtimeConnected(){return this._realtime?.isConnected()??false}async status(){return {baseUrl:this._baseUrl,user:await this.user.getCurrentUser(),realtimeConnected:this.isRealtimeConnected()}}async listTeams(e){let t=e?.bearerToken?{Authorization:`Bearer ${e.bearerToken}`}:void 0;return (await this._axiosInstance.get("/v5/user",{baseURL:this._baseUrl,...t&&{headers:t}})).data?.teams??[]}async setActiveTeam(e){if(!e?.trim())throw new P("teamId is required",{code:"VALIDATION_ERROR"});await this._axiosInstance.post("/v5/auth/active-team",{teamId:e},{baseURL:this._baseUrl});}dispose(){this.disconnectRealtime();}close(){this.dispose();}};
9
+ exports.CrawlerConfigService=rt;exports.CrawlerSessionService=lt;exports.DataFetcherService=ct;exports.ERROR_MESSAGES=j;exports.EntityResolverService=dt;exports.ExtractionBuilderService=ft;exports.ExtractionService=pt;exports.FetchDataOptions=vo;exports.KadoaClient=Kt;exports.KadoaHttpException=E;exports.KadoaSdkException=P;exports.NotificationChannelType=he;exports.NotificationChannelsService=fe;exports.NotificationSettingsEventTypeEnum=Ft;exports.NotificationSettingsService=ut;exports.NotificationSetupService=mt;exports.PageStatus=Ei;exports.Realtime=wt;exports.SchemaBuilder=ke;exports.SchemaFieldDataType=qi;exports.SchemasService=xe;exports.TERMINAL_JOB_STATES=Js;exports.TERMINAL_RUN_STATES=Hs;exports.UserService=ht;exports.ValidationCoreService=Rt;exports.ValidationRulesService=gt;exports.WorkflowsCoreService=Ct;exports.createCrawlerDomain=Vo;exports.pollUntil=_e;exports.validateAdditionalData=Jt;return exports;})({},L);//# sourceMappingURL=index.global.js.map
10
10
  //# sourceMappingURL=index.global.js.map