Socket
Socket
Sign inDemoInstall

@algolia/ingestion

Package Overview
Dependencies
Maintainers
0
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@algolia/ingestion - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

2

dist/builds/browser.min.js

@@ -1,2 +0,2 @@

function G(a,o,c="WithinHeaders"){let u={"x-algolia-api-key":o,"x-algolia-application-id":a};return{headers(){return c==="WithinHeaders"?u:{}},queryParameters(){return c==="WithinQueryParameters"?u:{}}}}function N(a){let o,c=`algolia-client-js-${a.key}`;function u(){return o===void 0&&(o=a.localStorage||window.localStorage),o}function h(){return JSON.parse(u().getItem(c)||"{}")}function q(e){u().setItem(c,JSON.stringify(e))}function T(){let e=a.timeToLive?a.timeToLive*1e3:null,r=h(),s=Object.fromEntries(Object.entries(r).filter(([,i])=>i.timestamp!==void 0));if(q(s),!e)return;let n=Object.fromEntries(Object.entries(s).filter(([,i])=>{let t=new Date().getTime();return!(i.timestamp+e<t)}));q(n)}return{get(e,r,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(T(),h()[JSON.stringify(e)])).then(n=>Promise.all([n?n.value:r(),n!==void 0])).then(([n,i])=>Promise.all([n,i||s.miss(n)])).then(([n])=>n)},set(e,r){return Promise.resolve().then(()=>{let s=h();return s[JSON.stringify(e)]={timestamp:new Date().getTime(),value:r},u().setItem(c,JSON.stringify(s)),r})},delete(e){return Promise.resolve().then(()=>{let r=h();delete r[JSON.stringify(e)],u().setItem(c,JSON.stringify(r))})},clear(){return Promise.resolve().then(()=>{u().removeItem(c)})}}}function Y(){return{get(a,o,c={miss:()=>Promise.resolve()}){return o().then(h=>Promise.all([h,c.miss(h)])).then(([h])=>h)},set(a,o){return Promise.resolve(o)},delete(a){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(a){let o=[...a.caches],c=o.shift();return c===void 0?Y():{get(u,h,q={miss:()=>Promise.resolve()}){return c.get(u,h,q).catch(()=>E({caches:o}).get(u,h,q))},set(u,h){return c.set(u,h).catch(()=>E({caches:o}).set(u,h))},delete(u){return c.delete(u).catch(()=>E({caches:o}).delete(u))},clear(){return c.clear().catch(()=>E({caches:o}).clear())}}}function k(a={serializable:!0}){let o={};return{get(c,u,h={miss:()=>Promise.resolve()}){let q=JSON.stringify(c);if(q in o)return Promise.resolve(a.serializable?JSON.parse(o[q]):o[q]);let T=u();return T.then(e=>h.miss(e)).then(()=>T)},set(c,u){return o[JSON.stringify(c)]=a.serializable?JSON.stringify(u):u,Promise.resolve(u)},delete(c){return delete o[JSON.stringify(c)],Promise.resolve()},clear(){return o={},Promise.resolve()}}}var L=2*60*1e3;function V(a,o="up"){let c=Date.now();function u(){return o==="up"||Date.now()-c>L}function h(){return o==="timed out"&&Date.now()-c<=L}return{...a,status:o,lastUpdate:c,isUp:u,isTimedOut:h}}var _=class extends Error{name="AlgoliaError";constructor(a,o){super(a),o&&(this.name=o)}},W=class extends _{stackTrace;constructor(a,o,c){super(a,c),this.stackTrace=o}},Z=class extends W{constructor(a){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",a,"RetryError")}},C=class extends W{status;constructor(a,o,c,u="ApiError"){super(a,c,u),this.status=o}},ee=class extends _{response;constructor(a,o){super(a,"DeserializationError"),this.response=o}},re=class extends C{error;constructor(a,o,c,u){super(a,o,u,"DetailedApiError"),this.error=c}};function te(a,o,c){let u=se(c),h=`${a.protocol}://${a.url}${a.port?`:${a.port}`:""}/${o.charAt(0)==="/"?o.substring(1):o}`;return u.length&&(h+=`?${u}`),h}function se(a){return Object.keys(a).filter(o=>a[o]!==void 0).sort().map(o=>`${o}=${encodeURIComponent(Object.prototype.toString.call(a[o])==="[object Array]"?a[o].join(","):a[o]).replaceAll("+","%20")}`).join("&")}function oe(a,o){if(a.method==="GET"||a.data===void 0&&o.data===void 0)return;let c=Array.isArray(a.data)?a.data:{...a.data,...o.data};return JSON.stringify(c)}function ae(a,o,c){let u={Accept:"application/json",...a,...o,...c},h={};return Object.keys(u).forEach(q=>{let T=u[q];h[q.toLowerCase()]=T}),h}function ne(a){try{return JSON.parse(a.content)}catch(o){throw new ee(o.message,a)}}function ie({content:a,status:o},c){try{let u=JSON.parse(a);return"error"in u?new re(u.message,o,u.error,c):new C(u.message,o,c)}catch{}return new C(a,o,c)}function ue({isTimedOut:a,status:o}){return!a&&~~o===0}function me({isTimedOut:a,status:o}){return a||ue({isTimedOut:a,status:o})||~~(o/100)!==2&&~~(o/100)!==4}function ce({status:a}){return~~(a/100)===2}function pe(a){return a.map(o=>B(o))}function B(a){let o=a.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...a,request:{...a.request,headers:{...a.request.headers,...o}}}}function M({hosts:a,hostsCache:o,baseHeaders:c,baseQueryParameters:u,algoliaAgent:h,timeouts:q,requester:T,requestsCache:e,responsesCache:r}){async function s(t){let m=await Promise.all(t.map(P=>o.get(P,()=>Promise.resolve(V(P))))),f=m.filter(P=>P.isUp()),l=m.filter(P=>P.isTimedOut()),d=[...f,...l];return{hosts:d.length>0?d:t,getTimeout(P,p){return(l.length===0&&P===0?1:l.length+3+P)*p}}}async function n(t,m,f=!0){let l=[],d=oe(t,m),g=ae(c,t.headers,m.headers),P=t.method==="GET"?{...t.data,...m.data}:{},p={...u,...t.queryParameters,...P};if(h.value&&(p["x-algolia-agent"]=h.value),m&&m.queryParameters)for(let y of Object.keys(m.queryParameters))!m.queryParameters[y]||Object.prototype.toString.call(m.queryParameters[y])==="[object Object]"?p[y]=m.queryParameters[y]:p[y]=m.queryParameters[y].toString();let w=0,A=async(y,x)=>{let S=y.pop();if(S===void 0)throw new Z(pe(l));let I={...q,...m.timeouts},H={data:d,headers:g,method:t.method,url:te(S,t.path,p),connectTimeout:x(w,I.connect),responseTimeout:x(w,f?I.read:I.write)},b=O=>{let Q={request:H,response:O,host:S,triesLeft:y.length};return l.push(Q),Q},R=await T.send(H);if(me(R)){let O=b(R);return R.isTimedOut&&w++,console.log("Retryable failure",B(O)),await o.set(S,V(S,R.isTimedOut?"timed out":"down")),A(y,x)}if(ce(R))return ne(R);throw b(R),ie(R,l)},K=a.filter(y=>y.accept==="readWrite"||(f?y.accept==="read":y.accept==="write")),v=await s(K);return A([...v.hosts].reverse(),v.getTimeout)}function i(t,m={}){let f=t.useReadTransporter||t.method==="GET";if(!f)return n(t,m,f);let l=()=>n(t,m);if((m.cacheable||t.cacheable)!==!0)return l();let g={request:t,requestOptions:m,transporter:{queryParameters:u,headers:c}};return r.get(g,()=>e.get(g,()=>e.set(g,l()).then(P=>Promise.all([e.delete(g),P]),P=>Promise.all([e.delete(g),Promise.reject(P)])).then(([P,p])=>p)),{miss:P=>r.set(g,P)})}return{hostsCache:o,requester:T,timeouts:q,algoliaAgent:h,baseHeaders:c,baseQueryParameters:u,hosts:a,request:i,requestsCache:e,responsesCache:r}}function de(a){let o={value:`Algolia for JavaScript (${a})`,add(c){let u=`; ${c.segment}${c.version!==void 0?` (${c.version})`:""}`;return o.value.indexOf(u)===-1&&(o.value=`${o.value}${u}`),o}};return o}function j({algoliaAgents:a,client:o,version:c}){let u=de(c).add({segment:o,version:c});return a.forEach(h=>u.add(h)),u}var J=1e3,$=2e3,z=3e4;function F(){function a(o){return new Promise(c=>{let u=new XMLHttpRequest;u.open(o.method,o.url,!0),Object.keys(o.headers).forEach(e=>u.setRequestHeader(e,o.headers[e]));let h=(e,r)=>setTimeout(()=>{u.abort(),c({status:0,content:r,isTimedOut:!0})},e),q=h(o.connectTimeout,"Connection timeout"),T;u.onreadystatechange=()=>{u.readyState>u.OPENED&&T===void 0&&(clearTimeout(q),T=h(o.responseTimeout,"Socket timeout"))},u.onerror=()=>{u.status===0&&(clearTimeout(q),clearTimeout(T),c({content:u.responseText||"Network request failed",status:u.status,isTimedOut:!1}))},u.onload=()=>{clearTimeout(q),clearTimeout(T),c({content:u.responseText,status:u.status,isTimedOut:!1})},u.send(o.data)})}return{send:a}}var D="1.3.1",U=["eu","us"];function he(a){return[{url:"data.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}]}function fe(a){return a.type==="onDemand"}function le(a){return a.type==="schedule"}function Pe(a){return a.type==="subscription"}function X({appId:a,apiKey:o,authMode:c,algoliaAgents:u,region:h,...q}){let T=G(a,o,c);return{transporter:M({hosts:he(h),...q,algoliaAgent:j({algoliaAgents:u,client:"Ingestion",version:D}),baseHeaders:{"content-type":"text/plain",...T.headers(),...q.baseHeaders},baseQueryParameters:{...T.queryParameters(),...q.baseQueryParameters}}),appId:a,clearCache(){return Promise.all([this.transporter.requestsCache.clear(),this.transporter.responsesCache.clear()]).then(()=>{})},get _ua(){return this.transporter.algoliaAgent.value},addAlgoliaAgent(e,r){this.transporter.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!c||c==="WithinHeaders"?this.transporter.baseHeaders["x-algolia-api-key"]=e:this.transporter.baseQueryParameters["x-algolia-api-key"]=e},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");let t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");let t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");let t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");let t={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createTaskV1(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");let t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");let t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},customDelete({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let m={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return this.transporter.request(m,s)},customGet({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let m={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return this.transporter.request(m,s)},customPost({path:e,parameters:r,body:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return this.transporter.request(f,n)},customPut({path:e,parameters:r,body:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return this.transporter.request(f,n)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");let t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");let t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");let t={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},generateTransformationCode(e,r){if(!e)throw new Error("Parameter `generateTransformationCodePayload` is required when calling `generateTransformationCode`.");if(!e.id)throw new Error("Parameter `generateTransformationCodePayload.id` is required when calling `generateTransformationCode`.");if(!e.userPrompt)throw new Error("Parameter `generateTransformationCodePayload.userPrompt` is required when calling `generateTransformationCode`.");let t={method:"POST",path:"/1/transformations/models",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");let t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getEvent({runID:e,eventID:r},s){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");let m={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return this.transporter.request(m,s)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");let t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");let t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let t={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");let t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");let t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},listAuthentications({itemsPerPage:e,page:r,type:s,platform:n,sort:i,order:t}={},m=void 0){let f="/1/authentications",l={},d={};e!==void 0&&(d.itemsPerPage=e.toString()),r!==void 0&&(d.page=r.toString()),s!==void 0&&(d.type=s.toString()),n!==void 0&&(d.platform=n.toString()),i!==void 0&&(d.sort=i.toString()),t!==void 0&&(d.order=t.toString());let g={method:"GET",path:f,queryParameters:d,headers:l};return this.transporter.request(g,m)},listDestinations({itemsPerPage:e,page:r,type:s,authenticationID:n,sort:i,order:t}={},m=void 0){let f="/1/destinations",l={},d={};e!==void 0&&(d.itemsPerPage=e.toString()),r!==void 0&&(d.page=r.toString()),s!==void 0&&(d.type=s.toString()),n!==void 0&&(d.authenticationID=n.toString()),i!==void 0&&(d.sort=i.toString()),t!==void 0&&(d.order=t.toString());let g={method:"GET",path:f,queryParameters:d,headers:l};return this.transporter.request(g,m)},listEvents({runID:e,itemsPerPage:r,page:s,status:n,type:i,sort:t,order:m,startDate:f,endDate:l},d){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let g="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),P={},p={};r!==void 0&&(p.itemsPerPage=r.toString()),s!==void 0&&(p.page=s.toString()),n!==void 0&&(p.status=n.toString()),i!==void 0&&(p.type=i.toString()),t!==void 0&&(p.sort=t.toString()),m!==void 0&&(p.order=m.toString()),f!==void 0&&(p.startDate=f.toString()),l!==void 0&&(p.endDate=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listRuns({itemsPerPage:e,page:r,status:s,type:n,taskID:i,sort:t,order:m,startDate:f,endDate:l}={},d=void 0){let g="/1/runs",P={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.status=s.toString()),n!==void 0&&(p.type=n.toString()),i!==void 0&&(p.taskID=i.toString()),t!==void 0&&(p.sort=t.toString()),m!==void 0&&(p.order=m.toString()),f!==void 0&&(p.startDate=f.toString()),l!==void 0&&(p.endDate=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listSources({itemsPerPage:e,page:r,type:s,authenticationID:n,sort:i,order:t}={},m=void 0){let f="/1/sources",l={},d={};e!==void 0&&(d.itemsPerPage=e.toString()),r!==void 0&&(d.page=r.toString()),s!==void 0&&(d.type=s.toString()),n!==void 0&&(d.authenticationID=n.toString()),i!==void 0&&(d.sort=i.toString()),t!==void 0&&(d.order=t.toString());let g={method:"GET",path:f,queryParameters:d,headers:l};return this.transporter.request(g,m)},listTasks({itemsPerPage:e,page:r,action:s,enabled:n,sourceID:i,destinationID:t,triggerType:m,sort:f,order:l}={},d=void 0){let g="/2/tasks",P={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),n!==void 0&&(p.enabled=n.toString()),i!==void 0&&(p.sourceID=i.toString()),t!==void 0&&(p.destinationID=t.toString()),m!==void 0&&(p.triggerType=m.toString()),f!==void 0&&(p.sort=f.toString()),l!==void 0&&(p.order=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listTasksV1({itemsPerPage:e,page:r,action:s,enabled:n,sourceID:i,destinationID:t,triggerType:m,sort:f,order:l}={},d=void 0){let g="/1/tasks",P={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),n!==void 0&&(p.enabled=n.toString()),i!==void 0&&(p.sourceID=i.toString()),t!==void 0&&(p.destinationID=t.toString()),m!==void 0&&(p.triggerType=m.toString()),f!==void 0&&(p.sort=f.toString()),l!==void 0&&(p.order=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listTransformationModels(e){let i={method:"GET",path:"/1/transformations/models",queryParameters:{},headers:{}};return this.transporter.request(i,e)},listTransformations({itemsPerPage:e,page:r,sort:s,order:n}={},i=void 0){let t="/1/transformations",m={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),r!==void 0&&(f.page=r.toString()),s!==void 0&&(f.sort=s.toString()),n!==void 0&&(f.order=n.toString());let l={method:"GET",path:t,queryParameters:f,headers:m};return this.transporter.request(l,i)},pushTask({taskID:e,pushTaskPayload:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");let m={method:"POST",path:"/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},runSource({sourceID:e,runSourcePayload:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let m={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return this.transporter.request(m,s)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");let t={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},runTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");let t={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");let t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");let t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");let t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");let t={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchTasksV1(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");let t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");let t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");let t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!r.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");let m={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateAuthentication({authenticationID:e,authenticationUpdate:r},s){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");let m={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateDestination({destinationID:e,destinationUpdate:r},s){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");let m={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateSource({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");let m={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateTask({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");let m={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateTaskV1({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");let m={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateTransformation({transformationID:e,transformationCreate:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");let m={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},validateSource(e,r=void 0){let t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return this.transporter.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");let m={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)}}}function Ts(a,o,c,u){if(!a||typeof a!="string")throw new Error("`appId` is missing.");if(!o||typeof o!="string")throw new Error("`apiKey` is missing.");if(!c||c&&(typeof c!="string"||!U.includes(c)))throw new Error(`\`region\` is required and must be one of the following: ${U.join(", ")}`);return X({appId:a,apiKey:o,region:c,timeouts:{connect:J,read:$,write:z},requester:F(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:k(),requestsCache:k({serializable:!1}),hostsCache:E({caches:[N({key:`${D}-${a}`}),k()]}),...u})}export{D as apiClientVersion,Ts as ingestionClient,fe as isOnDemandTrigger,le as isScheduleTrigger,Pe as isSubscriptionTrigger};
function G(n,o,c="WithinHeaders"){let m={"x-algolia-api-key":o,"x-algolia-application-id":n};return{headers(){return c==="WithinHeaders"?m:{}},queryParameters(){return c==="WithinQueryParameters"?m:{}}}}function N(n){let o,c=`algolia-client-js-${n.key}`;function m(){return o===void 0&&(o=n.localStorage||window.localStorage),o}function l(){return JSON.parse(m().getItem(c)||"{}")}function g(i){m().setItem(c,JSON.stringify(i))}function T(){let i=n.timeToLive?n.timeToLive*1e3:null,e=l(),r=Object.fromEntries(Object.entries(e).filter(([,u])=>u.timestamp!==void 0));if(g(r),!i)return;let s=Object.fromEntries(Object.entries(r).filter(([,u])=>{let a=new Date().getTime();return!(u.timestamp+i<a)}));g(s)}return{get(i,e,r={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(T(),l()[JSON.stringify(i)])).then(s=>Promise.all([s?s.value:e(),s!==void 0])).then(([s,u])=>Promise.all([s,u||r.miss(s)])).then(([s])=>s)},set(i,e){return Promise.resolve().then(()=>{let r=l();return r[JSON.stringify(i)]={timestamp:new Date().getTime(),value:e},m().setItem(c,JSON.stringify(r)),e})},delete(i){return Promise.resolve().then(()=>{let e=l();delete e[JSON.stringify(i)],m().setItem(c,JSON.stringify(e))})},clear(){return Promise.resolve().then(()=>{m().removeItem(c)})}}}function Y(){return{get(n,o,c={miss:()=>Promise.resolve()}){return o().then(l=>Promise.all([l,c.miss(l)])).then(([l])=>l)},set(n,o){return Promise.resolve(o)},delete(n){return Promise.resolve()},clear(){return Promise.resolve()}}}function S(n){let o=[...n.caches],c=o.shift();return c===void 0?Y():{get(m,l,g={miss:()=>Promise.resolve()}){return c.get(m,l,g).catch(()=>S({caches:o}).get(m,l,g))},set(m,l){return c.set(m,l).catch(()=>S({caches:o}).set(m,l))},delete(m){return c.delete(m).catch(()=>S({caches:o}).delete(m))},clear(){return c.clear().catch(()=>S({caches:o}).clear())}}}function D(n={serializable:!0}){let o={};return{get(c,m,l={miss:()=>Promise.resolve()}){let g=JSON.stringify(c);if(g in o)return Promise.resolve(n.serializable?JSON.parse(o[g]):o[g]);let T=m();return T.then(i=>l.miss(i)).then(()=>T)},set(c,m){return o[JSON.stringify(c)]=n.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(c){return delete o[JSON.stringify(c)],Promise.resolve()},clear(){return o={},Promise.resolve()}}}var L=2*60*1e3;function V(n,o="up"){let c=Date.now();function m(){return o==="up"||Date.now()-c>L}function l(){return o==="timed out"&&Date.now()-c<=L}return{...n,status:o,lastUpdate:c,isUp:m,isTimedOut:l}}var _=class extends Error{name="AlgoliaError";constructor(n,o){super(n),o&&(this.name=o)}},W=class extends _{stackTrace;constructor(n,o,c){super(n,c),this.stackTrace=o}},Z=class extends W{constructor(n){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",n,"RetryError")}},U=class extends W{status;constructor(n,o,c,m="ApiError"){super(n,c,m),this.status=o}},ee=class extends _{response;constructor(n,o){super(n,"DeserializationError"),this.response=o}},re=class extends U{error;constructor(n,o,c,m){super(n,o,m,"DetailedApiError"),this.error=c}};function te(n,o,c){let m=se(c),l=`${n.protocol}://${n.url}${n.port?`:${n.port}`:""}/${o.charAt(0)==="/"?o.substring(1):o}`;return m.length&&(l+=`?${m}`),l}function se(n){return Object.keys(n).filter(o=>n[o]!==void 0).sort().map(o=>`${o}=${encodeURIComponent(Object.prototype.toString.call(n[o])==="[object Array]"?n[o].join(","):n[o]).replaceAll("+","%20")}`).join("&")}function oe(n,o){if(n.method==="GET"||n.data===void 0&&o.data===void 0)return;let c=Array.isArray(n.data)?n.data:{...n.data,...o.data};return JSON.stringify(c)}function ae(n,o,c){let m={Accept:"application/json",...n,...o,...c},l={};return Object.keys(m).forEach(g=>{let T=m[g];l[g.toLowerCase()]=T}),l}function ne(n){try{return JSON.parse(n.content)}catch(o){throw new ee(o.message,n)}}function ie({content:n,status:o},c){try{let m=JSON.parse(n);return"error"in m?new re(m.message,o,m.error,c):new U(m.message,o,c)}catch{}return new U(n,o,c)}function ue({isTimedOut:n,status:o}){return!n&&~~o===0}function me({isTimedOut:n,status:o}){return n||ue({isTimedOut:n,status:o})||~~(o/100)!==2&&~~(o/100)!==4}function ce({status:n}){return~~(n/100)===2}function de(n){return n.map(o=>B(o))}function B(n){let o=n.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...n,request:{...n.request,headers:{...n.request.headers,...o}}}}function M({hosts:n,hostsCache:o,baseHeaders:c,baseQueryParameters:m,algoliaAgent:l,timeouts:g,requester:T,requestsCache:i,responsesCache:e}){async function r(a){let t=await Promise.all(a.map(P=>o.get(P,()=>Promise.resolve(V(P))))),d=t.filter(P=>P.isUp()),f=t.filter(P=>P.isTimedOut()),q=[...d,...f];return{hosts:q.length>0?q:a,getTimeout(P,y){return(f.length===0&&P===0?1:f.length+3+P)*y}}}async function s(a,t,d=!0){let f=[],q=oe(a,t),h=ae(c,a.headers,t.headers),P=a.method==="GET"?{...a.data,...t.data}:{},y={...m,...a.queryParameters,...P};if(l.value&&(y["x-algolia-agent"]=l.value),t&&t.queryParameters)for(let w of Object.keys(t.queryParameters))!t.queryParameters[w]||Object.prototype.toString.call(t.queryParameters[w])==="[object Object]"?y[w]=t.queryParameters[w]:y[w]=t.queryParameters[w].toString();let p=0,R=async(w,I)=>{let k=w.pop();if(k===void 0)throw new Z(de(f));let O={...g,...t.timeouts},H={data:q,headers:h,method:a.method,url:te(k,a.path,y),connectTimeout:I(p,O.connect),responseTimeout:I(p,d?O.read:O.write)},b=C=>{let Q={request:H,response:C,host:k,triesLeft:w.length};return f.push(Q),Q},E=await T.send(H);if(me(E)){let C=b(E);return E.isTimedOut&&p++,console.log("Retryable failure",B(C)),await o.set(k,V(k,E.isTimedOut?"timed out":"down")),R(w,I)}if(ce(E))return ne(E);throw b(E),ie(E,f)},K=n.filter(w=>w.accept==="readWrite"||(d?w.accept==="read":w.accept==="write")),v=await r(K);return R([...v.hosts].reverse(),v.getTimeout)}function u(a,t={}){let d=a.useReadTransporter||a.method==="GET";if(!d)return s(a,t,d);let f=()=>s(a,t);if((t.cacheable||a.cacheable)!==!0)return f();let h={request:a,requestOptions:t,transporter:{queryParameters:m,headers:c}};return e.get(h,()=>i.get(h,()=>i.set(h,f()).then(P=>Promise.all([i.delete(h),P]),P=>Promise.all([i.delete(h),Promise.reject(P)])).then(([P,y])=>y)),{miss:P=>e.set(h,P)})}return{hostsCache:o,requester:T,timeouts:g,algoliaAgent:l,baseHeaders:c,baseQueryParameters:m,hosts:n,request:u,requestsCache:i,responsesCache:e}}function pe(n){let o={value:`Algolia for JavaScript (${n})`,add(c){let m=`; ${c.segment}${c.version!==void 0?` (${c.version})`:""}`;return o.value.indexOf(m)===-1&&(o.value=`${o.value}${m}`),o}};return o}function j({algoliaAgents:n,client:o,version:c}){let m=pe(c).add({segment:o,version:c});return n.forEach(l=>m.add(l)),m}var J=1e3,$=2e3,z=3e4;function F(){function n(o){return new Promise(c=>{let m=new XMLHttpRequest;m.open(o.method,o.url,!0),Object.keys(o.headers).forEach(i=>m.setRequestHeader(i,o.headers[i]));let l=(i,e)=>setTimeout(()=>{m.abort(),c({status:0,content:e,isTimedOut:!0})},i),g=l(o.connectTimeout,"Connection timeout"),T;m.onreadystatechange=()=>{m.readyState>m.OPENED&&T===void 0&&(clearTimeout(g),T=l(o.responseTimeout,"Socket timeout"))},m.onerror=()=>{m.status===0&&(clearTimeout(g),clearTimeout(T),c({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}))},m.onload=()=>{clearTimeout(g),clearTimeout(T),c({content:m.responseText,status:m.status,isTimedOut:!1})},m.send(o.data)})}return{send:n}}var x="1.3.2",A=["eu","us"];function he(n){return[{url:"data.{region}.algolia.com".replace("{region}",n),accept:"readWrite",protocol:"https"}]}function fe(n){return n.type==="onDemand"}function le(n){return n.type==="schedule"}function Pe(n){return n.type==="subscription"}function X({appId:n,apiKey:o,authMode:c,algoliaAgents:m,region:l,...g}){let T=G(n,o,c),i=M({hosts:he(l),...g,algoliaAgent:j({algoliaAgents:m,client:"Ingestion",version:x}),baseHeaders:{"content-type":"text/plain",...T.headers(),...g.baseHeaders},baseQueryParameters:{...T.queryParameters(),...g.baseQueryParameters}});return{transporter:i,appId:n,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r})},setClientApiKey({apiKey:e}){!c||c==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=e:i.baseQueryParameters["x-algolia-api-key"]=e},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");let t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(t,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");let t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(t,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");let t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");let t={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTaskV1(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");let t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");let t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.request(t,r)},customDelete({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let d={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(d,s)},customGet({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let d={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(d,s)},customPost({path:e,parameters:r,body:s},u){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return i.request(f,u)},customPut({path:e,parameters:r,body:s},u){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return i.request(f,u)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");let t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");let t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");let t={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},generateTransformationCode(e,r){if(!e)throw new Error("Parameter `generateTransformationCodePayload` is required when calling `generateTransformationCode`.");if(!e.id)throw new Error("Parameter `generateTransformationCodePayload.id` is required when calling `generateTransformationCode`.");if(!e.userPrompt)throw new Error("Parameter `generateTransformationCodePayload.userPrompt` is required when calling `generateTransformationCode`.");let t={method:"POST",path:"/1/transformations/models",queryParameters:{},headers:{},data:e};return i.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");let t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getEvent({runID:e,eventID:r},s){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");let d={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(d,s)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");let t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");let t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let t={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");let t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");let t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},listAuthentications({itemsPerPage:e,page:r,type:s,platform:u,sort:a,order:t}={},d=void 0){let f="/1/authentications",q={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.type=s.toString()),u!==void 0&&(h.platform=u.toString()),a!==void 0&&(h.sort=a.toString()),t!==void 0&&(h.order=t.toString());let P={method:"GET",path:f,queryParameters:h,headers:q};return i.request(P,d)},listDestinations({itemsPerPage:e,page:r,type:s,authenticationID:u,sort:a,order:t}={},d=void 0){let f="/1/destinations",q={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.type=s.toString()),u!==void 0&&(h.authenticationID=u.toString()),a!==void 0&&(h.sort=a.toString()),t!==void 0&&(h.order=t.toString());let P={method:"GET",path:f,queryParameters:h,headers:q};return i.request(P,d)},listEvents({runID:e,itemsPerPage:r,page:s,status:u,type:a,sort:t,order:d,startDate:f,endDate:q},h){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let P="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),y={},p={};r!==void 0&&(p.itemsPerPage=r.toString()),s!==void 0&&(p.page=s.toString()),u!==void 0&&(p.status=u.toString()),a!==void 0&&(p.type=a.toString()),t!==void 0&&(p.sort=t.toString()),d!==void 0&&(p.order=d.toString()),f!==void 0&&(p.startDate=f.toString()),q!==void 0&&(p.endDate=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listRuns({itemsPerPage:e,page:r,status:s,type:u,taskID:a,sort:t,order:d,startDate:f,endDate:q}={},h=void 0){let P="/1/runs",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.status=s.toString()),u!==void 0&&(p.type=u.toString()),a!==void 0&&(p.taskID=a.toString()),t!==void 0&&(p.sort=t.toString()),d!==void 0&&(p.order=d.toString()),f!==void 0&&(p.startDate=f.toString()),q!==void 0&&(p.endDate=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listSources({itemsPerPage:e,page:r,type:s,authenticationID:u,sort:a,order:t}={},d=void 0){let f="/1/sources",q={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.type=s.toString()),u!==void 0&&(h.authenticationID=u.toString()),a!==void 0&&(h.sort=a.toString()),t!==void 0&&(h.order=t.toString());let P={method:"GET",path:f,queryParameters:h,headers:q};return i.request(P,d)},listTasks({itemsPerPage:e,page:r,action:s,enabled:u,sourceID:a,destinationID:t,triggerType:d,sort:f,order:q}={},h=void 0){let P="/2/tasks",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),u!==void 0&&(p.enabled=u.toString()),a!==void 0&&(p.sourceID=a.toString()),t!==void 0&&(p.destinationID=t.toString()),d!==void 0&&(p.triggerType=d.toString()),f!==void 0&&(p.sort=f.toString()),q!==void 0&&(p.order=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listTasksV1({itemsPerPage:e,page:r,action:s,enabled:u,sourceID:a,destinationID:t,triggerType:d,sort:f,order:q}={},h=void 0){let P="/1/tasks",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),u!==void 0&&(p.enabled=u.toString()),a!==void 0&&(p.sourceID=a.toString()),t!==void 0&&(p.destinationID=t.toString()),d!==void 0&&(p.triggerType=d.toString()),f!==void 0&&(p.sort=f.toString()),q!==void 0&&(p.order=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listTransformationModels(e){let a={method:"GET",path:"/1/transformations/models",queryParameters:{},headers:{}};return i.request(a,e)},listTransformations({itemsPerPage:e,page:r,sort:s,order:u}={},a=void 0){let t="/1/transformations",d={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),r!==void 0&&(f.page=r.toString()),s!==void 0&&(f.sort=s.toString()),u!==void 0&&(f.order=u.toString());let q={method:"GET",path:t,queryParameters:f,headers:d};return i.request(q,a)},pushTask({taskID:e,pushTaskPayload:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");let d={method:"POST",path:"/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},runSource({sourceID:e,runSourcePayload:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let d={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return i.request(d,s)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");let t={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},runTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");let t={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");let t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");let t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");let t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");let t={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTasksV1(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");let t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");let t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");let t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.request(t,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!r.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");let d={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateAuthentication({authenticationID:e,authenticationUpdate:r},s){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");let d={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateDestination({destinationID:e,destinationUpdate:r},s){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");let d={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateSource({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");let d={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateTask({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");let d={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateTaskV1({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");let d={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateTransformation({transformationID:e,transformationCreate:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");let d={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},validateSource(e,r=void 0){let t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return i.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");let d={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)}}}function Ts(n,o,c,m){if(!n||typeof n!="string")throw new Error("`appId` is missing.");if(!o||typeof o!="string")throw new Error("`apiKey` is missing.");if(!c||c&&(typeof c!="string"||!A.includes(c)))throw new Error(`\`region\` is required and must be one of the following: ${A.join(", ")}`);return X({appId:n,apiKey:o,region:c,timeouts:{connect:J,read:$,write:z},requester:F(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:D(),requestsCache:D({serializable:!1}),hostsCache:S({caches:[N({key:`${x}-${n}`}),D()]}),...m})}export{x as apiClientVersion,Ts as ingestionClient,fe as isOnDemandTrigger,le as isScheduleTrigger,Pe as isSubscriptionTrigger};
//# sourceMappingURL=browser.min.js.map

@@ -7,5 +7,5 @@ (function (global, factory) {

function G(a,o,c="WithinHeaders"){let u={"x-algolia-api-key":o,"x-algolia-application-id":a};return {headers(){return c==="WithinHeaders"?u:{}},queryParameters(){return c==="WithinQueryParameters"?u:{}}}}function N(a){let o,c=`algolia-client-js-${a.key}`;function u(){return o===void 0&&(o=a.localStorage||window.localStorage),o}function h(){return JSON.parse(u().getItem(c)||"{}")}function q(e){u().setItem(c,JSON.stringify(e));}function T(){let e=a.timeToLive?a.timeToLive*1e3:null,r=h(),s=Object.fromEntries(Object.entries(r).filter(([,i])=>i.timestamp!==void 0));if(q(s),!e)return;let n=Object.fromEntries(Object.entries(s).filter(([,i])=>{let t=new Date().getTime();return !(i.timestamp+e<t)}));q(n);}return {get(e,r,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(T(),h()[JSON.stringify(e)])).then(n=>Promise.all([n?n.value:r(),n!==void 0])).then(([n,i])=>Promise.all([n,i||s.miss(n)])).then(([n])=>n)},set(e,r){return Promise.resolve().then(()=>{let s=h();return s[JSON.stringify(e)]={timestamp:new Date().getTime(),value:r},u().setItem(c,JSON.stringify(s)),r})},delete(e){return Promise.resolve().then(()=>{let r=h();delete r[JSON.stringify(e)],u().setItem(c,JSON.stringify(r));})},clear(){return Promise.resolve().then(()=>{u().removeItem(c);})}}}function Y(){return {get(a,o,c={miss:()=>Promise.resolve()}){return o().then(h=>Promise.all([h,c.miss(h)])).then(([h])=>h)},set(a,o){return Promise.resolve(o)},delete(a){return Promise.resolve()},clear(){return Promise.resolve()}}}function E(a){let o=[...a.caches],c=o.shift();return c===void 0?Y():{get(u,h,q={miss:()=>Promise.resolve()}){return c.get(u,h,q).catch(()=>E({caches:o}).get(u,h,q))},set(u,h){return c.set(u,h).catch(()=>E({caches:o}).set(u,h))},delete(u){return c.delete(u).catch(()=>E({caches:o}).delete(u))},clear(){return c.clear().catch(()=>E({caches:o}).clear())}}}function k(a={serializable:!0}){let o={};return {get(c,u,h={miss:()=>Promise.resolve()}){let q=JSON.stringify(c);if(q in o)return Promise.resolve(a.serializable?JSON.parse(o[q]):o[q]);let T=u();return T.then(e=>h.miss(e)).then(()=>T)},set(c,u){return o[JSON.stringify(c)]=a.serializable?JSON.stringify(u):u,Promise.resolve(u)},delete(c){return delete o[JSON.stringify(c)],Promise.resolve()},clear(){return o={},Promise.resolve()}}}var L=2*60*1e3;function V(a,o="up"){let c=Date.now();function u(){return o==="up"||Date.now()-c>L}function h(){return o==="timed out"&&Date.now()-c<=L}return {...a,status:o,lastUpdate:c,isUp:u,isTimedOut:h}}var _=class extends Error{name="AlgoliaError";constructor(a,o){super(a),o&&(this.name=o);}},W=class extends _{stackTrace;constructor(a,o,c){super(a,c),this.stackTrace=o;}},Z=class extends W{constructor(a){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",a,"RetryError");}},C=class extends W{status;constructor(a,o,c,u="ApiError"){super(a,c,u),this.status=o;}},ee=class extends _{response;constructor(a,o){super(a,"DeserializationError"),this.response=o;}},re=class extends C{error;constructor(a,o,c,u){super(a,o,u,"DetailedApiError"),this.error=c;}};function te(a,o,c){let u=se(c),h=`${a.protocol}://${a.url}${a.port?`:${a.port}`:""}/${o.charAt(0)==="/"?o.substring(1):o}`;return u.length&&(h+=`?${u}`),h}function se(a){return Object.keys(a).filter(o=>a[o]!==void 0).sort().map(o=>`${o}=${encodeURIComponent(Object.prototype.toString.call(a[o])==="[object Array]"?a[o].join(","):a[o]).replaceAll("+","%20")}`).join("&")}function oe(a,o){if(a.method==="GET"||a.data===void 0&&o.data===void 0)return;let c=Array.isArray(a.data)?a.data:{...a.data,...o.data};return JSON.stringify(c)}function ae(a,o,c){let u={Accept:"application/json",...a,...o,...c},h={};return Object.keys(u).forEach(q=>{let T=u[q];h[q.toLowerCase()]=T;}),h}function ne(a){try{return JSON.parse(a.content)}catch(o){throw new ee(o.message,a)}}function ie({content:a,status:o},c){try{let u=JSON.parse(a);return "error"in u?new re(u.message,o,u.error,c):new C(u.message,o,c)}catch{}return new C(a,o,c)}function ue({isTimedOut:a,status:o}){return !a&&~~o===0}function me({isTimedOut:a,status:o}){return a||ue({isTimedOut:a,status:o})||~~(o/100)!==2&&~~(o/100)!==4}function ce({status:a}){return ~~(a/100)===2}function pe(a){return a.map(o=>B(o))}function B(a){let o=a.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...a,request:{...a.request,headers:{...a.request.headers,...o}}}}function M({hosts:a,hostsCache:o,baseHeaders:c,baseQueryParameters:u,algoliaAgent:h,timeouts:q,requester:T,requestsCache:e,responsesCache:r}){async function s(t){let m=await Promise.all(t.map(P=>o.get(P,()=>Promise.resolve(V(P))))),f=m.filter(P=>P.isUp()),l=m.filter(P=>P.isTimedOut()),d=[...f,...l];return {hosts:d.length>0?d:t,getTimeout(P,p){return (l.length===0&&P===0?1:l.length+3+P)*p}}}async function n(t,m,f=!0){let l=[],d=oe(t,m),g=ae(c,t.headers,m.headers),P=t.method==="GET"?{...t.data,...m.data}:{},p={...u,...t.queryParameters,...P};if(h.value&&(p["x-algolia-agent"]=h.value),m&&m.queryParameters)for(let y of Object.keys(m.queryParameters))!m.queryParameters[y]||Object.prototype.toString.call(m.queryParameters[y])==="[object Object]"?p[y]=m.queryParameters[y]:p[y]=m.queryParameters[y].toString();let w=0,A=async(y,x)=>{let S=y.pop();if(S===void 0)throw new Z(pe(l));let I={...q,...m.timeouts},H={data:d,headers:g,method:t.method,url:te(S,t.path,p),connectTimeout:x(w,I.connect),responseTimeout:x(w,f?I.read:I.write)},b=O=>{let Q={request:H,response:O,host:S,triesLeft:y.length};return l.push(Q),Q},R=await T.send(H);if(me(R)){let O=b(R);return R.isTimedOut&&w++,console.log("Retryable failure",B(O)),await o.set(S,V(S,R.isTimedOut?"timed out":"down")),A(y,x)}if(ce(R))return ne(R);throw b(R),ie(R,l)},K=a.filter(y=>y.accept==="readWrite"||(f?y.accept==="read":y.accept==="write")),v=await s(K);return A([...v.hosts].reverse(),v.getTimeout)}function i(t,m={}){let f=t.useReadTransporter||t.method==="GET";if(!f)return n(t,m,f);let l=()=>n(t,m);if((m.cacheable||t.cacheable)!==!0)return l();let g={request:t,requestOptions:m,transporter:{queryParameters:u,headers:c}};return r.get(g,()=>e.get(g,()=>e.set(g,l()).then(P=>Promise.all([e.delete(g),P]),P=>Promise.all([e.delete(g),Promise.reject(P)])).then(([P,p])=>p)),{miss:P=>r.set(g,P)})}return {hostsCache:o,requester:T,timeouts:q,algoliaAgent:h,baseHeaders:c,baseQueryParameters:u,hosts:a,request:i,requestsCache:e,responsesCache:r}}function de(a){let o={value:`Algolia for JavaScript (${a})`,add(c){let u=`; ${c.segment}${c.version!==void 0?` (${c.version})`:""}`;return o.value.indexOf(u)===-1&&(o.value=`${o.value}${u}`),o}};return o}function j({algoliaAgents:a,client:o,version:c}){let u=de(c).add({segment:o,version:c});return a.forEach(h=>u.add(h)),u}var J=1e3,$=2e3,z=3e4;function F(){function a(o){return new Promise(c=>{let u=new XMLHttpRequest;u.open(o.method,o.url,!0),Object.keys(o.headers).forEach(e=>u.setRequestHeader(e,o.headers[e]));let h=(e,r)=>setTimeout(()=>{u.abort(),c({status:0,content:r,isTimedOut:!0});},e),q=h(o.connectTimeout,"Connection timeout"),T;u.onreadystatechange=()=>{u.readyState>u.OPENED&&T===void 0&&(clearTimeout(q),T=h(o.responseTimeout,"Socket timeout"));},u.onerror=()=>{u.status===0&&(clearTimeout(q),clearTimeout(T),c({content:u.responseText||"Network request failed",status:u.status,isTimedOut:!1}));},u.onload=()=>{clearTimeout(q),clearTimeout(T),c({content:u.responseText,status:u.status,isTimedOut:!1});},u.send(o.data);})}return {send:a}}var D="1.3.1",U=["eu","us"];function he(a){return [{url:"data.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}]}function fe(a){return a.type==="onDemand"}function le(a){return a.type==="schedule"}function Pe(a){return a.type==="subscription"}function X({appId:a,apiKey:o,authMode:c,algoliaAgents:u,region:h,...q}){let T=G(a,o,c);return {transporter:M({hosts:he(h),...q,algoliaAgent:j({algoliaAgents:u,client:"Ingestion",version:D}),baseHeaders:{"content-type":"text/plain",...T.headers(),...q.baseHeaders},baseQueryParameters:{...T.queryParameters(),...q.baseQueryParameters}}),appId:a,clearCache(){return Promise.all([this.transporter.requestsCache.clear(),this.transporter.responsesCache.clear()]).then(()=>{})},get _ua(){return this.transporter.algoliaAgent.value},addAlgoliaAgent(e,r){this.transporter.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!c||c==="WithinHeaders"?this.transporter.baseHeaders["x-algolia-api-key"]=e:this.transporter.baseQueryParameters["x-algolia-api-key"]=e;},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");let t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");let t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");let t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");let t={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createTaskV1(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");let t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");let t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},customDelete({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let m={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return this.transporter.request(m,s)},customGet({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let m={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return this.transporter.request(m,s)},customPost({path:e,parameters:r,body:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return this.transporter.request(f,n)},customPut({path:e,parameters:r,body:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return this.transporter.request(f,n)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");let t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");let t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");let t={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},generateTransformationCode(e,r){if(!e)throw new Error("Parameter `generateTransformationCodePayload` is required when calling `generateTransformationCode`.");if(!e.id)throw new Error("Parameter `generateTransformationCodePayload.id` is required when calling `generateTransformationCode`.");if(!e.userPrompt)throw new Error("Parameter `generateTransformationCodePayload.userPrompt` is required when calling `generateTransformationCode`.");let t={method:"POST",path:"/1/transformations/models",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");let t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getEvent({runID:e,eventID:r},s){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");let m={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return this.transporter.request(m,s)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");let t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");let t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let t={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");let t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");let t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},listAuthentications({itemsPerPage:e,page:r,type:s,platform:n,sort:i,order:t}={},m=void 0){let f="/1/authentications",l={},d={};e!==void 0&&(d.itemsPerPage=e.toString()),r!==void 0&&(d.page=r.toString()),s!==void 0&&(d.type=s.toString()),n!==void 0&&(d.platform=n.toString()),i!==void 0&&(d.sort=i.toString()),t!==void 0&&(d.order=t.toString());let g={method:"GET",path:f,queryParameters:d,headers:l};return this.transporter.request(g,m)},listDestinations({itemsPerPage:e,page:r,type:s,authenticationID:n,sort:i,order:t}={},m=void 0){let f="/1/destinations",l={},d={};e!==void 0&&(d.itemsPerPage=e.toString()),r!==void 0&&(d.page=r.toString()),s!==void 0&&(d.type=s.toString()),n!==void 0&&(d.authenticationID=n.toString()),i!==void 0&&(d.sort=i.toString()),t!==void 0&&(d.order=t.toString());let g={method:"GET",path:f,queryParameters:d,headers:l};return this.transporter.request(g,m)},listEvents({runID:e,itemsPerPage:r,page:s,status:n,type:i,sort:t,order:m,startDate:f,endDate:l},d){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let g="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),P={},p={};r!==void 0&&(p.itemsPerPage=r.toString()),s!==void 0&&(p.page=s.toString()),n!==void 0&&(p.status=n.toString()),i!==void 0&&(p.type=i.toString()),t!==void 0&&(p.sort=t.toString()),m!==void 0&&(p.order=m.toString()),f!==void 0&&(p.startDate=f.toString()),l!==void 0&&(p.endDate=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listRuns({itemsPerPage:e,page:r,status:s,type:n,taskID:i,sort:t,order:m,startDate:f,endDate:l}={},d=void 0){let g="/1/runs",P={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.status=s.toString()),n!==void 0&&(p.type=n.toString()),i!==void 0&&(p.taskID=i.toString()),t!==void 0&&(p.sort=t.toString()),m!==void 0&&(p.order=m.toString()),f!==void 0&&(p.startDate=f.toString()),l!==void 0&&(p.endDate=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listSources({itemsPerPage:e,page:r,type:s,authenticationID:n,sort:i,order:t}={},m=void 0){let f="/1/sources",l={},d={};e!==void 0&&(d.itemsPerPage=e.toString()),r!==void 0&&(d.page=r.toString()),s!==void 0&&(d.type=s.toString()),n!==void 0&&(d.authenticationID=n.toString()),i!==void 0&&(d.sort=i.toString()),t!==void 0&&(d.order=t.toString());let g={method:"GET",path:f,queryParameters:d,headers:l};return this.transporter.request(g,m)},listTasks({itemsPerPage:e,page:r,action:s,enabled:n,sourceID:i,destinationID:t,triggerType:m,sort:f,order:l}={},d=void 0){let g="/2/tasks",P={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),n!==void 0&&(p.enabled=n.toString()),i!==void 0&&(p.sourceID=i.toString()),t!==void 0&&(p.destinationID=t.toString()),m!==void 0&&(p.triggerType=m.toString()),f!==void 0&&(p.sort=f.toString()),l!==void 0&&(p.order=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listTasksV1({itemsPerPage:e,page:r,action:s,enabled:n,sourceID:i,destinationID:t,triggerType:m,sort:f,order:l}={},d=void 0){let g="/1/tasks",P={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),n!==void 0&&(p.enabled=n.toString()),i!==void 0&&(p.sourceID=i.toString()),t!==void 0&&(p.destinationID=t.toString()),m!==void 0&&(p.triggerType=m.toString()),f!==void 0&&(p.sort=f.toString()),l!==void 0&&(p.order=l.toString());let w={method:"GET",path:g,queryParameters:p,headers:P};return this.transporter.request(w,d)},listTransformationModels(e){let i={method:"GET",path:"/1/transformations/models",queryParameters:{},headers:{}};return this.transporter.request(i,e)},listTransformations({itemsPerPage:e,page:r,sort:s,order:n}={},i=void 0){let t="/1/transformations",m={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),r!==void 0&&(f.page=r.toString()),s!==void 0&&(f.sort=s.toString()),n!==void 0&&(f.order=n.toString());let l={method:"GET",path:t,queryParameters:f,headers:m};return this.transporter.request(l,i)},pushTask({taskID:e,pushTaskPayload:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");let m={method:"POST",path:"/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},runSource({sourceID:e,runSourcePayload:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let m={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return this.transporter.request(m,s)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");let t={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},runTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");let t={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");let t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");let t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");let t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");let t={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchTasksV1(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");let t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");let t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return this.transporter.request(t,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");let t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return this.transporter.request(t,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!r.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");let m={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateAuthentication({authenticationID:e,authenticationUpdate:r},s){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");let m={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateDestination({destinationID:e,destinationUpdate:r},s){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");let m={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateSource({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");let m={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateTask({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");let m={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateTaskV1({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");let m={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},updateTransformation({transformationID:e,transformationCreate:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");let m={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)},validateSource(e,r=void 0){let t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return this.transporter.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");let m={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return this.transporter.request(m,s)}}}function Ts(a,o,c,u){if(!a||typeof a!="string")throw new Error("`appId` is missing.");if(!o||typeof o!="string")throw new Error("`apiKey` is missing.");if(!c||c&&(typeof c!="string"||!U.includes(c)))throw new Error(`\`region\` is required and must be one of the following: ${U.join(", ")}`);return X({appId:a,apiKey:o,region:c,timeouts:{connect:J,read:$,write:z},requester:F(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:k(),requestsCache:k({serializable:!1}),hostsCache:E({caches:[N({key:`${D}-${a}`}),k()]}),...u})}
function G(n,o,c="WithinHeaders"){let m={"x-algolia-api-key":o,"x-algolia-application-id":n};return {headers(){return c==="WithinHeaders"?m:{}},queryParameters(){return c==="WithinQueryParameters"?m:{}}}}function N(n){let o,c=`algolia-client-js-${n.key}`;function m(){return o===void 0&&(o=n.localStorage||window.localStorage),o}function l(){return JSON.parse(m().getItem(c)||"{}")}function g(i){m().setItem(c,JSON.stringify(i));}function T(){let i=n.timeToLive?n.timeToLive*1e3:null,e=l(),r=Object.fromEntries(Object.entries(e).filter(([,u])=>u.timestamp!==void 0));if(g(r),!i)return;let s=Object.fromEntries(Object.entries(r).filter(([,u])=>{let a=new Date().getTime();return !(u.timestamp+i<a)}));g(s);}return {get(i,e,r={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(T(),l()[JSON.stringify(i)])).then(s=>Promise.all([s?s.value:e(),s!==void 0])).then(([s,u])=>Promise.all([s,u||r.miss(s)])).then(([s])=>s)},set(i,e){return Promise.resolve().then(()=>{let r=l();return r[JSON.stringify(i)]={timestamp:new Date().getTime(),value:e},m().setItem(c,JSON.stringify(r)),e})},delete(i){return Promise.resolve().then(()=>{let e=l();delete e[JSON.stringify(i)],m().setItem(c,JSON.stringify(e));})},clear(){return Promise.resolve().then(()=>{m().removeItem(c);})}}}function Y(){return {get(n,o,c={miss:()=>Promise.resolve()}){return o().then(l=>Promise.all([l,c.miss(l)])).then(([l])=>l)},set(n,o){return Promise.resolve(o)},delete(n){return Promise.resolve()},clear(){return Promise.resolve()}}}function S(n){let o=[...n.caches],c=o.shift();return c===void 0?Y():{get(m,l,g={miss:()=>Promise.resolve()}){return c.get(m,l,g).catch(()=>S({caches:o}).get(m,l,g))},set(m,l){return c.set(m,l).catch(()=>S({caches:o}).set(m,l))},delete(m){return c.delete(m).catch(()=>S({caches:o}).delete(m))},clear(){return c.clear().catch(()=>S({caches:o}).clear())}}}function D(n={serializable:!0}){let o={};return {get(c,m,l={miss:()=>Promise.resolve()}){let g=JSON.stringify(c);if(g in o)return Promise.resolve(n.serializable?JSON.parse(o[g]):o[g]);let T=m();return T.then(i=>l.miss(i)).then(()=>T)},set(c,m){return o[JSON.stringify(c)]=n.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(c){return delete o[JSON.stringify(c)],Promise.resolve()},clear(){return o={},Promise.resolve()}}}var L=2*60*1e3;function V(n,o="up"){let c=Date.now();function m(){return o==="up"||Date.now()-c>L}function l(){return o==="timed out"&&Date.now()-c<=L}return {...n,status:o,lastUpdate:c,isUp:m,isTimedOut:l}}var _=class extends Error{name="AlgoliaError";constructor(n,o){super(n),o&&(this.name=o);}},W=class extends _{stackTrace;constructor(n,o,c){super(n,c),this.stackTrace=o;}},Z=class extends W{constructor(n){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",n,"RetryError");}},U=class extends W{status;constructor(n,o,c,m="ApiError"){super(n,c,m),this.status=o;}},ee=class extends _{response;constructor(n,o){super(n,"DeserializationError"),this.response=o;}},re=class extends U{error;constructor(n,o,c,m){super(n,o,m,"DetailedApiError"),this.error=c;}};function te(n,o,c){let m=se(c),l=`${n.protocol}://${n.url}${n.port?`:${n.port}`:""}/${o.charAt(0)==="/"?o.substring(1):o}`;return m.length&&(l+=`?${m}`),l}function se(n){return Object.keys(n).filter(o=>n[o]!==void 0).sort().map(o=>`${o}=${encodeURIComponent(Object.prototype.toString.call(n[o])==="[object Array]"?n[o].join(","):n[o]).replaceAll("+","%20")}`).join("&")}function oe(n,o){if(n.method==="GET"||n.data===void 0&&o.data===void 0)return;let c=Array.isArray(n.data)?n.data:{...n.data,...o.data};return JSON.stringify(c)}function ae(n,o,c){let m={Accept:"application/json",...n,...o,...c},l={};return Object.keys(m).forEach(g=>{let T=m[g];l[g.toLowerCase()]=T;}),l}function ne(n){try{return JSON.parse(n.content)}catch(o){throw new ee(o.message,n)}}function ie({content:n,status:o},c){try{let m=JSON.parse(n);return "error"in m?new re(m.message,o,m.error,c):new U(m.message,o,c)}catch{}return new U(n,o,c)}function ue({isTimedOut:n,status:o}){return !n&&~~o===0}function me({isTimedOut:n,status:o}){return n||ue({isTimedOut:n,status:o})||~~(o/100)!==2&&~~(o/100)!==4}function ce({status:n}){return ~~(n/100)===2}function de(n){return n.map(o=>B(o))}function B(n){let o=n.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...n,request:{...n.request,headers:{...n.request.headers,...o}}}}function M({hosts:n,hostsCache:o,baseHeaders:c,baseQueryParameters:m,algoliaAgent:l,timeouts:g,requester:T,requestsCache:i,responsesCache:e}){async function r(a){let t=await Promise.all(a.map(P=>o.get(P,()=>Promise.resolve(V(P))))),d=t.filter(P=>P.isUp()),f=t.filter(P=>P.isTimedOut()),q=[...d,...f];return {hosts:q.length>0?q:a,getTimeout(P,y){return (f.length===0&&P===0?1:f.length+3+P)*y}}}async function s(a,t,d=!0){let f=[],q=oe(a,t),h=ae(c,a.headers,t.headers),P=a.method==="GET"?{...a.data,...t.data}:{},y={...m,...a.queryParameters,...P};if(l.value&&(y["x-algolia-agent"]=l.value),t&&t.queryParameters)for(let w of Object.keys(t.queryParameters))!t.queryParameters[w]||Object.prototype.toString.call(t.queryParameters[w])==="[object Object]"?y[w]=t.queryParameters[w]:y[w]=t.queryParameters[w].toString();let p=0,R=async(w,I)=>{let k=w.pop();if(k===void 0)throw new Z(de(f));let O={...g,...t.timeouts},H={data:q,headers:h,method:a.method,url:te(k,a.path,y),connectTimeout:I(p,O.connect),responseTimeout:I(p,d?O.read:O.write)},b=C=>{let Q={request:H,response:C,host:k,triesLeft:w.length};return f.push(Q),Q},E=await T.send(H);if(me(E)){let C=b(E);return E.isTimedOut&&p++,console.log("Retryable failure",B(C)),await o.set(k,V(k,E.isTimedOut?"timed out":"down")),R(w,I)}if(ce(E))return ne(E);throw b(E),ie(E,f)},K=n.filter(w=>w.accept==="readWrite"||(d?w.accept==="read":w.accept==="write")),v=await r(K);return R([...v.hosts].reverse(),v.getTimeout)}function u(a,t={}){let d=a.useReadTransporter||a.method==="GET";if(!d)return s(a,t,d);let f=()=>s(a,t);if((t.cacheable||a.cacheable)!==!0)return f();let h={request:a,requestOptions:t,transporter:{queryParameters:m,headers:c}};return e.get(h,()=>i.get(h,()=>i.set(h,f()).then(P=>Promise.all([i.delete(h),P]),P=>Promise.all([i.delete(h),Promise.reject(P)])).then(([P,y])=>y)),{miss:P=>e.set(h,P)})}return {hostsCache:o,requester:T,timeouts:g,algoliaAgent:l,baseHeaders:c,baseQueryParameters:m,hosts:n,request:u,requestsCache:i,responsesCache:e}}function pe(n){let o={value:`Algolia for JavaScript (${n})`,add(c){let m=`; ${c.segment}${c.version!==void 0?` (${c.version})`:""}`;return o.value.indexOf(m)===-1&&(o.value=`${o.value}${m}`),o}};return o}function j({algoliaAgents:n,client:o,version:c}){let m=pe(c).add({segment:o,version:c});return n.forEach(l=>m.add(l)),m}var J=1e3,$=2e3,z=3e4;function F(){function n(o){return new Promise(c=>{let m=new XMLHttpRequest;m.open(o.method,o.url,!0),Object.keys(o.headers).forEach(i=>m.setRequestHeader(i,o.headers[i]));let l=(i,e)=>setTimeout(()=>{m.abort(),c({status:0,content:e,isTimedOut:!0});},i),g=l(o.connectTimeout,"Connection timeout"),T;m.onreadystatechange=()=>{m.readyState>m.OPENED&&T===void 0&&(clearTimeout(g),T=l(o.responseTimeout,"Socket timeout"));},m.onerror=()=>{m.status===0&&(clearTimeout(g),clearTimeout(T),c({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}));},m.onload=()=>{clearTimeout(g),clearTimeout(T),c({content:m.responseText,status:m.status,isTimedOut:!1});},m.send(o.data);})}return {send:n}}var x="1.3.2",A=["eu","us"];function he(n){return [{url:"data.{region}.algolia.com".replace("{region}",n),accept:"readWrite",protocol:"https"}]}function fe(n){return n.type==="onDemand"}function le(n){return n.type==="schedule"}function Pe(n){return n.type==="subscription"}function X({appId:n,apiKey:o,authMode:c,algoliaAgents:m,region:l,...g}){let T=G(n,o,c),i=M({hosts:he(l),...g,algoliaAgent:j({algoliaAgents:m,client:"Ingestion",version:x}),baseHeaders:{"content-type":"text/plain",...T.headers(),...g.baseHeaders},baseQueryParameters:{...T.queryParameters(),...g.baseQueryParameters}});return {transporter:i,appId:n,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,r){i.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!c||c==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=e:i.baseQueryParameters["x-algolia-api-key"]=e;},createAuthentication(e,r){if(!e)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!e.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!e.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!e.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");let t={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(t,r)},createDestination(e,r){if(!e)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!e.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!e.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!e.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");let t={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(t,r)},createSource(e,r){if(!e)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!e.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!e.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");let t={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTask(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");let t={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTaskV1(e,r){if(!e)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!e.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!e.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!e.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!e.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");let t={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(t,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.code)throw new Error("Parameter `transformationCreate.code` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");let t={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.request(t,r)},customDelete({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let d={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(d,s)},customGet({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let d={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(d,s)},customPost({path:e,parameters:r,body:s},u){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let f={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return i.request(f,u)},customPut({path:e,parameters:r,body:s},u){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let f={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return i.request(f,u)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let t={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");let t={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");let t={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");let t={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let t={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let t={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");let t={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");let t={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},generateTransformationCode(e,r){if(!e)throw new Error("Parameter `generateTransformationCodePayload` is required when calling `generateTransformationCode`.");if(!e.id)throw new Error("Parameter `generateTransformationCodePayload.id` is required when calling `generateTransformationCode`.");if(!e.userPrompt)throw new Error("Parameter `generateTransformationCodePayload.userPrompt` is required when calling `generateTransformationCode`.");let t={method:"POST",path:"/1/transformations/models",queryParameters:{},headers:{},data:e};return i.request(t,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let t={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");let t={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getEvent({runID:e,eventID:r},s){if(!e)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!r)throw new Error("Parameter `eventID` is required when calling `getEvent`.");let d={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(d,s)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");let t={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");let t={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let t={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");let t={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");let t={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},listAuthentications({itemsPerPage:e,page:r,type:s,platform:u,sort:a,order:t}={},d=void 0){let f="/1/authentications",q={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.type=s.toString()),u!==void 0&&(h.platform=u.toString()),a!==void 0&&(h.sort=a.toString()),t!==void 0&&(h.order=t.toString());let P={method:"GET",path:f,queryParameters:h,headers:q};return i.request(P,d)},listDestinations({itemsPerPage:e,page:r,type:s,authenticationID:u,sort:a,order:t}={},d=void 0){let f="/1/destinations",q={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.type=s.toString()),u!==void 0&&(h.authenticationID=u.toString()),a!==void 0&&(h.sort=a.toString()),t!==void 0&&(h.order=t.toString());let P={method:"GET",path:f,queryParameters:h,headers:q};return i.request(P,d)},listEvents({runID:e,itemsPerPage:r,page:s,status:u,type:a,sort:t,order:d,startDate:f,endDate:q},h){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let P="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),y={},p={};r!==void 0&&(p.itemsPerPage=r.toString()),s!==void 0&&(p.page=s.toString()),u!==void 0&&(p.status=u.toString()),a!==void 0&&(p.type=a.toString()),t!==void 0&&(p.sort=t.toString()),d!==void 0&&(p.order=d.toString()),f!==void 0&&(p.startDate=f.toString()),q!==void 0&&(p.endDate=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listRuns({itemsPerPage:e,page:r,status:s,type:u,taskID:a,sort:t,order:d,startDate:f,endDate:q}={},h=void 0){let P="/1/runs",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.status=s.toString()),u!==void 0&&(p.type=u.toString()),a!==void 0&&(p.taskID=a.toString()),t!==void 0&&(p.sort=t.toString()),d!==void 0&&(p.order=d.toString()),f!==void 0&&(p.startDate=f.toString()),q!==void 0&&(p.endDate=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listSources({itemsPerPage:e,page:r,type:s,authenticationID:u,sort:a,order:t}={},d=void 0){let f="/1/sources",q={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.type=s.toString()),u!==void 0&&(h.authenticationID=u.toString()),a!==void 0&&(h.sort=a.toString()),t!==void 0&&(h.order=t.toString());let P={method:"GET",path:f,queryParameters:h,headers:q};return i.request(P,d)},listTasks({itemsPerPage:e,page:r,action:s,enabled:u,sourceID:a,destinationID:t,triggerType:d,sort:f,order:q}={},h=void 0){let P="/2/tasks",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),u!==void 0&&(p.enabled=u.toString()),a!==void 0&&(p.sourceID=a.toString()),t!==void 0&&(p.destinationID=t.toString()),d!==void 0&&(p.triggerType=d.toString()),f!==void 0&&(p.sort=f.toString()),q!==void 0&&(p.order=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listTasksV1({itemsPerPage:e,page:r,action:s,enabled:u,sourceID:a,destinationID:t,triggerType:d,sort:f,order:q}={},h=void 0){let P="/1/tasks",y={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),u!==void 0&&(p.enabled=u.toString()),a!==void 0&&(p.sourceID=a.toString()),t!==void 0&&(p.destinationID=t.toString()),d!==void 0&&(p.triggerType=d.toString()),f!==void 0&&(p.sort=f.toString()),q!==void 0&&(p.order=q.toString());let R={method:"GET",path:P,queryParameters:p,headers:y};return i.request(R,h)},listTransformationModels(e){let a={method:"GET",path:"/1/transformations/models",queryParameters:{},headers:{}};return i.request(a,e)},listTransformations({itemsPerPage:e,page:r,sort:s,order:u}={},a=void 0){let t="/1/transformations",d={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),r!==void 0&&(f.page=r.toString()),s!==void 0&&(f.sort=s.toString()),u!==void 0&&(f.order=u.toString());let q={method:"GET",path:t,queryParameters:f,headers:d};return i.request(q,a)},pushTask({taskID:e,pushTaskPayload:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");let d={method:"POST",path:"/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},runSource({sourceID:e,runSourcePayload:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let d={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return i.request(d,s)},runTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");let t={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},runTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");let t={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},searchAuthentications(e,r){if(!e)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!e.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");let t={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchDestinations(e,r){if(!e)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!e.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");let t={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchSources(e,r){if(!e)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!e.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");let t={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTasks(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");let t={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTasksV1(e,r){if(!e)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!e.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");let t={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},searchTransformations(e,r){if(!e)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!e.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");let t={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.request(t,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let t={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(t,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");let t={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.request(t,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!r.code)throw new Error("Parameter `transformationTry.code` is required when calling `tryTransformationBeforeUpdate`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");let d={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateAuthentication({authenticationID:e,authenticationUpdate:r},s){if(!e)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!r)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");let d={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateDestination({destinationID:e,destinationUpdate:r},s){if(!e)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!r)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");let d={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateSource({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");let d={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateTask({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");let d={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateTaskV1({taskID:e,taskUpdate:r},s){if(!e)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!r)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");let d={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},updateTransformation({transformationID:e,transformationCreate:r},s){if(!e)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!r)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!r.code)throw new Error("Parameter `transformationCreate.code` is required when calling `updateTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");let d={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)},validateSource(e,r=void 0){let t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return i.request(t,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!r)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");let d={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,s)}}}function Ts(n,o,c,m){if(!n||typeof n!="string")throw new Error("`appId` is missing.");if(!o||typeof o!="string")throw new Error("`apiKey` is missing.");if(!c||c&&(typeof c!="string"||!A.includes(c)))throw new Error(`\`region\` is required and must be one of the following: ${A.join(", ")}`);return X({appId:n,apiKey:o,region:c,timeouts:{connect:J,read:$,write:z},requester:F(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:D(),requestsCache:D({serializable:!1}),hostsCache:S({caches:[N({key:`${x}-${n}`}),D()]}),...m})}
exports.apiClientVersion = D;
exports.apiClientVersion = x;
exports.ingestionClient = Ts;

@@ -12,0 +12,0 @@ exports.isOnDemandTrigger = fe;

{
"version": "1.3.1",
"version": "1.3.2",
"repository": {

@@ -47,5 +47,5 @@ "type": "git",

"dependencies": {
"@algolia/client-common": "5.3.1",
"@algolia/requester-browser-xhr": "5.3.1",
"@algolia/requester-node-http": "5.3.1"
"@algolia/client-common": "5.3.2",
"@algolia/requester-browser-xhr": "5.3.2",
"@algolia/requester-node-http": "5.3.2"
},

@@ -52,0 +52,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc