@algolia/ingestion 1.17.1 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,10 +4,10 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/ingestion"] = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- function V(){function a(o){return new Promise(d=>{let m=new XMLHttpRequest;m.open(o.method,o.url,!0),Object.keys(o.headers).forEach(n=>m.setRequestHeader(n,o.headers[n]));let f=(n,e)=>setTimeout(()=>{m.abort(),d({status:0,content:e,isTimedOut:!0});},n),T=f(o.connectTimeout,"Connection timeout"),w;m.onreadystatechange=()=>{m.readyState>m.OPENED&&w===void 0&&(clearTimeout(T),w=f(o.responseTimeout,"Socket timeout"));},m.onerror=()=>{m.status===0&&(clearTimeout(T),clearTimeout(w),d({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}));},m.onload=()=>{clearTimeout(T),clearTimeout(w),d({content:m.responseText,status:m.status,isTimedOut:!1});},m.send(o.data);})}return {send:a}}function _(a){let o,d=`algolia-client-js-${a.key}`;function m(){return o===void 0&&(o=a.localStorage||window.localStorage),o}function f(){return JSON.parse(m().getItem(d)||"{}")}function T(n){m().setItem(d,JSON.stringify(n));}function w(){let n=a.timeToLive?a.timeToLive*1e3:null,e=f(),r=Object.fromEntries(Object.entries(e).filter(([,i])=>i.timestamp!==void 0));if(T(r),!n)return;let s=Object.fromEntries(Object.entries(r).filter(([,i])=>{let u=new Date().getTime();return !(i.timestamp+n<u)}));T(s);}return {get(n,e,r={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(w(),f()[JSON.stringify(n)])).then(s=>Promise.all([s?s.value:e(),s!==void 0])).then(([s,i])=>Promise.all([s,i||r.miss(s)])).then(([s])=>s)},set(n,e){return Promise.resolve().then(()=>{let r=f();return r[JSON.stringify(n)]={timestamp:new Date().getTime(),value:e},m().setItem(d,JSON.stringify(r)),e})},delete(n){return Promise.resolve().then(()=>{let e=f();delete e[JSON.stringify(n)],m().setItem(d,JSON.stringify(e));})},clear(){return Promise.resolve().then(()=>{m().removeItem(d);})}}}function K(){return {get(a,o,d={miss:()=>Promise.resolve()}){return o().then(f=>Promise.all([f,d.miss(f)])).then(([f])=>f)},set(a,o){return Promise.resolve(o)},delete(a){return Promise.resolve()},clear(){return Promise.resolve()}}}function S(a){let o=[...a.caches],d=o.shift();return d===void 0?K():{get(m,f,T={miss:()=>Promise.resolve()}){return d.get(m,f,T).catch(()=>S({caches:o}).get(m,f,T))},set(m,f){return d.set(m,f).catch(()=>S({caches:o}).set(m,f))},delete(m){return d.delete(m).catch(()=>S({caches:o}).delete(m))},clear(){return d.clear().catch(()=>S({caches:o}).clear())}}}function x(a={serializable:!0}){let o={};return {get(d,m,f={miss:()=>Promise.resolve()}){let T=JSON.stringify(d);if(T in o)return Promise.resolve(a.serializable?JSON.parse(o[T]):o[T]);let w=m();return w.then(n=>f.miss(n)).then(()=>w)},set(d,m){return o[JSON.stringify(d)]=a.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(d){return delete o[JSON.stringify(d)],Promise.resolve()},clear(){return o={},Promise.resolve()}}}function Y(a){let o={value:`Algolia for JavaScript (${a})`,add(d){let m=`; ${d.segment}${d.version!==void 0?` (${d.version})`:""}`;return o.value.indexOf(m)===-1&&(o.value=`${o.value}${m}`),o}};return o}function W(a,o,d="WithinHeaders"){let m={"x-algolia-api-key":o,"x-algolia-application-id":a};return {headers(){return d==="WithinHeaders"?m:{}},queryParameters(){return d==="WithinQueryParameters"?m:{}}}}function B({algoliaAgents:a,client:o,version:d}){let m=Y(d).add({segment:o,version:d});return a.forEach(f=>m.add(f)),m}function $(){return {debug(a,o){return Promise.resolve()},info(a,o){return Promise.resolve()},error(a,o){return Promise.resolve()}}}var G=2*60*1e3;function N(a,o="up"){let d=Date.now();function m(){return o==="up"||Date.now()-d>G}function f(){return o==="timed out"&&Date.now()-d<=G}return {...a,status:o,lastUpdate:d,isUp:m,isTimedOut:f}}var j=class extends Error{name="AlgoliaError";constructor(a,o){super(a),o&&(this.name=o);}},J=class extends j{stackTrace;constructor(a,o,d){super(a,d),this.stackTrace=o;}},Z=class extends J{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");}},A=class extends J{status;constructor(a,o,d,m="ApiError"){super(a,d,m),this.status=o;}},ee=class extends j{response;constructor(a,o){super(a,"DeserializationError"),this.response=o;}},re=class extends A{error;constructor(a,o,d,m){super(a,o,m,"DetailedApiError"),this.error=d;}};function te(a,o,d){let m=se(d),f=`${a.protocol}://${a.url}${a.port?`:${a.port}`:""}/${o.charAt(0)==="/"?o.substring(1):o}`;return m.length&&(f+=`?${m}`),f}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]).replace(/\+/g,"%20")}`).join("&")}function oe(a,o){if(a.method==="GET"||a.data===void 0&&o.data===void 0)return;let d=Array.isArray(a.data)?a.data:{...a.data,...o.data};return JSON.stringify(d)}function ae(a,o,d){let m={Accept:"application/json",...a,...o,...d},f={};return Object.keys(m).forEach(T=>{let w=m[T];f[T.toLowerCase()]=w;}),f}function ne(a){try{return JSON.parse(a.content)}catch(o){throw new ee(o.message,a)}}function ie({content:a,status:o},d){try{let m=JSON.parse(a);return "error"in m?new re(m.message,o,m.error,d):new A(m.message,o,d)}catch{}return new A(a,o,d)}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 de(a){return a.map(o=>z(o))}function z(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:d,logger:m,baseQueryParameters:f,algoliaAgent:T,timeouts:w,requester:n,requestsCache:e,responsesCache:r}){async function s(t){let c=await Promise.all(t.map(g=>o.get(g,()=>Promise.resolve(N(g))))),h=c.filter(g=>g.isUp()),P=c.filter(g=>g.isTimedOut()),l=[...h,...P];return {hosts:l.length>0?l:t,getTimeout(g,p){return (P.length===0&&g===0?1:P.length+3+g)*p}}}async function i(t,c,h=!0){let P=[],l=oe(t,c),q=ae(d,t.headers,c.headers),g=t.method==="GET"?{...t.data,...c.data}:{},p={...f,...t.queryParameters,...g};if(T.value&&(p["x-algolia-agent"]=T.value),c&&c.queryParameters)for(let R of Object.keys(c.queryParameters))!c.queryParameters[R]||Object.prototype.toString.call(c.queryParameters[R])==="[object Object]"?p[R]=c.queryParameters[R]:p[R]=c.queryParameters[R].toString();let y=0,D=async(R,O)=>{let k=R.pop();if(k===void 0)throw new Z(de(P));let C={...w,...c.timeouts},b={data:l,headers:q,method:t.method,url:te(k,t.path,p),connectTimeout:O(y,C.connect),responseTimeout:O(y,h?C.read:C.write)},Q=U=>{let L={request:b,response:U,host:k,triesLeft:R.length};return P.push(L),L},E=await n.send(b);if(me(E)){let U=Q(E);return E.isTimedOut&&y++,m.info("Retryable failure",z(U)),await o.set(k,N(k,E.isTimedOut?"timed out":"down")),D(R,O)}if(ce(E))return ne(E);throw Q(E),ie(E,P)},X=a.filter(R=>R.accept==="readWrite"||(h?R.accept==="read":R.accept==="write")),H=await s(X);return D([...H.hosts].reverse(),H.getTimeout)}function u(t,c={}){let h=t.useReadTransporter||t.method==="GET";if(!h)return i(t,c,h);let P=()=>i(t,c);if((c.cacheable||t.cacheable)!==!0)return P();let q={request:t,requestOptions:c,transporter:{queryParameters:f,headers:d}};return r.get(q,()=>e.get(q,()=>e.set(q,P()).then(g=>Promise.all([e.delete(q),g]),g=>Promise.all([e.delete(q),Promise.reject(g)])).then(([g,p])=>p)),{miss:g=>r.set(q,g)})}return {hostsCache:o,requester:n,timeouts:w,logger:m,algoliaAgent:T,baseHeaders:d,baseQueryParameters:f,hosts:a,request:u,requestsCache:e,responsesCache:r}}var I="1.17.1",v=["eu","us"];function pe(a){return [{url:"data.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}]}function he(a){return a.type==="onDemand"}function fe(a){return a.type==="schedule"}function le(a){return a.type==="subscription"}function F({appId:a,apiKey:o,authMode:d,algoliaAgents:m,region:f,...T}){let w=W(a,o,d),n=M({hosts:pe(f),...T,algoliaAgent:B({algoliaAgents:m,client:"Ingestion",version:I}),baseHeaders:{"content-type":"text/plain",...w.headers(),...T.baseHeaders},baseQueryParameters:{...w.queryParameters(),...T.baseQueryParameters}});return {transporter:n,appId:a,clearCache(){return Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then(()=>{})},get _ua(){return n.algoliaAgent.value},addAlgoliaAgent(e,r){n.algoliaAgent.add({segment:e,version:r});},setClientApiKey({apiKey:e}){!d||d==="WithinHeaders"?n.baseHeaders["x-algolia-api-key"]=e:n.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 n.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 n.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 n.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 n.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 n.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 n.request(t,r)},customDelete({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customDelete`.");let c={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return n.request(c,s)},customGet({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let c={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return n.request(c,s)},customPost({path:e,parameters:r,body:s},i){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return n.request(h,i)},customPut({path:e,parameters:r,body:s},i){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return n.request(h,i)},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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 c={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return n.request(c,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 n.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 n.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 n.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 n.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 n.request(t,r)},listAuthentications({itemsPerPage:e,page:r,type:s,platform:i,sort:u,order:t}={},c=void 0){let h="/1/authentications",P={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),r!==void 0&&(l.page=r.toString()),s!==void 0&&(l.type=s.toString()),i!==void 0&&(l.platform=i.toString()),u!==void 0&&(l.sort=u.toString()),t!==void 0&&(l.order=t.toString());let q={method:"GET",path:h,queryParameters:l,headers:P};return n.request(q,c)},listDestinations({itemsPerPage:e,page:r,type:s,authenticationID:i,transformationID:u,sort:t,order:c}={},h=void 0){let P="/1/destinations",l={},q={};e!==void 0&&(q.itemsPerPage=e.toString()),r!==void 0&&(q.page=r.toString()),s!==void 0&&(q.type=s.toString()),i!==void 0&&(q.authenticationID=i.toString()),u!==void 0&&(q.transformationID=u.toString()),t!==void 0&&(q.sort=t.toString()),c!==void 0&&(q.order=c.toString());let g={method:"GET",path:P,queryParameters:q,headers:l};return n.request(g,h)},listEvents({runID:e,itemsPerPage:r,page:s,status:i,type:u,sort:t,order:c,startDate:h,endDate:P},l){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let q="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),g={},p={};r!==void 0&&(p.itemsPerPage=r.toString()),s!==void 0&&(p.page=s.toString()),i!==void 0&&(p.status=i.toString()),u!==void 0&&(p.type=u.toString()),t!==void 0&&(p.sort=t.toString()),c!==void 0&&(p.order=c.toString()),h!==void 0&&(p.startDate=h.toString()),P!==void 0&&(p.endDate=P.toString());let y={method:"GET",path:q,queryParameters:p,headers:g};return n.request(y,l)},listRuns({itemsPerPage:e,page:r,status:s,type:i,taskID:u,sort:t,order:c,startDate:h,endDate:P}={},l=void 0){let q="/1/runs",g={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.status=s.toString()),i!==void 0&&(p.type=i.toString()),u!==void 0&&(p.taskID=u.toString()),t!==void 0&&(p.sort=t.toString()),c!==void 0&&(p.order=c.toString()),h!==void 0&&(p.startDate=h.toString()),P!==void 0&&(p.endDate=P.toString());let y={method:"GET",path:q,queryParameters:p,headers:g};return n.request(y,l)},listSources({itemsPerPage:e,page:r,type:s,authenticationID:i,sort:u,order:t}={},c=void 0){let h="/1/sources",P={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),r!==void 0&&(l.page=r.toString()),s!==void 0&&(l.type=s.toString()),i!==void 0&&(l.authenticationID=i.toString()),u!==void 0&&(l.sort=u.toString()),t!==void 0&&(l.order=t.toString());let q={method:"GET",path:h,queryParameters:l,headers:P};return n.request(q,c)},listTasks({itemsPerPage:e,page:r,action:s,enabled:i,sourceID:u,sourceType:t,destinationID:c,triggerType:h,sort:P,order:l}={},q=void 0){let g="/2/tasks",p={},y={};e!==void 0&&(y.itemsPerPage=e.toString()),r!==void 0&&(y.page=r.toString()),s!==void 0&&(y.action=s.toString()),i!==void 0&&(y.enabled=i.toString()),u!==void 0&&(y.sourceID=u.toString()),t!==void 0&&(y.sourceType=t.toString()),c!==void 0&&(y.destinationID=c.toString()),h!==void 0&&(y.triggerType=h.toString()),P!==void 0&&(y.sort=P.toString()),l!==void 0&&(y.order=l.toString());let D={method:"GET",path:g,queryParameters:y,headers:p};return n.request(D,q)},listTasksV1({itemsPerPage:e,page:r,action:s,enabled:i,sourceID:u,destinationID:t,triggerType:c,sort:h,order:P}={},l=void 0){let q="/1/tasks",g={},p={};e!==void 0&&(p.itemsPerPage=e.toString()),r!==void 0&&(p.page=r.toString()),s!==void 0&&(p.action=s.toString()),i!==void 0&&(p.enabled=i.toString()),u!==void 0&&(p.sourceID=u.toString()),t!==void 0&&(p.destinationID=t.toString()),c!==void 0&&(p.triggerType=c.toString()),h!==void 0&&(p.sort=h.toString()),P!==void 0&&(p.order=P.toString());let y={method:"GET",path:q,queryParameters:p,headers:g};return n.request(y,l)},listTransformations({itemsPerPage:e,page:r,sort:s,order:i}={},u=void 0){let t="/1/transformations",c={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.sort=s.toString()),i!==void 0&&(h.order=i.toString());let P={method:"GET",path:t,queryParameters:h,headers:c};return n.request(P,u)},pushTask({taskID:e,pushTaskPayload:r,watch:s},i){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 u="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),t={},c={};s!==void 0&&(c.watch=s.toString());let h={method:"POST",path:u,queryParameters:c,headers:t,data:r};return n.request(h,i)},runSource({sourceID:e,runSourcePayload:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let c={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return n.request(c,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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 n.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 c={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,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 c={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,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 c={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,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 c={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,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 c={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,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 c={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,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 c={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,s)},validateSource(e,r=void 0){let t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return n.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 c={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return n.request(c,s)}}}function hs(a,o,d,m){if(!a||typeof a!="string")throw new Error("`appId` is missing.");if(!o||typeof o!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!v.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${v.join(", ")}`);return F({appId:a,apiKey:o,region:d,timeouts:{connect:25e3,read:25e3,write:25e3},logger:$(),requester:V(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:x(),requestsCache:x({serializable:!1}),hostsCache:S({caches:[_({key:`${I}-${a}`}),x()]}),...m})}
7
+ function G(){function a(o){return new Promise(d=>{let m=new XMLHttpRequest;m.open(o.method,o.url,!0),Object.keys(o.headers).forEach(i=>m.setRequestHeader(i,o.headers[i]));let f=(i,e)=>setTimeout(()=>{m.abort(),d({status:0,content:e,isTimedOut:!0});},i),w=f(o.connectTimeout,"Connection timeout"),T;m.onreadystatechange=()=>{m.readyState>m.OPENED&&T===void 0&&(clearTimeout(w),T=f(o.responseTimeout,"Socket timeout"));},m.onerror=()=>{m.status===0&&(clearTimeout(w),clearTimeout(T),d({content:m.responseText||"Network request failed",status:m.status,isTimedOut:!1}));},m.onload=()=>{clearTimeout(w),clearTimeout(T),d({content:m.responseText,status:m.status,isTimedOut:!1});},m.send(o.data);})}return {send:a}}function W(a){let o,d=`algolia-client-js-${a.key}`;function m(){return o===void 0&&(o=a.localStorage||window.localStorage),o}function f(){return JSON.parse(m().getItem(d)||"{}")}function w(i){m().setItem(d,JSON.stringify(i));}function T(){let i=a.timeToLive?a.timeToLive*1e3:null,e=f(),r=Object.fromEntries(Object.entries(e).filter(([,n])=>n.timestamp!==void 0));if(w(r),!i)return;let s=Object.fromEntries(Object.entries(r).filter(([,n])=>{let u=new Date().getTime();return !(n.timestamp+i<u)}));w(s);}return {get(i,e,r={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(T(),f()[JSON.stringify(i)])).then(s=>Promise.all([s?s.value:e(),s!==void 0])).then(([s,n])=>Promise.all([s,n||r.miss(s)])).then(([s])=>s)},set(i,e){return Promise.resolve().then(()=>{let r=f();return r[JSON.stringify(i)]={timestamp:new Date().getTime(),value:e},m().setItem(d,JSON.stringify(r)),e})},delete(i){return Promise.resolve().then(()=>{let e=f();delete e[JSON.stringify(i)],m().setItem(d,JSON.stringify(e));})},clear(){return Promise.resolve().then(()=>{m().removeItem(d);})}}}function K(){return {get(a,o,d={miss:()=>Promise.resolve()}){return o().then(f=>Promise.all([f,d.miss(f)])).then(([f])=>f)},set(a,o){return Promise.resolve(o)},delete(a){return Promise.resolve()},clear(){return Promise.resolve()}}}function k(a){let o=[...a.caches],d=o.shift();return d===void 0?K():{get(m,f,w={miss:()=>Promise.resolve()}){return d.get(m,f,w).catch(()=>k({caches:o}).get(m,f,w))},set(m,f){return d.set(m,f).catch(()=>k({caches:o}).set(m,f))},delete(m){return d.delete(m).catch(()=>k({caches:o}).delete(m))},clear(){return d.clear().catch(()=>k({caches:o}).clear())}}}function x(a={serializable:!0}){let o={};return {get(d,m,f={miss:()=>Promise.resolve()}){let w=JSON.stringify(d);if(w in o)return Promise.resolve(a.serializable?JSON.parse(o[w]):o[w]);let T=m();return T.then(i=>f.miss(i)).then(()=>T)},set(d,m){return o[JSON.stringify(d)]=a.serializable?JSON.stringify(m):m,Promise.resolve(m)},delete(d){return delete o[JSON.stringify(d)],Promise.resolve()},clear(){return o={},Promise.resolve()}}}function Y(a){let o={value:`Algolia for JavaScript (${a})`,add(d){let m=`; ${d.segment}${d.version!==void 0?` (${d.version})`:""}`;return o.value.indexOf(m)===-1&&(o.value=`${o.value}${m}`),o}};return o}function B(a,o,d="WithinHeaders"){let m={"x-algolia-api-key":o,"x-algolia-application-id":a};return {headers(){return d==="WithinHeaders"?m:{}},queryParameters(){return d==="WithinQueryParameters"?m:{}}}}function $({algoliaAgents:a,client:o,version:d}){let m=Y(d).add({segment:o,version:d});return a.forEach(f=>m.add(f)),m}function j(){return {debug(a,o){return Promise.resolve()},info(a,o){return Promise.resolve()},error(a,o){return Promise.resolve()}}}var N=2*60*1e3;function _(a,o="up"){let d=Date.now();function m(){return o==="up"||Date.now()-d>N}function f(){return o==="timed out"&&Date.now()-d<=N}return {...a,status:o,lastUpdate:d,isUp:m,isTimedOut:f}}var J=class extends Error{name="AlgoliaError";constructor(a,o){super(a),o&&(this.name=o);}},z=class extends J{stackTrace;constructor(a,o,d){super(a,d),this.stackTrace=o;}},Z=class extends z{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");}},v=class extends z{status;constructor(a,o,d,m="ApiError"){super(a,d,m),this.status=o;}},ee=class extends J{response;constructor(a,o){super(a,"DeserializationError"),this.response=o;}},re=class extends v{error;constructor(a,o,d,m){super(a,o,m,"DetailedApiError"),this.error=d;}};function te(a,o,d){let m=se(d),f=`${a.protocol}://${a.url}${a.port?`:${a.port}`:""}/${o.charAt(0)==="/"?o.substring(1):o}`;return m.length&&(f+=`?${m}`),f}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]).replace(/\+/g,"%20")}`).join("&")}function oe(a,o){if(a.method==="GET"||a.data===void 0&&o.data===void 0)return;let d=Array.isArray(a.data)?a.data:{...a.data,...o.data};return JSON.stringify(d)}function ae(a,o,d){let m={Accept:"application/json",...a,...o,...d},f={};return Object.keys(m).forEach(w=>{let T=m[w];f[w.toLowerCase()]=T;}),f}function ne(a){try{return JSON.parse(a.content)}catch(o){throw new ee(o.message,a)}}function ie({content:a,status:o},d){try{let m=JSON.parse(a);return "error"in m?new re(m.message,o,m.error,d):new v(m.message,o,d)}catch{}return new v(a,o,d)}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 de(a){return a.map(o=>M(o))}function M(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 F({hosts:a,hostsCache:o,baseHeaders:d,logger:m,baseQueryParameters:f,algoliaAgent:w,timeouts:T,requester:i,requestsCache:e,responsesCache:r}){async function s(t){let c=await Promise.all(t.map(g=>o.get(g,()=>Promise.resolve(_(g))))),h=c.filter(g=>g.isUp()),q=c.filter(g=>g.isTimedOut()),l=[...h,...q];return {hosts:l.length>0?l:t,getTimeout(g,p){return (q.length===0&&g===0?1:q.length+3+g)*p}}}async function n(t,c,h=!0){let q=[],l=oe(t,c),P=ae(d,t.headers,c.headers),g=t.method==="GET"?{...t.data,...c.data}:{},p={...f,...t.queryParameters,...g};if(w.value&&(p["x-algolia-agent"]=w.value),c&&c.queryParameters)for(let R of Object.keys(c.queryParameters))!c.queryParameters[R]||Object.prototype.toString.call(c.queryParameters[R])==="[object Object]"?p[R]=c.queryParameters[R]:p[R]=c.queryParameters[R].toString();let E=0,y=async(R,C)=>{let D=R.pop();if(D===void 0)throw new Z(de(q));let U={...T,...c.timeouts},Q={data:l,headers:P,method:t.method,url:te(D,t.path,p),connectTimeout:C(E,U.connect),responseTimeout:C(E,h?U.read:U.write)},L=A=>{let V={request:Q,response:A,host:D,triesLeft:R.length};return q.push(V),V},S=await i.send(Q);if(me(S)){let A=L(S);return S.isTimedOut&&E++,m.info("Retryable failure",M(A)),await o.set(D,_(D,S.isTimedOut?"timed out":"down")),y(R,C)}if(ce(S))return ne(S);throw L(S),ie(S,q)},O=a.filter(R=>R.accept==="readWrite"||(h?R.accept==="read":R.accept==="write")),b=await s(O);return y([...b.hosts].reverse(),b.getTimeout)}function u(t,c={}){let h=t.useReadTransporter||t.method==="GET";if(!h)return n(t,c,h);let q=()=>n(t,c);if((c.cacheable||t.cacheable)!==!0)return q();let P={request:t,requestOptions:c,transporter:{queryParameters:f,headers:d}};return r.get(P,()=>e.get(P,()=>e.set(P,q()).then(g=>Promise.all([e.delete(P),g]),g=>Promise.all([e.delete(P),Promise.reject(g)])).then(([g,p])=>p)),{miss:g=>r.set(P,g)})}return {hostsCache:o,requester:i,timeouts:T,logger:m,algoliaAgent:w,baseHeaders:d,baseQueryParameters:f,hosts:a,request:u,requestsCache:e,responsesCache:r}}var I="1.19.0",H=["eu","us"];function pe(a){return [{url:"data.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}]}function he(a){return a.type==="onDemand"}function fe(a){return a.type==="schedule"}function le(a){return a.type==="subscription"}function X({appId:a,apiKey:o,authMode:d,algoliaAgents:m,region:f,...w}){let T=B(a,o,d),i=F({hosts:pe(f),...w,algoliaAgent:$({algoliaAgents:m,client:"Ingestion",version:I}),baseHeaders:{"content-type":"text/plain",...T.headers(),...w.baseHeaders},baseQueryParameters:{...T.queryParameters(),...w.baseQueryParameters}});return {transporter:i,appId:a,apiKey:o,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}){!d||d==="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 c={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(c,s)},customGet({path:e,parameters:r},s){if(!e)throw new Error("Parameter `path` is required when calling `customGet`.");let c={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return i.request(c,s)},customPost({path:e,parameters:r,body:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let h={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return i.request(h,n)},customPut({path:e,parameters:r,body:s},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let h={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:s||{}};return i.request(h,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 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)},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 c={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(c,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:n,sort:u,order:t}={},c=void 0){let h="/1/authentications",q={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),r!==void 0&&(l.page=r.toString()),s!==void 0&&(l.type=s.toString()),n!==void 0&&(l.platform=n.toString()),u!==void 0&&(l.sort=u.toString()),t!==void 0&&(l.order=t.toString());let P={method:"GET",path:h,queryParameters:l,headers:q};return i.request(P,c)},listDestinations({itemsPerPage:e,page:r,type:s,authenticationID:n,transformationID:u,sort:t,order:c}={},h=void 0){let q="/1/destinations",l={},P={};e!==void 0&&(P.itemsPerPage=e.toString()),r!==void 0&&(P.page=r.toString()),s!==void 0&&(P.type=s.toString()),n!==void 0&&(P.authenticationID=n.toString()),u!==void 0&&(P.transformationID=u.toString()),t!==void 0&&(P.sort=t.toString()),c!==void 0&&(P.order=c.toString());let g={method:"GET",path:q,queryParameters:P,headers:l};return i.request(g,h)},listEvents({runID:e,itemsPerPage:r,page:s,status:n,type:u,sort:t,order:c,startDate:h,endDate:q},l){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let P="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),g={},p={};r!==void 0&&(p.itemsPerPage=r.toString()),s!==void 0&&(p.page=s.toString()),n!==void 0&&(p.status=n.toString()),u!==void 0&&(p.type=u.toString()),t!==void 0&&(p.sort=t.toString()),c!==void 0&&(p.order=c.toString()),h!==void 0&&(p.startDate=h.toString()),q!==void 0&&(p.endDate=q.toString());let E={method:"GET",path:P,queryParameters:p,headers:g};return i.request(E,l)},listRuns({itemsPerPage:e,page:r,status:s,type:n,taskID:u,sort:t,order:c,startDate:h,endDate:q}={},l=void 0){let P="/1/runs",g={},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()),u!==void 0&&(p.taskID=u.toString()),t!==void 0&&(p.sort=t.toString()),c!==void 0&&(p.order=c.toString()),h!==void 0&&(p.startDate=h.toString()),q!==void 0&&(p.endDate=q.toString());let E={method:"GET",path:P,queryParameters:p,headers:g};return i.request(E,l)},listSources({itemsPerPage:e,page:r,type:s,authenticationID:n,sort:u,order:t}={},c=void 0){let h="/1/sources",q={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),r!==void 0&&(l.page=r.toString()),s!==void 0&&(l.type=s.toString()),n!==void 0&&(l.authenticationID=n.toString()),u!==void 0&&(l.sort=u.toString()),t!==void 0&&(l.order=t.toString());let P={method:"GET",path:h,queryParameters:l,headers:q};return i.request(P,c)},listTasks({itemsPerPage:e,page:r,action:s,enabled:n,sourceID:u,sourceType:t,destinationID:c,triggerType:h,withEmailNotifications:q,sort:l,order:P}={},g=void 0){let p="/2/tasks",E={},y={};e!==void 0&&(y.itemsPerPage=e.toString()),r!==void 0&&(y.page=r.toString()),s!==void 0&&(y.action=s.toString()),n!==void 0&&(y.enabled=n.toString()),u!==void 0&&(y.sourceID=u.toString()),t!==void 0&&(y.sourceType=t.toString()),c!==void 0&&(y.destinationID=c.toString()),h!==void 0&&(y.triggerType=h.toString()),q!==void 0&&(y.withEmailNotifications=q.toString()),l!==void 0&&(y.sort=l.toString()),P!==void 0&&(y.order=P.toString());let O={method:"GET",path:p,queryParameters:y,headers:E};return i.request(O,g)},listTasksV1({itemsPerPage:e,page:r,action:s,enabled:n,sourceID:u,destinationID:t,triggerType:c,sort:h,order:q}={},l=void 0){let P="/1/tasks",g={},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()),u!==void 0&&(p.sourceID=u.toString()),t!==void 0&&(p.destinationID=t.toString()),c!==void 0&&(p.triggerType=c.toString()),h!==void 0&&(p.sort=h.toString()),q!==void 0&&(p.order=q.toString());let E={method:"GET",path:P,queryParameters:p,headers:g};return i.request(E,l)},listTransformations({itemsPerPage:e,page:r,sort:s,order:n}={},u=void 0){let t="/1/transformations",c={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),s!==void 0&&(h.sort=s.toString()),n!==void 0&&(h.order=n.toString());let q={method:"GET",path:t,queryParameters:h,headers:c};return i.request(q,u)},pushTask({taskID:e,pushTaskPayload:r,watch:s},n){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 u="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),t={},c={};s!==void 0&&(c.watch=s.toString());let h={method:"POST",path:u,queryParameters:c,headers:t,data:r};return n={timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},i.request(h,n)},runSource({sourceID:e,runSourcePayload:r},s){if(!e)throw new Error("Parameter `sourceID` is required when calling `runSource`.");let c={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return i.request(c,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 r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},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 c={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(c,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 c={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(c,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 c={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(c,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 c={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(c,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 c={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(c,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 c={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(c,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 c={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(c,s)},validateSource(e,r=void 0){let t={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},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 c={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return s={timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},i.request(c,s)}}}function Ps(a,o,d,m){if(!a||typeof a!="string")throw new Error("`appId` is missing.");if(!o||typeof o!="string")throw new Error("`apiKey` is missing.");if(!d||d&&(typeof d!="string"||!H.includes(d)))throw new Error(`\`region\` is required and must be one of the following: ${H.join(", ")}`);return X({appId:a,apiKey:o,region:d,timeouts:{connect:25e3,read:25e3,write:25e3},logger:j(),requester:G(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:x(),requestsCache:x({serializable:!1}),hostsCache:k({caches:[W({key:`${I}-${a}`}),x()]}),...m})}
8
8
 
9
9
  exports.apiClientVersion = I;
10
- exports.ingestionClient = hs;
10
+ exports.ingestionClient = Ps;
11
11
  exports.isOnDemandTrigger = he;
12
12
  exports.isScheduleTrigger = fe;
13
13
  exports.isSubscriptionTrigger = le;
@@ -4,7 +4,7 @@ import { createFetchRequester } from "@algolia/requester-fetch";
4
4
 
5
5
  // src/ingestionClient.ts
6
6
  import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common";
7
- var apiClientVersion = "1.17.1";
7
+ var apiClientVersion = "1.19.0";
8
8
  var REGIONS = ["eu", "us"];
9
9
  function getDefaultHosts(region) {
10
10
  const url = "data.{region}.algolia.com".replace("{region}", region);
@@ -52,6 +52,10 @@ function createIngestionClient({
52
52
  * The `appId` currently in use.
53
53
  */
54
54
  appId: appIdOption,
55
+ /**
56
+ * The `apiKey` currently in use.
57
+ */
58
+ apiKey: apiKeyOption,
55
59
  /**
56
60
  * Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
57
61
  */
@@ -1119,6 +1123,7 @@ function createIngestionClient({
1119
1123
  * @param listTasks.sourceType - Filters the tasks with the specified source type.
1120
1124
  * @param listTasks.destinationID - Destination IDs for filtering the list of tasks.
1121
1125
  * @param listTasks.triggerType - Type of task trigger for filtering the list of tasks.
1126
+ * @param listTasks.withEmailNotifications - If specified, the response only includes tasks with notifications.email.enabled set to this value.
1122
1127
  * @param listTasks.sort - Property by which to sort the list of tasks.
1123
1128
  * @param listTasks.order - Sort order of the response, ascending or descending.
1124
1129
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -1132,6 +1137,7 @@ function createIngestionClient({
1132
1137
  sourceType,
1133
1138
  destinationID,
1134
1139
  triggerType,
1140
+ withEmailNotifications,
1135
1141
  sort,
1136
1142
  order
1137
1143
  } = {}, requestOptions = void 0) {
@@ -1162,6 +1168,9 @@ function createIngestionClient({
1162
1168
  if (triggerType !== void 0) {
1163
1169
  queryParameters["triggerType"] = triggerType.toString();
1164
1170
  }
1171
+ if (withEmailNotifications !== void 0) {
1172
+ queryParameters["withEmailNotifications"] = withEmailNotifications.toString();
1173
+ }
1165
1174
  if (sort !== void 0) {
1166
1175
  queryParameters["sort"] = sort.toString();
1167
1176
  }
@@ -1311,6 +1320,14 @@ function createIngestionClient({
1311
1320
  headers,
1312
1321
  data: pushTaskPayload
1313
1322
  };
1323
+ requestOptions = {
1324
+ timeouts: {
1325
+ connect: 18e4,
1326
+ read: 18e4,
1327
+ write: 18e4,
1328
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1329
+ }
1330
+ };
1314
1331
  return transporter.request(request, requestOptions);
1315
1332
  },
1316
1333
  /**
@@ -1572,7 +1589,7 @@ function createIngestionClient({
1572
1589
  return transporter.request(request, requestOptions);
1573
1590
  },
1574
1591
  /**
1575
- * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: singer`.
1592
+ * Triggers a stream-listing request for a source. Triggering stream-listing requests only works with sources with `type: docker` and `imageType: airbyte`.
1576
1593
  *
1577
1594
  * Required API Key ACLs:
1578
1595
  * - addObject
@@ -1595,6 +1612,14 @@ function createIngestionClient({
1595
1612
  queryParameters,
1596
1613
  headers
1597
1614
  };
1615
+ requestOptions = {
1616
+ timeouts: {
1617
+ connect: 18e4,
1618
+ read: 18e4,
1619
+ write: 18e4,
1620
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1621
+ }
1622
+ };
1598
1623
  return transporter.request(request, requestOptions);
1599
1624
  },
1600
1625
  /**
@@ -1878,6 +1903,14 @@ function createIngestionClient({
1878
1903
  headers,
1879
1904
  data: sourceCreate ? sourceCreate : {}
1880
1905
  };
1906
+ requestOptions = {
1907
+ timeouts: {
1908
+ connect: 18e4,
1909
+ read: 18e4,
1910
+ write: 18e4,
1911
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1912
+ }
1913
+ };
1881
1914
  return transporter.request(request, requestOptions);
1882
1915
  },
1883
1916
  /**
@@ -1909,6 +1942,14 @@ function createIngestionClient({
1909
1942
  headers,
1910
1943
  data: sourceUpdate
1911
1944
  };
1945
+ requestOptions = {
1946
+ timeouts: {
1947
+ connect: 18e4,
1948
+ read: 18e4,
1949
+ write: 18e4,
1950
+ ...requestOptions == null ? void 0 : requestOptions.timeouts
1951
+ }
1952
+ };
1912
1953
  return transporter.request(request, requestOptions);
1913
1954
  }
1914
1955
  };
@@ -1936,8 +1977,8 @@ function ingestionClient(appId, apiKey, region, options) {
1936
1977
  write: 25e3
1937
1978
  },
1938
1979
  logger: createNullLogger(),
1939
- algoliaAgents: [{ segment: "Fetch" }],
1940
1980
  requester: createFetchRequester(),
1981
+ algoliaAgents: [{ segment: "Fetch" }],
1941
1982
  responsesCache: createNullCache(),
1942
1983
  requestsCache: createNullCache(),
1943
1984
  hostsCache: createMemoryCache(),