@kadoa/node-sdk 0.19.4-beta.2 → 0.19.4-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.global.js +1 -1
- package/dist/browser/index.global.js.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -5,6 +5,6 @@ var KadoaSDK=(function(exports,L){'use strict';function _interopDefault(e){retur
|
|
|
5
5
|
`):" "+Rs(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 bt={getAdapter:wi,adapters:fo};function mo(o){if(o.cancelToken&&o.cancelToken.throwIfRequested(),o.signal&&o.signal.aborted)throw new ae(null,o)}function Dt(o){return mo(o),o.headers=B.from(o.headers),o.data=Qe.call(o,o.transformRequest),["post","put","patch"].indexOf(o.method)!==-1&&o.headers.setContentType("application/x-www-form-urlencoded",false),bt.getAdapter(o.adapter||De.adapter,o)(o).then(function(s){return mo(o),s.data=Qe.call(o,o.transformResponse,s),s.headers=B.from(s.headers),s},function(s){return Ye(s)||(mo(o),s&&s.response&&(s.response.data=Qe.call(o,o.transformResponse,s.response),s.response.headers=B.from(s.response.headers))),Promise.reject(s)})}var Ot="1.13.2";var Et={};["object","boolean","number","function","string","symbol"].forEach((o,e)=>{Et[o]=function(s){return typeof s===o||"a"+(e<1?"n ":" ")+o};});var hs={};Et.transitional=function(e,t,s){function a(i,n){return "[Axios v"+Ot+"] 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&&!hs[n]&&(hs[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}};Et.spelling=function(e){return (t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),true)};function Ri(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 et={assertOptions:Ri,validators:Et};var ie=et.validators,qe=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Xt,response:new Xt};}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
6
|
`+i):s.stack=i;}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=oe(this.defaults,t);let{transitional:s,paramsSerializer:a,headers:i}=t;s!==void 0&&et.assertOptions(s,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},false),a!=null&&(u.isFunction(a)?t.paramsSerializer={serialize:a}:et.assertOptions(a,{encode:ie.function,serialize:ie.function},true)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=true),et.assertOptions(t,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},true),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=i&&u.merge(i.common,i[t.method]);i&&u.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f];}),t.headers=B.concat(n,i);let r=[],l=true;this.interceptors.request.forEach(function(R){typeof R.runWhen=="function"&&R.runWhen(t)===false||(l=l&&R.synchronous,r.unshift(R.fulfilled,R.rejected));});let d=[];this.interceptors.response.forEach(function(R){d.push(R.fulfilled,R.rejected);});let c,p=0,m;if(!l){let f=[Dt.bind(this),void 0];for(f.unshift(...r),f.push(...d),m=f.length,c=Promise.resolve(t);p<m;)c=c.then(f[p++],f[p++]);return c}m=r.length;let h=t;for(;p<m;){let f=r[p++],R=r[p++];try{h=f(h);}catch(w){R.call(this,w);break}}try{c=Dt.call(this,h);}catch(f){return Promise.reject(f)}for(p=0,m=d.length;p<m;)c=c.then(d[p++],d[p++]);return c}getUri(e){e=oe(this.defaults,e);let t=Ze(e.baseURL,e.url,e.allowAbsoluteUrls);return $e(t,e.params,e.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(e){qe.prototype[e]=function(t,s){return this.request(oe(s||{},{method:e,url:t,data:(s||{}).data}))};});u.forEach(["post","put","patch"],function(e){function t(s){return function(i,n,r){return this.request(oe(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 tt=qe;var wo=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 ae(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}}},gs=wo;function Ro(o){return function(t){return o.apply(null,t)}}function ho(o){return u.isObject(o)&&o.isAxiosError===true}var go={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(go).forEach(([o,e])=>{go[e]=o;});var ys=go;function Cs(o){let e=new tt(o),t=Me(tt.prototype.request,e);return u.extend(t,tt.prototype,e,{allOwnKeys:true}),u.extend(t,e,null,{allOwnKeys:true}),t.create=function(a){return Cs(oe(o,a))},t}var F=Cs(De);F.Axios=tt;F.CanceledError=ae;F.CancelToken=gs;F.isCancel=Ye;F.VERSION=Ot;F.toFormData=fe;F.AxiosError=W;F.Cancel=F.CanceledError;F.all=function(e){return Promise.all(e)};F.spread=Ro;F.isAxiosError=ho;F.mergeConfig=oe;F.AxiosHeaders=B;F.formToJSON=o=>vt(u.isHTMLForm(o)?new FormData(o):o);F.getAdapter=bt.getAdapter;F.HttpStatusCode=ys;F.default=F;var g=F;var{Axios:Ql,AxiosError:As,CanceledError:Yl,isCancel:Xl,CancelToken:Zl,VERSION:ed,all:td,Cancel:od,isAxiosError:xs,spread:sd,toFormData:ad,AxiosHeaders:id,HttpStatusCode:nd,formToJSON:rd,getAdapter:ld,mergeConfig:dd}=g;var C=globalThis.URL,Is=globalThis.URLSearchParams;var y="https://api.kadoa.com".replace(/\/+$/,"");var X=class{constructor(e,t=y,s=g){this.basePath=t;this.axios=s;e&&(this.configuration=e,this.basePath=e.basePath??t);}},qt=class extends Error{constructor(t,s){super(s);this.field=t;this.name="RequiredError";}},A={};var x="https://example.com",S=function(o,e,t){if(t==null)throw new qt(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 me=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 yo(o,e,t=""){e!=null&&(typeof e=="object"?Array.isArray(e)?e.forEach(s=>yo(o,s,t)):Object.keys(e).forEach(s=>yo(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 Is(o.search);yo(t,e),o.search=t.toString();},E=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:{}):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 hi=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,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}},v4CrawlConfigPost:async(e,t={})=>{let s="/v4/crawl/config",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}},v4CrawlPausePost:async(e,t={})=>{let s="/v4/crawl/pause",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}},v4CrawlPost:async(e,t={})=>{let s="/v4/crawl/",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}},v4CrawlResumePost:async(e,t={})=>{let s="/v4/crawl/resume",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,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),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 C(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),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 C(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),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(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),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 C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}}}},Q=function(o){let e=hi(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 (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=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,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=A["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=A["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=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 (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=A["CrawlerApi.v4CrawlStartPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)}}};var Ae=class extends X{v4CrawlBucketDataFilenameb64Get(e,t){return Q(this.configuration).v4CrawlBucketDataFilenameb64Get(e.filenameb64,e.contentType,e.cacheControl,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigConfigIdGet(e,t){return Q(this.configuration).v4CrawlConfigConfigIdGet(e.configId,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigDelete(e={},t){return Q(this.configuration).v4CrawlConfigDelete(e.deleteCrawlerConfigRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlConfigPost(e={},t){return Q(this.configuration).v4CrawlConfigPost(e.createCrawlerConfigRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlPausePost(e={},t){return Q(this.configuration).v4CrawlPausePost(e.pauseCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlPost(e={},t){return Q(this.configuration).v4CrawlPost(e.startCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlResumePost(e={},t){return Q(this.configuration).v4CrawlResumePost(e.resumeCrawlerSessionRequest,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdListGet(e,t){return Q(this.configuration).v4CrawlSessionIdListGet(e.sessionId,e.includeAll,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdPagesGet(e,t){return Q(this.configuration).v4CrawlSessionIdPagesGet(e.sessionId,e.currentPage,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdPagesPageIdGet(e,t){return Q(this.configuration).v4CrawlSessionIdPagesPageIdGet(e.sessionId,e.pageId,e.format,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionIdStatusGet(e,t){return Q(this.configuration).v4CrawlSessionIdStatusGet(e.sessionId,t).then(s=>s(this.axios,this.basePath))}v4CrawlSessionsGet(e={},t){return Q(this.configuration).v4CrawlSessionsGet(e.page,e.pageSize,e.userId,t).then(s=>s(this.axios,this.basePath))}v4CrawlStartPost(e={},t){return Q(this.configuration).v4CrawlStartPost(e.startSessionWithConfigRequest,t).then(s=>s(this.axios,this.basePath))}};var gi=function(o){return {v4DataValidationRulesActionsBulkApprovePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/bulk-approve",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}},v4DataValidationRulesActionsGeneratePost:async(e,t={})=>{let s="/v4/data-validation/rules/actions/generate",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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 C(l,x),c;o&&(c=o.baseOptions);let p={method:"GET",...c,...r},m={},h={};if(await I(m,"x-api-key",o),e!==void 0&&(h.groupId=e),t!==void 0&&(h.workflowId=t),s!==void 0&&(h.status=s),a!==void 0&&(h.page=a),i!==void 0&&(h.pageSize=i),n!==void 0)for(let[R,w]of Object.entries(n))h[R]=w;k(d,h);let f=c&&c.headers?c.headers:{};return p.headers={...m,...f,...r.headers},{url:V(d),options:p}},v4DataValidationRulesPost:async(e,t={})=>{let s="/v4/data-validation/rules",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}},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,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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,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),k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}},v4DataValidationRulesRuleIdPut:async(e,t,s={})=>{S("v4DataValidationRulesRuleIdPut","ruleId",e);let a="/v4/data-validation/rules/{ruleId}".replace("{ruleId}",encodeURIComponent(String(e))),i=new C(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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(t,r,o),{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,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),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 C(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),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 C(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),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 C(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",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},l.data=E(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,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",k(n,c);let p=r&&r.headers?r.headers:{};return l.headers={...d,...p,...a.headers},l.data=E(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,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),k(l,m);let h=d&&d.headers?d.headers:{};return c.headers={...p,...h,...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 C(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),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,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),k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},{url:V(i),options:r}}}},T=function(o){let e=gi(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 d=await e.v4DataValidationRulesGet(t,s,a,i,n,r,l),c=o?.serverIndex??0,p=A["DataValidationApi.v4DataValidationRulesGet"]?.[c]?.url;return (m,h)=>v(d,g,y,o)(m,p||h)},async v4DataValidationRulesPost(t,s){let a=await e.v4DataValidationRulesPost(t,s),i=o?.serverIndex??0,n=A["DataValidationApi.v4DataValidationRulesPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)},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,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=A["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=A["DataValidationApi.v4DataValidationRulesRuleIdGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)},async v4DataValidationRulesRuleIdPut(t,s,a){let i=await e.v4DataValidationRulesRuleIdPut(t,s,a),n=o?.serverIndex??0,r=A["DataValidationApi.v4DataValidationRulesRuleIdPut"]?.[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=A["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=A["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=A["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=A["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=A["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=A["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=A["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=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,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=A["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=A["DataValidationApi.v4DataValidationWorkflowsWorkflowIdValidationsLatestGet"]?.[n]?.url;return (l,d)=>v(i,g,y,o)(l,r||d)}}};var we=class extends X{v4DataValidationRulesActionsBulkApprovePost(e={},t){return T(this.configuration).v4DataValidationRulesActionsBulkApprovePost(e.bulkApproveRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsBulkDeletePost(e={},t){return T(this.configuration).v4DataValidationRulesActionsBulkDeletePost(e.bulkDeleteRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsDeleteAllDelete(e={},t){return T(this.configuration).v4DataValidationRulesActionsDeleteAllDelete(e.deleteRuleWithReason,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsGeneratePost(e={},t){return T(this.configuration).v4DataValidationRulesActionsGeneratePost(e.generateRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesActionsGenerateRulesPost(e={},t){return T(this.configuration).v4DataValidationRulesActionsGenerateRulesPost(e.generateRules,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesGet(e={},t){return T(this.configuration).v4DataValidationRulesGet(e.groupId,e.workflowId,e.status,e.page,e.pageSize,e.includeDeleted,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesPost(e={},t){return T(this.configuration).v4DataValidationRulesPost(e.createRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdDelete(e,t){return T(this.configuration).v4DataValidationRulesRuleIdDelete(e.ruleId,e.deleteRuleWithReason,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdDisablePost(e,t){return T(this.configuration).v4DataValidationRulesRuleIdDisablePost(e.ruleId,e.disableRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdGet(e,t){return T(this.configuration).v4DataValidationRulesRuleIdGet(e.ruleId,e.includeDeleted,t).then(s=>s(this.axios,this.basePath))}v4DataValidationRulesRuleIdPut(e,t){return T(this.configuration).v4DataValidationRulesRuleIdPut(e.ruleId,e.updateRule,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdAnomaliesGet(e,t){return T(this.configuration).v4DataValidationValidationsValidationIdAnomaliesGet(e.validationId,e.page,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(e,t){return T(this.configuration).v4DataValidationValidationsValidationIdAnomaliesRulesRuleNameGet(e.validationId,e.ruleName,e.page,e.pageSize,t).then(s=>s(this.axios,this.basePath))}v4DataValidationValidationsValidationIdGet(e,t){return T(this.configuration).v4DataValidationValidationsValidationIdGet(e.validationId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowIdJobsJobIdValidatePost(e,t){return T(this.configuration).v4DataValidationWorkflowIdJobsJobIdValidatePost(e.workflowId,e.jobId,e.dataValidationRequestBody,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(e,t){return T(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidatePost(e.workflowId,e.jobId,e.dataValidationRequestBody,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e,t){return T(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 T(this.configuration).v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsLatestGet(e.workflowId,e.jobId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationConfigGet(e,t){return T(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationConfigGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationConfigPut(e,t){return T(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationConfigPut(e.workflowId,e.v4DataValidationWorkflowsWorkflowIdValidationConfigPutRequest,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationTogglePut(e,t){return T(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationTogglePut(e.workflowId,e.v4DataValidationWorkflowsWorkflowIdValidationTogglePutRequest,t).then(s=>s(this.axios,this.basePath))}v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(e,t){return T(this.configuration).v4DataValidationWorkflowsWorkflowIdValidationsLatestGet(e.workflowId,e.includeDryRun,t).then(s=>s(this.axios,this.basePath))}};var yi=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,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(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),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 C(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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(t,r,o),{url:V(i),options:r}},v5NotificationsChannelsGet:async(e,t,s={})=>{let a="/v5/notifications/channels",i=new C(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),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 C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(t,x),a;o&&(a=o.baseOptions);let i={method:"GET",...a,...e},n={},r={};await I(n,"x-api-key",o),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 C(l,x),c;o&&(c=o.baseOptions);let p={method:"GET",...c,...r},m={},h={};await I(m,"x-api-key",o),e!==void 0&&(h.workflowId=e),t!==void 0&&(h.eventType=t),s!==void 0&&(h.startDate=s instanceof Date?s.toISOString():s),a!==void 0&&(h.endDate=a instanceof Date?a.toISOString():a),i!==void 0&&(h.limit=i),n!==void 0&&(h.offset=n),k(d,h);let f=c&&c.headers?c.headers:{};return p.headers={...m,...f,...r.headers},{url:V(d),options:p}},v5NotificationsSettingsGet:async(e,t,s={})=>{let a="/v5/notifications/settings",i=new C(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),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 C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(e,n,o),{url:V(a),options:n}}}},K=function(o){let e=yi(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,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=A["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=A["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=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 d=await e.v5NotificationsLogsGet(t,s,a,i,n,r,l),c=o?.serverIndex??0,p=A["NotificationsApi.v5NotificationsLogsGet"]?.[c]?.url;return (m,h)=>v(d,g,y,o)(m,p||h)},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,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=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,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=A["NotificationsApi.v5NotificationsTestPost"]?.[i]?.url;return (r,l)=>v(a,g,y,o)(r,n||l)}}};var Ne=class extends X{v5NotificationsChannelsChannelIdDelete(e,t){return K(this.configuration).v5NotificationsChannelsChannelIdDelete(e.channelId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsChannelIdGet(e,t){return K(this.configuration).v5NotificationsChannelsChannelIdGet(e.channelId,e.includeConfigurations,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsChannelIdPut(e,t){return K(this.configuration).v5NotificationsChannelsChannelIdPut(e.channelId,e.v5NotificationsChannelsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsGet(e={},t){return K(this.configuration).v5NotificationsChannelsGet(e.workflowId,e.includeConfigurations,t).then(s=>s(this.axios,this.basePath))}v5NotificationsChannelsPost(e,t){return K(this.configuration).v5NotificationsChannelsPost(e.v5NotificationsChannelsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsEventTypesEventTypeGet(e,t){return K(this.configuration).v5NotificationsEventTypesEventTypeGet(e.eventType,t).then(s=>s(this.axios,this.basePath))}v5NotificationsEventTypesGet(e){return K(this.configuration).v5NotificationsEventTypesGet(e).then(t=>t(this.axios,this.basePath))}v5NotificationsLogsGet(e={},t){return K(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 K(this.configuration).v5NotificationsSettingsGet(e.workflowId,e.eventType,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsPost(e,t){return K(this.configuration).v5NotificationsSettingsPost(e.v5NotificationsSettingsPostRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdDelete(e,t){return K(this.configuration).v5NotificationsSettingsSettingsIdDelete(e.settingsId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdGet(e,t){return K(this.configuration).v5NotificationsSettingsSettingsIdGet(e.settingsId,t).then(s=>s(this.axios,this.basePath))}v5NotificationsSettingsSettingsIdPut(e,t){return K(this.configuration).v5NotificationsSettingsSettingsIdPut(e.settingsId,e.v5NotificationsSettingsSettingsIdPutRequest,t).then(s=>s(this.axios,this.basePath))}v5NotificationsTestPost(e,t){return K(this.configuration).v5NotificationsTestPost(e.v5NotificationsTestPostRequest,t).then(s=>s(this.axios,this.basePath))}},Nt={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 Ci=function(o){return {v4SchemasGet:async(e={})=>{let t="/v4/schemas/",s=new C(t,x),a;o&&(a=o.baseOptions);let i={method:"GET",...a,...e},n={},r={};await I(n,"x-api-key",o),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 C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(t,r,o),{url:V(i),options:r}}}},ot=function(o){let e=Ci(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,d)=>v(i,g,y,o)(l,r||d)}}};var Ge=class extends X{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 Ai=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,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),await me(d,o),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 C(c,x),m;o&&(m=o.baseOptions);let h={method:"GET",...m,...d},f={},R={};await I(f,"x-api-key",o),await me(f,o),s!==void 0&&(R.workflowIds=s),a!==void 0&&(R.startDate=a instanceof Date?a.toISOString():a),i!==void 0&&(R.endDate=i instanceof Date?i.toISOString():i),n!==void 0&&(R.skip=n),r!==void 0&&(R.limit=r),l!==void 0&&(R.exclude=l),e!=null&&(f["x-api-key"]=String(e)),t!=null&&(f.Authorization=String(t)),k(p,R);let w=m&&m.headers?m.headers:{};return h.headers={...f,...w,...d.headers},{url:V(p),options:h}},v4WorkflowsGet:async(e,t,s,a,i,n,r,l,d,c,p,m={})=>{let h="/v4/workflows",f=new C(h,x),R;o&&(R=o.baseOptions);let w={method:"GET",...R,...m},b={},D={};await I(b,"x-api-key",o),e!==void 0&&(D.search=e),t!==void 0&&(D.skip=t),s!==void 0&&(D.limit=s),a!==void 0&&(D.state=a),i&&(D.tags=i),n!==void 0&&(D.userId=n),r!==void 0&&(D.monitoring=r),l!==void 0&&(D.updateInterval=l),d!==void 0&&(D.templateId=d),c!==void 0&&(D.includeDeleted=c),p!==void 0&&(D.format=p),k(f,D);let N=R&&R.headers?R.headers:{};return w.headers={...b,...N,...m.headers},{url:V(f),options:w}},v4WorkflowsPost:async(e,t={})=>{let s="/v4/workflows/",a=new C(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",k(a,l);let d=i&&i.headers?i.headers:{};return n.headers={...r,...d,...t.headers},n.data=E(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,x),d;o&&(d=o.baseOptions);let c={method:"GET",...d,...n},p={},m={};await I(p,"x-api-key",o),await me(p,o),a!==void 0&&(m.page=a),i!==void 0&&(m.limit=i),t!=null&&(p["x-api-key"]=String(t)),s!=null&&(p.Authorization=String(s)),k(l,m);let h=d&&d.headers?d.headers:{};return c.headers={...p,...h,...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 C(i,x),r;o&&(r=o.baseOptions);let l={method:"PUT",...r,...a},d={},c={};await I(d,"x-api-key",o),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 C(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",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=E(t,d,o),{url:V(r),options:d}},v4WorkflowsWorkflowIdDataGet:async(e,t,s,a,i,n,r,l,d,c,p,m,h,f={})=>{S("v4WorkflowsWorkflowIdDataGet","workflowId",e);let R="/v4/workflows/{workflowId}/data".replace("{workflowId}",encodeURIComponent(String(e))),w=new C(R,x),b;o&&(b=o.baseOptions);let D={method:"GET",...b,...f},N={},q={};await I(N,"x-api-key",o),await me(N,o),a!==void 0&&(q.runId=a),i!==void 0&&(q.format=i),n!==void 0&&(q.sortBy=n),r!==void 0&&(q.order=r),l!==void 0&&(q.filters=l),d!==void 0&&(q.page=d),c!==void 0&&(q.limit=c),p!==void 0&&(q.gzip=p),m!==void 0&&(q.rowIds=m),h!==void 0&&(q.includeAnomalies=h),t!=null&&(N["x-api-key"]=String(t)),s!=null&&(N.Authorization=String(s)),k(w,q);let M=b&&b.headers?b.headers:{};return D.headers={...N,...M,...f.headers},{url:V(w),options:D}},v4WorkflowsWorkflowIdDelete:async(e,t={})=>{S("v4WorkflowsWorkflowIdDelete","workflowId",e);let s="/v4/workflows/{workflowId}".replace("{workflowId}",encodeURIComponent(String(e))),a=new C(s,x),i;o&&(i=o.baseOptions);let n={method:"DELETE",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"GET",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(a,x),n;o&&(n=o.baseOptions);let r={method:"GET",...n,...s},l={},d={};await I(l,"x-api-key",o),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 C(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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,x),i;o&&(i=o.baseOptions);let n={method:"PUT",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(s,x),i;o&&(i=o.baseOptions);let n={method:"PUT",...i,...t},r={},l={};await I(r,"x-api-key",o),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 C(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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,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",k(i,d);let c=n&&n.headers?n.headers:{};return r.headers={...l,...c,...s.headers},r.data=E(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,x),r;o&&(r=o.baseOptions);let l={method:"GET",...r,...a},d={},c={};await I(d,"x-api-key",o),await me(d,o),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 C(d,x),p;o&&(p=o.baseOptions);let m={method:"GET",...p,...l},h={},f={};await I(h,"x-api-key",o),await me(h,o),s!==void 0&&(f.workflowIds=s),a!==void 0&&(f.startDate=a instanceof Date?a.toISOString():a),i!==void 0&&(f.endDate=i instanceof Date?i.toISOString():i),n!==void 0&&(f.skip=n),r!==void 0&&(f.limit=r),e!=null&&(h["x-api-key"]=String(e)),t!=null&&(h.Authorization=String(t)),k(c,f);let R=p&&p.headers?p.headers:{};return m.headers={...h,...R,...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 C(r,x),d;o&&(d=o.baseOptions);let c={method:"GET",...d,...n},p={},m={};await I(p,"x-api-key",o),await me(p,o),a!==void 0&&(m.page=a),i!==void 0&&(m.limit=i),t!=null&&(p["x-api-key"]=String(t)),s!=null&&(p.Authorization=String(s)),k(l,m);let h=d&&d.headers?d.headers:{};return c.headers={...p,...h,...n.headers},{url:V(l),options:c}}}},U=function(o){let e=Ai(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 (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,h=A["WorkflowsApi.v4ChangesGet"]?.[m]?.url;return (f,R)=>v(p,g,y,o)(f,h||R)},async v4WorkflowsGet(t,s,a,i,n,r,l,d,c,p,m,h){let f=await e.v4WorkflowsGet(t,s,a,i,n,r,l,d,c,p,m,h),R=o?.serverIndex??0,w=A["WorkflowsApi.v4WorkflowsGet"]?.[R]?.url;return (b,D)=>v(f,g,y,o)(b,w||D)},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),d=o?.serverIndex??0,c=A["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=A["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=A["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,h,f,R){let w=await e.v4WorkflowsWorkflowIdDataGet(t,s,a,i,n,r,l,d,c,p,m,h,f,R),b=o?.serverIndex??0,D=A["WorkflowsApi.v4WorkflowsWorkflowIdDataGet"]?.[b]?.url;return (N,q)=>v(w,g,y,o)(N,D||q)},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,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=A["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=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,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=A["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=A["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=A["WorkflowsApi.v5ChangesGet"]?.[p]?.url;return (h,f)=>v(c,g,y,o)(h,m||f)},async v5WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r){let l=await e.v5WorkflowsWorkflowIdAuditlogGet(t,s,a,i,n,r),d=o?.serverIndex??0,c=A["WorkflowsApi.v5WorkflowsWorkflowIdAuditlogGet"]?.[d]?.url;return (p,m)=>v(l,g,y,o)(p,c||m)}}};var st=class extends X{v4ChangesChangeIdGet(e,t){return U(this.configuration).v4ChangesChangeIdGet(e.changeId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4ChangesGet(e={},t){return U(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))}v4WorkflowsGet(e={},t){return U(this.configuration).v4WorkflowsGet(e.search,e.skip,e.limit,e.state,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 U(this.configuration).v4WorkflowsPost(e.createWorkflowBody,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdAuditlogGet(e,t){return U(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 U(this.configuration).v4WorkflowsWorkflowIdComplianceApprovePut(e.workflowId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdComplianceRejectPut(e,t){return U(this.configuration).v4WorkflowsWorkflowIdComplianceRejectPut(e.workflowId,e.v4WorkflowsWorkflowIdComplianceRejectPutRequest,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdDataGet(e,t){return U(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 U(this.configuration).v4WorkflowsWorkflowIdDelete(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdGet(e,t){return U(this.configuration).v4WorkflowsWorkflowIdGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdHistoryGet(e,t){return U(this.configuration).v4WorkflowsWorkflowIdHistoryGet(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdJobsJobIdGet(e,t){return U(this.configuration).v4WorkflowsWorkflowIdJobsJobIdGet(e.workflowId,e.jobId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdMetadataPut(e,t){return U(this.configuration).v4WorkflowsWorkflowIdMetadataPut(e.workflowId,e.v4WorkflowsWorkflowIdMetadataPutRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdPausePut(e,t){return U(this.configuration).v4WorkflowsWorkflowIdPausePut(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdResumePut(e,t){return U(this.configuration).v4WorkflowsWorkflowIdResumePut(e.workflowId,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdRunPut(e,t){return U(this.configuration).v4WorkflowsWorkflowIdRunPut(e.workflowId,e.v4WorkflowsWorkflowIdRunPutRequest,t).then(s=>s(this.axios,this.basePath))}v4WorkflowsWorkflowIdSchedulePut(e,t){return U(this.configuration).v4WorkflowsWorkflowIdSchedulePut(e.workflowId,e.v4WorkflowsWorkflowIdSchedulePutRequest,t).then(s=>s(this.axios,this.basePath))}v5ChangesChangeIdGet(e,t){return U(this.configuration).v5ChangesChangeIdGet(e.changeId,e.xApiKey,e.authorization,t).then(s=>s(this.axios,this.basePath))}v5ChangesGet(e={},t){return U(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 U(this.configuration).v5WorkflowsWorkflowIdAuditlogGet(e.workflowId,e.xApiKey,e.authorization,e.page,e.limit,t).then(s=>s(this.axios,this.basePath))}};var at=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 Y={String:"STRING",Number:"NUMBER",Boolean:"BOOLEAN",Date:"DATE",Datetime:"DATETIME",Money:"MONEY",Image:"IMAGE",Link:"LINK",Object:"OBJECT",Array:"ARRAY"};var Co=class{},xi={String:Y.String,Number:Y.Number,Boolean:Y.Boolean,Date:Y.Date,Datetime:Y.Datetime,Money:Y.Money,Image:Y.Image,Link:Y.Link,Object:Y.Object,Array:Y.Array},Ii={...xi,Text:Y.String,Url:Y.Link};var Te=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 it=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 Te(s=>this.fetchData({...e,...s})).fetchAll({limit:e.limit??this.defaultLimit})}async*fetchDataPages(e){let t=new Te(s=>this.fetchData({...e,...s}));for await(let s of t.pages({limit:e.limit??this.defaultLimit}))yield s;}};var Z={AUTH_ERROR:"AUTH_ERROR",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,_=P.ERROR_MESSAGES;var O=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,cause:e})}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:xs(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 Ws=ta(Ps()),de=o=>(0, Ws.default)(`kadoa:${o}`),z={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 Ao(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 bs(o){return o==="__proto__"}function ne(o,e){let t=Object.keys(e);for(let s=0;s<t.length;s++){let a=t[s];if(bs(a))continue;let i=e[a],n=o[a];Array.isArray(i)?Array.isArray(n)?o[a]=ne(n,i):o[a]=ne([],i):Ao(i)?Ao(n)?o[a]=ne(n,i):o[a]=ne({},i):(n===void 0||i!==void 0)&&(o[a]=i);}return o}function Ds(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}var Gi=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function Os(o){return Array.from(o.match(Gi)??[])}function xo(o){let e=Os(o);if(e.length===0)return "";let[t,...s]=e;return `${t.toLowerCase()}${s.map(a=>Ds(a)).join("")}`}function Io(o){return o.substring(0,1).toUpperCase()+o.substring(1)}var Le=class Le{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),Le.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${Io(xo(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(!Le.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}})}};Le.FIELD_NAME_PATTERN=/^[A-Za-z0-9]+$/,Le.TYPES_REQUIRING_EXAMPLE=["STRING","IMAGE","LINK","OBJECT","ARRAY"];var Ie=Le;var Ft=z.schemas,ke=class{constructor(e){this.schemasApi=new Ge(e.configuration);}builder(e){let t=this;return new class extends Ie{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){Ft("Fetching schema with ID: %s",e);let s=(await this.schemasApi.v4SchemasSchemaIdGet({schemaId:e})).data.data;if(!s)throw new P(`${_.SCHEMA_NOT_FOUND}: ${e}`,{code:Z.NOT_FOUND,details:{schemaId:e}});return s}async listSchemas(){return (await this.schemasApi.v4SchemasGet()).data.data}async createSchema(e){Ft("Creating schema with name: %s",e.name);let s=(await this.schemasApi.v4SchemasPost({createSchemaBody:e})).data.schemaId;if(!s)throw new P(_.SCHEMA_CREATE_FAILED,{code:Z.INTERNAL_ERROR});return this.getSchema(s)}async updateSchema(e,t){return Ft("Updating schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdPut({schemaId:e,updateSchemaBody:t}),this.getSchema(e)}async deleteSchema(e){Ft("Deleting schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdDelete({schemaId:e});}};var Ti="/v4/entity",nt=class{constructor(e){this.client=e;this.schemasService=new ke(e);}async resolveEntity(e,t){if(e==="ai-detection"){if(!t?.link)throw new P(_.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(_.ENTITY_INVARIANT_VIOLATION,{details:{entity:e}})}async fetchEntityFields(e){this.validateEntityOptions(e);let t=`${this.client.baseUrl}${Ti}`,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(_.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(_.LINK_REQUIRED,{code:"VALIDATION_ERROR",details:{options:e}})}};var Fi=z.extraction,Ui=new Set(["FINISHED","SUCCESS"]),ko={mode:"run",pollingInterval:5e3,maxWaitTime:3e5,navigationMode:"single-page",location:{type:"auto"},bypassPreview:true,autoStart:true},rt=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=ne(ko,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 f=e.entity||"ai-detection";n={entity:typeof f=="object"&&"name"in f?f.name:void 0,fields:typeof f=="object"&&"fields"in f?f.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 f=await this.notificationSetupService.setup({workflowId:a,events:t.notifications?.events,channels:t.notifications?.channels});Fi("Notifications setup: %O",f.map(R=>({id:R.id,eventType:R.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 f=await this.dataFetcherService.fetchData({workflowId:a});p=f.data,m=f.pagination;}else throw new P(`${_.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(_.NO_URLS,{code:"VALIDATION_ERROR"})}async resumeWorkflow(e){await this.workflowsCoreService.resume(e);let t=await this.workflowsCoreService.wait(e,{pollIntervalMs:ko.pollingInterval,timeoutMs:ko.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(`${_.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?Ui.has(e.toUpperCase()):false}};var Vo=z.extraction,lt=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 h=i(new Ie);if("schemaId"in h)m={schemaId:h.schemaId};else {let f=h.build();m=f.entityName?{name:f.entityName,fields:f.fields}:{fields:f.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=await this.workflowsCoreService.create({urls:e,name:t,description:s,navigationMode:a,monitoring:this._monitoringOptions,schemaId:typeof i=="object"&&"schemaId"in i?i.schemaId:void 0,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:c.id}),this._workflowId=c.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"),Vo("Job started: %O",t),this._jobId=t.jobId;let s=await this.workflowsCoreService.waitForJobCompletion(this._workflowId,t.jobId);return Vo("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"),Vo("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 Re={EMAIL:"EMAIL",SLACK:"SLACK",WEBHOOK:"WEBHOOK",WEBSOCKET:"WEBSOCKET"};var Es=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Bi(o){let e=[];if(!o.recipients?.length)e.push({message:"Recipients are required for email channel"});else for(let t of o.recipients)Es.test(t)||e.push({message:`Invalid email address: ${t}`});if(o.from!==void 0&&(Es.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:Z.VALIDATION_ERROR,details:{issues:e}});return o}var Ut=class Ut{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 O.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 O.wrap(t,{message:"Failed to delete channel"})}async createChannel(e,t){let s=await this.buildPayload(ne(t||{},{name:Ut.DEFAULT_CHANNEL_NAME,channelType:e,config:{}})),a=await this.api.v5NotificationsChannelsPost({v5NotificationsChannelsPostRequest:s});if(a.status===201){let i=a.data.data?.channel;if(!i)throw O.wrap(a,{message:"Failed to create default channels"});return i}throw O.wrap(a,{message:"Failed to create default channels"})}async buildPayload(e){let t;switch(e.channelType){case Re.EMAIL:t=await this.buildEmailChannelConfig(e.config);break;case Re.SLACK:t=await this.buildSlackChannelConfig(e.config);break;case Re.WEBHOOK:t=await this.buildWebhookChannelConfig(e.config);break;case Re.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=ne(e,{recipients:t});return Bi(s)}async buildSlackChannelConfig(e){return e}async buildWebhookChannelConfig(e){return e}async buildWebsocketChannelConfig(e){return e}};Ut.DEFAULT_CHANNEL_NAME="default";var ce=Ut;var dt=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 O.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 O.wrap(t,{message:"Failed to list notification settings"});return s}async listAllEvents(){return Object.values(Nt)}async deleteSettings(e){let t=await this.api.v5NotificationsSettingsSettingsIdDelete({settingsId:e});if(t.status!==200)throw O.wrap(t,{message:"Failed to delete notification settings"})}};var he=z.notifications,ct=class{constructor(e,t){this.channelsService=e;this.settingsService=t;}async setupForWorkflow(e){if((await this.settingsService.listSettings({workflowId:e.workflowId})).length>0)throw new P("Settings already exist",{code:Z.BAD_REQUEST,details:{workflowId:e.workflowId}});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:Z.BAD_REQUEST});return this.setup({events:e.events,channels:e.channels})}async setup(e){e.workflowId?he("Setting up notifications for workflow %s",e.workflowId):he("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(r=>r.id).filter(Boolean);he("Creating notification settings for workflow %s: %O",e.workflowId,{events:a,channels:i});let n=await Promise.all(a.map(async r=>await this.settingsService.createSettings({workflowId:e.workflowId,channelIds:i,eventType:r,enabled:true,eventConfiguration:{}})));return he(e.workflowId?"Successfully setup notifications for workflow %s":"Successfully setup notifications for workspace",e.workflowId),n}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:Z.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===Re.WEBSOCKET?t.find(l=>l.channelType===i):t.find(l=>l.channelType===i&&l.name===ce.DEFAULT_CHANNEL_NAME);if(n)return he("Using existing default channel: %O",{workflowId:s,channelType:i,channelId:n.id}),n;let r=await this.channelsService.createChannel(i);return he("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||ce.DEFAULT_CHANNEL_NAME,l=t.find(c=>c.channelType===i&&(c.name||ce.DEFAULT_CHANNEL_NAME)===r);if(l)return he("Using existing channel: %O",{workflowId:s,channelType:i,channelName:r,channelId:l.id}),l;let d=await this.channelsService.createChannel(i,{name:r,config:n});return he("Created channel with custom config %O",{workflowId:s,channelType:i,channelName:r,channel:d}),d}))}};var Bt="https://api.kadoa.com",qs="wss://realtime.kadoa.com",Ns="https://realtime.kadoa.com";var ge="0.19.3",Lt="kadoa-node-sdk",Gs="node";var re=z.wss;typeof WebSocket>"u"&&(window.WebSocket=Xs("ws"));var pt=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,this.source=e.source;}async connect(){if(!this.isConnecting){this.isConnecting=true;try{let e=await fetch(`${Bt}/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();this.socket=new WebSocket(`${qs}?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,...this.source&&{source:this.source}})),re("Connected to WebSocket"),this.notifyConnectionListeners(!0)),this.startHeartbeatCheck();},this.socket.onmessage=a=>{try{let i=JSON.parse(a.data);i.type==="heartbeat"?this.handleHeartbeat():(i?.id&&fetch(`${Ns}/api/v1/events/ack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:i.id})}),this.notifyEventListeners(i));}catch(i){re("Failed to parse incoming message: %O",i);}},this.socket.onclose=()=>{re("WebSocket disconnected. Attempting to reconnect..."),this.isConnecting=!1,this.stopHeartbeatCheck(),this.notifyConnectionListeners(!1,"Connection closed"),setTimeout(()=>this.connect(),this.reconnectDelay);},this.socket.onerror=a=>{re("WebSocket error: %O",a),this.isConnecting=!1,this.notifyErrorListeners(a);};}catch(e){re("Failed to connect: %O",e),this.isConnecting=false,setTimeout(()=>this.connect(),this.reconnectDelay);}}}handleHeartbeat(){re("Heartbeat received"),this.lastHeartbeat=Date.now();}notifyEventListeners(e){this.eventListeners.forEach(t=>{try{t(e);}catch(s){re("Error in event listener: %O",s);}});}notifyConnectionListeners(e,t){this.connectionListeners.forEach(s=>{try{s(e,t);}catch(a){re("Error in connection listener: %O",a);}});}notifyErrorListeners(e){this.errorListeners.forEach(t=>{try{t(e);}catch(s){re("Error in error listener: %O",s);}});}startHeartbeatCheck(){this.missedHeartbeatCheckTimer=setInterval(()=>{Date.now()-this.lastHeartbeat>this.missedHeartbeatsLimit&&(re("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 ut=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 Li={pollIntervalMs:1e4,timeoutMs:300*1e3},Ts={ABORTED:"ABORTED",TIMEOUT:"TIMEOUT"};async function _e(o,e,t={}){let s={...Li,...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:Ts.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:Ts.TIMEOUT,details:{timeoutMs:i,attempts:r,duration:Date.now()-n}})}function _t(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 _i="https://registry.npmjs.org",Fs="@kadoa/node-sdk";async function Us(){try{let o=await fetch(`${_i}/${Fs}`,{headers:{Accept:"application/json"}});if(!o.ok)return;let t=(await o.json())["dist-tags"]?.latest;if(!t)return;ji(t,ge)&&console.warn(`\u26A0\uFE0F A new version of ${Lt} is available: ${t} (current: ${ge}). Update with: npm install ${Fs}@latest`);}catch{}}function ji(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 ft=class{constructor(e){this.validationApi=new we(e.configuration,e.baseUrl,e.axiosInstance);}async listWorkflowValidations(e){let t=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e);if(t.status!==200)throw O.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 O.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 O.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 O.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 O.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 O.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 O.wrap(s.data,{message:"Failed to get validation anomalies by rule"});return s.data}async waitUntilCompleted(e,t){return (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 mt=class{constructor(e){this.validationApi=new we(e.configuration,e.baseUrl,e.axiosInstance);}async listRules(e){let t=await this.validationApi.v4DataValidationRulesGet(e);if(t.status!==200||t.data.error)throw O.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 O.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 O.wrap(t.data.data,{message:"Failed to get validation rule by name"});return t.data.data?.find(s=>s.name===e)}async createRule(e){let t=await this.validationApi.v4DataValidationRulesPost({createRule:e});if(t.status!==200||t.data.error)throw O.wrap(t.data.data,{message:t.data.message||"Failed to create validation rule"});return t.data.data}async updateRule(e,t){let s=await this.validationApi.v4DataValidationRulesRuleIdPut({ruleId:e,updateRule:t});if(s.status!==200||s.data.error)throw O.wrap(s.data.data,{message:s.data.message||"Failed to update validation rule"});return s.data.data}async disableRule(e){let t=await this.validationApi.v4DataValidationRulesRuleIdDisablePost(e);if(t.status!==200||t.data.error)throw O.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 O.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 O.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 O.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 O.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 O.wrap(t.data.data,{message:t.data.message||"Failed to delete all validation rules"});return t.data.data}};var wt={Finished:"FINISHED",Failed:"FAILED",NotSupported:"NOT_SUPPORTED",FailedInsufficientFunds:"FAILED_INSUFFICIENT_FUNDS"};var Ls=new Set([wt.Finished,wt.Failed,wt.NotSupported,wt.FailedInsufficientFunds]),_s=new Set(["FINISHED","SUCCESS","FAILED","ERROR","STOPPED","CANCELLED"]),Bs=z.workflow,Rt=class{constructor(e){this.workflowsApi=e;}async create(e){_t(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},r=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:n}),l=r.data?.workflowId;if(!l)throw new P(_.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,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},a=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:s}),i=a.data?.workflowId;if(!i)throw new P(_.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 _t(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 Bs("workflow %s state: %s",e,a.runState),a},a=>!!(t?.targetState&&a.state===t.targetState||a.runState&&_s.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(_.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 Bs("workflow run %s state: %s",t,i.state),i},i=>!!(s?.targetStatus&&i.state===s.targetStatus||i.state&&Ls.has(i.state)),s)).result}};var j=[];for(let o=0;o<256;++o)j.push((o+256).toString(16).slice(1));function js(o,e=0){return (j[o[e+0]]+j[o[e+1]]+j[o[e+2]]+j[o[e+3]]+"-"+j[o[e+4]]+j[o[e+5]]+"-"+j[o[e+6]]+j[o[e+7]]+"-"+j[o[e+8]]+j[o[e+9]]+"-"+j[o[e+10]]+j[o[e+11]]+j[o[e+12]]+j[o[e+13]]+j[o[e+14]]+j[o[e+15]]).toLowerCase()}var vo,Mi=new Uint8Array(16);function So(){if(!vo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");vo=crypto.getRandomValues.bind(crypto);}return vo(Mi)}var Ji=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Po={randomUUID:Ji};function Hi(o,e,t){o=o||{};let s=o.random??o.rng?.()??So();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 js(s)}function Ki(o,e,t){return Po.randomUUID&&!e&&!o?Po.randomUUID():Hi(o,e,t)}var Wo=Ki;var jt=class{constructor(e){this.client=e;this._api=null;}get api(){return this._api||(this._api=new Ae(this.client.configuration,this.client.baseUrl,this.client.axiosInstance)),this._api}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 Mt=class{constructor(e){this.client=e;this._api=null;}get api(){return this._api||(this._api=new Ae(this.client.configuration,this.client.baseUrl,this.client.axiosInstance)),this._api}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 Ms(o){return {config:new jt(o),session:new Mt(o)}}function Js(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)}}var bo=class{constructor(e){this._baseUrl=Bt,this._timeout=e.timeout||3e4,this._apiKey=e.apiKey;let t={"User-Agent":`${Lt}/${ge}`,"X-SDK-Version":ge,"X-SDK-Language":Gs};this._configuration=new at({apiKey:this._apiKey,basePath:this._baseUrl,baseOptions:{headers:t}}),this._axiosInstance=g.create({timeout:this._timeout,headers:t}),this._axiosInstance.interceptors.request.use(w=>(w.headers["x-request-id"]=Wo(),w)),this._axiosInstance.interceptors.response.use(w=>{if(w.status===401)throw new O("Unauthorized",{code:Z.AUTH_ERROR,httpStatus:401});return w},w=>{throw w instanceof As&&w.response?.status===400?O.wrap(w):O.wrap(w)});let s=new st(this.configuration,this.baseUrl,this.axiosInstance),a=new Ne(this.configuration,this.baseUrl,this.axiosInstance),i=new ut(this),n=new it(s),r=new ce(a,i),l=new dt(a),d=new nt(this),c=new Rt(s),p=new ke(this),m=new ct(r,l),h=new ft(this),f=new mt(this),R=new rt(c,n,d,m,r,l);this._extractionBuilderService=new lt(c,d,n,m),this.user=i,this.extraction=R,this.workflow=c,this.schema=p,this.notification={channels:r,settings:l,setup:m,configure:w=>m.setup(w),setupForWorkflow:w=>m.setupForWorkflow(w),setupForWorkspace:w=>m.setupForWorkspace(w)},this.validation=Js(h,f),this.crawler=Ms(this),e.enableRealtime&&e.realtimeConfig?.autoConnect!==false&&this.connectRealtime(),Us().catch(()=>{});}get configuration(){return this._configuration}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}get apiKey(){return this._apiKey}get timeout(){return this._timeout}get realtime(){return this._realtime}extract(e){return this._extractionBuilderService.extract(e)}connectRealtime(){return this._realtime||(this._realtime=new pt({apiKey:this._apiKey}),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()}}dispose(){this.disconnectRealtime();}};
|
|
8
|
+
`)}static wrap(e,t){return e instanceof o||e instanceof P?e:xs(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 Ws=ta(Ps()),de=o=>(0, Ws.default)(`kadoa:${o}`),z={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 Ao(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 bs(o){return o==="__proto__"}function ne(o,e){let t=Object.keys(e);for(let s=0;s<t.length;s++){let a=t[s];if(bs(a))continue;let i=e[a],n=o[a];Array.isArray(i)?Array.isArray(n)?o[a]=ne(n,i):o[a]=ne([],i):Ao(i)?Ao(n)?o[a]=ne(n,i):o[a]=ne({},i):(n===void 0||i!==void 0)&&(o[a]=i);}return o}function Ds(o){return o.charAt(0).toUpperCase()+o.slice(1).toLowerCase()}var Gi=/\p{Lu}?\p{Ll}+|[0-9]+|\p{Lu}+(?!\p{Ll})|\p{Emoji_Presentation}|\p{Extended_Pictographic}|\p{L}+/gu;function Os(o){return Array.from(o.match(Gi)??[])}function xo(o){let e=Os(o);if(e.length===0)return "";let[t,...s]=e;return `${t.toLowerCase()}${s.map(a=>Ds(a)).join("")}`}function Io(o){return o.substring(0,1).toUpperCase()+o.substring(1)}var Le=class Le{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),Le.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${Io(xo(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(!Le.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}})}};Le.FIELD_NAME_PATTERN=/^[A-Za-z0-9]+$/,Le.TYPES_REQUIRING_EXAMPLE=["STRING","IMAGE","LINK","OBJECT","ARRAY"];var Ie=Le;var Ft=z.schemas,ke=class{constructor(e){this.schemasApi=new Ge(e.configuration);}builder(e){let t=this;return new class extends Ie{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){Ft("Fetching schema with ID: %s",e);let s=(await this.schemasApi.v4SchemasSchemaIdGet({schemaId:e})).data.data;if(!s)throw new P(`${_.SCHEMA_NOT_FOUND}: ${e}`,{code:Z.NOT_FOUND,details:{schemaId:e}});return s}async listSchemas(){return (await this.schemasApi.v4SchemasGet()).data.data}async createSchema(e){Ft("Creating schema with name: %s",e.name);let s=(await this.schemasApi.v4SchemasPost({createSchemaBody:e})).data.schemaId;if(!s)throw new P(_.SCHEMA_CREATE_FAILED,{code:Z.INTERNAL_ERROR});return this.getSchema(s)}async updateSchema(e,t){return Ft("Updating schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdPut({schemaId:e,updateSchemaBody:t}),this.getSchema(e)}async deleteSchema(e){Ft("Deleting schema with ID: %s",e),await this.schemasApi.v4SchemasSchemaIdDelete({schemaId:e});}};var Ti="/v4/entity",nt=class{constructor(e){this.client=e;this.schemasService=new ke(e);}async resolveEntity(e,t){if(e==="ai-detection"){if(!t?.link)throw new P(_.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(_.ENTITY_INVARIANT_VIOLATION,{details:{entity:e}})}async fetchEntityFields(e){this.validateEntityOptions(e);let t=`${this.client.baseUrl}${Ti}`,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(_.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(_.LINK_REQUIRED,{code:"VALIDATION_ERROR",details:{options:e}})}};var Fi=z.extraction,Ui=new Set(["FINISHED","SUCCESS"]),ko={mode:"run",pollingInterval:5e3,maxWaitTime:3e5,navigationMode:"single-page",location:{type:"auto"},bypassPreview:true,autoStart:true},rt=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=ne(ko,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 f=e.entity||"ai-detection";n={entity:typeof f=="object"&&"name"in f?f.name:void 0,fields:typeof f=="object"&&"fields"in f?f.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 f=await this.notificationSetupService.setup({workflowId:a,events:t.notifications?.events,channels:t.notifications?.channels});Fi("Notifications setup: %O",f.map(R=>({id:R.id,eventType:R.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 f=await this.dataFetcherService.fetchData({workflowId:a});p=f.data,m=f.pagination;}else throw new P(`${_.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(_.NO_URLS,{code:"VALIDATION_ERROR"})}async resumeWorkflow(e){await this.workflowsCoreService.resume(e);let t=await this.workflowsCoreService.wait(e,{pollIntervalMs:ko.pollingInterval,timeoutMs:ko.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(`${_.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?Ui.has(e.toUpperCase()):false}};var Vo=z.extraction,lt=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 h=i(new Ie);if("schemaId"in h)m={schemaId:h.schemaId};else {let f=h.build();m=f.entityName?{name:f.entityName,fields:f.fields}:{fields:f.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=await this.workflowsCoreService.create({urls:e,name:t,description:s,navigationMode:a,monitoring:this._monitoringOptions,schemaId:typeof i=="object"&&"schemaId"in i?i.schemaId:void 0,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:c.id}),this._workflowId=c.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"),Vo("Job started: %O",t),this._jobId=t.jobId;let s=await this.workflowsCoreService.waitForJobCompletion(this._workflowId,t.jobId);return Vo("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"),Vo("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 Re={EMAIL:"EMAIL",SLACK:"SLACK",WEBHOOK:"WEBHOOK",WEBSOCKET:"WEBSOCKET"};var Es=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Bi(o){let e=[];if(!o.recipients?.length)e.push({message:"Recipients are required for email channel"});else for(let t of o.recipients)Es.test(t)||e.push({message:`Invalid email address: ${t}`});if(o.from!==void 0&&(Es.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:Z.VALIDATION_ERROR,details:{issues:e}});return o}var Ut=class Ut{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 O.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 O.wrap(t,{message:"Failed to delete channel"})}async createChannel(e,t){let s=await this.buildPayload(ne(t||{},{name:Ut.DEFAULT_CHANNEL_NAME,channelType:e,config:{}})),a=await this.api.v5NotificationsChannelsPost({v5NotificationsChannelsPostRequest:s});if(a.status===201){let i=a.data.data?.channel;if(!i)throw O.wrap(a,{message:"Failed to create default channels"});return i}throw O.wrap(a,{message:"Failed to create default channels"})}async buildPayload(e){let t;switch(e.channelType){case Re.EMAIL:t=await this.buildEmailChannelConfig(e.config);break;case Re.SLACK:t=await this.buildSlackChannelConfig(e.config);break;case Re.WEBHOOK:t=await this.buildWebhookChannelConfig(e.config);break;case Re.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=ne(e,{recipients:t});return Bi(s)}async buildSlackChannelConfig(e){return e}async buildWebhookChannelConfig(e){return e}async buildWebsocketChannelConfig(e){return e}};Ut.DEFAULT_CHANNEL_NAME="default";var ce=Ut;var dt=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 O.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 O.wrap(t,{message:"Failed to list notification settings"});return s}async listAllEvents(){return Object.values(Nt)}async deleteSettings(e){let t=await this.api.v5NotificationsSettingsSettingsIdDelete({settingsId:e});if(t.status!==200)throw O.wrap(t,{message:"Failed to delete notification settings"})}};var he=z.notifications,ct=class{constructor(e,t){this.channelsService=e;this.settingsService=t;}async setupForWorkflow(e){if((await this.settingsService.listSettings({workflowId:e.workflowId})).length>0)throw new P("Settings already exist",{code:Z.BAD_REQUEST,details:{workflowId:e.workflowId}});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:Z.BAD_REQUEST});return this.setup({events:e.events,channels:e.channels})}async setup(e){e.workflowId?he("Setting up notifications for workflow %s",e.workflowId):he("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(r=>r.id).filter(Boolean);he("Creating notification settings for workflow %s: %O",e.workflowId,{events:a,channels:i});let n=await Promise.all(a.map(async r=>await this.settingsService.createSettings({workflowId:e.workflowId,channelIds:i,eventType:r,enabled:true,eventConfiguration:{}})));return he(e.workflowId?"Successfully setup notifications for workflow %s":"Successfully setup notifications for workspace",e.workflowId),n}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:Z.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===Re.WEBSOCKET?t.find(l=>l.channelType===i):t.find(l=>l.channelType===i&&l.name===ce.DEFAULT_CHANNEL_NAME);if(n)return he("Using existing default channel: %O",{workflowId:s,channelType:i,channelId:n.id}),n;let r=await this.channelsService.createChannel(i);return he("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||ce.DEFAULT_CHANNEL_NAME,l=t.find(c=>c.channelType===i&&(c.name||ce.DEFAULT_CHANNEL_NAME)===r);if(l)return he("Using existing channel: %O",{workflowId:s,channelType:i,channelName:r,channelId:l.id}),l;let d=await this.channelsService.createChannel(i,{name:r,config:n});return he("Created channel with custom config %O",{workflowId:s,channelType:i,channelName:r,channel:d}),d}))}};var Bt="https://api.kadoa.com",qs="wss://realtime.kadoa.com",Ns="https://realtime.kadoa.com";var ge="0.19.3",Lt="kadoa-node-sdk",Gs="node";var re=z.wss;typeof WebSocket>"u"&&(window.WebSocket=Xs("ws"));var pt=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,this.source=e.source;}async connect(){if(!this.isConnecting){this.isConnecting=true;try{let e=await fetch(`${Bt}/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();this.socket=new WebSocket(`${qs}?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,...this.source&&{source:this.source}})),re("Connected to WebSocket"),this.notifyConnectionListeners(!0)),this.startHeartbeatCheck();},this.socket.onmessage=a=>{try{let i=JSON.parse(a.data);i.type==="heartbeat"?this.handleHeartbeat():(i?.id&&fetch(`${Ns}/api/v1/events/ack`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:i.id})}),this.notifyEventListeners(i));}catch(i){re("Failed to parse incoming message: %O",i);}},this.socket.onclose=()=>{re("WebSocket disconnected. Attempting to reconnect..."),this.isConnecting=!1,this.stopHeartbeatCheck(),this.notifyConnectionListeners(!1,"Connection closed"),setTimeout(()=>this.connect(),this.reconnectDelay);},this.socket.onerror=a=>{re("WebSocket error: %O",a),this.isConnecting=!1,this.notifyErrorListeners(a);};}catch(e){re("Failed to connect: %O",e),this.isConnecting=false,setTimeout(()=>this.connect(),this.reconnectDelay);}}}handleHeartbeat(){re("Heartbeat received"),this.lastHeartbeat=Date.now();}notifyEventListeners(e){this.eventListeners.forEach(t=>{try{t(e);}catch(s){re("Error in event listener: %O",s);}});}notifyConnectionListeners(e,t){this.connectionListeners.forEach(s=>{try{s(e,t);}catch(a){re("Error in connection listener: %O",a);}});}notifyErrorListeners(e){this.errorListeners.forEach(t=>{try{t(e);}catch(s){re("Error in error listener: %O",s);}});}startHeartbeatCheck(){this.missedHeartbeatCheckTimer=setInterval(()=>{Date.now()-this.lastHeartbeat>this.missedHeartbeatsLimit&&(re("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 ut=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 Li={pollIntervalMs:1e4,timeoutMs:300*1e3},Ts={ABORTED:"ABORTED",TIMEOUT:"TIMEOUT"};async function _e(o,e,t={}){let s={...Li,...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:Ts.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:Ts.TIMEOUT,details:{timeoutMs:i,attempts:r,duration:Date.now()-n}})}function _t(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 _i="https://registry.npmjs.org",Fs="@kadoa/node-sdk";async function Us(){try{let o=await fetch(`${_i}/${Fs}`,{headers:{Accept:"application/json"}});if(!o.ok)return;let t=(await o.json())["dist-tags"]?.latest;if(!t)return;ji(t,ge)&&console.warn(`\u26A0\uFE0F A new version of ${Lt} is available: ${t} (current: ${ge}). Update with: npm install ${Fs}@latest`);}catch{}}function ji(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 ft=class{constructor(e){this.validationApi=new we(e.configuration,e.baseUrl,e.axiosInstance);}async listWorkflowValidations(e){let t=await this.validationApi.v4DataValidationWorkflowsWorkflowIdJobsJobIdValidationsGet(e);if(t.status!==200)throw O.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 O.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 O.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 O.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 O.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 O.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 O.wrap(s.data,{message:"Failed to get validation anomalies by rule"});return s.data}async waitUntilCompleted(e,t){return (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 mt=class{constructor(e){this.validationApi=new we(e.configuration,e.baseUrl,e.axiosInstance);}async listRules(e){let t=await this.validationApi.v4DataValidationRulesGet(e);if(t.status!==200||t.data.error)throw O.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 O.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 O.wrap(t.data.data,{message:"Failed to get validation rule by name"});return t.data.data?.find(s=>s.name===e)}async createRule(e){let t=await this.validationApi.v4DataValidationRulesPost({createRule:e});if(t.status!==200||t.data.error)throw O.wrap(t.data.data,{message:t.data.message||"Failed to create validation rule"});return t.data.data}async updateRule(e,t){let s=await this.validationApi.v4DataValidationRulesRuleIdPut({ruleId:e,updateRule:t});if(s.status!==200||s.data.error)throw O.wrap(s.data.data,{message:s.data.message||"Failed to update validation rule"});return s.data.data}async disableRule(e){let t=await this.validationApi.v4DataValidationRulesRuleIdDisablePost(e);if(t.status!==200||t.data.error)throw O.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 O.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 O.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 O.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 O.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 O.wrap(t.data.data,{message:t.data.message||"Failed to delete all validation rules"});return t.data.data}};var wt={Finished:"FINISHED",Failed:"FAILED",NotSupported:"NOT_SUPPORTED",FailedInsufficientFunds:"FAILED_INSUFFICIENT_FUNDS"};var Ls=new Set([wt.Finished,wt.Failed,wt.NotSupported,wt.FailedInsufficientFunds]),_s=new Set(["FINISHED","SUCCESS","FAILED","ERROR","STOPPED","CANCELLED"]),Bs=z.workflow,Rt=class{constructor(e){this.workflowsApi=e;}async create(e){_t(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},r=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:n}),l=r.data?.workflowId;if(!l)throw new P(_.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,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},a=await this.workflowsApi.v4WorkflowsPost({createWorkflowBody:s}),i=a.data?.workflowId;if(!i)throw new P(_.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 _t(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 Bs("workflow %s state: %s",e,a.runState),a},a=>!!(t?.targetState&&a.state===t.targetState||a.runState&&_s.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(_.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 Bs("workflow run %s state: %s",t,i.state),i},i=>!!(s?.targetStatus&&i.state===s.targetStatus||i.state&&Ls.has(i.state)),s)).result}};var j=[];for(let o=0;o<256;++o)j.push((o+256).toString(16).slice(1));function js(o,e=0){return (j[o[e+0]]+j[o[e+1]]+j[o[e+2]]+j[o[e+3]]+"-"+j[o[e+4]]+j[o[e+5]]+"-"+j[o[e+6]]+j[o[e+7]]+"-"+j[o[e+8]]+j[o[e+9]]+"-"+j[o[e+10]]+j[o[e+11]]+j[o[e+12]]+j[o[e+13]]+j[o[e+14]]+j[o[e+15]]).toLowerCase()}var vo,Mi=new Uint8Array(16);function So(){if(!vo){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");vo=crypto.getRandomValues.bind(crypto);}return vo(Mi)}var Ji=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Po={randomUUID:Ji};function Hi(o,e,t){o=o||{};let s=o.random??o.rng?.()??So();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 js(s)}function Ki(o,e,t){return Po.randomUUID&&!e&&!o?Po.randomUUID():Hi(o,e,t)}var Wo=Ki;var jt=class{constructor(e){this.client=e;this._api=null;}get api(){return this._api||(this._api=new Ae(this.client.configuration,this.client.baseUrl,this.client.axiosInstance)),this._api}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 Mt=class{constructor(e){this.client=e;this._api=null;}get api(){return this._api||(this._api=new Ae(this.client.configuration,this.client.baseUrl,this.client.axiosInstance)),this._api}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 Ms(o){return {config:new jt(o),session:new Mt(o)}}function Js(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)}}var bo=class{constructor(e){this._baseUrl=Bt,this._timeout=e.timeout||3e4,this._apiKey=e.apiKey;let t={"User-Agent":`${Lt}/${ge}`,"X-SDK-Version":ge,"X-SDK-Language":Gs};this._configuration=new at({apiKey:this._apiKey,basePath:this._baseUrl,baseOptions:{headers:t}}),this._axiosInstance=g.create({timeout:this._timeout,headers:t}),this._axiosInstance.interceptors.request.use(w=>(w.headers["x-request-id"]=Wo(),w)),this._axiosInstance.interceptors.response.use(w=>{if(w.status===401)throw new O("Unauthorized",{code:Z.AUTH_ERROR,httpStatus:401});return w},w=>{throw w instanceof As&&w.response?.status===400?O.wrap(w):O.wrap(w)});let s=new st(this.configuration,this.baseUrl,this.axiosInstance),a=new Ne(this.configuration,this.baseUrl,this.axiosInstance),i=new ut(this),n=new it(s),r=new ce(a,i),l=new dt(a),d=new nt(this),c=new Rt(s),p=new ke(this),m=new ct(r,l),h=new ft(this),f=new mt(this),R=new rt(c,n,d,m,r,l);this._extractionBuilderService=new lt(c,d,n,m),this.user=i,this.extraction=R,this.workflow=c,this.schema=p,this.notification={channels:r,settings:l,setup:m,configure:w=>m.setup(w),setupForWorkflow:w=>m.setupForWorkflow(w),setupForWorkspace:w=>m.setupForWorkspace(w)},this.validation=Js(h,f),this.crawler=Ms(this),this._realtimeConfig=e.realtimeConfig,e.enableRealtime&&e.realtimeConfig?.autoConnect!==false&&this.connectRealtime(),Us().catch(()=>{});}get configuration(){return this._configuration}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}get apiKey(){return this._apiKey}get timeout(){return this._timeout}get realtime(){return this._realtime}extract(e){return this._extractionBuilderService.extract(e)}connectRealtime(){return this._realtime||(this._realtime=new pt({apiKey:this._apiKey,...this._realtimeConfig?.reconnectDelay!=null&&{reconnectDelay:this._realtimeConfig.reconnectDelay},...this._realtimeConfig?.heartbeatInterval!=null&&{heartbeatInterval:this._realtimeConfig.heartbeatInterval},...this._realtimeConfig?.source&&{source:this._realtimeConfig.source}}),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()}}dispose(){this.disconnectRealtime();}};
|
|
9
9
|
exports.DataFetcherService=it;exports.ERROR_MESSAGES=_;exports.EntityResolverService=nt;exports.ExtractionBuilderService=lt;exports.ExtractionService=rt;exports.FetchDataOptions=Co;exports.KadoaClient=bo;exports.KadoaHttpException=O;exports.KadoaSdkException=P;exports.NotificationChannelType=Re;exports.NotificationChannelsService=ce;exports.NotificationSettingsEventTypeEnum=Nt;exports.NotificationSettingsService=dt;exports.NotificationSetupService=ct;exports.Realtime=pt;exports.SchemaBuilder=Ie;exports.SchemaFieldDataType=Ii;exports.SchemasService=ke;exports.TERMINAL_JOB_STATES=Ls;exports.TERMINAL_RUN_STATES=_s;exports.UserService=ut;exports.ValidationCoreService=ft;exports.ValidationRulesService=mt;exports.WorkflowsCoreService=Rt;exports.pollUntil=_e;exports.validateAdditionalData=_t;return exports;})({},L);//# sourceMappingURL=index.global.js.map
|
|
10
10
|
//# sourceMappingURL=index.global.js.map
|