@algolia/ingestion 1.55.2 → 1.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- function Y(s){let a,m=`algolia-client-js-${s.key}`;function i(){return a===void 0&&(a=s.localStorage||window.localStorage),a}function P(){return JSON.parse(i().getItem(m)||"{}")}function R(e){i().setItem(m,JSON.stringify(e))}function S(){return new Promise(e=>setTimeout(e,0))}function d(){let e=s.timeToLive?s.timeToLive*1e3:null,t=P(),o=new Date().getTime(),n=!1;return{namespace:Object.fromEntries(Object.entries(t).filter(([,r])=>!r||r.timestamp===void 0||e&&r.timestamp+e<o?(n=!0,!1):!0)),changed:n}}return{get(e,t,o={miss:()=>Promise.resolve()}){return S().then(()=>{let{namespace:n,changed:c}=d(),r=n[JSON.stringify(e)];return c&&R(n),r?r.value:t().then(p=>o.miss(p).then(()=>p))})},set(e,t){return S().then(()=>{let o=P();return o[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},i().setItem(m,JSON.stringify(o)),t})},delete(e){return S().then(()=>{let t=P();delete t[JSON.stringify(e)],i().setItem(m,JSON.stringify(t))})},clear(){return Promise.resolve().then(()=>{i().removeItem(m)})}}}function ce(){return{get(s,a,m={miss:()=>Promise.resolve()}){return a().then(P=>Promise.all([P,m.miss(P)])).then(([P])=>P)},set(s,a){return Promise.resolve(a)},delete(s){return Promise.resolve()},clear(){return Promise.resolve()}}}function A(s){let a=[...s.caches],m=a.shift();return m===void 0?ce():{get(i,P,R={miss:()=>Promise.resolve()}){return m.get(i,P,R).catch(()=>A({caches:a}).get(i,P,R))},set(i,P){return m.set(i,P).catch(()=>A({caches:a}).set(i,P))},delete(i){return m.delete(i).catch(()=>A({caches:a}).delete(i))},clear(){return m.clear().catch(()=>A({caches:a}).clear())}}}function H(s={serializable:!0}){let a={};return{get(m,i,P={miss:()=>Promise.resolve()}){let R=JSON.stringify(m);if(R in a)return Promise.resolve(s.serializable?JSON.parse(a[R]):a[R]);let S=i();return S.then(d=>P.miss(d)).then(()=>S)},set(m,i){return a[JSON.stringify(m)]=s.serializable?JSON.stringify(i):i,Promise.resolve(i)},delete(m){return delete a[JSON.stringify(m)],Promise.resolve()},clear(){return a={},Promise.resolve()}}}function me(s){let a={value:`Algolia for JavaScript (${s})`,add(m){let i=`; ${m.segment}${m.version!==void 0?` (${m.version})`:""}`;return a.value.indexOf(i)===-1&&(a.value=`${a.value}${i}`),a}};return a}function Z(s,a,m="WithinHeaders"){let i={"x-algolia-api-key":a,"x-algolia-application-id":s};return{headers(){return m==="WithinHeaders"?i:{}},queryParameters(){return m==="WithinQueryParameters"?i:{}}}}function ee({func:s,validate:a,aggregator:m,error:i,timeout:P=()=>0}){let R=S=>new Promise((d,e)=>{s(S).then(async t=>(m&&await m(t),await a(t)?d(t):i&&await i.validate(t)?e(new Error(await i.message(t))):setTimeout(()=>{R(t).then(d).catch(e)},await P()))).catch(t=>{e(t)})});return R()}function te({algoliaAgents:s,client:a,version:m}){let i=me(m).add({segment:a,version:m});return s.forEach(P=>i.add(P)),i}function re(){return{debug(s,a){return Promise.resolve()},info(s,a){return Promise.resolve()},error(s,a){return Promise.resolve()}}}var de=10*1024*1024;async function*pe(s){let a=s.getReader();try{for(;;){let{done:m,value:i}=await a.read();if(m)return;yield i}}finally{a.releaseLock()}}function he(s){return Symbol.asyncIterator in s?s:pe(s)}async function*fe(s){let a=new TextDecoder("utf-8"),m=[],i=0,P=!1,R=!0;for await(let d of he(s)){let e=a.decode(d,{stream:!0}),t=0;for(P&&(P=!1,e.length>0&&e[0]===`
2
- `&&(t=1));t<e.length;){let o=e.indexOf("\r",t),n=e.indexOf(`
3
- `,t);if(o===-1&&n===-1){let f=e.slice(t);if(m.push(f),i+=f.length,i>de)throw new Error("SSE line buffer exceeded 10MB");break}let c,r;o!==-1&&(n===-1||o<n)?(c=o,o+1<e.length?r=e[o+1]===`
4
- `?2:1:(P=!0,r=1)):(c=n,r=1);let p=e.slice(t,c);m.push(p);let y=m.length===1?m[0]:m.join("");m.length=0,i=0,R&&(y.startsWith("\uFEFF")&&(y=y.slice(1)),R=!1),yield y,t=c+r}}let S=a.decode();if(S&&m.push(S),m.length>0){let d=m.join("");R&&d.startsWith("\uFEFF")&&(d=d.slice(1)),yield d}}var le=class{data=[];eventType="";lastEventId=null;retry=null;decode(s){if(s==="")return this.dispatch();if(s[0]===":")return null;let a=s.indexOf(":"),m,i;switch(a===-1?(m=s,i=""):(m=s.slice(0,a),i=s.slice(a+1),i[0]===" "&&(i=i.slice(1))),m){case"data":this.data.push(i);break;case"event":this.eventType=i;break;case"id":i.includes("\0")||(this.lastEventId=i);break;case"retry":/^[0-9]+$/.test(i)&&(this.retry=parseInt(i,10));break}return null}dispatch(){let s=this.eventType;if(this.eventType="",this.data.length===0)return null;let a={data:this.data.join(`
5
- `),event:s,id:this.lastEventId,retry:this.retry};return this.data=[],a}};async function*Pe(s){let a=new le;for await(let m of fe(s)){let i=a.decode(m);i!==null&&(yield i)}}var qe=750,F=120*1e3;function M(s,a="up"){let m=Date.now();function i(){return a==="up"||Date.now()-m>F}function P(){return a==="timed out"&&Date.now()-m<=F}return{...s,status:a,lastUpdate:m,isUp:i,isTimedOut:P}}var se=class extends Error{name="AlgoliaError";constructor(s,a){super(s),a&&(this.name=a)}};var oe=class extends se{stackTrace;constructor(s,a,m){super(s,m),this.stackTrace=a}},J=class extends oe{constructor(s){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",s,"RetryError")}},N=class extends oe{status;constructor(s,a,m,i="ApiError"){super(s,m,i),this.status=a}},ye=class extends se{response;constructor(s,a){super(s,"DeserializationError"),this.response=a}},Te=class extends N{error;constructor(s,a,m,i){super(s,a,i,"DetailedApiError"),this.error=m}};function z(s,a,m){let i=Re(m),P=`${s.protocol}://${s.url}${s.port?`:${s.port}`:""}/${a.charAt(0)==="/"?a.substring(1):a}`;return i.length&&(P+=`?${i}`),P}function Re(s){return Object.keys(s).filter(a=>s[a]!==void 0).sort().map(a=>`${a}=${encodeURIComponent(Object.prototype.toString.call(s[a])==="[object Array]"?s[a].join(","):s[a]).replace(/\+/g,"%20")}`).join("&")}function X(s,a){if(s.method==="GET"||s.data===void 0&&a.data===void 0)return;let m=Array.isArray(s.data)?s.data:{...s.data,...a.data};return JSON.stringify(m)}function K(s,a,m){let i={Accept:"application/json",...s,...a,...m},P={};return Object.keys(i).forEach(R=>{let S=i[R];P[R.toLowerCase()]=S}),P}function ge(s){if(!(s.status===204||s.content.length===0))try{return JSON.parse(s.content)}catch(a){throw new ye(a.message,s)}}function Se({content:s,status:a},m){try{let i=JSON.parse(s);return"error"in i?new Te(i.message,a,i.error,m):new N(i.message,a,m)}catch{}return new N(s,a,m)}function ke({isTimedOut:s,status:a}){return!s&&~~a===0}function xe({isTimedOut:s,status:a}){return s||ke({isTimedOut:s,status:a})||~~(a/100)!==2&&~~(a/100)!==4}function De({status:s}){return~~(s/100)===2}function Ie(s){return s.map(a=>ae(a))}function ae(s){let a=s.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...s,request:{...s.request,headers:{...s.request.headers,...a}}}}function ne({hosts:s,hostsCache:a,baseHeaders:m,logger:i,baseQueryParameters:P,algoliaAgent:R,timeouts:S,requester:d,requestsCache:e,responsesCache:t,compress:o,compression:n}){async function c(f){let h=await Promise.all(f.map(q=>a.get(q,()=>Promise.resolve(M(q))))),T=h.filter(q=>q.isUp()),g=h.filter(q=>q.isTimedOut()),l=[...T,...g];return{hosts:l.length>0?l:f,getTimeout(q,x){return(g.length===0&&q===0?1:g.length+3+q)*x}}}async function r(f,h,T){let g=[],l=X(f,h),k=K(m,f.headers,h.headers),q=n==="gzip"&&l!==void 0&&l.length>qe&&(f.method==="POST"||f.method==="PUT");q&&o===void 0&&i.info("Compression is disabled because no compress method is available.");let x=q&&o!==void 0,v=x?await o(l):l;x&&(k["content-encoding"]="gzip");let C=f.method==="GET"?{...f.data,...h.data}:{},I={...P,...f.queryParameters,...C};if(R.value&&(I["x-algolia-agent"]=R.value),h&&h.queryParameters)for(let D of Object.keys(h.queryParameters))!h.queryParameters[D]||Object.prototype.toString.call(h.queryParameters[D])==="[object Object]"?I[D]=h.queryParameters[D]:I[D]=h.queryParameters[D].toString();let U=0,b=async(D,Q)=>{let w=D.pop();if(w===void 0)throw new J(Ie(g));let V={...S,...h.timeouts},j={data:v,headers:k,method:f.method,url:z(w,f.path,I),connectTimeout:Q(U,V.connect),responseTimeout:Q(U,T?V.read:V.write)},$=G=>{let B={request:j,response:G,host:w,triesLeft:D.length};return g.push(B),B},O=await d.send(j);if(xe(O)){let G=$(O);return O.isTimedOut&&U++,i.info("Retryable failure",ae(G)),await a.set(w,M(w,O.isTimedOut?"timed out":"down")),b(D,Q)}if(De(O))return ge(O);throw $(O),Se(O,g)},E=s.filter(D=>D.accept==="readWrite"||(T?D.accept==="read":D.accept==="write")),W=await c(E);return b([...W.hosts].reverse(),W.getTimeout)}function p(f,h={}){let T=()=>r(f,h,g),g=f.useReadTransporter||f.method==="GET";if((h.cacheable||f.cacheable)!==!0)return T();let k={request:f,requestOptions:h,transporter:{queryParameters:P,headers:m}};return t.get(k,()=>e.get(k,()=>e.set(k,T()).then(q=>Promise.all([e.delete(k),q]),q=>Promise.all([e.delete(k),Promise.reject(q)])).then(([q,x])=>x)),{miss:q=>t.set(k,q)})}async function*y(f,h={}){if(!d.sendStream)throw new Error("This requester does not support streaming");let T=X(f,h),g=K(m,f.headers,h.headers);g.accept="text/event-stream";let l=f.method==="GET"?{...f.data,...h.data}:{},k={...P,...f.queryParameters,...l};if(R.value&&(k["x-algolia-agent"]=R.value),h&&h.queryParameters)for(let E of Object.keys(h.queryParameters))!h.queryParameters[E]||Object.prototype.toString.call(h.queryParameters[E])==="[object Object]"?k[E]=h.queryParameters[E]:k[E]=h.queryParameters[E].toString();let q=f.useReadTransporter||f.method==="GET",x=s.filter(E=>E.accept==="readWrite"||(q?E.accept==="read":E.accept==="write")),C=(await c(x)).hosts[0];if(!C)throw new J([]);let I={...S,...h.timeouts},U={data:T,headers:g,method:f.method,url:z(C,f.path,k),connectTimeout:I.connect,responseTimeout:q?I.read:I.write},b=await d.sendStream(U);yield*Pe(b)}return{hostsCache:a,requester:d,timeouts:S,logger:i,algoliaAgent:R,baseHeaders:m,baseQueryParameters:P,hosts:s,request:p,requestStream:y,requestsCache:e,responsesCache:t}}function u(s,a,m){if(m==null||typeof m=="string"&&m.length===0)throw new Error(`Parameter \`${s}\` is required when calling \`${a}\`.`)}function ie(){function s(a){return new Promise(m=>{let i=new XMLHttpRequest;i.open(a.method,a.url,!0),Object.keys(a.headers).forEach(d=>i.setRequestHeader(d,a.headers[d]));let P=(d,e)=>setTimeout(()=>{i.abort(),m({status:0,content:e,isTimedOut:!0})},d),R=P(a.connectTimeout,"Connection timeout"),S;i.onreadystatechange=()=>{i.readyState>i.OPENED&&S===void 0&&(clearTimeout(R),S=P(a.responseTimeout,"Socket timeout"))},i.onerror=()=>{i.status===0&&(clearTimeout(R),clearTimeout(S),m({content:i.responseText||"Network request failed",status:i.status,isTimedOut:!1}))},i.onload=()=>{clearTimeout(R),clearTimeout(S),m({content:i.responseText,status:i.status,isTimedOut:!1})},i.send(a.data)})}return{send:s}}var L="1.55.2",_=["eu","us"];function Ee(s){return[{url:"data.{region}.algolia.com".replace("{region}",s),accept:"readWrite",protocol:"https"}]}function ve(s){return s.type==="onDemand"}function Ce(s){return s.type==="schedule"}function Oe(s){return s.type==="subscription"}function ue({appId:s,apiKey:a,authMode:m,algoliaAgents:i,region:P,...R}){let S=Z(s,a,m),d=ne({hosts:Ee(P),...R,algoliaAgent:te({algoliaAgents:i,client:"Ingestion",version:L}),baseHeaders:{"content-type":"text/plain",...S.headers(),...R.baseHeaders},baseQueryParameters:{...S.queryParameters(),...R.baseQueryParameters}});return{transporter:d,appId:s,apiKey:a,clearCache(){return Promise.all([d.requestsCache.clear(),d.responsesCache.clear()]).then(()=>{})},get _ua(){return d.algoliaAgent.value},addAlgoliaAgent(e,t){d.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!m||m==="WithinHeaders"?d.baseHeaders["x-algolia-api-key"]=e:d.baseQueryParameters["x-algolia-api-key"]=e},async chunkedPush({indexName:e,objects:t,action:o="addObject",waitForTasks:n,batchSize:c=1e3,referenceIndexName:r,maxRetries:p=100},y){if(c<1)throw new Error("`batchSize` must be at least 1.");let f=[],h=0,T=[],g=Math.floor(c/10)||c,l=async(q,x)=>{for(let v of T.slice(q,x)){if(!v.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");let C=0;await ee({func:async()=>{if(v.eventID===void 0||!v.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:v.runID,eventID:v.eventID}).catch(I=>{if(I.status!==404)throw I})},validate:I=>I!==void 0,aggregator:()=>C+=1,error:{validate:()=>C>=p,message:()=>`Stopped waiting for the task after ${p} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>Math.min(C*1500,5e3)})}},k=t.entries();for(let[q,x]of k)f.push(x),(f.length===c||q===t.length-1)&&(T.push(await this.push({indexName:e,pushTaskPayload:{action:o,records:f},referenceIndexName:r},y)),f=[]),n&&T.length-h>=g&&(await l(h,h+g),h+=g);return n&&await l(h,T.length),T},createAuthentication(e,t){u("authenticationCreate","createAuthentication",e),u("authenticationCreate.type","createAuthentication",e.type),u("authenticationCreate.name","createAuthentication",e.name),u("authenticationCreate.input","createAuthentication",e.input);let r={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return d.request(r,t)},createDestination(e,t){u("destinationCreate","createDestination",e),u("destinationCreate.type","createDestination",e.type),u("destinationCreate.name","createDestination",e.name),u("destinationCreate.input","createDestination",e.input);let r={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return d.request(r,t)},createSource(e,t){u("sourceCreate","createSource",e),u("sourceCreate.type","createSource",e.type),u("sourceCreate.name","createSource",e.name);let r={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return d.request(r,t)},createTask(e,t){u("taskCreate","createTask",e),u("taskCreate.sourceID","createTask",e.sourceID),u("taskCreate.destinationID","createTask",e.destinationID),u("taskCreate.action","createTask",e.action);let r={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return d.request(r,t)},createTaskV1(e,t){u("taskCreate","createTaskV1",e),u("taskCreate.sourceID","createTaskV1",e.sourceID),u("taskCreate.destinationID","createTaskV1",e.destinationID),u("taskCreate.trigger","createTaskV1",e.trigger),u("taskCreate.action","createTaskV1",e.action);let r={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return d.request(r,t)},createTransformation(e,t){u("transformationCreate","createTransformation",e),u("transformationCreate.name","createTransformation",e.name);let r={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return d.request(r,t)},customDelete({path:e,parameters:t},o){u("path","customDelete",e);let p={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return d.request(p,o)},customGet({path:e,parameters:t},o){u("path","customGet",e);let p={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return d.request(p,o)},customPost({path:e,parameters:t,body:o},n){u("path","customPost",e);let y={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:o||{}};return d.request(y,n)},customPut({path:e,parameters:t,body:o},n){u("path","customPut",e);let y={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:o||{}};return d.request(y,n)},deleteAuthentication({authenticationID:e},t){u("authenticationID","deleteAuthentication",e);let r={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteDestination({destinationID:e},t){u("destinationID","deleteDestination",e);let r={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteSource({sourceID:e},t){u("sourceID","deleteSource",e);let r={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteTask({taskID:e},t){u("taskID","deleteTask",e);let r={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteTaskV1({taskID:e},t){u("taskID","deleteTaskV1",e);let r={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteTransformation({transformationID:e},t){u("transformationID","deleteTransformation",e);let r={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},disableTask({taskID:e},t){u("taskID","disableTask",e);let r={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},disableTaskV1({taskID:e},t){u("taskID","disableTaskV1",e);let r={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},enableTask({taskID:e},t){u("taskID","enableTask",e);let r={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},enableTaskV1({taskID:e},t){u("taskID","enableTaskV1",e);let r={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getAuthentication({authenticationID:e},t){u("authenticationID","getAuthentication",e);let r={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getDestination({destinationID:e},t){u("destinationID","getDestination",e);let r={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getEvent({runID:e,eventID:t},o){u("runID","getEvent",e),u("eventID","getEvent",t);let p={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return d.request(p,o)},getRun({runID:e},t){u("runID","getRun",e);let r={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getSource({sourceID:e},t){u("sourceID","getSource",e);let r={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getTask({taskID:e},t){u("taskID","getTask",e);let r={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getTaskV1({taskID:e},t){u("taskID","getTaskV1",e);let r={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getTransformation({transformationID:e},t){u("transformationID","getTransformation",e);let r={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},listAuthentications({itemsPerPage:e,page:t,type:o,platform:n,sort:c,order:r}={},p=void 0){let y="/1/authentications",f={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),t!==void 0&&(h.page=t.toString()),o!==void 0&&(h.type=o.toString()),n!==void 0&&(h.platform=n.toString()),c!==void 0&&(h.sort=c.toString()),r!==void 0&&(h.order=r.toString());let T={method:"GET",path:y,queryParameters:h,headers:f};return d.request(T,p)},listDestinations({itemsPerPage:e,page:t,type:o,authenticationID:n,transformationID:c,sort:r,order:p}={},y=void 0){let f="/1/destinations",h={},T={};e!==void 0&&(T.itemsPerPage=e.toString()),t!==void 0&&(T.page=t.toString()),o!==void 0&&(T.type=o.toString()),n!==void 0&&(T.authenticationID=n.toString()),c!==void 0&&(T.transformationID=c.toString()),r!==void 0&&(T.sort=r.toString()),p!==void 0&&(T.order=p.toString());let g={method:"GET",path:f,queryParameters:T,headers:h};return d.request(g,y)},listEvents({runID:e,itemsPerPage:t,page:o,status:n,type:c,sort:r,order:p,startDate:y,endDate:f},h){u("runID","listEvents",e);let T="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),g={},l={};t!==void 0&&(l.itemsPerPage=t.toString()),o!==void 0&&(l.page=o.toString()),n!==void 0&&(l.status=n.toString()),c!==void 0&&(l.type=c.toString()),r!==void 0&&(l.sort=r.toString()),p!==void 0&&(l.order=p.toString()),y!==void 0&&(l.startDate=y.toString()),f!==void 0&&(l.endDate=f.toString());let k={method:"GET",path:T,queryParameters:l,headers:g};return d.request(k,h)},listRuns({itemsPerPage:e,page:t,status:o,type:n,taskID:c,sort:r,order:p,startDate:y,endDate:f}={},h=void 0){let T="/1/runs",g={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),t!==void 0&&(l.page=t.toString()),o!==void 0&&(l.status=o.toString()),n!==void 0&&(l.type=n.toString()),c!==void 0&&(l.taskID=c.toString()),r!==void 0&&(l.sort=r.toString()),p!==void 0&&(l.order=p.toString()),y!==void 0&&(l.startDate=y.toString()),f!==void 0&&(l.endDate=f.toString());let k={method:"GET",path:T,queryParameters:l,headers:g};return d.request(k,h)},listSources({itemsPerPage:e,page:t,type:o,authenticationID:n,sort:c,order:r}={},p=void 0){let y="/1/sources",f={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),t!==void 0&&(h.page=t.toString()),o!==void 0&&(h.type=o.toString()),n!==void 0&&(h.authenticationID=n.toString()),c!==void 0&&(h.sort=c.toString()),r!==void 0&&(h.order=r.toString());let T={method:"GET",path:y,queryParameters:h,headers:f};return d.request(T,p)},listTasks({itemsPerPage:e,page:t,action:o,enabled:n,sourceID:c,sourceType:r,destinationID:p,triggerType:y,withEmailNotifications:f,sort:h,order:T}={},g=void 0){let l="/2/tasks",k={},q={};e!==void 0&&(q.itemsPerPage=e.toString()),t!==void 0&&(q.page=t.toString()),o!==void 0&&(q.action=o.toString()),n!==void 0&&(q.enabled=n.toString()),c!==void 0&&(q.sourceID=c.toString()),r!==void 0&&(q.sourceType=r.toString()),p!==void 0&&(q.destinationID=p.toString()),y!==void 0&&(q.triggerType=y.toString()),f!==void 0&&(q.withEmailNotifications=f.toString()),h!==void 0&&(q.sort=h.toString()),T!==void 0&&(q.order=T.toString());let x={method:"GET",path:l,queryParameters:q,headers:k};return d.request(x,g)},listTasksV1({itemsPerPage:e,page:t,action:o,enabled:n,sourceID:c,destinationID:r,triggerType:p,sort:y,order:f}={},h=void 0){let T="/1/tasks",g={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),t!==void 0&&(l.page=t.toString()),o!==void 0&&(l.action=o.toString()),n!==void 0&&(l.enabled=n.toString()),c!==void 0&&(l.sourceID=c.toString()),r!==void 0&&(l.destinationID=r.toString()),p!==void 0&&(l.triggerType=p.toString()),y!==void 0&&(l.sort=y.toString()),f!==void 0&&(l.order=f.toString());let k={method:"GET",path:T,queryParameters:l,headers:g};return d.request(k,h)},listTransformations({itemsPerPage:e,page:t,sort:o,order:n,type:c}={},r=void 0){let p="/1/transformations",y={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),t!==void 0&&(f.page=t.toString()),o!==void 0&&(f.sort=o.toString()),n!==void 0&&(f.order=n.toString()),c!==void 0&&(f.type=c.toString());let h={method:"GET",path:p,queryParameters:f,headers:y};return d.request(h,r)},push({indexName:e,pushTaskPayload:t,watch:o,referenceIndexName:n},c){u("indexName","push",e),u("pushTaskPayload","push",t),u("pushTaskPayload.action","push",t.action),u("pushTaskPayload.records","push",t.records);let r="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(e)),p={},y={};o!==void 0&&(y.watch=o.toString()),n!==void 0&&(y.referenceIndexName=n.toString());let f={method:"POST",path:r,queryParameters:y,headers:p,data:t};return c={timeouts:{connect:18e4,read:18e4,write:18e4,...c?.timeouts}},d.request(f,c)},pushTask({taskID:e,pushTaskPayload:t,watch:o},n){u("taskID","pushTask",e),u("pushTaskPayload","pushTask",t),u("pushTaskPayload.action","pushTask",t.action),u("pushTaskPayload.records","pushTask",t.records);let c="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),r={},p={};o!==void 0&&(p.watch=o.toString());let y={method:"POST",path:c,queryParameters:p,headers:r,data:t};return n={timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},d.request(y,n)},replaceTask({taskID:e,taskReplace:t},o){u("taskID","replaceTask",e),u("taskReplace","replaceTask",t),u("taskReplace.destinationID","replaceTask",t.destinationID),u("taskReplace.action","replaceTask",t.action);let p={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},runSource({sourceID:e,runSourcePayload:t},o){u("sourceID","runSource",e);let p={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return d.request(p,o)},runTask({taskID:e,runTaskPayload:t},o){u("taskID","runTask",e);let p={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return d.request(p,o)},runTaskV1({taskID:e,runTaskPayload:t},o){u("taskID","runTaskV1",e);let p={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return d.request(p,o)},searchAuthentications(e,t){u("authenticationSearch","searchAuthentications",e),u("authenticationSearch.authenticationIDs","searchAuthentications",e.authenticationIDs);let r={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchDestinations(e,t){u("destinationSearch","searchDestinations",e),u("destinationSearch.destinationIDs","searchDestinations",e.destinationIDs);let r={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchSources(e,t){u("sourceSearch","searchSources",e),u("sourceSearch.sourceIDs","searchSources",e.sourceIDs);let r={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchTasks(e,t){u("taskSearch","searchTasks",e),u("taskSearch.taskIDs","searchTasks",e.taskIDs);let r={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchTasksV1(e,t){u("taskSearch","searchTasksV1",e),u("taskSearch.taskIDs","searchTasksV1",e.taskIDs);let r={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchTransformations(e,t){u("transformationSearch","searchTransformations",e),u("transformationSearch.transformationIDs","searchTransformations",e.transformationIDs);let r={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},triggerDockerSourceDiscover({sourceID:e},t){u("sourceID","triggerDockerSourceDiscover",e);let r={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},d.request(r,t)},tryTransformation(e,t){u("transformationTry","tryTransformation",e),u("transformationTry.sampleRecord","tryTransformation",e.sampleRecord);let r={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return d.request(r,t)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:t},o){u("transformationID","tryTransformationBeforeUpdate",e),u("transformationTry","tryTransformationBeforeUpdate",t),u("transformationTry.sampleRecord","tryTransformationBeforeUpdate",t.sampleRecord);let p={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateAuthentication({authenticationID:e,authenticationUpdate:t},o){u("authenticationID","updateAuthentication",e),u("authenticationUpdate","updateAuthentication",t);let p={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateDestination({destinationID:e,destinationUpdate:t},o){u("destinationID","updateDestination",e),u("destinationUpdate","updateDestination",t);let p={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateSource({sourceID:e,sourceUpdate:t},o){u("sourceID","updateSource",e),u("sourceUpdate","updateSource",t);let p={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateTask({taskID:e,taskUpdate:t},o){u("taskID","updateTask",e),u("taskUpdate","updateTask",t);let p={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateTaskV1({taskID:e,taskUpdate:t},o){u("taskID","updateTaskV1",e),u("taskUpdate","updateTaskV1",t);let p={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateTransformation({transformationID:e,transformationCreate:t},o){u("transformationID","updateTransformation",e),u("transformationCreate","updateTransformation",t),u("transformationCreate.name","updateTransformation",t.name);let p={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},validateSource(e,t=void 0){let r={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},d.request(r,t)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:t},o){u("sourceID","validateSourceBeforeUpdate",e),u("sourceUpdate","validateSourceBeforeUpdate",t);let p={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return o={timeouts:{connect:18e4,read:18e4,write:18e4,...o?.timeouts}},d.request(p,o)}}}function Vs(s,a,m,i){if(!s||typeof s!="string")throw new Error("`appId` is missing.");if(!a||typeof a!="string")throw new Error("`apiKey` is missing.");if(!m||m&&(typeof m!="string"||!_.includes(m)))throw new Error(`\`region\` is required and must be one of the following: ${_.join(", ")}`);let{compression:P,...R}=i||{};return ue({appId:s,apiKey:a,region:m,timeouts:{connect:25e3,read:25e3,write:25e3},logger:re(),requester:ie(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:H(),requestsCache:H({serializable:!1}),hostsCache:A({caches:[Y({key:`${L}-${s}`}),H()]}),...R})}export{L as apiClientVersion,Vs as ingestionClient,ve as isOnDemandTrigger,Ce as isScheduleTrigger,Oe as isSubscriptionTrigger};
1
+ function ae(u){let c,p=`algolia-client-js-${u.key}`;function h(){return c===void 0&&(c=u.localStorage||window.localStorage),c}function l(){return JSON.parse(h().getItem(p)||"{}")}function I(e){h().setItem(p,JSON.stringify(e))}function k(){return new Promise(e=>setTimeout(e,0))}function i(){let e=u.timeToLive?u.timeToLive*1e3:null,t=l(),s=new Date().getTime(),a=!1;return{namespace:Object.fromEntries(Object.entries(t).filter(([,r])=>!r||r.timestamp===void 0||e&&r.timestamp+e<s?(a=!0,!1):!0)),changed:a}}return{get(e,t,s={miss:()=>Promise.resolve()}){return k().then(()=>{let{namespace:a,changed:n}=i(),r=a[JSON.stringify(e)];return n&&I(a),r?r.value:t().then(d=>s.miss(d).then(()=>d))})},set(e,t){return k().then(()=>{let s=l();return s[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},h().setItem(p,JSON.stringify(s)),t})},delete(e){return k().then(()=>{let t=l();delete t[JSON.stringify(e)],h().setItem(p,JSON.stringify(t))})},clear(){return Promise.resolve().then(()=>{h().removeItem(p)})}}}function Te(){return{get(u,c,p={miss:()=>Promise.resolve()}){return c().then(l=>Promise.all([l,p.miss(l)])).then(([l])=>l)},set(u,c){return Promise.resolve(c)},delete(u){return Promise.resolve()},clear(){return Promise.resolve()}}}function O(u){let c=[...u.caches],p=c.shift();return p===void 0?Te():{get(h,l,I={miss:()=>Promise.resolve()}){return p.get(h,l,I).catch(()=>O({caches:c}).get(h,l,I))},set(h,l){return p.set(h,l).catch(()=>O({caches:c}).set(h,l))},delete(h){return p.delete(h).catch(()=>O({caches:c}).delete(h))},clear(){return p.clear().catch(()=>O({caches:c}).clear())}}}function L(u={serializable:!0}){let c={};return{get(p,h,l={miss:()=>Promise.resolve()}){let I=JSON.stringify(p);if(I in c)return Promise.resolve(u.serializable?JSON.parse(c[I]):c[I]);let k=h();return k.then(i=>l.miss(i)).then(()=>k)},set(p,h){return c[JSON.stringify(p)]=u.serializable?JSON.stringify(h):h,Promise.resolve(h)},delete(p){return delete c[JSON.stringify(p)],Promise.resolve()},clear(){return c={},Promise.resolve()}}}function le(u){let c={value:`Algolia for JavaScript (${u})`,add(p){let h=`; ${p.segment}${p.version!==void 0?` (${p.version})`:""}`;return c.value.indexOf(h)===-1&&(c.value=`${c.value}${h}`),c}};return c}function ne(u,c,p="WithinHeaders"){let h={"x-algolia-api-key":c,"x-algolia-application-id":u};return{headers(){return p==="WithinHeaders"?h:{}},queryParameters(){return p==="WithinQueryParameters"?h:{}}}}function ie({func:u,validate:c,aggregator:p,error:h,timeout:l=()=>0}){let I=k=>new Promise((i,e)=>{u(k).then(async t=>(p&&await p(t),await c(t)?i(t):h&&await h.validate(t)?e(new Error(await h.message(t))):setTimeout(()=>{I(t).then(i).catch(e)},await l()))).catch(t=>{e(t)})});return I()}function ue({algoliaAgents:u,client:c,version:p}){let h=le(p).add({segment:c,version:p});return u.forEach(l=>h.add(l)),h}function ce(){return{debug(u,c){return Promise.resolve()},info(u,c){return Promise.resolve()},error(u,c){return Promise.resolve()}}}var Re=10*1024*1024;async function*ye(u){let c=u.getReader();try{for(;;){let{done:p,value:h}=await c.read();if(p)return;yield h}}finally{c.releaseLock()}}function Ie(u){return Symbol.asyncIterator in u?u:ye(u)}async function*ge(u){let c=new TextDecoder("utf-8"),p=[],h=0,l=!1,I=!0;for await(let i of Ie(u)){let e=c.decode(i,{stream:!0}),t=0;for(l&&(l=!1,e.length>0&&e[0]===`
2
+ `&&(t=1));t<e.length;){let s=e.indexOf("\r",t),a=e.indexOf(`
3
+ `,t);if(s===-1&&a===-1){let q=e.slice(t);if(p.push(q),h+=q.length,h>Re)throw new Error("SSE line buffer exceeded 10MB");break}let n,r;s!==-1&&(a===-1||s<a)?(n=s,s+1<e.length?r=e[s+1]===`
4
+ `?2:1:(l=!0,r=1)):(n=a,r=1);let d=e.slice(t,n);p.push(d);let f=p.length===1?p[0]:p.join("");p.length=0,h=0,I&&(f.startsWith("\uFEFF")&&(f=f.slice(1)),I=!1),yield f,t=n+r}}let k=c.decode();if(k&&p.push(k),p.length>0){let i=p.join("");I&&i.startsWith("\uFEFF")&&(i=i.slice(1)),yield i}}var He=class{data=[];eventType="";lastEventId=null;retry=null;decode(u){if(u==="")return this.dispatch();if(u[0]===":")return null;let c=u.indexOf(":"),p,h;switch(c===-1?(p=u,h=""):(p=u.slice(0,c),h=u.slice(c+1),h[0]===" "&&(h=h.slice(1))),p){case"data":this.data.push(h);break;case"event":this.eventType=h;break;case"id":h.includes("\0")||(this.lastEventId=h);break;case"retry":/^[0-9]+$/.test(h)&&(this.retry=parseInt(h,10));break}return null}dispatch(){let u=this.eventType;if(this.eventType="",this.data.length===0)return null;let c={data:this.data.join(`
5
+ `),event:u,id:this.lastEventId,retry:this.retry};return this.data=[],c}};async function*ke(u){let c=new He;for await(let p of ge(u)){let h=c.decode(p);h!==null&&(yield h)}}var De=750,K=120*1e3;function Y(u,c="up"){let p=Date.now();function h(){return c==="up"||Date.now()-p>K}function l(){return c==="timed out"&&Date.now()-p<=K}return{...u,status:c,lastUpdate:p,isUp:h,isTimedOut:l}}var de=class extends Error{name="AlgoliaError";constructor(u,c){super(u),c&&(this.name=c)}};var pe=class extends de{stackTrace;correlationId;constructor(u,c,p,h){super(h?`${u} (Correlation-ID: ${h})`:u,p),this.stackTrace=c,this.correlationId=h}},Z=class extends pe{constructor(u,c){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",u,"RetryError",c)}},j=class extends pe{status;constructor(u,c,p,h="ApiError",l){super(u,p,h,l),this.status=c}},Se=class extends de{response;correlationId;constructor(u,c,p){super(p?`${u} (Correlation-ID: ${p})`:u,"DeserializationError"),this.response=c,this.correlationId=p}},We=class extends j{error;constructor(u,c,p,h,l){super(u,c,h,"DetailedApiError",l),this.error=p}};function ee(u,c,p){let h=xe(p),l=`${u.protocol}://${u.url}${u.port?`:${u.port}`:""}/${c.charAt(0)==="/"?c.substring(1):c}`;return h.length&&(l+=`?${h}`),l}function xe(u){return Object.keys(u).filter(c=>u[c]!==void 0).sort().map(c=>`${c}=${encodeURIComponent(Object.prototype.toString.call(u[c])==="[object Array]"?u[c].join(","):u[c]).replace(/\+/g,"%20")}`).join("&")}function te(u,c){if(u.method==="GET"||u.data===void 0&&c.data===void 0)return;let p=Array.isArray(u.data)?u.data:{...u.data,...c.data};return JSON.stringify(p)}function re(u,c,p){let h={Accept:"application/json",...u,...c,...p},l={};return Object.keys(h).forEach(I=>{let k=h[I];l[I.toLowerCase()]=k}),l}function me(u){if(!(u.status===204||u.content.length===0))try{return JSON.parse(u.content)}catch(c){throw new Se(c.message,u,$(u.headers))}}function Ae(u){return{status:u.status,headers:u.headers,content:u.content,data:me(u)}}function $(u){if(!u)return;if(u["correlation-id"]!==void 0)return u["correlation-id"];let c=Object.keys(u).find(p=>p.toLowerCase()==="correlation-id");return c===void 0?void 0:u[c]}function Ee(u){for(let c=u.length-1;c>=0;c--){let p=$(u[c].response.headers);if(p!==void 0)return p}}function Ce(u,c){let{content:p,status:h}=u,l=$(u.headers);try{let I=JSON.parse(p);return"error"in I?new We(I.message,h,I.error,c,l):new j(I.message,h,c,"ApiError",l)}catch{}return new j(p,h,c,"ApiError",l)}var w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",se=11;function oe(){var u;let c="";if(typeof((u=globalThis.crypto)==null?void 0:u.getRandomValues)=="function"){let p=new Uint8Array(se);globalThis.crypto.getRandomValues(p);for(let h of p)c+=w[h%w.length];return c}for(let p=0;p<se;p++)c+=w[Math.floor(Math.random()*w.length)];return c}function Oe({isTimedOut:u,status:c}){return!u&&~~c===0}function Ue({isTimedOut:u,status:c}){return u||Oe({isTimedOut:u,status:c})||~~(c/100)!==2&&~~(c/100)!==4}function ve({status:u}){return~~(u/100)===2}function Qe(u){return u.map(c=>he(c))}function he(u){let c=u.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...u,request:{...u.request,headers:{...u.request.headers,...c}}}}function fe({hosts:u,hostsCache:c,baseHeaders:p,logger:h,baseQueryParameters:l,algoliaAgent:I,timeouts:k,requester:i,requestsCache:e,responsesCache:t,compress:s,compression:a,requestIdChannel:n}){function r(T,m){n===void 0||T["request-id"]!==void 0||Object.keys(m).some(g=>g.toLowerCase()==="x-algolia-request-id")||(n==="headers"?T["request-id"]=oe():m["x-algolia-request-id"]=oe())}async function d(T){let m=await Promise.all(T.map(H=>c.get(H,()=>Promise.resolve(Y(H))))),g=m.filter(H=>H.isUp()),y=m.filter(H=>H.isTimedOut()),S=[...g,...y];return{hosts:S.length>0?S:T,getTimeout(H,x){return(y.length===0&&H===0?1:y.length+3+H)*x}}}async function f(T,m,g){let y=[],S=te(T,m),D=re(p,T.headers,m.headers),H=a==="gzip"&&S!==void 0&&S.length>De&&(T.method==="POST"||T.method==="PUT");H&&s===void 0&&h.info("Compression is disabled because no compress method is available.");let x=H&&s!==void 0,G=x?await s(S):S;x&&(D["content-encoding"]="gzip");let Q=T.method==="GET"?{...T.data,...m.data}:{},E={...l,...T.queryParameters,...Q};if(I.value&&(E["x-algolia-agent"]=I.value),m&&m.queryParameters)for(let W of Object.keys(m.queryParameters))!m.queryParameters[W]||Object.prototype.toString.call(m.queryParameters[W])==="[object Object]"?E[W]=m.queryParameters[W]:E[W]=m.queryParameters[W].toString();r(D,E);let U=0,b=async(W,N)=>{let v=W.pop();if(v===void 0)throw new Z(Qe(y),Ee(y));let _={...k,...m.timeouts},z={data:G,headers:D,method:T.method,url:ee(v,T.path,E),connectTimeout:N(U,_.connect),responseTimeout:N(U,g?_.read:_.write)},J=B=>{let X={request:z,response:B,host:v,triesLeft:W.length};return y.push(X),X},C=await i.send(z);if(Ue(C)){let B=J(C);return C.isTimedOut&&U++,h.info("Retryable failure",he(B)),await c.set(v,Y(v,C.isTimedOut?"timed out":"down")),b(W,N)}if(ve(C))return C;throw J(C),Ce(C,y)},A=u.filter(W=>W.accept==="readWrite"||(g?W.accept==="read":W.accept==="write")),F=await d(A);return b([...F.hosts].reverse(),F.getTimeout)}function q(T,m={}){let g=()=>f(T,m,y).then(H=>me(H)),y=T.useReadTransporter||T.method==="GET";if((m.cacheable||T.cacheable)!==!0)return g();let D={request:T,requestOptions:m,transporter:{queryParameters:l,headers:p}};return t.get(D,()=>e.get(D,()=>e.set(D,g()).then(H=>Promise.all([e.delete(D),H]),H=>Promise.all([e.delete(D),Promise.reject(H)])).then(([H,x])=>x)),{miss:H=>t.set(D,H)})}function P(T,m={}){let g=T.useReadTransporter||T.method==="GET";return f(T,m,g).then(y=>Ae(y))}async function*R(T,m={}){if(!i.sendStream)throw new Error("This requester does not support streaming");let g=te(T,m),y=re(p,T.headers,m.headers);y.accept="text/event-stream";let S=T.method==="GET"?{...T.data,...m.data}:{},D={...l,...T.queryParameters,...S};if(I.value&&(D["x-algolia-agent"]=I.value),m&&m.queryParameters)for(let A of Object.keys(m.queryParameters))!m.queryParameters[A]||Object.prototype.toString.call(m.queryParameters[A])==="[object Object]"?D[A]=m.queryParameters[A]:D[A]=m.queryParameters[A].toString();r(y,D);let H=T.useReadTransporter||T.method==="GET",x=u.filter(A=>A.accept==="readWrite"||(H?A.accept==="read":A.accept==="write")),Q=(await d(x)).hosts[0];if(!Q)throw new Z([]);let E={...k,...m.timeouts},U={data:g,headers:y,method:T.method,url:ee(Q,T.path,D),connectTimeout:E.connect,responseTimeout:H?E.read:E.write},b=await i.sendStream(U);yield*ke(b)}return{hostsCache:c,requester:i,timeouts:k,logger:h,algoliaAgent:I,baseHeaders:p,baseQueryParameters:l,requestIdChannel:n,hosts:u,request:q,requestWithHttpInfo:P,requestStream:R,requestsCache:e,responsesCache:t}}function o(u,c,p){if(p==null||typeof p=="string"&&p.length===0)throw new Error(`Parameter \`${u}\` is required when calling \`${c}\`.`)}function be(u){let c={};for(let p of u.trim().split(/[\r\n]+/)){let h=p.indexOf(": ");h>0&&(c[p.slice(0,h).toLowerCase()]=p.slice(h+2))}return c}function Pe(){function u(c){return new Promise(p=>{let h=new XMLHttpRequest;h.open(c.method,c.url,!0),Object.keys(c.headers).forEach(i=>h.setRequestHeader(i,c.headers[i]));let l=(i,e)=>setTimeout(()=>{h.abort(),p({status:0,content:e,isTimedOut:!0})},i),I=l(c.connectTimeout,"Connection timeout"),k;h.onreadystatechange=()=>{h.readyState>h.OPENED&&k===void 0&&(clearTimeout(I),k=l(c.responseTimeout,"Socket timeout"))},h.onerror=()=>{h.status===0&&(clearTimeout(I),clearTimeout(k),p({content:h.responseText||"Network request failed",status:h.status,isTimedOut:!1}))},h.onload=()=>{clearTimeout(I),clearTimeout(k),p({content:h.responseText,headers:be(h.getAllResponseHeaders()),status:h.status,isTimedOut:!1})},h.send(c.data)})}return{send:u}}var V="1.57.0",M=["eu","us"];function we(u){return[{url:"data.{region}.algolia.com".replace("{region}",u),accept:"readWrite",protocol:"https"}]}function Le(u){return u.type==="onDemand"}function Ve(u){return u.type==="schedule"}function Ge(u){return u.type==="subscription"}function qe({appId:u,apiKey:c,authMode:p,algoliaAgents:h,region:l,...I}){let k=ne(u,c,p),i=fe({hosts:we(l),...I,algoliaAgent:ue({algoliaAgents:h,client:"Ingestion",version:V}),baseHeaders:{"content-type":"text/plain",...k.headers(),...I.baseHeaders},baseQueryParameters:{...k.queryParameters(),...I.baseQueryParameters}});return{transporter:i,appId:u,apiKey:c,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!p||p==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=e:i.baseQueryParameters["x-algolia-api-key"]=e},async chunkedPush({indexName:e,objects:t,action:s="addObject",waitForTasks:a,batchSize:n=1e3,referenceIndexName:r,maxRetries:d=100},f){if(n<1)throw new Error("`batchSize` must be at least 1.");let q=[],P=0,R=[],T=Math.floor(n/10)||n,m=async(y,S)=>{for(let D of R.slice(y,S)){if(!D.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");let H=0;await ie({func:async()=>{if(D.eventID===void 0||!D.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:D.runID,eventID:D.eventID}).catch(x=>{if(x.status!==404)throw x})},validate:x=>x!==void 0,aggregator:()=>H+=1,error:{validate:()=>H>=d,message:()=>`Stopped waiting for the task after ${d} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>Math.min(H*1500,5e3)})}},g=t.entries();for(let[y,S]of g)q.push(S),(q.length===n||y===t.length-1)&&(R.push(await this.push({indexName:e,pushTaskPayload:{action:s,records:q},referenceIndexName:r},f)),q=[]),a&&R.length-P>=T&&(await m(P,P+T),P+=T);return a&&await m(P,R.length),R},createAuthentication(e,t){o("authenticationCreate","createAuthentication",e),o("authenticationCreate.type","createAuthentication",e.type),o("authenticationCreate.name","createAuthentication",e.name),o("authenticationCreate.input","createAuthentication",e.input);let r={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(r,t)},createAuthenticationWithHTTPInfo(e,t){o("authenticationCreate","createAuthenticationWithHTTPInfo",e),o("authenticationCreate.type","createAuthenticationWithHTTPInfo",e.type),o("authenticationCreate.name","createAuthenticationWithHTTPInfo",e.name),o("authenticationCreate.input","createAuthenticationWithHTTPInfo",e.input);let r={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},createDestination(e,t){o("destinationCreate","createDestination",e),o("destinationCreate.type","createDestination",e.type),o("destinationCreate.name","createDestination",e.name),o("destinationCreate.input","createDestination",e.input);let r={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(r,t)},createDestinationWithHTTPInfo(e,t){o("destinationCreate","createDestinationWithHTTPInfo",e),o("destinationCreate.type","createDestinationWithHTTPInfo",e.type),o("destinationCreate.name","createDestinationWithHTTPInfo",e.name),o("destinationCreate.input","createDestinationWithHTTPInfo",e.input);let r={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},createSource(e,t){o("sourceCreate","createSource",e),o("sourceCreate.type","createSource",e.type),o("sourceCreate.name","createSource",e.name);let r={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(r,t)},createSourceWithHTTPInfo(e,t){o("sourceCreate","createSourceWithHTTPInfo",e),o("sourceCreate.type","createSourceWithHTTPInfo",e.type),o("sourceCreate.name","createSourceWithHTTPInfo",e.name);let r={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},createTask(e,t){o("taskCreate","createTask",e),o("taskCreate.sourceID","createTask",e.sourceID),o("taskCreate.destinationID","createTask",e.destinationID),o("taskCreate.action","createTask",e.action);let r={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return i.request(r,t)},createTaskWithHTTPInfo(e,t){o("taskCreate","createTaskWithHTTPInfo",e),o("taskCreate.sourceID","createTaskWithHTTPInfo",e.sourceID),o("taskCreate.destinationID","createTaskWithHTTPInfo",e.destinationID),o("taskCreate.action","createTaskWithHTTPInfo",e.action);let r={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},createTaskV1(e,t){o("taskCreate","createTaskV1",e),o("taskCreate.sourceID","createTaskV1",e.sourceID),o("taskCreate.destinationID","createTaskV1",e.destinationID),o("taskCreate.trigger","createTaskV1",e.trigger),o("taskCreate.action","createTaskV1",e.action);let r={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(r,t)},createTaskV1WithHTTPInfo(e,t){o("taskCreate","createTaskV1WithHTTPInfo",e),o("taskCreate.sourceID","createTaskV1WithHTTPInfo",e.sourceID),o("taskCreate.destinationID","createTaskV1WithHTTPInfo",e.destinationID),o("taskCreate.trigger","createTaskV1WithHTTPInfo",e.trigger),o("taskCreate.action","createTaskV1WithHTTPInfo",e.action);let r={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},createTransformation(e,t){o("transformationCreate","createTransformation",e),o("transformationCreate.name","createTransformation",e.name);let r={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.request(r,t)},createTransformationWithHTTPInfo(e,t){o("transformationCreate","createTransformationWithHTTPInfo",e),o("transformationCreate.name","createTransformationWithHTTPInfo",e.name);let r={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},customDelete({path:e,parameters:t},s){o("path","customDelete",e);let d={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(d,s)},customDeleteWithHTTPInfo({path:e,parameters:t},s){o("path","customDeleteWithHTTPInfo",e);let d={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.requestWithHttpInfo(d,s)},customGet({path:e,parameters:t},s){o("path","customGet",e);let d={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(d,s)},customGetWithHTTPInfo({path:e,parameters:t},s){o("path","customGetWithHTTPInfo",e);let d={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.requestWithHttpInfo(d,s)},customPost({path:e,parameters:t,body:s},a){o("path","customPost",e);let f={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:s||{}};return i.request(f,a)},customPostWithHTTPInfo({path:e,parameters:t,body:s},a){o("path","customPostWithHTTPInfo",e);let f={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:s||{}};return i.requestWithHttpInfo(f,a)},customPut({path:e,parameters:t,body:s},a){o("path","customPut",e);let f={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:s||{}};return i.request(f,a)},customPutWithHTTPInfo({path:e,parameters:t,body:s},a){o("path","customPutWithHTTPInfo",e);let f={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:s||{}};return i.requestWithHttpInfo(f,a)},deleteAuthentication({authenticationID:e},t){o("authenticationID","deleteAuthentication",e);let r={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteAuthenticationWithHTTPInfo({authenticationID:e},t){o("authenticationID","deleteAuthenticationWithHTTPInfo",e);let r={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},deleteDestination({destinationID:e},t){o("destinationID","deleteDestination",e);let r={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteDestinationWithHTTPInfo({destinationID:e},t){o("destinationID","deleteDestinationWithHTTPInfo",e);let r={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},deleteSource({sourceID:e},t){o("sourceID","deleteSource",e);let r={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteSourceWithHTTPInfo({sourceID:e},t){o("sourceID","deleteSourceWithHTTPInfo",e);let r={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},deleteTask({taskID:e},t){o("taskID","deleteTask",e);let r={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteTaskWithHTTPInfo({taskID:e},t){o("taskID","deleteTaskWithHTTPInfo",e);let r={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},deleteTaskV1({taskID:e},t){o("taskID","deleteTaskV1",e);let r={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteTaskV1WithHTTPInfo({taskID:e},t){o("taskID","deleteTaskV1WithHTTPInfo",e);let r={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},deleteTransformation({transformationID:e},t){o("transformationID","deleteTransformation",e);let r={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},deleteTransformationWithHTTPInfo({transformationID:e},t){o("transformationID","deleteTransformationWithHTTPInfo",e);let r={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},disableTask({taskID:e},t){o("taskID","disableTask",e);let r={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},disableTaskWithHTTPInfo({taskID:e},t){o("taskID","disableTaskWithHTTPInfo",e);let r={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},disableTaskV1({taskID:e},t){o("taskID","disableTaskV1",e);let r={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},disableTaskV1WithHTTPInfo({taskID:e},t){o("taskID","disableTaskV1WithHTTPInfo",e);let r={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},enableTask({taskID:e},t){o("taskID","enableTask",e);let r={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},enableTaskWithHTTPInfo({taskID:e},t){o("taskID","enableTaskWithHTTPInfo",e);let r={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},enableTaskV1({taskID:e},t){o("taskID","enableTaskV1",e);let r={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},enableTaskV1WithHTTPInfo({taskID:e},t){o("taskID","enableTaskV1WithHTTPInfo",e);let r={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},getAuthentication({authenticationID:e},t){o("authenticationID","getAuthentication",e);let r={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getAuthenticationWithHTTPInfo({authenticationID:e},t){o("authenticationID","getAuthenticationWithHTTPInfo",e);let r={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},getDestination({destinationID:e},t){o("destinationID","getDestination",e);let r={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getDestinationWithHTTPInfo({destinationID:e},t){o("destinationID","getDestinationWithHTTPInfo",e);let r={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},getEvent({runID:e,eventID:t},s){o("runID","getEvent",e),o("eventID","getEvent",t);let d={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return i.request(d,s)},getEventWithHTTPInfo({runID:e,eventID:t},s){o("runID","getEventWithHTTPInfo",e),o("eventID","getEventWithHTTPInfo",t);let d={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,s)},getRun({runID:e},t){o("runID","getRun",e);let r={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getRunWithHTTPInfo({runID:e},t){o("runID","getRunWithHTTPInfo",e);let r={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},getSource({sourceID:e},t){o("sourceID","getSource",e);let r={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getSourceWithHTTPInfo({sourceID:e},t){o("sourceID","getSourceWithHTTPInfo",e);let r={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},getTask({taskID:e},t){o("taskID","getTask",e);let r={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getTaskWithHTTPInfo({taskID:e},t){o("taskID","getTaskWithHTTPInfo",e);let r={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},getTaskV1({taskID:e},t){o("taskID","getTaskV1",e);let r={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getTaskV1WithHTTPInfo({taskID:e},t){o("taskID","getTaskV1WithHTTPInfo",e);let r={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},getTransformation({transformationID:e},t){o("transformationID","getTransformation",e);let r={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(r,t)},getTransformationWithHTTPInfo({transformationID:e},t){o("transformationID","getTransformationWithHTTPInfo",e);let r={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(r,t)},listAuthentications({itemsPerPage:e,page:t,type:s,platform:a,sort:n,order:r}={},d=void 0){let f="/1/authentications",q={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),t!==void 0&&(P.page=t.toString()),s!==void 0&&(P.type=s.toString()),a!==void 0&&(P.platform=a.toString()),n!==void 0&&(P.sort=n.toString()),r!==void 0&&(P.order=r.toString());let R={method:"GET",path:f,queryParameters:P,headers:q};return i.request(R,d)},listAuthenticationsWithHTTPInfo({itemsPerPage:e,page:t,type:s,platform:a,sort:n,order:r}={},d=void 0){let f="/1/authentications",q={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),t!==void 0&&(P.page=t.toString()),s!==void 0&&(P.type=s.toString()),a!==void 0&&(P.platform=a.toString()),n!==void 0&&(P.sort=n.toString()),r!==void 0&&(P.order=r.toString());let R={method:"GET",path:f,queryParameters:P,headers:q};return i.requestWithHttpInfo(R,d)},listDestinations({itemsPerPage:e,page:t,type:s,authenticationID:a,transformationID:n,sort:r,order:d}={},f=void 0){let q="/1/destinations",P={},R={};e!==void 0&&(R.itemsPerPage=e.toString()),t!==void 0&&(R.page=t.toString()),s!==void 0&&(R.type=s.toString()),a!==void 0&&(R.authenticationID=a.toString()),n!==void 0&&(R.transformationID=n.toString()),r!==void 0&&(R.sort=r.toString()),d!==void 0&&(R.order=d.toString());let T={method:"GET",path:q,queryParameters:R,headers:P};return i.request(T,f)},listDestinationsWithHTTPInfo({itemsPerPage:e,page:t,type:s,authenticationID:a,transformationID:n,sort:r,order:d}={},f=void 0){let q="/1/destinations",P={},R={};e!==void 0&&(R.itemsPerPage=e.toString()),t!==void 0&&(R.page=t.toString()),s!==void 0&&(R.type=s.toString()),a!==void 0&&(R.authenticationID=a.toString()),n!==void 0&&(R.transformationID=n.toString()),r!==void 0&&(R.sort=r.toString()),d!==void 0&&(R.order=d.toString());let T={method:"GET",path:q,queryParameters:R,headers:P};return i.requestWithHttpInfo(T,f)},listEvents({runID:e,itemsPerPage:t,page:s,status:a,type:n,sort:r,order:d,startDate:f,endDate:q},P){o("runID","listEvents",e);let R="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),T={},m={};t!==void 0&&(m.itemsPerPage=t.toString()),s!==void 0&&(m.page=s.toString()),a!==void 0&&(m.status=a.toString()),n!==void 0&&(m.type=n.toString()),r!==void 0&&(m.sort=r.toString()),d!==void 0&&(m.order=d.toString()),f!==void 0&&(m.startDate=f.toString()),q!==void 0&&(m.endDate=q.toString());let g={method:"GET",path:R,queryParameters:m,headers:T};return i.request(g,P)},listEventsWithHTTPInfo({runID:e,itemsPerPage:t,page:s,status:a,type:n,sort:r,order:d,startDate:f,endDate:q},P){o("runID","listEventsWithHTTPInfo",e);let R="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),T={},m={};t!==void 0&&(m.itemsPerPage=t.toString()),s!==void 0&&(m.page=s.toString()),a!==void 0&&(m.status=a.toString()),n!==void 0&&(m.type=n.toString()),r!==void 0&&(m.sort=r.toString()),d!==void 0&&(m.order=d.toString()),f!==void 0&&(m.startDate=f.toString()),q!==void 0&&(m.endDate=q.toString());let g={method:"GET",path:R,queryParameters:m,headers:T};return i.requestWithHttpInfo(g,P)},listRuns({itemsPerPage:e,page:t,status:s,type:a,taskID:n,sort:r,order:d,startDate:f,endDate:q}={},P=void 0){let R="/1/runs",T={},m={};e!==void 0&&(m.itemsPerPage=e.toString()),t!==void 0&&(m.page=t.toString()),s!==void 0&&(m.status=s.toString()),a!==void 0&&(m.type=a.toString()),n!==void 0&&(m.taskID=n.toString()),r!==void 0&&(m.sort=r.toString()),d!==void 0&&(m.order=d.toString()),f!==void 0&&(m.startDate=f.toString()),q!==void 0&&(m.endDate=q.toString());let g={method:"GET",path:R,queryParameters:m,headers:T};return i.request(g,P)},listRunsWithHTTPInfo({itemsPerPage:e,page:t,status:s,type:a,taskID:n,sort:r,order:d,startDate:f,endDate:q}={},P=void 0){let R="/1/runs",T={},m={};e!==void 0&&(m.itemsPerPage=e.toString()),t!==void 0&&(m.page=t.toString()),s!==void 0&&(m.status=s.toString()),a!==void 0&&(m.type=a.toString()),n!==void 0&&(m.taskID=n.toString()),r!==void 0&&(m.sort=r.toString()),d!==void 0&&(m.order=d.toString()),f!==void 0&&(m.startDate=f.toString()),q!==void 0&&(m.endDate=q.toString());let g={method:"GET",path:R,queryParameters:m,headers:T};return i.requestWithHttpInfo(g,P)},listSources({itemsPerPage:e,page:t,type:s,authenticationID:a,sort:n,order:r}={},d=void 0){let f="/1/sources",q={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),t!==void 0&&(P.page=t.toString()),s!==void 0&&(P.type=s.toString()),a!==void 0&&(P.authenticationID=a.toString()),n!==void 0&&(P.sort=n.toString()),r!==void 0&&(P.order=r.toString());let R={method:"GET",path:f,queryParameters:P,headers:q};return i.request(R,d)},listSourcesWithHTTPInfo({itemsPerPage:e,page:t,type:s,authenticationID:a,sort:n,order:r}={},d=void 0){let f="/1/sources",q={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),t!==void 0&&(P.page=t.toString()),s!==void 0&&(P.type=s.toString()),a!==void 0&&(P.authenticationID=a.toString()),n!==void 0&&(P.sort=n.toString()),r!==void 0&&(P.order=r.toString());let R={method:"GET",path:f,queryParameters:P,headers:q};return i.requestWithHttpInfo(R,d)},listTasks({itemsPerPage:e,page:t,action:s,enabled:a,sourceID:n,sourceType:r,destinationID:d,triggerType:f,withEmailNotifications:q,sort:P,order:R}={},T=void 0){let m="/2/tasks",g={},y={};e!==void 0&&(y.itemsPerPage=e.toString()),t!==void 0&&(y.page=t.toString()),s!==void 0&&(y.action=s.toString()),a!==void 0&&(y.enabled=a.toString()),n!==void 0&&(y.sourceID=n.toString()),r!==void 0&&(y.sourceType=r.toString()),d!==void 0&&(y.destinationID=d.toString()),f!==void 0&&(y.triggerType=f.toString()),q!==void 0&&(y.withEmailNotifications=q.toString()),P!==void 0&&(y.sort=P.toString()),R!==void 0&&(y.order=R.toString());let S={method:"GET",path:m,queryParameters:y,headers:g};return i.request(S,T)},listTasksWithHTTPInfo({itemsPerPage:e,page:t,action:s,enabled:a,sourceID:n,sourceType:r,destinationID:d,triggerType:f,withEmailNotifications:q,sort:P,order:R}={},T=void 0){let m="/2/tasks",g={},y={};e!==void 0&&(y.itemsPerPage=e.toString()),t!==void 0&&(y.page=t.toString()),s!==void 0&&(y.action=s.toString()),a!==void 0&&(y.enabled=a.toString()),n!==void 0&&(y.sourceID=n.toString()),r!==void 0&&(y.sourceType=r.toString()),d!==void 0&&(y.destinationID=d.toString()),f!==void 0&&(y.triggerType=f.toString()),q!==void 0&&(y.withEmailNotifications=q.toString()),P!==void 0&&(y.sort=P.toString()),R!==void 0&&(y.order=R.toString());let S={method:"GET",path:m,queryParameters:y,headers:g};return i.requestWithHttpInfo(S,T)},listTasksV1({itemsPerPage:e,page:t,action:s,enabled:a,sourceID:n,destinationID:r,triggerType:d,sort:f,order:q}={},P=void 0){let R="/1/tasks",T={},m={};e!==void 0&&(m.itemsPerPage=e.toString()),t!==void 0&&(m.page=t.toString()),s!==void 0&&(m.action=s.toString()),a!==void 0&&(m.enabled=a.toString()),n!==void 0&&(m.sourceID=n.toString()),r!==void 0&&(m.destinationID=r.toString()),d!==void 0&&(m.triggerType=d.toString()),f!==void 0&&(m.sort=f.toString()),q!==void 0&&(m.order=q.toString());let g={method:"GET",path:R,queryParameters:m,headers:T};return i.request(g,P)},listTasksV1WithHTTPInfo({itemsPerPage:e,page:t,action:s,enabled:a,sourceID:n,destinationID:r,triggerType:d,sort:f,order:q}={},P=void 0){let R="/1/tasks",T={},m={};e!==void 0&&(m.itemsPerPage=e.toString()),t!==void 0&&(m.page=t.toString()),s!==void 0&&(m.action=s.toString()),a!==void 0&&(m.enabled=a.toString()),n!==void 0&&(m.sourceID=n.toString()),r!==void 0&&(m.destinationID=r.toString()),d!==void 0&&(m.triggerType=d.toString()),f!==void 0&&(m.sort=f.toString()),q!==void 0&&(m.order=q.toString());let g={method:"GET",path:R,queryParameters:m,headers:T};return i.requestWithHttpInfo(g,P)},listTransformations({itemsPerPage:e,page:t,sort:s,order:a,type:n}={},r=void 0){let d="/1/transformations",f={},q={};e!==void 0&&(q.itemsPerPage=e.toString()),t!==void 0&&(q.page=t.toString()),s!==void 0&&(q.sort=s.toString()),a!==void 0&&(q.order=a.toString()),n!==void 0&&(q.type=n.toString());let P={method:"GET",path:d,queryParameters:q,headers:f};return i.request(P,r)},listTransformationsWithHTTPInfo({itemsPerPage:e,page:t,sort:s,order:a,type:n}={},r=void 0){let d="/1/transformations",f={},q={};e!==void 0&&(q.itemsPerPage=e.toString()),t!==void 0&&(q.page=t.toString()),s!==void 0&&(q.sort=s.toString()),a!==void 0&&(q.order=a.toString()),n!==void 0&&(q.type=n.toString());let P={method:"GET",path:d,queryParameters:q,headers:f};return i.requestWithHttpInfo(P,r)},push({indexName:e,pushTaskPayload:t,watch:s,referenceIndexName:a},n){o("indexName","push",e),o("pushTaskPayload","push",t),o("pushTaskPayload.action","push",t.action),o("pushTaskPayload.records","push",t.records);let r="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(e)),d={},f={};s!==void 0&&(f.watch=s.toString()),a!==void 0&&(f.referenceIndexName=a.toString());let q={method:"POST",path:r,queryParameters:f,headers:d,data:t};return n={...n,timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},i.request(q,n)},pushWithHTTPInfo({indexName:e,pushTaskPayload:t,watch:s,referenceIndexName:a},n){o("indexName","pushWithHTTPInfo",e),o("pushTaskPayload","pushWithHTTPInfo",t),o("pushTaskPayload.action","pushWithHTTPInfo",t.action),o("pushTaskPayload.records","pushWithHTTPInfo",t.records);let r="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(e)),d={},f={};s!==void 0&&(f.watch=s.toString()),a!==void 0&&(f.referenceIndexName=a.toString());let q={method:"POST",path:r,queryParameters:f,headers:d,data:t};return n={...n,timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},i.requestWithHttpInfo(q,n)},pushTask({taskID:e,pushTaskPayload:t,watch:s},a){o("taskID","pushTask",e),o("pushTaskPayload","pushTask",t),o("pushTaskPayload.action","pushTask",t.action),o("pushTaskPayload.records","pushTask",t.records);let n="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),r={},d={};s!==void 0&&(d.watch=s.toString());let f={method:"POST",path:n,queryParameters:d,headers:r,data:t};return a={...a,timeouts:{connect:18e4,read:18e4,write:18e4,...a?.timeouts}},i.request(f,a)},pushTaskWithHTTPInfo({taskID:e,pushTaskPayload:t,watch:s},a){o("taskID","pushTaskWithHTTPInfo",e),o("pushTaskPayload","pushTaskWithHTTPInfo",t),o("pushTaskPayload.action","pushTaskWithHTTPInfo",t.action),o("pushTaskPayload.records","pushTaskWithHTTPInfo",t.records);let n="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),r={},d={};s!==void 0&&(d.watch=s.toString());let f={method:"POST",path:n,queryParameters:d,headers:r,data:t};return a={...a,timeouts:{connect:18e4,read:18e4,write:18e4,...a?.timeouts}},i.requestWithHttpInfo(f,a)},replaceTask({taskID:e,taskReplace:t},s){o("taskID","replaceTask",e),o("taskReplace","replaceTask",t),o("taskReplace.destinationID","replaceTask",t.destinationID),o("taskReplace.action","replaceTask",t.action);let d={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},replaceTaskWithHTTPInfo({taskID:e,taskReplace:t},s){o("taskID","replaceTaskWithHTTPInfo",e),o("taskReplace","replaceTaskWithHTTPInfo",t),o("taskReplace.destinationID","replaceTaskWithHTTPInfo",t.destinationID),o("taskReplace.action","replaceTaskWithHTTPInfo",t.action);let d={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},runSource({sourceID:e,runSourcePayload:t},s){o("sourceID","runSource",e);let d={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return i.request(d,s)},runSourceWithHTTPInfo({sourceID:e,runSourcePayload:t},s){o("sourceID","runSourceWithHTTPInfo",e);let d={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return i.requestWithHttpInfo(d,s)},runTask({taskID:e,runTaskPayload:t},s){o("taskID","runTask",e);let d={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return i.request(d,s)},runTaskWithHTTPInfo({taskID:e,runTaskPayload:t},s){o("taskID","runTaskWithHTTPInfo",e);let d={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return i.requestWithHttpInfo(d,s)},runTaskV1({taskID:e,runTaskPayload:t},s){o("taskID","runTaskV1",e);let d={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return i.request(d,s)},runTaskV1WithHTTPInfo({taskID:e,runTaskPayload:t},s){o("taskID","runTaskV1WithHTTPInfo",e);let d={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return i.requestWithHttpInfo(d,s)},searchAuthentications(e,t){o("authenticationSearch","searchAuthentications",e),o("authenticationSearch.authenticationIDs","searchAuthentications",e.authenticationIDs);let r={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchAuthenticationsWithHTTPInfo(e,t){o("authenticationSearch","searchAuthenticationsWithHTTPInfo",e),o("authenticationSearch.authenticationIDs","searchAuthenticationsWithHTTPInfo",e.authenticationIDs);let r={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},searchDestinations(e,t){o("destinationSearch","searchDestinations",e),o("destinationSearch.destinationIDs","searchDestinations",e.destinationIDs);let r={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchDestinationsWithHTTPInfo(e,t){o("destinationSearch","searchDestinationsWithHTTPInfo",e),o("destinationSearch.destinationIDs","searchDestinationsWithHTTPInfo",e.destinationIDs);let r={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},searchSources(e,t){o("sourceSearch","searchSources",e),o("sourceSearch.sourceIDs","searchSources",e.sourceIDs);let r={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchSourcesWithHTTPInfo(e,t){o("sourceSearch","searchSourcesWithHTTPInfo",e),o("sourceSearch.sourceIDs","searchSourcesWithHTTPInfo",e.sourceIDs);let r={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},searchTasks(e,t){o("taskSearch","searchTasks",e),o("taskSearch.taskIDs","searchTasks",e.taskIDs);let r={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchTasksWithHTTPInfo(e,t){o("taskSearch","searchTasksWithHTTPInfo",e),o("taskSearch.taskIDs","searchTasksWithHTTPInfo",e.taskIDs);let r={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},searchTasksV1(e,t){o("taskSearch","searchTasksV1",e),o("taskSearch.taskIDs","searchTasksV1",e.taskIDs);let r={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchTasksV1WithHTTPInfo(e,t){o("taskSearch","searchTasksV1WithHTTPInfo",e),o("taskSearch.taskIDs","searchTasksV1WithHTTPInfo",e.taskIDs);let r={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},searchTransformations(e,t){o("transformationSearch","searchTransformations",e),o("transformationSearch.transformationIDs","searchTransformations",e.transformationIDs);let r={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.request(r,t)},searchTransformationsWithHTTPInfo(e,t){o("transformationSearch","searchTransformationsWithHTTPInfo",e),o("transformationSearch.transformationIDs","searchTransformationsWithHTTPInfo",e.transformationIDs);let r={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},triggerDockerSourceDiscover({sourceID:e},t){o("sourceID","triggerDockerSourceDiscover",e);let r={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t={...t,timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},i.request(r,t)},triggerDockerSourceDiscoverWithHTTPInfo({sourceID:e},t){o("sourceID","triggerDockerSourceDiscoverWithHTTPInfo",e);let r={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t={...t,timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},i.requestWithHttpInfo(r,t)},tryTransformation(e,t){o("transformationTry","tryTransformation",e),o("transformationTry.sampleRecord","tryTransformation",e.sampleRecord);let r={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.request(r,t)},tryTransformationWithHTTPInfo(e,t){o("transformationTry","tryTransformationWithHTTPInfo",e),o("transformationTry.sampleRecord","tryTransformationWithHTTPInfo",e.sampleRecord);let r={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.requestWithHttpInfo(r,t)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:t},s){o("transformationID","tryTransformationBeforeUpdate",e),o("transformationTry","tryTransformationBeforeUpdate",t),o("transformationTry.sampleRecord","tryTransformationBeforeUpdate",t.sampleRecord);let d={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},tryTransformationBeforeUpdateWithHTTPInfo({transformationID:e,transformationTry:t},s){o("transformationID","tryTransformationBeforeUpdateWithHTTPInfo",e),o("transformationTry","tryTransformationBeforeUpdateWithHTTPInfo",t),o("transformationTry.sampleRecord","tryTransformationBeforeUpdateWithHTTPInfo",t.sampleRecord);let d={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},updateAuthentication({authenticationID:e,authenticationUpdate:t},s){o("authenticationID","updateAuthentication",e),o("authenticationUpdate","updateAuthentication",t);let d={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},updateAuthenticationWithHTTPInfo({authenticationID:e,authenticationUpdate:t},s){o("authenticationID","updateAuthenticationWithHTTPInfo",e),o("authenticationUpdate","updateAuthenticationWithHTTPInfo",t);let d={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},updateDestination({destinationID:e,destinationUpdate:t},s){o("destinationID","updateDestination",e),o("destinationUpdate","updateDestination",t);let d={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},updateDestinationWithHTTPInfo({destinationID:e,destinationUpdate:t},s){o("destinationID","updateDestinationWithHTTPInfo",e),o("destinationUpdate","updateDestinationWithHTTPInfo",t);let d={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},updateSource({sourceID:e,sourceUpdate:t},s){o("sourceID","updateSource",e),o("sourceUpdate","updateSource",t);let d={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},updateSourceWithHTTPInfo({sourceID:e,sourceUpdate:t},s){o("sourceID","updateSourceWithHTTPInfo",e),o("sourceUpdate","updateSourceWithHTTPInfo",t);let d={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},updateTask({taskID:e,taskUpdate:t},s){o("taskID","updateTask",e),o("taskUpdate","updateTask",t);let d={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},updateTaskWithHTTPInfo({taskID:e,taskUpdate:t},s){o("taskID","updateTaskWithHTTPInfo",e),o("taskUpdate","updateTaskWithHTTPInfo",t);let d={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},updateTaskV1({taskID:e,taskUpdate:t},s){o("taskID","updateTaskV1",e),o("taskUpdate","updateTaskV1",t);let d={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},updateTaskV1WithHTTPInfo({taskID:e,taskUpdate:t},s){o("taskID","updateTaskV1WithHTTPInfo",e),o("taskUpdate","updateTaskV1WithHTTPInfo",t);let d={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},updateTransformation({transformationID:e,transformationCreate:t},s){o("transformationID","updateTransformation",e),o("transformationCreate","updateTransformation",t),o("transformationCreate.name","updateTransformation",t.name);let d={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.request(d,s)},updateTransformationWithHTTPInfo({transformationID:e,transformationCreate:t},s){o("transformationID","updateTransformationWithHTTPInfo",e),o("transformationCreate","updateTransformationWithHTTPInfo",t),o("transformationCreate.name","updateTransformationWithHTTPInfo",t.name);let d={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return i.requestWithHttpInfo(d,s)},validateSource(e,t=void 0){let r={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return t={...t,timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},i.request(r,t)},validateSourceWithHTTPInfo(e,t=void 0){let r={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return t={...t,timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},i.requestWithHttpInfo(r,t)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:t},s){o("sourceID","validateSourceBeforeUpdate",e),o("sourceUpdate","validateSourceBeforeUpdate",t);let d={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return s={...s,timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},i.request(d,s)},validateSourceBeforeUpdateWithHTTPInfo({sourceID:e,sourceUpdate:t},s){o("sourceID","validateSourceBeforeUpdateWithHTTPInfo",e),o("sourceUpdate","validateSourceBeforeUpdateWithHTTPInfo",t);let d={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return s={...s,timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},i.requestWithHttpInfo(d,s)}}}function zs(u,c,p,h){if(!u||typeof u!="string")throw new Error("`appId` is missing.");if(!c||typeof c!="string")throw new Error("`apiKey` is missing.");if(!p||p&&(typeof p!="string"||!M.includes(p)))throw new Error(`\`region\` is required and must be one of the following: ${M.join(", ")}`);let{compression:l,...I}=h||{};return qe({appId:u,apiKey:c,region:p,timeouts:{connect:25e3,read:25e3,write:25e3},logger:ce(),requester:Pe(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:L(),requestsCache:L({serializable:!1}),hostsCache:O({caches:[ae({key:`${V}-${u}`}),L()]}),...I})}export{V as apiClientVersion,zs as ingestionClient,Le as isOnDemandTrigger,Ve as isScheduleTrigger,Ge as isSubscriptionTrigger};
6
6
  //# sourceMappingURL=browser.min.js.map