@algolia/monitoring 1.55.2 → 1.56.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,13 +4,13 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@algolia/monitoring"] = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- function V(t){let e,s=`algolia-client-js-${t.key}`;function r(){return e===void 0&&(e=t.localStorage||window.localStorage),e}function a(){return JSON.parse(r().getItem(s)||"{}")}function p(o){r().setItem(s,JSON.stringify(o));}function i(){return new Promise(o=>setTimeout(o,0))}function n(){let o=t.timeToLive?t.timeToLive*1e3:null,c=a(),u=new Date().getTime(),m=false;return {namespace:Object.fromEntries(Object.entries(c).filter(([,y])=>!y||y.timestamp===void 0||o&&y.timestamp+o<u?(m=true,false):true)),changed:m}}return {get(o,c,u={miss:()=>Promise.resolve()}){return i().then(()=>{let{namespace:m,changed:h}=n(),y=m[JSON.stringify(o)];return h&&p(m),y?y.value:c().then(v=>u.miss(v).then(()=>v))})},set(o,c){return i().then(()=>{let u=a();return u[JSON.stringify(o)]={timestamp:new Date().getTime(),value:c},r().setItem(s,JSON.stringify(u)),c})},delete(o){return i().then(()=>{let c=a();delete c[JSON.stringify(o)],r().setItem(s,JSON.stringify(c));})},clear(){return Promise.resolve().then(()=>{r().removeItem(s);})}}}function ie(){return {get(t,e,s={miss:()=>Promise.resolve()}){return e().then(a=>Promise.all([a,s.miss(a)])).then(([a])=>a)},set(t,e){return Promise.resolve(e)},delete(t){return Promise.resolve()},clear(){return Promise.resolve()}}}function C(t){let e=[...t.caches],s=e.shift();return s===void 0?ie():{get(r,a,p={miss:()=>Promise.resolve()}){return s.get(r,a,p).catch(()=>C({caches:e}).get(r,a,p))},set(r,a){return s.set(r,a).catch(()=>C({caches:e}).set(r,a))},delete(r){return s.delete(r).catch(()=>C({caches:e}).delete(r))},clear(){return s.clear().catch(()=>C({caches:e}).clear())}}}function L(t={serializable:true}){let e={};return {get(s,r,a={miss:()=>Promise.resolve()}){let p=JSON.stringify(s);if(p in e)return Promise.resolve(t.serializable?JSON.parse(e[p]):e[p]);let i=r();return i.then(n=>a.miss(n)).then(()=>i)},set(s,r){return e[JSON.stringify(s)]=t.serializable?JSON.stringify(r):r,Promise.resolve(r)},delete(s){return delete e[JSON.stringify(s)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}function ce(t){let e={value:`Algolia for JavaScript (${t})`,add(s){let r=`; ${s.segment}${s.version!==void 0?` (${s.version})`:""}`;return e.value.indexOf(r)===-1&&(e.value=`${e.value}${r}`),e}};return e}function Y(t,e,s="WithinHeaders"){let r={"x-algolia-api-key":e,"x-algolia-application-id":t};return {headers(){return s==="WithinHeaders"?r:{}},queryParameters(){return s==="WithinQueryParameters"?r:{}}}}function Z({algoliaAgents:t,client:e,version:s}){let r=ce(s).add({segment:e,version:s});return t.forEach(a=>r.add(a)),r}function ee(){return {debug(t,e){return Promise.resolve()},info(t,e){return Promise.resolve()},error(t,e){return Promise.resolve()}}}var ue=10*1024*1024;async function*le(t){let e=t.getReader();try{for(;;){let{done:s,value:r}=await e.read();if(s)return;yield r;}}finally{e.releaseLock();}}function de(t){return Symbol.asyncIterator in t?t:le(t)}async function*me(t){let e=new TextDecoder("utf-8"),s=[],r=0,a=false,p=true;for await(let n of de(t)){let o=e.decode(n,{stream:true}),c=0;for(a&&(a=false,o.length>0&&o[0]===`
8
- `&&(c=1));c<o.length;){let u=o.indexOf("\r",c),m=o.indexOf(`
9
- `,c);if(u===-1&&m===-1){let l=o.slice(c);if(s.push(l),r+=l.length,r>ue)throw new Error("SSE line buffer exceeded 10MB");break}let h,y;u!==-1&&(m===-1||u<m)?(h=u,u+1<o.length?y=o[u+1]===`
10
- `?2:1:(a=true,y=1)):(h=m,y=1);let v=o.slice(c,h);s.push(v);let b=s.length===1?s[0]:s.join("");s.length=0,r=0,p&&(b.startsWith("\uFEFF")&&(b=b.slice(1)),p=false),yield b,c=h+y;}}let i=e.decode();if(i&&s.push(i),s.length>0){let n=s.join("");p&&n.startsWith("\uFEFF")&&(n=n.slice(1)),yield n;}}var pe=class{data=[];eventType="";lastEventId=null;retry=null;decode(t){if(t==="")return this.dispatch();if(t[0]===":")return null;let e=t.indexOf(":"),s,r;switch(e===-1?(s=t,r=""):(s=t.slice(0,e),r=t.slice(e+1),r[0]===" "&&(r=r.slice(1))),s){case "data":this.data.push(r);break;case "event":this.eventType=r;break;case "id":r.includes("\0")||(this.lastEventId=r);break;case "retry":/^[0-9]+$/.test(r)&&(this.retry=parseInt(r,10));break}return null}dispatch(){let t=this.eventType;if(this.eventType="",this.data.length===0)return null;let e={data:this.data.join(`
11
- `),event:t,id:this.lastEventId,retry:this.retry};return this.data=[],e}};async function*he(t){let e=new pe;for await(let s of me(t)){let r=e.decode(s);r!==null&&(yield r);}}var fe=750,W=120*1e3;function z(t,e="up"){let s=Date.now();function r(){return e==="up"||Date.now()-s>W}function a(){return e==="timed out"&&Date.now()-s<=W}return {...t,status:e,lastUpdate:s,isUp:r,isTimedOut:a}}var te=class extends Error{name="AlgoliaError";constructor(t,e){super(t),e&&(this.name=e);}};var re=class extends te{stackTrace;constructor(t,e,s){super(t,s),this.stackTrace=e;}},J=class extends re{constructor(t){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",t,"RetryError");}},M=class extends re{status;constructor(t,e,s,r="ApiError"){super(t,s,r),this.status=e;}},ye=class extends te{response;constructor(t,e){super(t,"DeserializationError"),this.response=e;}},ge=class extends M{error;constructor(t,e,s,r){super(t,e,r,"DetailedApiError"),this.error=s;}};function B(t,e,s){let r=Pe(s),a=`${t.protocol}://${t.url}${t.port?`:${t.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return r.length&&(a+=`?${r}`),a}function Pe(t){return Object.keys(t).filter(e=>t[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(t[e])==="[object Array]"?t[e].join(","):t[e]).replace(/\+/g,"%20")}`).join("&")}function X(t,e){if(t.method==="GET"||t.data===void 0&&e.data===void 0)return;let s=Array.isArray(t.data)?t.data:{...t.data,...e.data};return JSON.stringify(s)}function K(t,e,s){let r={Accept:"application/json",...t,...e,...s},a={};return Object.keys(r).forEach(p=>{let i=r[p];a[p.toLowerCase()]=i;}),a}function Te(t){if(!(t.status===204||t.content.length===0))try{return JSON.parse(t.content)}catch(e){throw new ye(e.message,t)}}function Re({content:t,status:e},s){try{let r=JSON.parse(t);return "error"in r?new ge(r.message,e,r.error,s):new M(r.message,e,s)}catch{}return new M(t,e,s)}function Ee({isTimedOut:t,status:e}){return !t&&~~e===0}function ve({isTimedOut:t,status:e}){return t||Ee({isTimedOut:t,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function qe({status:t}){return ~~(t/100)===2}function xe(t){return t.map(e=>se(e))}function se(t){let e=t.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...t,request:{...t.request,headers:{...t.request.headers,...e}}}}function ne({hosts:t,hostsCache:e,baseHeaders:s,logger:r,baseQueryParameters:a,algoliaAgent:p,timeouts:i,requester:n,requestsCache:o,responsesCache:c,compress:u,compression:m}){async function h(l){let d=await Promise.all(l.map(f=>e.get(f,()=>Promise.resolve(z(f))))),x=d.filter(f=>f.isUp()),T=d.filter(f=>f.isTimedOut()),q=[...x,...T];return {hosts:q.length>0?q:l,getTimeout(f,w){return (T.length===0&&f===0?1:T.length+3+f)*w}}}async function y(l,d,x){let T=[],q=X(l,d),g=K(s,l.headers,d.headers),f=m==="gzip"&&q!==void 0&&q.length>fe&&(l.method==="POST"||l.method==="PUT");f&&u===void 0&&r.info("Compression is disabled because no compress method is available.");let w=f&&u!==void 0,D=w?await u(q):q;w&&(g["content-encoding"]="gzip");let _=l.method==="GET"?{...l.data,...d.data}:{},S={...a,...l.queryParameters,..._};if(p.value&&(S["x-algolia-agent"]=p.value),d&&d.queryParameters)for(let P of Object.keys(d.queryParameters))!d.queryParameters[P]||Object.prototype.toString.call(d.queryParameters[P])==="[object Object]"?S[P]=d.queryParameters[P]:S[P]=d.queryParameters[P].toString();let A=0,k=async(P,G)=>{let O=P.pop();if(O===void 0)throw new J(xe(T));let U={...i,...d.timeouts},j={data:D,headers:g,method:l.method,url:B(O,l.path,S),connectTimeout:G(A,U.connect),responseTimeout:G(A,x?U.read:U.write)},F=H=>{let Q={request:j,response:H,host:O,triesLeft:P.length};return T.push(Q),Q},I=await n.send(j);if(ve(I)){let H=F(I);return I.isTimedOut&&A++,r.info("Retryable failure",se(H)),await e.set(O,z(O,I.isTimedOut?"timed out":"down")),k(P,G)}if(qe(I))return Te(I);throw F(I),Re(I,T)},R=t.filter(P=>P.accept==="readWrite"||(x?P.accept==="read":P.accept==="write")),$=await h(R);return k([...$.hosts].reverse(),$.getTimeout)}function v(l,d={}){let x=()=>y(l,d,T),T=l.useReadTransporter||l.method==="GET";if((d.cacheable||l.cacheable)!==true)return x();let g={request:l,requestOptions:d,transporter:{queryParameters:a,headers:s}};return c.get(g,()=>o.get(g,()=>o.set(g,x()).then(f=>Promise.all([o.delete(g),f]),f=>Promise.all([o.delete(g),Promise.reject(f)])).then(([f,w])=>w)),{miss:f=>c.set(g,f)})}async function*b(l,d={}){if(!n.sendStream)throw new Error("This requester does not support streaming");let x=X(l,d),T=K(s,l.headers,d.headers);T.accept="text/event-stream";let q=l.method==="GET"?{...l.data,...d.data}:{},g={...a,...l.queryParameters,...q};if(p.value&&(g["x-algolia-agent"]=p.value),d&&d.queryParameters)for(let R of Object.keys(d.queryParameters))!d.queryParameters[R]||Object.prototype.toString.call(d.queryParameters[R])==="[object Object]"?g[R]=d.queryParameters[R]:g[R]=d.queryParameters[R].toString();let f=l.useReadTransporter||l.method==="GET",w=t.filter(R=>R.accept==="readWrite"||(f?R.accept==="read":R.accept==="write")),_=(await h(w)).hosts[0];if(!_)throw new J([]);let S={...i,...d.timeouts},A={data:x,headers:T,method:l.method,url:B(_,l.path,g),connectTimeout:S.connect,responseTimeout:f?S.read:S.write},k=await n.sendStream(A);yield*he(k);}return {hostsCache:e,requester:n,timeouts:i,logger:r,algoliaAgent:p,baseHeaders:s,baseQueryParameters:a,hosts:t,request:v,requestStream:b,requestsCache:o,responsesCache:c}}function E(t,e,s){if(s==null||typeof s=="string"&&s.length===0)throw new Error(`Parameter \`${t}\` is required when calling \`${e}\`.`)}function oe(){function t(e){return new Promise(s=>{let r=new XMLHttpRequest;r.open(e.method,e.url,true),Object.keys(e.headers).forEach(n=>r.setRequestHeader(n,e.headers[n]));let a=(n,o)=>setTimeout(()=>{r.abort(),s({status:0,content:o,isTimedOut:true});},n),p=a(e.connectTimeout,"Connection timeout"),i;r.onreadystatechange=()=>{r.readyState>r.OPENED&&i===void 0&&(clearTimeout(p),i=a(e.responseTimeout,"Socket timeout"));},r.onerror=()=>{r.status===0&&(clearTimeout(p),clearTimeout(i),s({content:r.responseText||"Network request failed",status:r.status,isTimedOut:false}));},r.onload=()=>{clearTimeout(p),clearTimeout(i),s({content:r.responseText,status:r.status,isTimedOut:false});},r.send(e.data);})}return {send:t}}var N="1.55.2";function we(){return [{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function ae({appId:t,apiKey:e,authMode:s,algoliaAgents:r,...a}){let p=Y(t,e,s),i=ne({hosts:we(),...a,algoliaAgent:Z({algoliaAgents:r,client:"Monitoring",version:N}),baseHeaders:{"content-type":"text/plain",...p.headers(),...a.baseHeaders},baseQueryParameters:{...p.queryParameters(),...a.baseQueryParameters}});return {transporter:i,appId:t,apiKey:e,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(n,o){i.algoliaAgent.add({segment:n,version:o});},setClientApiKey({apiKey:n}){!s||s==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=n:i.baseQueryParameters["x-algolia-api-key"]=n;},customDelete({path:n,parameters:o},c){E("path","customDelete",n);let y={method:"DELETE",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.request(y,c)},customGet({path:n,parameters:o},c){E("path","customGet",n);let y={method:"GET",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.request(y,c)},customPost({path:n,parameters:o,body:c},u){E("path","customPost",n);let v={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:c||{}};return i.request(v,u)},customPut({path:n,parameters:o,body:c},u){E("path","customPut",n);let v={method:"PUT",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:c||{}};return i.request(v,u)},getClusterIncidents({clusters:n},o){E("clusters","getClusterIncidents",n);let h={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(h,o)},getClusterStatus({clusters:n},o){E("clusters","getClusterStatus",n);let h={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(h,o)},getIncidents(n){let m={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return i.request(m,n)},getIndexingTime({clusters:n},o){E("clusters","getIndexingTime",n);let h={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(h,o)},getLatency({clusters:n},o){E("clusters","getLatency",n);let h={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(h,o)},getMetrics({metric:n,period:o},c){E("metric","getMetrics",n),E("period","getMetrics",o);let y={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(n)).replace("{period}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(y,c)},getReachability({clusters:n},o){E("clusters","getReachability",n);let h={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(h,o)},getServers(n){let m={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return i.request(m,n)},getStatus(n){let m={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return i.request(m,n)}}}function dt(t,e,s){if(!t||typeof t!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");let{compression:r,...a}=s||{};return ae({appId:t,apiKey:e,timeouts:{connect:1e3,read:2e3,write:3e4},logger:ee(),requester:oe(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:L(),requestsCache:L({serializable:false}),hostsCache:C({caches:[V({key:`${N}-${t}`}),L()]}),...a})}
7
+ function Y(e){let t,n=`algolia-client-js-${e.key}`;function s(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function l(){return JSON.parse(s().getItem(n)||"{}")}function P(o){s().setItem(n,JSON.stringify(o));}function i(){return new Promise(o=>setTimeout(o,0))}function r(){let o=e.timeToLive?e.timeToLive*1e3:null,a=l(),u=new Date().getTime(),c=false;return {namespace:Object.fromEntries(Object.entries(a).filter(([,p])=>!p||p.timestamp===void 0||o&&p.timestamp+o<u?(c=true,false):true)),changed:c}}return {get(o,a,u={miss:()=>Promise.resolve()}){return i().then(()=>{let{namespace:c,changed:d}=r(),p=c[JSON.stringify(o)];return d&&P(c),p?p.value:a().then(q=>u.miss(q).then(()=>q))})},set(o,a){return i().then(()=>{let u=l();return u[JSON.stringify(o)]={timestamp:new Date().getTime(),value:a},s().setItem(n,JSON.stringify(u)),a})},delete(o){return i().then(()=>{let a=l();delete a[JSON.stringify(o)],s().setItem(n,JSON.stringify(a));})},clear(){return Promise.resolve().then(()=>{s().removeItem(n);})}}}function ce(){return {get(e,t,n={miss:()=>Promise.resolve()}){return t().then(l=>Promise.all([l,n.miss(l)])).then(([l])=>l)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function w(e){let t=[...e.caches],n=t.shift();return n===void 0?ce():{get(s,l,P={miss:()=>Promise.resolve()}){return n.get(s,l,P).catch(()=>w({caches:t}).get(s,l,P))},set(s,l){return n.set(s,l).catch(()=>w({caches:t}).set(s,l))},delete(s){return n.delete(s).catch(()=>w({caches:t}).delete(s))},clear(){return n.clear().catch(()=>w({caches:t}).clear())}}}function k(e={serializable:true}){let t={};return {get(n,s,l={miss:()=>Promise.resolve()}){let P=JSON.stringify(n);if(P in t)return Promise.resolve(e.serializable?JSON.parse(t[P]):t[P]);let i=s();return i.then(r=>l.miss(r)).then(()=>i)},set(n,s){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(n){return delete t[JSON.stringify(n)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function le(e){let t={value:`Algolia for JavaScript (${e})`,add(n){let s=`; ${n.segment}${n.version!==void 0?` (${n.version})`:""}`;return t.value.indexOf(s)===-1&&(t.value=`${t.value}${s}`),t}};return t}function Z(e,t,n="WithinHeaders"){let s={"x-algolia-api-key":t,"x-algolia-application-id":e};return {headers(){return n==="WithinHeaders"?s:{}},queryParameters(){return n==="WithinQueryParameters"?s:{}}}}function ee({algoliaAgents:e,client:t,version:n}){let s=le(n).add({segment:t,version:n});return e.forEach(l=>s.add(l)),s}function te(){return {debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var de=10*1024*1024;async function*me(e){let t=e.getReader();try{for(;;){let{done:n,value:s}=await t.read();if(n)return;yield s;}}finally{t.releaseLock();}}function he(e){return Symbol.asyncIterator in e?e:me(e)}async function*pe(e){let t=new TextDecoder("utf-8"),n=[],s=0,l=false,P=true;for await(let r of he(e)){let o=t.decode(r,{stream:true}),a=0;for(l&&(l=false,o.length>0&&o[0]===`
8
+ `&&(a=1));a<o.length;){let u=o.indexOf("\r",a),c=o.indexOf(`
9
+ `,a);if(u===-1&&c===-1){let b=o.slice(a);if(n.push(b),s+=b.length,s>de)throw new Error("SSE line buffer exceeded 10MB");break}let d,p;u!==-1&&(c===-1||u<c)?(d=u,u+1<o.length?p=o[u+1]===`
10
+ `?2:1:(l=true,p=1)):(d=c,p=1);let q=o.slice(a,d);n.push(q);let C=n.length===1?n[0]:n.join("");n.length=0,s=0,P&&(C.startsWith("\uFEFF")&&(C=C.slice(1)),P=false),yield C,a=d+p;}}let i=t.decode();if(i&&n.push(i),n.length>0){let r=n.join("");P&&r.startsWith("\uFEFF")&&(r=r.slice(1)),yield r;}}var Pe=class{data=[];eventType="";lastEventId=null;retry=null;decode(e){if(e==="")return this.dispatch();if(e[0]===":")return null;let t=e.indexOf(":"),n,s;switch(t===-1?(n=e,s=""):(n=e.slice(0,t),s=e.slice(t+1),s[0]===" "&&(s=s.slice(1))),n){case "data":this.data.push(s);break;case "event":this.eventType=s;break;case "id":s.includes("\0")||(this.lastEventId=s);break;case "retry":/^[0-9]+$/.test(s)&&(this.retry=parseInt(s,10));break}return null}dispatch(){let e=this.eventType;if(this.eventType="",this.data.length===0)return null;let t={data:this.data.join(`
11
+ `),event:e,id:this.lastEventId,retry:this.retry};return this.data=[],t}};async function*fe(e){let t=new Pe;for await(let n of pe(e)){let s=t.decode(n);s!==null&&(yield s);}}var ye=750,z=120*1e3;function J(e,t="up"){let n=Date.now();function s(){return t==="up"||Date.now()-n>z}function l(){return t==="timed out"&&Date.now()-n<=z}return {...e,status:t,lastUpdate:n,isUp:s,isTimedOut:l}}var re=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t);}};var se=class extends re{stackTrace;constructor(e,t,n){super(e,n),this.stackTrace=t;}},B=class extends se{constructor(e){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",e,"RetryError");}},M=class extends se{status;constructor(e,t,n,s="ApiError"){super(e,n,s),this.status=t;}},ge=class extends re{response;constructor(e,t){super(e,"DeserializationError"),this.response=t;}},qe=class extends M{error;constructor(e,t,n,s){super(e,t,s,"DetailedApiError"),this.error=n;}};function X(e,t,n){let s=Te(n),l=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return s.length&&(l+=`?${s}`),l}function Te(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])==="[object Array]"?e[t].join(","):e[t]).replace(/\+/g,"%20")}`).join("&")}function K(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;let n=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(n)}function V(e,t,n){let s={Accept:"application/json",...e,...t,...n},l={};return Object.keys(s).forEach(P=>{let i=s[P];l[P.toLowerCase()]=i;}),l}function ne(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new ge(t.message,e)}}function Re(e){return {status:e.status,headers:e.headers,content:e.content,data:ne(e)}}function Ie({content:e,status:t},n){try{let s=JSON.parse(e);return "error"in s?new qe(s.message,t,s.error,n):new M(s.message,t,n)}catch{}return new M(e,t,n)}function Ee({isTimedOut:e,status:t}){return !e&&~~t===0}function ve({isTimedOut:e,status:t}){return e||Ee({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function He({status:e}){return ~~(e/100)===2}function xe(e){return e.map(t=>oe(t))}function oe(e){let t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function ae({hosts:e,hostsCache:t,baseHeaders:n,logger:s,baseQueryParameters:l,algoliaAgent:P,timeouts:i,requester:r,requestsCache:o,responsesCache:a,compress:u,compression:c}){async function d(m){let h=await Promise.all(m.map(f=>t.get(f,()=>Promise.resolve(J(f))))),E=h.filter(f=>f.isUp()),T=h.filter(f=>f.isTimedOut()),v=[...E,...T];return {hosts:v.length>0?v:m,getTimeout(f,H){return (T.length===0&&f===0?1:T.length+3+f)*H}}}async function p(m,h,E){let T=[],v=K(m,h),g=V(n,m.headers,h.headers),f=c==="gzip"&&v!==void 0&&v.length>ye&&(m.method==="POST"||m.method==="PUT");f&&u===void 0&&s.info("Compression is disabled because no compress method is available.");let H=f&&u!==void 0,_=H?await u(v):v;H&&(g["content-encoding"]="gzip");let W=m.method==="GET"?{...m.data,...h.data}:{},x={...l,...m.queryParameters,...W};if(P.value&&(x["x-algolia-agent"]=P.value),h&&h.queryParameters)for(let R of Object.keys(h.queryParameters))!h.queryParameters[R]||Object.prototype.toString.call(h.queryParameters[R])==="[object Object]"?x[R]=h.queryParameters[R]:x[R]=h.queryParameters[R].toString();let A=0,G=async(R,D)=>{let O=R.pop();if(O===void 0)throw new B(xe(T));let U={...i,...h.timeouts},$={data:_,headers:g,method:m.method,url:X(O,m.path,x),connectTimeout:D(A,U.connect),responseTimeout:D(A,E?U.read:U.write)},j=N=>{let F={request:$,response:N,host:O,triesLeft:R.length};return T.push(F),F},S=await r.send($);if(ve(S)){let N=j(S);return S.isTimedOut&&A++,s.info("Retryable failure",oe(N)),await t.set(O,J(O,S.isTimedOut?"timed out":"down")),G(R,D)}if(He(S))return S;throw j(S),Ie(S,T)},I=e.filter(R=>R.accept==="readWrite"||(E?R.accept==="read":R.accept==="write")),Q=await d(I);return G([...Q.hosts].reverse(),Q.getTimeout)}function q(m,h={}){let E=()=>p(m,h,T).then(f=>ne(f)),T=m.useReadTransporter||m.method==="GET";if((h.cacheable||m.cacheable)!==true)return E();let g={request:m,requestOptions:h,transporter:{queryParameters:l,headers:n}};return a.get(g,()=>o.get(g,()=>o.set(g,E()).then(f=>Promise.all([o.delete(g),f]),f=>Promise.all([o.delete(g),Promise.reject(f)])).then(([f,H])=>H)),{miss:f=>a.set(g,f)})}function C(m,h={}){let E=m.useReadTransporter||m.method==="GET";return p(m,h,E).then(T=>Re(T))}async function*b(m,h={}){if(!r.sendStream)throw new Error("This requester does not support streaming");let E=K(m,h),T=V(n,m.headers,h.headers);T.accept="text/event-stream";let v=m.method==="GET"?{...m.data,...h.data}:{},g={...l,...m.queryParameters,...v};if(P.value&&(g["x-algolia-agent"]=P.value),h&&h.queryParameters)for(let I of Object.keys(h.queryParameters))!h.queryParameters[I]||Object.prototype.toString.call(h.queryParameters[I])==="[object Object]"?g[I]=h.queryParameters[I]:g[I]=h.queryParameters[I].toString();let f=m.useReadTransporter||m.method==="GET",H=e.filter(I=>I.accept==="readWrite"||(f?I.accept==="read":I.accept==="write")),W=(await d(H)).hosts[0];if(!W)throw new B([]);let x={...i,...h.timeouts},A={data:E,headers:T,method:m.method,url:X(W,m.path,g),connectTimeout:x.connect,responseTimeout:f?x.read:x.write},G=await r.sendStream(A);yield*fe(G);}return {hostsCache:t,requester:r,timeouts:i,logger:s,algoliaAgent:P,baseHeaders:n,baseQueryParameters:l,hosts:e,request:q,requestWithHttpInfo:C,requestStream:b,requestsCache:o,responsesCache:a}}function y(e,t,n){if(n==null||typeof n=="string"&&n.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function Se(e){let t={};for(let n of e.trim().split(/[\r\n]+/)){let s=n.indexOf(": ");s>0&&(t[n.slice(0,s).toLowerCase()]=n.slice(s+2));}return t}function ie(){function e(t){return new Promise(n=>{let s=new XMLHttpRequest;s.open(t.method,t.url,true),Object.keys(t.headers).forEach(r=>s.setRequestHeader(r,t.headers[r]));let l=(r,o)=>setTimeout(()=>{s.abort(),n({status:0,content:o,isTimedOut:true});},r),P=l(t.connectTimeout,"Connection timeout"),i;s.onreadystatechange=()=>{s.readyState>s.OPENED&&i===void 0&&(clearTimeout(P),i=l(t.responseTimeout,"Socket timeout"));},s.onerror=()=>{s.status===0&&(clearTimeout(P),clearTimeout(i),n({content:s.responseText||"Network request failed",status:s.status,isTimedOut:false}));},s.onload=()=>{clearTimeout(P),clearTimeout(i),n({content:s.responseText,headers:Se(s.getAllResponseHeaders()),status:s.status,isTimedOut:false});},s.send(t.data);})}return {send:e}}var L="1.56.0";function Ce(){return [{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function ue({appId:e,apiKey:t,authMode:n,algoliaAgents:s,...l}){let P=Z(e,t,n),i=ae({hosts:Ce(),...l,algoliaAgent:ee({algoliaAgents:s,client:"Monitoring",version:L}),baseHeaders:{"content-type":"text/plain",...P.headers(),...l.baseHeaders},baseQueryParameters:{...P.queryParameters(),...l.baseQueryParameters}});return {transporter:i,appId:e,apiKey:t,clearCache(){return Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then(()=>{})},get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(r,o){i.algoliaAgent.add({segment:r,version:o});},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=r:i.baseQueryParameters["x-algolia-api-key"]=r;},customDelete({path:r,parameters:o},a){y("path","customDelete",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return i.request(p,a)},customDeleteWithHTTPInfo({path:r,parameters:o},a){y("path","customDeleteWithHTTPInfo",r);let p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return i.requestWithHttpInfo(p,a)},customGet({path:r,parameters:o},a){y("path","customGet",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return i.request(p,a)},customGetWithHTTPInfo({path:r,parameters:o},a){y("path","customGetWithHTTPInfo",r);let p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{}};return i.requestWithHttpInfo(p,a)},customPost({path:r,parameters:o,body:a},u){y("path","customPost",r);let q={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return i.request(q,u)},customPostWithHTTPInfo({path:r,parameters:o,body:a},u){y("path","customPostWithHTTPInfo",r);let q={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return i.requestWithHttpInfo(q,u)},customPut({path:r,parameters:o,body:a},u){y("path","customPut",r);let q={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return i.request(q,u)},customPutWithHTTPInfo({path:r,parameters:o,body:a},u){y("path","customPutWithHTTPInfo",r);let q={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:o||{},headers:{},data:a||{}};return i.requestWithHttpInfo(q,u)},getClusterIncidents({clusters:r},o){y("clusters","getClusterIncidents",r);let d={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(d,o)},getClusterIncidentsWithHTTPInfo({clusters:r},o){y("clusters","getClusterIncidentsWithHTTPInfo",r);let d={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getClusterStatus({clusters:r},o){y("clusters","getClusterStatus",r);let d={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(d,o)},getClusterStatusWithHTTPInfo({clusters:r},o){y("clusters","getClusterStatusWithHTTPInfo",r);let d={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getIncidents(r){let c={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return i.request(c,r)},getIncidentsWithHTTPInfo(r){let c={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return i.requestWithHttpInfo(c,r)},getIndexingTime({clusters:r},o){y("clusters","getIndexingTime",r);let d={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(d,o)},getIndexingTimeWithHTTPInfo({clusters:r},o){y("clusters","getIndexingTimeWithHTTPInfo",r);let d={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getLatency({clusters:r},o){y("clusters","getLatency",r);let d={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(d,o)},getLatencyWithHTTPInfo({clusters:r},o){y("clusters","getLatencyWithHTTPInfo",r);let d={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getMetrics({metric:r,period:o},a){y("metric","getMetrics",r),y("period","getMetrics",o);let p={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(r)).replace("{period}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(p,a)},getMetricsWithHTTPInfo({metric:r,period:o},a){y("metric","getMetricsWithHTTPInfo",r),y("period","getMetricsWithHTTPInfo",o);let p={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(r)).replace("{period}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(p,a)},getReachability({clusters:r},o){y("clusters","getReachability",r);let d={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.request(d,o)},getReachabilityWithHTTPInfo({clusters:r},o){y("clusters","getReachabilityWithHTTPInfo",r);let d={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(r)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getServers(r){let c={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return i.request(c,r)},getServersWithHTTPInfo(r){let c={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return i.requestWithHttpInfo(c,r)},getStatus(r){let c={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return i.request(c,r)},getStatusWithHTTPInfo(r){let c={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return i.requestWithHttpInfo(c,r)}}}function pt(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");let{compression:s,...l}=n||{};return ue({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:te(),requester:ie(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:k(),requestsCache:k({serializable:false}),hostsCache:w({caches:[Y({key:`${L}-${e}`}),k()]}),...l})}
12
12
 
13
- exports.apiClientVersion = N;
14
- exports.monitoringClient = dt;
13
+ exports.apiClientVersion = L;
14
+ exports.monitoringClient = pt;
15
15
 
16
16
  }));
@@ -5,7 +5,7 @@ import { createFetchRequester } from "@algolia/requester-fetch";
5
5
 
6
6
  // src/monitoringClient.ts
7
7
  import { createAuth, createTransporter, getAlgoliaAgent, validateRequired } from "@algolia/client-common";
8
- var apiClientVersion = "1.55.2";
8
+ var apiClientVersion = "1.56.0";
9
9
  function getDefaultHosts() {
10
10
  return [{ url: "status.algolia.com", accept: "readWrite", protocol: "https" }];
11
11
  }
@@ -99,6 +99,29 @@ function createMonitoringClient({
99
99
  };
100
100
  return transporter.request(request, requestOptions);
101
101
  },
102
+ /**
103
+ * This method lets you send requests to the Algolia REST API.
104
+ *
105
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
106
+ * @param customDelete - The customDelete object.
107
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
108
+ * @param customDelete.parameters - Query parameters to apply to the current query.
109
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
110
+ * @see customDelete for the plain version.
111
+ */
112
+ customDeleteWithHTTPInfo({ path, parameters }, requestOptions) {
113
+ validateRequired("path", "customDeleteWithHTTPInfo", path);
114
+ const requestPath = "/{path}".replace("{path}", path);
115
+ const headers = {};
116
+ const queryParameters = parameters ? parameters : {};
117
+ const request = {
118
+ method: "DELETE",
119
+ path: requestPath,
120
+ queryParameters,
121
+ headers
122
+ };
123
+ return transporter.requestWithHttpInfo(request, requestOptions);
124
+ },
102
125
  /**
103
126
  * This method lets you send requests to the Algolia REST API.
104
127
  * @param customGet - The customGet object.
@@ -119,6 +142,29 @@ function createMonitoringClient({
119
142
  };
120
143
  return transporter.request(request, requestOptions);
121
144
  },
145
+ /**
146
+ * This method lets you send requests to the Algolia REST API.
147
+ *
148
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
149
+ * @param customGet - The customGet object.
150
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
151
+ * @param customGet.parameters - Query parameters to apply to the current query.
152
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
153
+ * @see customGet for the plain version.
154
+ */
155
+ customGetWithHTTPInfo({ path, parameters }, requestOptions) {
156
+ validateRequired("path", "customGetWithHTTPInfo", path);
157
+ const requestPath = "/{path}".replace("{path}", path);
158
+ const headers = {};
159
+ const queryParameters = parameters ? parameters : {};
160
+ const request = {
161
+ method: "GET",
162
+ path: requestPath,
163
+ queryParameters,
164
+ headers
165
+ };
166
+ return transporter.requestWithHttpInfo(request, requestOptions);
167
+ },
122
168
  /**
123
169
  * This method lets you send requests to the Algolia REST API.
124
170
  * @param customPost - The customPost object.
@@ -141,6 +187,31 @@ function createMonitoringClient({
141
187
  };
142
188
  return transporter.request(request, requestOptions);
143
189
  },
190
+ /**
191
+ * This method lets you send requests to the Algolia REST API.
192
+ *
193
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
194
+ * @param customPost - The customPost object.
195
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
196
+ * @param customPost.parameters - Query parameters to apply to the current query.
197
+ * @param customPost.body - Parameters to send with the custom request.
198
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
199
+ * @see customPost for the plain version.
200
+ */
201
+ customPostWithHTTPInfo({ path, parameters, body }, requestOptions) {
202
+ validateRequired("path", "customPostWithHTTPInfo", path);
203
+ const requestPath = "/{path}".replace("{path}", path);
204
+ const headers = {};
205
+ const queryParameters = parameters ? parameters : {};
206
+ const request = {
207
+ method: "POST",
208
+ path: requestPath,
209
+ queryParameters,
210
+ headers,
211
+ data: body ? body : {}
212
+ };
213
+ return transporter.requestWithHttpInfo(request, requestOptions);
214
+ },
144
215
  /**
145
216
  * This method lets you send requests to the Algolia REST API.
146
217
  * @param customPut - The customPut object.
@@ -163,6 +234,31 @@ function createMonitoringClient({
163
234
  };
164
235
  return transporter.request(request, requestOptions);
165
236
  },
237
+ /**
238
+ * This method lets you send requests to the Algolia REST API.
239
+ *
240
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
241
+ * @param customPut - The customPut object.
242
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
243
+ * @param customPut.parameters - Query parameters to apply to the current query.
244
+ * @param customPut.body - Parameters to send with the custom request.
245
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
246
+ * @see customPut for the plain version.
247
+ */
248
+ customPutWithHTTPInfo({ path, parameters, body }, requestOptions) {
249
+ validateRequired("path", "customPutWithHTTPInfo", path);
250
+ const requestPath = "/{path}".replace("{path}", path);
251
+ const headers = {};
252
+ const queryParameters = parameters ? parameters : {};
253
+ const request = {
254
+ method: "PUT",
255
+ path: requestPath,
256
+ queryParameters,
257
+ headers,
258
+ data: body ? body : {}
259
+ };
260
+ return transporter.requestWithHttpInfo(request, requestOptions);
261
+ },
166
262
  /**
167
263
  * Retrieves known incidents for the selected clusters.
168
264
  * @param getClusterIncidents - The getClusterIncidents object.
@@ -182,6 +278,28 @@ function createMonitoringClient({
182
278
  };
183
279
  return transporter.request(request, requestOptions);
184
280
  },
281
+ /**
282
+ * Retrieves known incidents for the selected clusters.
283
+ *
284
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
285
+ * @param getClusterIncidents - The getClusterIncidents object.
286
+ * @param getClusterIncidents.clusters - Subset of clusters, separated by commas.
287
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
288
+ * @see getClusterIncidents for the plain version.
289
+ */
290
+ getClusterIncidentsWithHTTPInfo({ clusters }, requestOptions) {
291
+ validateRequired("clusters", "getClusterIncidentsWithHTTPInfo", clusters);
292
+ const requestPath = "/1/incidents/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
293
+ const headers = {};
294
+ const queryParameters = {};
295
+ const request = {
296
+ method: "GET",
297
+ path: requestPath,
298
+ queryParameters,
299
+ headers
300
+ };
301
+ return transporter.requestWithHttpInfo(request, requestOptions);
302
+ },
185
303
  /**
186
304
  * Retrieves the status of selected clusters.
187
305
  * @param getClusterStatus - The getClusterStatus object.
@@ -201,6 +319,28 @@ function createMonitoringClient({
201
319
  };
202
320
  return transporter.request(request, requestOptions);
203
321
  },
322
+ /**
323
+ * Retrieves the status of selected clusters.
324
+ *
325
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
326
+ * @param getClusterStatus - The getClusterStatus object.
327
+ * @param getClusterStatus.clusters - Subset of clusters, separated by commas.
328
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
329
+ * @see getClusterStatus for the plain version.
330
+ */
331
+ getClusterStatusWithHTTPInfo({ clusters }, requestOptions) {
332
+ validateRequired("clusters", "getClusterStatusWithHTTPInfo", clusters);
333
+ const requestPath = "/1/status/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
334
+ const headers = {};
335
+ const queryParameters = {};
336
+ const request = {
337
+ method: "GET",
338
+ path: requestPath,
339
+ queryParameters,
340
+ headers
341
+ };
342
+ return transporter.requestWithHttpInfo(request, requestOptions);
343
+ },
204
344
  /**
205
345
  * Retrieves known incidents for all clusters.
206
346
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -217,6 +357,25 @@ function createMonitoringClient({
217
357
  };
218
358
  return transporter.request(request, requestOptions);
219
359
  },
360
+ /**
361
+ * Retrieves known incidents for all clusters.
362
+ *
363
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
364
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
365
+ * @see getIncidents for the plain version.
366
+ */
367
+ getIncidentsWithHTTPInfo(requestOptions) {
368
+ const requestPath = "/1/incidents";
369
+ const headers = {};
370
+ const queryParameters = {};
371
+ const request = {
372
+ method: "GET",
373
+ path: requestPath,
374
+ queryParameters,
375
+ headers
376
+ };
377
+ return transporter.requestWithHttpInfo(request, requestOptions);
378
+ },
220
379
  /**
221
380
  * Retrieves indexing latency metrics for selected clusters. This endpoint is intended for infrastructure-level monitoring and availability checks. The returned value reflects latency measured on Algolia\'s internal monitoring index and is reported in milliseconds. This metric isn\'t intended to represent the indexing performance of an individual application or index. To measure when an indexing operation has completed for your application, use the `waitTask` method.
222
381
  * @param getIndexingTime - The getIndexingTime object.
@@ -236,6 +395,28 @@ function createMonitoringClient({
236
395
  };
237
396
  return transporter.request(request, requestOptions);
238
397
  },
398
+ /**
399
+ * Retrieves indexing latency metrics for selected clusters. This endpoint is intended for infrastructure-level monitoring and availability checks. The returned value reflects latency measured on Algolia\'s internal monitoring index and is reported in milliseconds. This metric isn\'t intended to represent the indexing performance of an individual application or index. To measure when an indexing operation has completed for your application, use the `waitTask` method.
400
+ *
401
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
402
+ * @param getIndexingTime - The getIndexingTime object.
403
+ * @param getIndexingTime.clusters - Subset of clusters, separated by commas.
404
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
405
+ * @see getIndexingTime for the plain version.
406
+ */
407
+ getIndexingTimeWithHTTPInfo({ clusters }, requestOptions) {
408
+ validateRequired("clusters", "getIndexingTimeWithHTTPInfo", clusters);
409
+ const requestPath = "/1/indexing/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
410
+ const headers = {};
411
+ const queryParameters = {};
412
+ const request = {
413
+ method: "GET",
414
+ path: requestPath,
415
+ queryParameters,
416
+ headers
417
+ };
418
+ return transporter.requestWithHttpInfo(request, requestOptions);
419
+ },
239
420
  /**
240
421
  * Retrieves the average latency for search requests for selected clusters.
241
422
  * @param getLatency - The getLatency object.
@@ -255,6 +436,28 @@ function createMonitoringClient({
255
436
  };
256
437
  return transporter.request(request, requestOptions);
257
438
  },
439
+ /**
440
+ * Retrieves the average latency for search requests for selected clusters.
441
+ *
442
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
443
+ * @param getLatency - The getLatency object.
444
+ * @param getLatency.clusters - Subset of clusters, separated by commas.
445
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
446
+ * @see getLatency for the plain version.
447
+ */
448
+ getLatencyWithHTTPInfo({ clusters }, requestOptions) {
449
+ validateRequired("clusters", "getLatencyWithHTTPInfo", clusters);
450
+ const requestPath = "/1/latency/{clusters}".replace("{clusters}", encodeURIComponent(clusters));
451
+ const headers = {};
452
+ const queryParameters = {};
453
+ const request = {
454
+ method: "GET",
455
+ path: requestPath,
456
+ queryParameters,
457
+ headers
458
+ };
459
+ return transporter.requestWithHttpInfo(request, requestOptions);
460
+ },
258
461
  /**
259
462
  * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).
260
463
  * @param getMetrics - The getMetrics object.
@@ -276,6 +479,30 @@ function createMonitoringClient({
276
479
  };
277
480
  return transporter.request(request, requestOptions);
278
481
  },
482
+ /**
483
+ * Retrieves metrics related to your Algolia infrastructure, aggregated over a selected time window. Access to this API is available as part of the [Premium or Elevate plans](https://www.algolia.com/pricing). You must authenticate requests with the `x-algolia-application-id` and `x-algolia-api-key` headers (using the Monitoring API key).
484
+ *
485
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
486
+ * @param getMetrics - The getMetrics object.
487
+ * @param getMetrics.metric - Metric to report. For more information about the individual metrics, see the description of the API response. To include all metrics, use `*`.
488
+ * @param getMetrics.period - Period over which to aggregate the metrics: - `minute`. Aggregate the last minute. 1 data point per 10 seconds. - `hour`. Aggregate the last hour. 1 data point per minute. - `day`. Aggregate the last day. 1 data point per 10 minutes. - `week`. Aggregate the last week. 1 data point per hour. - `month`. Aggregate the last month. 1 data point per day.
489
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
490
+ * @see getMetrics for the plain version.
491
+ */
492
+ getMetricsWithHTTPInfo({ metric, period }, requestOptions) {
493
+ validateRequired("metric", "getMetricsWithHTTPInfo", metric);
494
+ validateRequired("period", "getMetricsWithHTTPInfo", period);
495
+ const requestPath = "/1/infrastructure/{metric}/period/{period}".replace("{metric}", encodeURIComponent(metric)).replace("{period}", encodeURIComponent(period));
496
+ const headers = {};
497
+ const queryParameters = {};
498
+ const request = {
499
+ method: "GET",
500
+ path: requestPath,
501
+ queryParameters,
502
+ headers
503
+ };
504
+ return transporter.requestWithHttpInfo(request, requestOptions);
505
+ },
279
506
  /**
280
507
  * Test whether clusters are reachable or not.
281
508
  * @param getReachability - The getReachability object.
@@ -295,6 +522,28 @@ function createMonitoringClient({
295
522
  };
296
523
  return transporter.request(request, requestOptions);
297
524
  },
525
+ /**
526
+ * Test whether clusters are reachable or not.
527
+ *
528
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
529
+ * @param getReachability - The getReachability object.
530
+ * @param getReachability.clusters - Subset of clusters, separated by commas.
531
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
532
+ * @see getReachability for the plain version.
533
+ */
534
+ getReachabilityWithHTTPInfo({ clusters }, requestOptions) {
535
+ validateRequired("clusters", "getReachabilityWithHTTPInfo", clusters);
536
+ const requestPath = "/1/reachability/{clusters}/probes".replace("{clusters}", encodeURIComponent(clusters));
537
+ const headers = {};
538
+ const queryParameters = {};
539
+ const request = {
540
+ method: "GET",
541
+ path: requestPath,
542
+ queryParameters,
543
+ headers
544
+ };
545
+ return transporter.requestWithHttpInfo(request, requestOptions);
546
+ },
298
547
  /**
299
548
  * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
300
549
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -311,6 +560,25 @@ function createMonitoringClient({
311
560
  };
312
561
  return transporter.request(request, requestOptions);
313
562
  },
563
+ /**
564
+ * Retrieves the servers that belong to clusters. The response depends on whether you authenticate your API request: - With authentication, the response lists the servers assigned to your Algolia application\'s cluster. - Without authentication, the response lists the servers for all Algolia clusters.
565
+ *
566
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
567
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
568
+ * @see getServers for the plain version.
569
+ */
570
+ getServersWithHTTPInfo(requestOptions) {
571
+ const requestPath = "/1/inventory/servers";
572
+ const headers = {};
573
+ const queryParameters = {};
574
+ const request = {
575
+ method: "GET",
576
+ path: requestPath,
577
+ queryParameters,
578
+ headers
579
+ };
580
+ return transporter.requestWithHttpInfo(request, requestOptions);
581
+ },
314
582
  /**
315
583
  * Retrieves the status of all Algolia clusters and instances.
316
584
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
@@ -326,6 +594,25 @@ function createMonitoringClient({
326
594
  headers
327
595
  };
328
596
  return transporter.request(request, requestOptions);
597
+ },
598
+ /**
599
+ * Retrieves the status of all Algolia clusters and instances.
600
+ *
601
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
602
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
603
+ * @see getStatus for the plain version.
604
+ */
605
+ getStatusWithHTTPInfo(requestOptions) {
606
+ const requestPath = "/1/status";
607
+ const headers = {};
608
+ const queryParameters = {};
609
+ const request = {
610
+ method: "GET",
611
+ path: requestPath,
612
+ queryParameters,
613
+ headers
614
+ };
615
+ return transporter.requestWithHttpInfo(request, requestOptions);
329
616
  }
330
617
  };
331
618
  }