@algolia/ingestion 1.52.1 → 1.54.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.
- package/README.md +4 -4
- package/dist/browser.d.ts +5 -4
- package/dist/builds/browser.js +119 -293
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +5 -1
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +10 -6
- package/dist/builds/fetch.js +119 -293
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +112 -292
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +119 -293
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +119 -293
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +5 -4
- package/dist/node.d.cts +5 -4
- package/dist/node.d.ts +5 -4
- package/dist/src/ingestionClient.cjs +112 -292
- package/dist/src/ingestionClient.cjs.map +1 -1
- package/dist/src/ingestionClient.js +119 -300
- package/dist/src/ingestionClient.js.map +1 -1
- package/dist/worker.d.ts +5 -4
- package/package.json +9 -9
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
function B(a){let o,m=`algolia-client-js-${a.key}`;function c(){return o===void 0&&(o=a.localStorage||window.localStorage),o}function P(){return JSON.parse(c().getItem(m)||"{}")}function g(i){c().setItem(m,JSON.stringify(i))}function R(){let i=a.timeToLive?a.timeToLive*1e3:null,e=P(),r=Object.fromEntries(Object.entries(e).filter(([,n])=>n.timestamp!==void 0));if(g(r),!i)return;let t=Object.fromEntries(Object.entries(r).filter(([,n])=>{let u=new Date().getTime();return!(n.timestamp+i<u)}));g(t)}return{get(i,e,r={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(R(),P()[JSON.stringify(i)])).then(t=>Promise.all([t?t.value:e(),t!==void 0])).then(([t,n])=>Promise.all([t,n||r.miss(t)])).then(([t])=>t)},set(i,e){return Promise.resolve().then(()=>{let r=P();return r[JSON.stringify(i)]={timestamp:new Date().getTime(),value:e},c().setItem(m,JSON.stringify(r)),e})},delete(i){return Promise.resolve().then(()=>{let e=P();delete e[JSON.stringify(i)],c().setItem(m,JSON.stringify(e))})},clear(){return Promise.resolve().then(()=>{c().removeItem(m)})}}}function se(){return{get(a,o,m={miss:()=>Promise.resolve()}){return o().then(P=>Promise.all([P,m.miss(P)])).then(([P])=>P)},set(a,o){return Promise.resolve(o)},delete(a){return Promise.resolve()},clear(){return Promise.resolve()}}}function x(a){let o=[...a.caches],m=o.shift();return m===void 0?se():{get(c,P,g={miss:()=>Promise.resolve()}){return m.get(c,P,g).catch(()=>x({caches:o}).get(c,P,g))},set(c,P){return m.set(c,P).catch(()=>x({caches:o}).set(c,P))},delete(c){return m.delete(c).catch(()=>x({caches:o}).delete(c))},clear(){return m.clear().catch(()=>x({caches:o}).clear())}}}function C(a={serializable:!0}){let o={};return{get(m,c,P={miss:()=>Promise.resolve()}){let g=JSON.stringify(m);if(g in o)return Promise.resolve(a.serializable?JSON.parse(o[g]):o[g]);let R=c();return R.then(i=>P.miss(i)).then(()=>R)},set(m,c){return o[JSON.stringify(m)]=a.serializable?JSON.stringify(c):c,Promise.resolve(c)},delete(m){return delete o[JSON.stringify(m)],Promise.resolve()},clear(){return o={},Promise.resolve()}}}function oe(a){let o={value:`Algolia for JavaScript (${a})`,add(m){let c=`; ${m.segment}${m.version!==void 0?` (${m.version})`:""}`;return o.value.indexOf(c)===-1&&(o.value=`${o.value}${c}`),o}};return o}function J(a,o,m="WithinHeaders"){let c={"x-algolia-api-key":o,"x-algolia-application-id":a};return{headers(){return m==="WithinHeaders"?c:{}},queryParameters(){return m==="WithinQueryParameters"?c:{}}}}function z({func:a,validate:o,aggregator:m,error:c,timeout:P=()=>0}){let g=R=>new Promise((i,e)=>{a(R).then(async r=>(m&&await m(r),await o(r)?i(r):c&&await c.validate(r)?e(new Error(await c.message(r))):setTimeout(()=>{g(r).then(i).catch(e)},await P()))).catch(r=>{e(r)})});return g()}function M({algoliaAgents:a,client:o,version:m}){let c=oe(m).add({segment:o,version:m});return a.forEach(P=>c.add(P)),c}function F(){return{debug(a,o){return Promise.resolve()},info(a,o){return Promise.resolve()},error(a,o){return Promise.resolve()}}}var ae=750,$=120*1e3;function j(a,o="up"){let m=Date.now();function c(){return o==="up"||Date.now()-m>$}function P(){return o==="timed out"&&Date.now()-m<=$}return{...a,status:o,lastUpdate:m,isUp:c,isTimedOut:P}}var X=class extends Error{name="AlgoliaError";constructor(a,o){super(a),o&&(this.name=o)}};var K=class extends X{stackTrace;constructor(a,o,m){super(a,m),this.stackTrace=o}},ne=class extends K{constructor(a){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",a,"RetryError")}},Q=class extends K{status;constructor(a,o,m,c="ApiError"){super(a,m,c),this.status=o}},ie=class extends X{response;constructor(a,o){super(a,"DeserializationError"),this.response=o}},ue=class extends Q{error;constructor(a,o,m,c){super(a,o,c,"DetailedApiError"),this.error=m}};function ce(a,o,m){let c=me(m),P=`${a.protocol}://${a.url}${a.port?`:${a.port}`:""}/${o.charAt(0)==="/"?o.substring(1):o}`;return c.length&&(P+=`?${c}`),P}function me(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 de(a,o){if(a.method==="GET"||a.data===void 0&&o.data===void 0)return;let m=Array.isArray(a.data)?a.data:{...a.data,...o.data};return JSON.stringify(m)}function pe(a,o,m){let c={Accept:"application/json",...a,...o,...m},P={};return Object.keys(c).forEach(g=>{let R=c[g];P[g.toLowerCase()]=R}),P}function he(a){try{return JSON.parse(a.content)}catch(o){throw new ie(o.message,a)}}function fe({content:a,status:o},m){try{let c=JSON.parse(a);return"error"in c?new ue(c.message,o,c.error,m):new Q(c.message,o,m)}catch{}return new Q(a,o,m)}function le({isTimedOut:a,status:o}){return!a&&~~o===0}function Pe({isTimedOut:a,status:o}){return a||le({isTimedOut:a,status:o})||~~(o/100)!==2&&~~(o/100)!==4}function qe({status:a}){return~~(a/100)===2}function ge(a){return a.map(o=>Y(o))}function Y(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 Z({hosts:a,hostsCache:o,baseHeaders:m,logger:c,baseQueryParameters:P,algoliaAgent:g,timeouts:R,requester:i,requestsCache:e,responsesCache:r,compress:t,compression:n}){async function u(p){let h=await Promise.all(p.map(w=>o.get(w,()=>Promise.resolve(j(w))))),l=h.filter(w=>w.isUp()),q=h.filter(w=>w.isTimedOut()),y=[...l,...q];return{hosts:y.length>0?y:p,getTimeout(w,T){return(q.length===0&&w===0?1:q.length+3+w)*T}}}async function s(p,h,l){let q=[],y=de(p,h),f=pe(m,p.headers,h.headers),w=n==="gzip"&&y!==void 0&&y.length>ae&&(p.method==="POST"||p.method==="PUT");w&&t===void 0&&c.info("Compression is disabled because no compress method is available.");let T=w&&t!==void 0,k=T?await t(y):y;T&&(f["content-encoding"]="gzip");let S=p.method==="GET"?{...p.data,...h.data}:{},O={...P,...p.queryParameters,...S};if(g.value&&(O["x-algolia-agent"]=g.value),h&&h.queryParameters)for(let E of Object.keys(h.queryParameters))!h.queryParameters[E]||Object.prototype.toString.call(h.queryParameters[E])==="[object Object]"?O[E]=h.queryParameters[E]:O[E]=h.queryParameters[E].toString();let U=0,V=async(E,A)=>{let I=E.pop();if(I===void 0)throw new ne(ge(q));let H={...R,...h.timeouts},N={data:k,headers:f,method:p.method,url:ce(I,p.path,O),connectTimeout:A(U,H.connect),responseTimeout:A(U,l?H.read:H.write)},_=b=>{let W={request:N,response:b,host:I,triesLeft:E.length};return q.push(W),W},D=await i.send(N);if(Pe(D)){let b=_(D);return D.isTimedOut&&U++,c.info("Retryable failure",Y(b)),await o.set(I,j(I,D.isTimedOut?"timed out":"down")),V(E,A)}if(qe(D))return he(D);throw _(D),fe(D,q)},te=a.filter(E=>E.accept==="readWrite"||(l?E.accept==="read":E.accept==="write")),G=await u(te);return V([...G.hosts].reverse(),G.getTimeout)}function d(p,h={}){let l=()=>s(p,h,q),q=p.useReadTransporter||p.method==="GET";if((h.cacheable||p.cacheable)!==!0)return l();let f={request:p,requestOptions:h,transporter:{queryParameters:P,headers:m}};return r.get(f,()=>e.get(f,()=>e.set(f,l()).then(w=>Promise.all([e.delete(f),w]),w=>Promise.all([e.delete(f),Promise.reject(w)])).then(([w,T])=>T)),{miss:w=>r.set(f,w)})}return{hostsCache:o,requester:i,timeouts:R,logger:c,algoliaAgent:g,baseHeaders:m,baseQueryParameters:P,hosts:a,request:d,requestsCache:e,responsesCache:r}}function ee(){function a(o){return new Promise(m=>{let c=new XMLHttpRequest;c.open(o.method,o.url,!0),Object.keys(o.headers).forEach(i=>c.setRequestHeader(i,o.headers[i]));let P=(i,e)=>setTimeout(()=>{c.abort(),m({status:0,content:e,isTimedOut:!0})},i),g=P(o.connectTimeout,"Connection timeout"),R;c.onreadystatechange=()=>{c.readyState>c.OPENED&&R===void 0&&(clearTimeout(g),R=P(o.responseTimeout,"Socket timeout"))},c.onerror=()=>{c.status===0&&(clearTimeout(g),clearTimeout(R),m({content:c.responseText||"Network request failed",status:c.status,isTimedOut:!1}))},c.onload=()=>{clearTimeout(g),clearTimeout(R),m({content:c.responseText,status:c.status,isTimedOut:!1})},c.send(o.data)})}return{send:a}}var v="1.52.1",L=["eu","us"];function we(a){return[{url:"data.{region}.algolia.com".replace("{region}",a),accept:"readWrite",protocol:"https"}]}function Te(a){return a.type==="onDemand"}function ye(a){return a.type==="schedule"}function Re(a){return a.type==="subscription"}function re({appId:a,apiKey:o,authMode:m,algoliaAgents:c,region:P,...g}){let R=J(a,o,m),i=Z({hosts:we(P),...g,algoliaAgent:M({algoliaAgents:c,client:"Ingestion",version:v}),baseHeaders:{"content-type":"text/plain",...R.headers(),...g.baseHeaders},baseQueryParameters:{...R.queryParameters(),...g.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}){!m||m==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=e:i.baseQueryParameters["x-algolia-api-key"]=e},async chunkedPush({indexName:e,objects:r,action:t="addObject",waitForTasks:n,batchSize:u=1e3,referenceIndexName:s},d){let p=[],h=0,l=[],q=Math.floor(u/10)||u,y=r.entries();for(let[f,w]of y)if(p.push(w),(p.length===u||f===r.length-1)&&(l.push(await this.push({indexName:e,pushTaskPayload:{action:t,records:p},referenceIndexName:s},d)),p=[]),n&&l.length>0&&(l.length%q===0||f===r.length-1)){for(let T of l.slice(h,h+q)){if(!T.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");let k=0;await z({func:async()=>{if(T.eventID===void 0||!T.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:T.runID,eventID:T.eventID}).catch(S=>{if(S.status!==404)throw S})},validate:S=>S!==void 0,aggregator:()=>k+=1,error:{validate:()=>k>=50,message:()=>`The maximum number of retries exceeded. (${k}/50)`},timeout:()=>Math.min(k*1500,5e3)})}h+=q}return l},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 s={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return i.request(s,r)},createTransformation(e,r){if(!e)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!e.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");let s={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return i.request(s,r)},customDelete({path:e,parameters:r},t){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,t)},customGet({path:e,parameters:r},t){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,t)},customPost({path:e,parameters:r,body:t},n){if(!e)throw new Error("Parameter `path` is required when calling `customPost`.");let p={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(p,n)},customPut({path:e,parameters:r,body:t},n){if(!e)throw new Error("Parameter `path` is required when calling `customPut`.");let p={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return i.request(p,n)},deleteAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");let s={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},deleteDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");let s={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},deleteSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");let s={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},deleteTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");let s={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},deleteTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");let s={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},deleteTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");let s={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},disableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTask`.");let s={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},disableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");let s={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},enableTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTask`.");let s={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},enableTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");let s={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},getAuthentication({authenticationID:e},r){if(!e)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");let s={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},getDestination({destinationID:e},r){if(!e)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");let s={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},getEvent({runID:e,eventID:r},t){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,t)},getRun({runID:e},r){if(!e)throw new Error("Parameter `runID` is required when calling `getRun`.");let s={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},getSource({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `getSource`.");let s={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},getTask({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTask`.");let s={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},getTaskV1({taskID:e},r){if(!e)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");let s={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},getTransformation({transformationID:e},r){if(!e)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");let s={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return i.request(s,r)},listAuthentications({itemsPerPage:e,page:r,type:t,platform:n,sort:u,order:s}={},d=void 0){let p="/1/authentications",h={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),r!==void 0&&(l.page=r.toString()),t!==void 0&&(l.type=t.toString()),n!==void 0&&(l.platform=n.toString()),u!==void 0&&(l.sort=u.toString()),s!==void 0&&(l.order=s.toString());let q={method:"GET",path:p,queryParameters:l,headers:h};return i.request(q,d)},listDestinations({itemsPerPage:e,page:r,type:t,authenticationID:n,transformationID:u,sort:s,order:d}={},p=void 0){let h="/1/destinations",l={},q={};e!==void 0&&(q.itemsPerPage=e.toString()),r!==void 0&&(q.page=r.toString()),t!==void 0&&(q.type=t.toString()),n!==void 0&&(q.authenticationID=n.toString()),u!==void 0&&(q.transformationID=u.toString()),s!==void 0&&(q.sort=s.toString()),d!==void 0&&(q.order=d.toString());let y={method:"GET",path:h,queryParameters:q,headers:l};return i.request(y,p)},listEvents({runID:e,itemsPerPage:r,page:t,status:n,type:u,sort:s,order:d,startDate:p,endDate:h},l){if(!e)throw new Error("Parameter `runID` is required when calling `listEvents`.");let q="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),y={},f={};r!==void 0&&(f.itemsPerPage=r.toString()),t!==void 0&&(f.page=t.toString()),n!==void 0&&(f.status=n.toString()),u!==void 0&&(f.type=u.toString()),s!==void 0&&(f.sort=s.toString()),d!==void 0&&(f.order=d.toString()),p!==void 0&&(f.startDate=p.toString()),h!==void 0&&(f.endDate=h.toString());let w={method:"GET",path:q,queryParameters:f,headers:y};return i.request(w,l)},listRuns({itemsPerPage:e,page:r,status:t,type:n,taskID:u,sort:s,order:d,startDate:p,endDate:h}={},l=void 0){let q="/1/runs",y={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),r!==void 0&&(f.page=r.toString()),t!==void 0&&(f.status=t.toString()),n!==void 0&&(f.type=n.toString()),u!==void 0&&(f.taskID=u.toString()),s!==void 0&&(f.sort=s.toString()),d!==void 0&&(f.order=d.toString()),p!==void 0&&(f.startDate=p.toString()),h!==void 0&&(f.endDate=h.toString());let w={method:"GET",path:q,queryParameters:f,headers:y};return i.request(w,l)},listSources({itemsPerPage:e,page:r,type:t,authenticationID:n,sort:u,order:s}={},d=void 0){let p="/1/sources",h={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),r!==void 0&&(l.page=r.toString()),t!==void 0&&(l.type=t.toString()),n!==void 0&&(l.authenticationID=n.toString()),u!==void 0&&(l.sort=u.toString()),s!==void 0&&(l.order=s.toString());let q={method:"GET",path:p,queryParameters:l,headers:h};return i.request(q,d)},listTasks({itemsPerPage:e,page:r,action:t,enabled:n,sourceID:u,sourceType:s,destinationID:d,triggerType:p,withEmailNotifications:h,sort:l,order:q}={},y=void 0){let f="/2/tasks",w={},T={};e!==void 0&&(T.itemsPerPage=e.toString()),r!==void 0&&(T.page=r.toString()),t!==void 0&&(T.action=t.toString()),n!==void 0&&(T.enabled=n.toString()),u!==void 0&&(T.sourceID=u.toString()),s!==void 0&&(T.sourceType=s.toString()),d!==void 0&&(T.destinationID=d.toString()),p!==void 0&&(T.triggerType=p.toString()),h!==void 0&&(T.withEmailNotifications=h.toString()),l!==void 0&&(T.sort=l.toString()),q!==void 0&&(T.order=q.toString());let k={method:"GET",path:f,queryParameters:T,headers:w};return i.request(k,y)},listTasksV1({itemsPerPage:e,page:r,action:t,enabled:n,sourceID:u,destinationID:s,triggerType:d,sort:p,order:h}={},l=void 0){let q="/1/tasks",y={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),r!==void 0&&(f.page=r.toString()),t!==void 0&&(f.action=t.toString()),n!==void 0&&(f.enabled=n.toString()),u!==void 0&&(f.sourceID=u.toString()),s!==void 0&&(f.destinationID=s.toString()),d!==void 0&&(f.triggerType=d.toString()),p!==void 0&&(f.sort=p.toString()),h!==void 0&&(f.order=h.toString());let w={method:"GET",path:q,queryParameters:f,headers:y};return i.request(w,l)},listTransformations({itemsPerPage:e,page:r,sort:t,order:n,type:u}={},s=void 0){let d="/1/transformations",p={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),r!==void 0&&(h.page=r.toString()),t!==void 0&&(h.sort=t.toString()),n!==void 0&&(h.order=n.toString()),u!==void 0&&(h.type=u.toString());let l={method:"GET",path:d,queryParameters:h,headers:p};return i.request(l,s)},push({indexName:e,pushTaskPayload:r,watch:t,referenceIndexName:n},u){if(!e)throw new Error("Parameter `indexName` is required when calling `push`.");if(!r)throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");if(!r.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");if(!r.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");let s="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(e)),d={},p={};t!==void 0&&(p.watch=t.toString()),n!==void 0&&(p.referenceIndexName=n.toString());let h={method:"POST",path:s,queryParameters:p,headers:d,data:r};return u={timeouts:{connect:18e4,read:18e4,write:18e4,...u?.timeouts}},i.request(h,u)},pushTask({taskID:e,pushTaskPayload:r,watch:t},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)),s={},d={};t!==void 0&&(d.watch=t.toString());let p={method:"POST",path:u,queryParameters:d,headers:s,data:r};return n={timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},i.request(p,n)},replaceTask({taskID:e,taskReplace:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `replaceTask`.");if(!r)throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");if(!r.destinationID)throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");if(!r.action)throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");let d={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return i.request(d,t)},runSource({sourceID:e,runSourcePayload:r},t){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,t)},runTask({taskID:e,runTaskPayload:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `runTask`.");let d={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return i.request(d,t)},runTaskV1({taskID:e,runTaskPayload:r},t){if(!e)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");let d={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return i.request(d,t)},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 s={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return i.request(s,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 s={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return i.request(s,r)},triggerDockerSourceDiscover({sourceID:e},r){if(!e)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");let s={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(s,r)},tryTransformation(e,r){if(!e)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!e.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");let s={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return i.request(s,r)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:r},t){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.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,t)},updateAuthentication({authenticationID:e,authenticationUpdate:r},t){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,t)},updateDestination({destinationID:e,destinationUpdate:r},t){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,t)},updateSource({sourceID:e,sourceUpdate:r},t){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,t)},updateTask({taskID:e,taskUpdate:r},t){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,t)},updateTaskV1({taskID:e,taskUpdate:r},t){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,t)},updateTransformation({transformationID:e,transformationCreate:r},t){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.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,t)},validateSource(e,r=void 0){let s={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return r={timeouts:{connect:18e4,read:18e4,write:18e4,...r?.timeouts}},i.request(s,r)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:r},t){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 t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},i.request(d,t)}}}function Os(a,o,m,c){if(!a||typeof a!="string")throw new Error("`appId` is missing.");if(!o||typeof o!="string")throw new Error("`apiKey` is missing.");if(!m||m&&(typeof m!="string"||!L.includes(m)))throw new Error(`\`region\` is required and must be one of the following: ${L.join(", ")}`);let{compression:P,...g}=c||{};return re({appId:a,apiKey:o,region:m,timeouts:{connect:25e3,read:25e3,write:25e3},logger:F(),requester:ee(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:C(),requestsCache:C({serializable:!1}),hostsCache:x({caches:[B({key:`${v}-${a}`}),C()]}),...g})}export{v as apiClientVersion,Os as ingestionClient,Te as isOnDemandTrigger,ye as isScheduleTrigger,Re as isSubscriptionTrigger};
|
|
1
|
+
function Y(s){let a,c=`algolia-client-js-${s.key}`;function i(){return a===void 0&&(a=s.localStorage||window.localStorage),a}function P(){return JSON.parse(i().getItem(c)||"{}")}function R(e){i().setItem(c,JSON.stringify(e))}function S(){return new Promise(e=>setTimeout(e,0))}function d(){let e=s.timeToLive?s.timeToLive*1e3:null,t=P(),o=new Date().getTime(),n=!1;return{namespace:Object.fromEntries(Object.entries(t).filter(([,r])=>!r||r.timestamp===void 0||e&&r.timestamp+e<o?(n=!0,!1):!0)),changed:n}}return{get(e,t,o={miss:()=>Promise.resolve()}){return S().then(()=>{let{namespace:n,changed:m}=d(),r=n[JSON.stringify(e)];return m&&R(n),r?r.value:t().then(p=>o.miss(p).then(()=>p))})},set(e,t){return S().then(()=>{let o=P();return o[JSON.stringify(e)]={timestamp:new Date().getTime(),value:t},i().setItem(c,JSON.stringify(o)),t})},delete(e){return S().then(()=>{let t=P();delete t[JSON.stringify(e)],i().setItem(c,JSON.stringify(t))})},clear(){return Promise.resolve().then(()=>{i().removeItem(c)})}}}function ce(){return{get(s,a,c={miss:()=>Promise.resolve()}){return a().then(P=>Promise.all([P,c.miss(P)])).then(([P])=>P)},set(s,a){return Promise.resolve(a)},delete(s){return Promise.resolve()},clear(){return Promise.resolve()}}}function U(s){let a=[...s.caches],c=a.shift();return c===void 0?ce():{get(i,P,R={miss:()=>Promise.resolve()}){return c.get(i,P,R).catch(()=>U({caches:a}).get(i,P,R))},set(i,P){return c.set(i,P).catch(()=>U({caches:a}).set(i,P))},delete(i){return c.delete(i).catch(()=>U({caches:a}).delete(i))},clear(){return c.clear().catch(()=>U({caches:a}).clear())}}}function H(s={serializable:!0}){let a={};return{get(c,i,P={miss:()=>Promise.resolve()}){let R=JSON.stringify(c);if(R in a)return Promise.resolve(s.serializable?JSON.parse(a[R]):a[R]);let S=i();return S.then(d=>P.miss(d)).then(()=>S)},set(c,i){return a[JSON.stringify(c)]=s.serializable?JSON.stringify(i):i,Promise.resolve(i)},delete(c){return delete a[JSON.stringify(c)],Promise.resolve()},clear(){return a={},Promise.resolve()}}}function me(s){let a={value:`Algolia for JavaScript (${s})`,add(c){let i=`; ${c.segment}${c.version!==void 0?` (${c.version})`:""}`;return a.value.indexOf(i)===-1&&(a.value=`${a.value}${i}`),a}};return a}function Z(s,a,c="WithinHeaders"){let i={"x-algolia-api-key":a,"x-algolia-application-id":s};return{headers(){return c==="WithinHeaders"?i:{}},queryParameters(){return c==="WithinQueryParameters"?i:{}}}}function ee({func:s,validate:a,aggregator:c,error:i,timeout:P=()=>0}){let R=S=>new Promise((d,e)=>{s(S).then(async t=>(c&&await c(t),await a(t)?d(t):i&&await i.validate(t)?e(new Error(await i.message(t))):setTimeout(()=>{R(t).then(d).catch(e)},await P()))).catch(t=>{e(t)})});return R()}function te({algoliaAgents:s,client:a,version:c}){let i=me(c).add({segment:a,version:c});return s.forEach(P=>i.add(P)),i}function re(){return{debug(s,a){return Promise.resolve()},info(s,a){return Promise.resolve()},error(s,a){return Promise.resolve()}}}var de=10*1024*1024;async function*pe(s){let a=s.getReader();try{for(;;){let{done:c,value:i}=await a.read();if(c)return;yield i}}finally{a.releaseLock()}}function he(s){return Symbol.asyncIterator in s?s:pe(s)}async function*fe(s){let a=new TextDecoder("utf-8"),c=[],i=0,P=!1,R=!0;for await(let d of he(s)){let e=a.decode(d,{stream:!0}),t=0;for(P&&(P=!1,e.length>0&&e[0]===`
|
|
2
|
+
`&&(t=1));t<e.length;){let o=e.indexOf("\r",t),n=e.indexOf(`
|
|
3
|
+
`,t);if(o===-1&&n===-1){let h=e.slice(t);if(c.push(h),i+=h.length,i>de)throw new Error("SSE line buffer exceeded 10MB");break}let m,r;o!==-1&&(n===-1||o<n)?(m=o,o+1<e.length?r=e[o+1]===`
|
|
4
|
+
`?2:1:(P=!0,r=1)):(m=n,r=1);let p=e.slice(t,m);c.push(p);let q=c.length===1?c[0]:c.join("");c.length=0,i=0,R&&(q.startsWith("\uFEFF")&&(q=q.slice(1)),R=!1),yield q,t=m+r}}let S=a.decode();if(S&&c.push(S),c.length>0){let d=c.join("");R&&d.startsWith("\uFEFF")&&(d=d.slice(1)),yield d}}var le=class{data=[];eventType="";lastEventId=null;retry=null;decode(s){if(s==="")return this.dispatch();if(s[0]===":")return null;let a=s.indexOf(":"),c,i;switch(a===-1?(c=s,i=""):(c=s.slice(0,a),i=s.slice(a+1),i[0]===" "&&(i=i.slice(1))),c){case"data":this.data.push(i);break;case"event":this.eventType=i;break;case"id":i.includes("\0")||(this.lastEventId=i);break;case"retry":/^[0-9]+$/.test(i)&&(this.retry=parseInt(i,10));break}return null}dispatch(){let s=this.eventType;if(this.eventType="",this.data.length===0)return null;let a={data:this.data.join(`
|
|
5
|
+
`),event:s,id:this.lastEventId,retry:this.retry};return this.data=[],a}};async function*Pe(s){let a=new le;for await(let c of fe(s)){let i=a.decode(c);i!==null&&(yield i)}}var qe=750,F=120*1e3;function M(s,a="up"){let c=Date.now();function i(){return a==="up"||Date.now()-c>F}function P(){return a==="timed out"&&Date.now()-c<=F}return{...s,status:a,lastUpdate:c,isUp:i,isTimedOut:P}}var se=class extends Error{name="AlgoliaError";constructor(s,a){super(s),a&&(this.name=a)}};var oe=class extends se{stackTrace;constructor(s,a,c){super(s,c),this.stackTrace=a}},z=class extends oe{constructor(s){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",s,"RetryError")}},N=class extends oe{status;constructor(s,a,c,i="ApiError"){super(s,c,i),this.status=a}},ye=class extends se{response;constructor(s,a){super(s,"DeserializationError"),this.response=a}},Te=class extends N{error;constructor(s,a,c,i){super(s,a,i,"DetailedApiError"),this.error=c}};function J(s,a,c){let i=Re(c),P=`${s.protocol}://${s.url}${s.port?`:${s.port}`:""}/${a.charAt(0)==="/"?a.substring(1):a}`;return i.length&&(P+=`?${i}`),P}function Re(s){return Object.keys(s).filter(a=>s[a]!==void 0).sort().map(a=>`${a}=${encodeURIComponent(Object.prototype.toString.call(s[a])==="[object Array]"?s[a].join(","):s[a]).replace(/\+/g,"%20")}`).join("&")}function X(s,a){if(s.method==="GET"||s.data===void 0&&a.data===void 0)return;let c=Array.isArray(s.data)?s.data:{...s.data,...a.data};return JSON.stringify(c)}function K(s,a,c){let i={Accept:"application/json",...s,...a,...c},P={};return Object.keys(i).forEach(R=>{let S=i[R];P[R.toLowerCase()]=S}),P}function ge(s){if(!(s.status===204||s.content.length===0))try{return JSON.parse(s.content)}catch(a){throw new ye(a.message,s)}}function ke({content:s,status:a},c){try{let i=JSON.parse(s);return"error"in i?new Te(i.message,a,i.error,c):new N(i.message,a,c)}catch{}return new N(s,a,c)}function Se({isTimedOut:s,status:a}){return!s&&~~a===0}function xe({isTimedOut:s,status:a}){return s||Se({isTimedOut:s,status:a})||~~(a/100)!==2&&~~(a/100)!==4}function De({status:s}){return~~(s/100)===2}function Ie(s){return s.map(a=>ae(a))}function ae(s){let a=s.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...s,request:{...s.request,headers:{...s.request.headers,...a}}}}function ne({hosts:s,hostsCache:a,baseHeaders:c,logger:i,baseQueryParameters:P,algoliaAgent:R,timeouts:S,requester:d,requestsCache:e,responsesCache:t,compress:o,compression:n}){async function m(h){let f=await Promise.all(h.map(T=>a.get(T,()=>Promise.resolve(M(T))))),y=f.filter(T=>T.isUp()),g=f.filter(T=>T.isTimedOut()),l=[...y,...g];return{hosts:l.length>0?l:h,getTimeout(T,x){return(g.length===0&&T===0?1:g.length+3+T)*x}}}async function r(h,f,y){let g=[],l=X(h,f),k=K(c,h.headers,f.headers),T=n==="gzip"&&l!==void 0&&l.length>qe&&(h.method==="POST"||h.method==="PUT");T&&o===void 0&&i.info("Compression is disabled because no compress method is available.");let x=T&&o!==void 0,O=x?await o(l):l;x&&(k["content-encoding"]="gzip");let E=h.method==="GET"?{...h.data,...f.data}:{},v={...P,...h.queryParameters,...E};if(R.value&&(v["x-algolia-agent"]=R.value),f&&f.queryParameters)for(let D of Object.keys(f.queryParameters))!f.queryParameters[D]||Object.prototype.toString.call(f.queryParameters[D])==="[object Object]"?v[D]=f.queryParameters[D]:v[D]=f.queryParameters[D].toString();let A=0,b=async(D,Q)=>{let w=D.pop();if(w===void 0)throw new z(Ie(g));let V={...S,...f.timeouts},$={data:O,headers:k,method:h.method,url:J(w,h.path,v),connectTimeout:Q(A,V.connect),responseTimeout:Q(A,y?V.read:V.write)},j=G=>{let B={request:$,response:G,host:w,triesLeft:D.length};return g.push(B),B},C=await d.send($);if(xe(C)){let G=j(C);return C.isTimedOut&&A++,i.info("Retryable failure",ae(G)),await a.set(w,M(w,C.isTimedOut?"timed out":"down")),b(D,Q)}if(De(C))return ge(C);throw j(C),ke(C,g)},I=s.filter(D=>D.accept==="readWrite"||(y?D.accept==="read":D.accept==="write")),W=await m(I);return b([...W.hosts].reverse(),W.getTimeout)}function p(h,f={}){let y=()=>r(h,f,g),g=h.useReadTransporter||h.method==="GET";if((f.cacheable||h.cacheable)!==!0)return y();let k={request:h,requestOptions:f,transporter:{queryParameters:P,headers:c}};return t.get(k,()=>e.get(k,()=>e.set(k,y()).then(T=>Promise.all([e.delete(k),T]),T=>Promise.all([e.delete(k),Promise.reject(T)])).then(([T,x])=>x)),{miss:T=>t.set(k,T)})}async function*q(h,f={}){if(!d.sendStream)throw new Error("This requester does not support streaming");let y=X(h,f),g=K(c,h.headers,f.headers);g.accept="text/event-stream";let l=h.method==="GET"?{...h.data,...f.data}:{},k={...P,...h.queryParameters,...l};if(R.value&&(k["x-algolia-agent"]=R.value),f&&f.queryParameters)for(let I of Object.keys(f.queryParameters))!f.queryParameters[I]||Object.prototype.toString.call(f.queryParameters[I])==="[object Object]"?k[I]=f.queryParameters[I]:k[I]=f.queryParameters[I].toString();let T=h.useReadTransporter||h.method==="GET",x=s.filter(I=>I.accept==="readWrite"||(T?I.accept==="read":I.accept==="write")),E=(await m(x)).hosts[0];if(!E)throw new z([]);let v={...S,...f.timeouts},A={data:y,headers:g,method:h.method,url:J(E,h.path,k),connectTimeout:v.connect,responseTimeout:T?v.read:v.write},b=await d.sendStream(A);yield*Pe(b)}return{hostsCache:a,requester:d,timeouts:S,logger:i,algoliaAgent:R,baseHeaders:c,baseQueryParameters:P,hosts:s,request:p,requestStream:q,requestsCache:e,responsesCache:t}}function u(s,a,c){if(c==null||typeof c=="string"&&c.length===0)throw new Error(`Parameter \`${s}\` is required when calling \`${a}\`.`)}function ie(){function s(a){return new Promise(c=>{let i=new XMLHttpRequest;i.open(a.method,a.url,!0),Object.keys(a.headers).forEach(d=>i.setRequestHeader(d,a.headers[d]));let P=(d,e)=>setTimeout(()=>{i.abort(),c({status:0,content:e,isTimedOut:!0})},d),R=P(a.connectTimeout,"Connection timeout"),S;i.onreadystatechange=()=>{i.readyState>i.OPENED&&S===void 0&&(clearTimeout(R),S=P(a.responseTimeout,"Socket timeout"))},i.onerror=()=>{i.status===0&&(clearTimeout(R),clearTimeout(S),c({content:i.responseText||"Network request failed",status:i.status,isTimedOut:!1}))},i.onload=()=>{clearTimeout(R),clearTimeout(S),c({content:i.responseText,status:i.status,isTimedOut:!1})},i.send(a.data)})}return{send:s}}var L="1.54.0",_=["eu","us"];function Ee(s){return[{url:"data.{region}.algolia.com".replace("{region}",s),accept:"readWrite",protocol:"https"}]}function ve(s){return s.type==="onDemand"}function Ce(s){return s.type==="schedule"}function Oe(s){return s.type==="subscription"}function ue({appId:s,apiKey:a,authMode:c,algoliaAgents:i,region:P,...R}){let S=Z(s,a,c),d=ne({hosts:Ee(P),...R,algoliaAgent:te({algoliaAgents:i,client:"Ingestion",version:L}),baseHeaders:{"content-type":"text/plain",...S.headers(),...R.baseHeaders},baseQueryParameters:{...S.queryParameters(),...R.baseQueryParameters}});return{transporter:d,appId:s,apiKey:a,clearCache(){return Promise.all([d.requestsCache.clear(),d.responsesCache.clear()]).then(()=>{})},get _ua(){return d.algoliaAgent.value},addAlgoliaAgent(e,t){d.algoliaAgent.add({segment:e,version:t})},setClientApiKey({apiKey:e}){!c||c==="WithinHeaders"?d.baseHeaders["x-algolia-api-key"]=e:d.baseQueryParameters["x-algolia-api-key"]=e},async chunkedPush({indexName:e,objects:t,action:o="addObject",waitForTasks:n,batchSize:m=1e3,referenceIndexName:r,maxRetries:p=100},q){let h=[],f=0,y=[],g=Math.floor(m/10)||m,l=t.entries();for(let[k,T]of l)if(h.push(T),(h.length===m||k===t.length-1)&&(y.push(await this.push({indexName:e,pushTaskPayload:{action:o,records:h},referenceIndexName:r},q)),h=[]),n&&y.length>0&&(y.length%g===0||k===t.length-1)){for(let x of y.slice(f,f+g)){if(!x.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");let O=0;await ee({func:async()=>{if(x.eventID===void 0||!x.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:x.runID,eventID:x.eventID}).catch(E=>{if(E.status!==404)throw E})},validate:E=>E!==void 0,aggregator:()=>O+=1,error:{validate:()=>O>=p,message:()=>`Stopped waiting for the task after ${p} retries. This does not mean the operation failed; it may still complete. If you need to keep polling, retry with a higher maxRetries.`},timeout:()=>Math.min(O*1500,5e3)})}f+=g}return y},createAuthentication(e,t){u("authenticationCreate","createAuthentication",e),u("authenticationCreate.type","createAuthentication",e.type),u("authenticationCreate.name","createAuthentication",e.name),u("authenticationCreate.input","createAuthentication",e.input);let r={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:e};return d.request(r,t)},createDestination(e,t){u("destinationCreate","createDestination",e),u("destinationCreate.type","createDestination",e.type),u("destinationCreate.name","createDestination",e.name),u("destinationCreate.input","createDestination",e.input);let r={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:e};return d.request(r,t)},createSource(e,t){u("sourceCreate","createSource",e),u("sourceCreate.type","createSource",e.type),u("sourceCreate.name","createSource",e.name);let r={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:e};return d.request(r,t)},createTask(e,t){u("taskCreate","createTask",e),u("taskCreate.sourceID","createTask",e.sourceID),u("taskCreate.destinationID","createTask",e.destinationID),u("taskCreate.action","createTask",e.action);let r={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:e};return d.request(r,t)},createTaskV1(e,t){u("taskCreate","createTaskV1",e),u("taskCreate.sourceID","createTaskV1",e.sourceID),u("taskCreate.destinationID","createTaskV1",e.destinationID),u("taskCreate.trigger","createTaskV1",e.trigger),u("taskCreate.action","createTaskV1",e.action);let r={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:e};return d.request(r,t)},createTransformation(e,t){u("transformationCreate","createTransformation",e),u("transformationCreate.name","createTransformation",e.name);let r={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:e};return d.request(r,t)},customDelete({path:e,parameters:t},o){u("path","customDelete",e);let p={method:"DELETE",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return d.request(p,o)},customGet({path:e,parameters:t},o){u("path","customGet",e);let p={method:"GET",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return d.request(p,o)},customPost({path:e,parameters:t,body:o},n){u("path","customPost",e);let q={method:"POST",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:o||{}};return d.request(q,n)},customPut({path:e,parameters:t,body:o},n){u("path","customPut",e);let q={method:"PUT",path:"/{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:o||{}};return d.request(q,n)},deleteAuthentication({authenticationID:e},t){u("authenticationID","deleteAuthentication",e);let r={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteDestination({destinationID:e},t){u("destinationID","deleteDestination",e);let r={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteSource({sourceID:e},t){u("sourceID","deleteSource",e);let r={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteTask({taskID:e},t){u("taskID","deleteTask",e);let r={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteTaskV1({taskID:e},t){u("taskID","deleteTaskV1",e);let r={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},deleteTransformation({transformationID:e},t){u("transformationID","deleteTransformation",e);let r={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},disableTask({taskID:e},t){u("taskID","disableTask",e);let r={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},disableTaskV1({taskID:e},t){u("taskID","disableTaskV1",e);let r={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},enableTask({taskID:e},t){u("taskID","enableTask",e);let r={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},enableTaskV1({taskID:e},t){u("taskID","enableTaskV1",e);let r={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getAuthentication({authenticationID:e},t){u("authenticationID","getAuthentication",e);let r={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getDestination({destinationID:e},t){u("destinationID","getDestination",e);let r={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getEvent({runID:e,eventID:t},o){u("runID","getEvent",e),u("eventID","getEvent",t);let p={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(e)).replace("{eventID}",encodeURIComponent(t)),queryParameters:{},headers:{}};return d.request(p,o)},getRun({runID:e},t){u("runID","getRun",e);let r={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getSource({sourceID:e},t){u("sourceID","getSource",e);let r={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getTask({taskID:e},t){u("taskID","getTask",e);let r={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getTaskV1({taskID:e},t){u("taskID","getTaskV1",e);let r={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},getTransformation({transformationID:e},t){u("transformationID","getTransformation",e);let r={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return d.request(r,t)},listAuthentications({itemsPerPage:e,page:t,type:o,platform:n,sort:m,order:r}={},p=void 0){let q="/1/authentications",h={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),t!==void 0&&(f.page=t.toString()),o!==void 0&&(f.type=o.toString()),n!==void 0&&(f.platform=n.toString()),m!==void 0&&(f.sort=m.toString()),r!==void 0&&(f.order=r.toString());let y={method:"GET",path:q,queryParameters:f,headers:h};return d.request(y,p)},listDestinations({itemsPerPage:e,page:t,type:o,authenticationID:n,transformationID:m,sort:r,order:p}={},q=void 0){let h="/1/destinations",f={},y={};e!==void 0&&(y.itemsPerPage=e.toString()),t!==void 0&&(y.page=t.toString()),o!==void 0&&(y.type=o.toString()),n!==void 0&&(y.authenticationID=n.toString()),m!==void 0&&(y.transformationID=m.toString()),r!==void 0&&(y.sort=r.toString()),p!==void 0&&(y.order=p.toString());let g={method:"GET",path:h,queryParameters:y,headers:f};return d.request(g,q)},listEvents({runID:e,itemsPerPage:t,page:o,status:n,type:m,sort:r,order:p,startDate:q,endDate:h},f){u("runID","listEvents",e);let y="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(e)),g={},l={};t!==void 0&&(l.itemsPerPage=t.toString()),o!==void 0&&(l.page=o.toString()),n!==void 0&&(l.status=n.toString()),m!==void 0&&(l.type=m.toString()),r!==void 0&&(l.sort=r.toString()),p!==void 0&&(l.order=p.toString()),q!==void 0&&(l.startDate=q.toString()),h!==void 0&&(l.endDate=h.toString());let k={method:"GET",path:y,queryParameters:l,headers:g};return d.request(k,f)},listRuns({itemsPerPage:e,page:t,status:o,type:n,taskID:m,sort:r,order:p,startDate:q,endDate:h}={},f=void 0){let y="/1/runs",g={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),t!==void 0&&(l.page=t.toString()),o!==void 0&&(l.status=o.toString()),n!==void 0&&(l.type=n.toString()),m!==void 0&&(l.taskID=m.toString()),r!==void 0&&(l.sort=r.toString()),p!==void 0&&(l.order=p.toString()),q!==void 0&&(l.startDate=q.toString()),h!==void 0&&(l.endDate=h.toString());let k={method:"GET",path:y,queryParameters:l,headers:g};return d.request(k,f)},listSources({itemsPerPage:e,page:t,type:o,authenticationID:n,sort:m,order:r}={},p=void 0){let q="/1/sources",h={},f={};e!==void 0&&(f.itemsPerPage=e.toString()),t!==void 0&&(f.page=t.toString()),o!==void 0&&(f.type=o.toString()),n!==void 0&&(f.authenticationID=n.toString()),m!==void 0&&(f.sort=m.toString()),r!==void 0&&(f.order=r.toString());let y={method:"GET",path:q,queryParameters:f,headers:h};return d.request(y,p)},listTasks({itemsPerPage:e,page:t,action:o,enabled:n,sourceID:m,sourceType:r,destinationID:p,triggerType:q,withEmailNotifications:h,sort:f,order:y}={},g=void 0){let l="/2/tasks",k={},T={};e!==void 0&&(T.itemsPerPage=e.toString()),t!==void 0&&(T.page=t.toString()),o!==void 0&&(T.action=o.toString()),n!==void 0&&(T.enabled=n.toString()),m!==void 0&&(T.sourceID=m.toString()),r!==void 0&&(T.sourceType=r.toString()),p!==void 0&&(T.destinationID=p.toString()),q!==void 0&&(T.triggerType=q.toString()),h!==void 0&&(T.withEmailNotifications=h.toString()),f!==void 0&&(T.sort=f.toString()),y!==void 0&&(T.order=y.toString());let x={method:"GET",path:l,queryParameters:T,headers:k};return d.request(x,g)},listTasksV1({itemsPerPage:e,page:t,action:o,enabled:n,sourceID:m,destinationID:r,triggerType:p,sort:q,order:h}={},f=void 0){let y="/1/tasks",g={},l={};e!==void 0&&(l.itemsPerPage=e.toString()),t!==void 0&&(l.page=t.toString()),o!==void 0&&(l.action=o.toString()),n!==void 0&&(l.enabled=n.toString()),m!==void 0&&(l.sourceID=m.toString()),r!==void 0&&(l.destinationID=r.toString()),p!==void 0&&(l.triggerType=p.toString()),q!==void 0&&(l.sort=q.toString()),h!==void 0&&(l.order=h.toString());let k={method:"GET",path:y,queryParameters:l,headers:g};return d.request(k,f)},listTransformations({itemsPerPage:e,page:t,sort:o,order:n,type:m}={},r=void 0){let p="/1/transformations",q={},h={};e!==void 0&&(h.itemsPerPage=e.toString()),t!==void 0&&(h.page=t.toString()),o!==void 0&&(h.sort=o.toString()),n!==void 0&&(h.order=n.toString()),m!==void 0&&(h.type=m.toString());let f={method:"GET",path:p,queryParameters:h,headers:q};return d.request(f,r)},push({indexName:e,pushTaskPayload:t,watch:o,referenceIndexName:n},m){u("indexName","push",e),u("pushTaskPayload","push",t),u("pushTaskPayload.action","push",t.action),u("pushTaskPayload.records","push",t.records);let r="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(e)),p={},q={};o!==void 0&&(q.watch=o.toString()),n!==void 0&&(q.referenceIndexName=n.toString());let h={method:"POST",path:r,queryParameters:q,headers:p,data:t};return m={timeouts:{connect:18e4,read:18e4,write:18e4,...m?.timeouts}},d.request(h,m)},pushTask({taskID:e,pushTaskPayload:t,watch:o},n){u("taskID","pushTask",e),u("pushTaskPayload","pushTask",t),u("pushTaskPayload.action","pushTask",t.action),u("pushTaskPayload.records","pushTask",t.records);let m="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(e)),r={},p={};o!==void 0&&(p.watch=o.toString());let q={method:"POST",path:m,queryParameters:p,headers:r,data:t};return n={timeouts:{connect:18e4,read:18e4,write:18e4,...n?.timeouts}},d.request(q,n)},replaceTask({taskID:e,taskReplace:t},o){u("taskID","replaceTask",e),u("taskReplace","replaceTask",t),u("taskReplace.destinationID","replaceTask",t.destinationID),u("taskReplace.action","replaceTask",t.action);let p={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},runSource({sourceID:e,runSourcePayload:t},o){u("sourceID","runSource",e);let p={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return d.request(p,o)},runTask({taskID:e,runTaskPayload:t},o){u("taskID","runTask",e);let p={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return d.request(p,o)},runTaskV1({taskID:e,runTaskPayload:t},o){u("taskID","runTaskV1",e);let p={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t||{}};return d.request(p,o)},searchAuthentications(e,t){u("authenticationSearch","searchAuthentications",e),u("authenticationSearch.authenticationIDs","searchAuthentications",e.authenticationIDs);let r={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchDestinations(e,t){u("destinationSearch","searchDestinations",e),u("destinationSearch.destinationIDs","searchDestinations",e.destinationIDs);let r={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchSources(e,t){u("sourceSearch","searchSources",e),u("sourceSearch.sourceIDs","searchSources",e.sourceIDs);let r={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchTasks(e,t){u("taskSearch","searchTasks",e),u("taskSearch.taskIDs","searchTasks",e.taskIDs);let r={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchTasksV1(e,t){u("taskSearch","searchTasksV1",e),u("taskSearch.taskIDs","searchTasksV1",e.taskIDs);let r={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},searchTransformations(e,t){u("transformationSearch","searchTransformations",e),u("transformationSearch.transformationIDs","searchTransformations",e.transformationIDs);let r={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:e};return d.request(r,t)},triggerDockerSourceDiscover({sourceID:e},t){u("sourceID","triggerDockerSourceDiscover",e);let r={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},d.request(r,t)},tryTransformation(e,t){u("transformationTry","tryTransformation",e),u("transformationTry.sampleRecord","tryTransformation",e.sampleRecord);let r={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:e};return d.request(r,t)},tryTransformationBeforeUpdate({transformationID:e,transformationTry:t},o){u("transformationID","tryTransformationBeforeUpdate",e),u("transformationTry","tryTransformationBeforeUpdate",t),u("transformationTry.sampleRecord","tryTransformationBeforeUpdate",t.sampleRecord);let p={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateAuthentication({authenticationID:e,authenticationUpdate:t},o){u("authenticationID","updateAuthentication",e),u("authenticationUpdate","updateAuthentication",t);let p={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateDestination({destinationID:e,destinationUpdate:t},o){u("destinationID","updateDestination",e),u("destinationUpdate","updateDestination",t);let p={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateSource({sourceID:e,sourceUpdate:t},o){u("sourceID","updateSource",e),u("sourceUpdate","updateSource",t);let p={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateTask({taskID:e,taskUpdate:t},o){u("taskID","updateTask",e),u("taskUpdate","updateTask",t);let p={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateTaskV1({taskID:e,taskUpdate:t},o){u("taskID","updateTaskV1",e),u("taskUpdate","updateTaskV1",t);let p={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},updateTransformation({transformationID:e,transformationCreate:t},o){u("transformationID","updateTransformation",e),u("transformationCreate","updateTransformation",t),u("transformationCreate.name","updateTransformation",t.name);let p={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return d.request(p,o)},validateSource(e,t=void 0){let r={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:e||{}};return t={timeouts:{connect:18e4,read:18e4,write:18e4,...t?.timeouts}},d.request(r,t)},validateSourceBeforeUpdate({sourceID:e,sourceUpdate:t},o){u("sourceID","validateSourceBeforeUpdate",e),u("sourceUpdate","validateSourceBeforeUpdate",t);let p={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(e)),queryParameters:{},headers:{},data:t};return o={timeouts:{connect:18e4,read:18e4,write:18e4,...o?.timeouts}},d.request(p,o)}}}function Vs(s,a,c,i){if(!s||typeof s!="string")throw new Error("`appId` is missing.");if(!a||typeof a!="string")throw new Error("`apiKey` is missing.");if(!c||c&&(typeof c!="string"||!_.includes(c)))throw new Error(`\`region\` is required and must be one of the following: ${_.join(", ")}`);let{compression:P,...R}=i||{};return ue({appId:s,apiKey:a,region:c,timeouts:{connect:25e3,read:25e3,write:25e3},logger:re(),requester:ie(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:H(),requestsCache:H({serializable:!1}),hostsCache:U({caches:[Y({key:`${L}-${s}`}),H()]}),...R})}export{L as apiClientVersion,Vs as ingestionClient,ve as isOnDemandTrigger,Ce as isScheduleTrigger,Oe as isSubscriptionTrigger};
|
|
2
6
|
//# sourceMappingURL=browser.min.js.map
|