@algolia/monitoring 1.55.2 → 1.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/browser.d.ts +138 -3
- package/dist/builds/browser.js +288 -1
- package/dist/builds/browser.js.map +1 -1
- package/dist/builds/browser.min.js +5 -5
- package/dist/builds/browser.min.js.map +1 -1
- package/dist/builds/browser.umd.js +7 -7
- package/dist/builds/fetch.js +288 -1
- package/dist/builds/fetch.js.map +1 -1
- package/dist/builds/node.cjs +288 -1
- package/dist/builds/node.cjs.map +1 -1
- package/dist/builds/node.js +288 -1
- package/dist/builds/node.js.map +1 -1
- package/dist/builds/worker.js +288 -1
- package/dist/builds/worker.js.map +1 -1
- package/dist/fetch.d.ts +138 -3
- package/dist/node.d.cts +138 -3
- package/dist/node.d.ts +138 -3
- package/dist/src/monitoringClient.cjs +288 -1
- package/dist/src/monitoringClient.cjs.map +1 -1
- package/dist/src/monitoringClient.js +288 -1
- package/dist/src/monitoringClient.js.map +1 -1
- package/dist/worker.d.ts +138 -3
- package/package.json +10 -10
|
@@ -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
|
|
8
|
-
`&&(
|
|
9
|
-
`,
|
|
10
|
-
`?2:1:(
|
|
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 re(e){let t,r=`algolia-client-js-${e.key}`;function s(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function u(){return JSON.parse(s().getItem(r)||"{}")}function p(o){s().setItem(r,JSON.stringify(o));}function i(){return new Promise(o=>setTimeout(o,0))}function n(){let o=e.timeToLive?e.timeToLive*1e3:null,a=u(),c=new Date().getTime(),l=false;return {namespace:Object.fromEntries(Object.entries(a).filter(([,f])=>!f||f.timestamp===void 0||o&&f.timestamp+o<c?(l=true,false):true)),changed:l}}return {get(o,a,c={miss:()=>Promise.resolve()}){return i().then(()=>{let{namespace:l,changed:d}=n(),f=l[JSON.stringify(o)];return d&&p(l),f?f.value:a().then(R=>c.miss(R).then(()=>R))})},set(o,a){return i().then(()=>{let c=u();return c[JSON.stringify(o)]={timestamp:new Date().getTime(),value:a},s().setItem(r,JSON.stringify(c)),a})},delete(o){return i().then(()=>{let a=u();delete a[JSON.stringify(o)],s().setItem(r,JSON.stringify(a));})},clear(){return Promise.resolve().then(()=>{s().removeItem(r);})}}}function fe(){return {get(e,t,r={miss:()=>Promise.resolve()}){return t().then(u=>Promise.all([u,r.miss(u)])).then(([u])=>u)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function S(e){let t=[...e.caches],r=t.shift();return r===void 0?fe():{get(s,u,p={miss:()=>Promise.resolve()}){return r.get(s,u,p).catch(()=>S({caches:t}).get(s,u,p))},set(s,u){return r.set(s,u).catch(()=>S({caches:t}).set(s,u))},delete(s){return r.delete(s).catch(()=>S({caches:t}).delete(s))},clear(){return r.clear().catch(()=>S({caches:t}).clear())}}}function k(e={serializable:true}){let t={};return {get(r,s,u={miss:()=>Promise.resolve()}){let p=JSON.stringify(r);if(p in t)return Promise.resolve(e.serializable?JSON.parse(t[p]):t[p]);let i=s();return i.then(n=>u.miss(n)).then(()=>i)},set(r,s){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)},delete(r){return delete t[JSON.stringify(r)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function Pe(e){let t={value:`Algolia for JavaScript (${e})`,add(r){let s=`; ${r.segment}${r.version!==void 0?` (${r.version})`:""}`;return t.value.indexOf(s)===-1&&(t.value=`${t.value}${s}`),t}};return t}function se(e,t,r="WithinHeaders"){let s={"x-algolia-api-key":t,"x-algolia-application-id":e};return {headers(){return r==="WithinHeaders"?s:{}},queryParameters(){return r==="WithinQueryParameters"?s:{}}}}function ne({algoliaAgents:e,client:t,version:r}){let s=Pe(r).add({segment:t,version:r});return e.forEach(u=>s.add(u)),s}function oe(){return {debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var ye=10*1024*1024;async function*ge(e){let t=e.getReader();try{for(;;){let{done:r,value:s}=await t.read();if(r)return;yield s;}}finally{t.releaseLock();}}function qe(e){return Symbol.asyncIterator in e?e:ge(e)}async function*Re(e){let t=new TextDecoder("utf-8"),r=[],s=0,u=false,p=true;for await(let n of qe(e)){let o=t.decode(n,{stream:true}),a=0;for(u&&(u=false,o.length>0&&o[0]===`
|
|
8
|
+
`&&(a=1));a<o.length;){let c=o.indexOf("\r",a),l=o.indexOf(`
|
|
9
|
+
`,a);if(c===-1&&l===-1){let O=o.slice(a);if(r.push(O),s+=O.length,s>ye)throw new Error("SSE line buffer exceeded 10MB");break}let d,f;c!==-1&&(l===-1||c<l)?(d=c,c+1<o.length?f=o[c+1]===`
|
|
10
|
+
`?2:1:(u=true,f=1)):(d=l,f=1);let R=o.slice(a,d);r.push(R);let w=r.length===1?r[0]:r.join("");r.length=0,s=0,p&&(w.startsWith("\uFEFF")&&(w=w.slice(1)),p=false),yield w,a=d+f;}}let i=t.decode();if(i&&r.push(i),r.length>0){let n=r.join("");p&&n.startsWith("\uFEFF")&&(n=n.slice(1)),yield n;}}var Te=class{data=[];eventType="";lastEventId=null;retry=null;decode(e){if(e==="")return this.dispatch();if(e[0]===":")return null;let t=e.indexOf(":"),r,s;switch(t===-1?(r=e,s=""):(r=e.slice(0,t),s=e.slice(t+1),s[0]===" "&&(s=s.slice(1))),r){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*Ie(e){let t=new Te;for await(let r of Re(e)){let s=t.decode(r);s!==null&&(yield s);}}var ve=750,B=120*1e3;function X(e,t="up"){let r=Date.now();function s(){return t==="up"||Date.now()-r>B}function u(){return t==="timed out"&&Date.now()-r<=B}return {...e,status:t,lastUpdate:r,isUp:s,isTimedOut:u}}var ae=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t);}};var ie=class extends ae{stackTrace;correlationId;constructor(e,t,r,s){super(s?`${e} (Correlation-ID: ${s})`:e,r),this.stackTrace=t,this.correlationId=s;}},V=class extends ie{constructor(e,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",e,"RetryError",t);}},Q=class extends ie{status;constructor(e,t,r,s="ApiError",u){super(e,r,s,u),this.status=t;}},Ee=class extends ae{response;correlationId;constructor(e,t,r){super(r?`${e} (Correlation-ID: ${r})`:e,"DeserializationError"),this.response=t,this.correlationId=r;}},He=class extends Q{error;constructor(e,t,r,s,u){super(e,t,s,"DetailedApiError",u),this.error=r;}};function K(e,t,r){let s=xe(r),u=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return s.length&&(u+=`?${s}`),u}function xe(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 Y(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;let r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}function Z(e,t,r){let s={Accept:"application/json",...e,...t,...r},u={};return Object.keys(s).forEach(p=>{let i=s[p];u[p.toLowerCase()]=i;}),u}function ue(e){if(!(e.status===204||e.content.length===0))try{return JSON.parse(e.content)}catch(t){throw new Ee(t.message,e,j(e.headers))}}function Ce(e){return {status:e.status,headers:e.headers,content:e.content,data:ue(e)}}function j(e){if(!e)return;if(e["correlation-id"]!==void 0)return e["correlation-id"];let t=Object.keys(e).find(r=>r.toLowerCase()==="correlation-id");return t===void 0?void 0:e[t]}function we(e){for(let t=e.length-1;t>=0;t--){let r=j(e[t].response.headers);if(r!==void 0)return r}}function Se(e,t){let{content:r,status:s}=e,u=j(e.headers);try{let p=JSON.parse(r);return "error"in p?new He(p.message,s,p.error,t,u):new Q(p.message,s,t,"ApiError",u)}catch{}return new Q(r,s,t,"ApiError",u)}var L="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ee=11;function te(){var e;let t="";if(typeof((e=globalThis.crypto)==null?void 0:e.getRandomValues)=="function"){let r=new Uint8Array(ee);globalThis.crypto.getRandomValues(r);for(let s of r)t+=L[s%L.length];return t}for(let r=0;r<ee;r++)t+=L[Math.floor(Math.random()*L.length)];return t}function be({isTimedOut:e,status:t}){return !e&&~~t===0}function Ae({isTimedOut:e,status:t}){return e||be({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function Oe({status:e}){return ~~(e/100)===2}function We(e){return e.map(t=>ce(t))}function ce(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 le({hosts:e,hostsCache:t,baseHeaders:r,logger:s,baseQueryParameters:u,algoliaAgent:p,timeouts:i,requester:n,requestsCache:o,responsesCache:a,compress:c,compression:l,requestIdChannel:d}){function f(m,h){d===void 0||m["request-id"]!==void 0||Object.keys(h).some(I=>I.toLowerCase()==="x-algolia-request-id")||(d==="headers"?m["request-id"]=te():h["x-algolia-request-id"]=te());}async function R(m){let h=await Promise.all(m.map(P=>t.get(P,()=>Promise.resolve(X(P))))),I=h.filter(P=>P.isUp()),q=h.filter(P=>P.isTimedOut()),E=[...I,...q];return {hosts:E.length>0?E:m,getTimeout(P,x){return (q.length===0&&P===0?1:q.length+3+P)*x}}}async function w(m,h,I){let q=[],E=Y(m,h),g=Z(r,m.headers,h.headers),P=l==="gzip"&&E!==void 0&&E.length>ve&&(m.method==="POST"||m.method==="PUT");P&&c===void 0&&s.info("Compression is disabled because no compress method is available.");let x=P&&c!==void 0,D=x?await c(E):E;x&&(g["content-encoding"]="gzip");let W=m.method==="GET"?{...m.data,...h.data}:{},H={...u,...m.queryParameters,...W};if(p.value&&(H["x-algolia-agent"]=p.value),h&&h.queryParameters)for(let T of Object.keys(h.queryParameters))!h.queryParameters[T]||Object.prototype.toString.call(h.queryParameters[T])==="[object Object]"?H[T]=h.queryParameters[T]:H[T]=h.queryParameters[T].toString();f(g,H);let b=0,G=async(T,U)=>{let A=T.pop();if(A===void 0)throw new V(We(q),we(q));let N={...i,...h.timeouts},F={data:D,headers:g,method:m.method,url:K(A,m.path,H),connectTimeout:U(b,N.connect),responseTimeout:U(b,I?N.read:N.write)},z=M=>{let J={request:F,response:M,host:A,triesLeft:T.length};return q.push(J),J},C=await n.send(F);if(Ae(C)){let M=z(C);return C.isTimedOut&&b++,s.info("Retryable failure",ce(M)),await t.set(A,X(A,C.isTimedOut?"timed out":"down")),G(T,U)}if(Oe(C))return C;throw z(C),Se(C,q)},v=e.filter(T=>T.accept==="readWrite"||(I?T.accept==="read":T.accept==="write")),$=await R(v);return G([...$.hosts].reverse(),$.getTimeout)}function O(m,h={}){let I=()=>w(m,h,q).then(P=>ue(P)),q=m.useReadTransporter||m.method==="GET";if((h.cacheable||m.cacheable)!==true)return I();let g={request:m,requestOptions:h,transporter:{queryParameters:u,headers:r}};return a.get(g,()=>o.get(g,()=>o.set(g,I()).then(P=>Promise.all([o.delete(g),P]),P=>Promise.all([o.delete(g),Promise.reject(P)])).then(([P,x])=>x)),{miss:P=>a.set(g,P)})}function he(m,h={}){let I=m.useReadTransporter||m.method==="GET";return w(m,h,I).then(q=>Ce(q))}async function*pe(m,h={}){if(!n.sendStream)throw new Error("This requester does not support streaming");let I=Y(m,h),q=Z(r,m.headers,h.headers);q.accept="text/event-stream";let E=m.method==="GET"?{...m.data,...h.data}:{},g={...u,...m.queryParameters,...E};if(p.value&&(g["x-algolia-agent"]=p.value),h&&h.queryParameters)for(let v of Object.keys(h.queryParameters))!h.queryParameters[v]||Object.prototype.toString.call(h.queryParameters[v])==="[object Object]"?g[v]=h.queryParameters[v]:g[v]=h.queryParameters[v].toString();f(q,g);let P=m.useReadTransporter||m.method==="GET",x=e.filter(v=>v.accept==="readWrite"||(P?v.accept==="read":v.accept==="write")),W=(await R(x)).hosts[0];if(!W)throw new V([]);let H={...i,...h.timeouts},b={data:I,headers:q,method:m.method,url:K(W,m.path,g),connectTimeout:H.connect,responseTimeout:P?H.read:H.write},G=await n.sendStream(b);yield*Ie(G);}return {hostsCache:t,requester:n,timeouts:i,logger:s,algoliaAgent:p,baseHeaders:r,baseQueryParameters:u,requestIdChannel:d,hosts:e,request:O,requestWithHttpInfo:he,requestStream:pe,requestsCache:o,responsesCache:a}}function y(e,t,r){if(r==null||typeof r=="string"&&r.length===0)throw new Error(`Parameter \`${e}\` is required when calling \`${t}\`.`)}function Ge(e){let t={};for(let r of e.trim().split(/[\r\n]+/)){let s=r.indexOf(": ");s>0&&(t[r.slice(0,s).toLowerCase()]=r.slice(s+2));}return t}function de(){function e(t){return new Promise(r=>{let s=new XMLHttpRequest;s.open(t.method,t.url,true),Object.keys(t.headers).forEach(n=>s.setRequestHeader(n,t.headers[n]));let u=(n,o)=>setTimeout(()=>{s.abort(),r({status:0,content:o,isTimedOut:true});},n),p=u(t.connectTimeout,"Connection timeout"),i;s.onreadystatechange=()=>{s.readyState>s.OPENED&&i===void 0&&(clearTimeout(p),i=u(t.responseTimeout,"Socket timeout"));},s.onerror=()=>{s.status===0&&(clearTimeout(p),clearTimeout(i),r({content:s.responseText||"Network request failed",status:s.status,isTimedOut:false}));},s.onload=()=>{clearTimeout(p),clearTimeout(i),r({content:s.responseText,headers:Ge(s.getAllResponseHeaders()),status:s.status,isTimedOut:false});},s.send(t.data);})}return {send:e}}var _="1.57.0";function Le(){return [{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function me({appId:e,apiKey:t,authMode:r,algoliaAgents:s,...u}){let p=se(e,t,r),i=le({hosts:Le(),...u,algoliaAgent:ne({algoliaAgents:s,client:"Monitoring",version:_}),baseHeaders:{"content-type":"text/plain",...p.headers(),...u.baseHeaders},baseQueryParameters:{...p.queryParameters(),...u.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(n,o){i.algoliaAgent.add({segment:n,version:o});},setClientApiKey({apiKey:n}){!r||r==="WithinHeaders"?i.baseHeaders["x-algolia-api-key"]=n:i.baseQueryParameters["x-algolia-api-key"]=n;},customDelete({path:n,parameters:o},a){y("path","customDelete",n);let f={method:"DELETE",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.request(f,a)},customDeleteWithHTTPInfo({path:n,parameters:o},a){y("path","customDeleteWithHTTPInfo",n);let f={method:"DELETE",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.requestWithHttpInfo(f,a)},customGet({path:n,parameters:o},a){y("path","customGet",n);let f={method:"GET",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.request(f,a)},customGetWithHTTPInfo({path:n,parameters:o},a){y("path","customGetWithHTTPInfo",n);let f={method:"GET",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{}};return i.requestWithHttpInfo(f,a)},customPost({path:n,parameters:o,body:a},c){y("path","customPost",n);let R={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:a||{}};return i.request(R,c)},customPostWithHTTPInfo({path:n,parameters:o,body:a},c){y("path","customPostWithHTTPInfo",n);let R={method:"POST",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:a||{}};return i.requestWithHttpInfo(R,c)},customPut({path:n,parameters:o,body:a},c){y("path","customPut",n);let R={method:"PUT",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:a||{}};return i.request(R,c)},customPutWithHTTPInfo({path:n,parameters:o,body:a},c){y("path","customPutWithHTTPInfo",n);let R={method:"PUT",path:"/{path}".replace("{path}",n),queryParameters:o||{},headers:{},data:a||{}};return i.requestWithHttpInfo(R,c)},getClusterIncidents({clusters:n},o){y("clusters","getClusterIncidents",n);let d={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(d,o)},getClusterIncidentsWithHTTPInfo({clusters:n},o){y("clusters","getClusterIncidentsWithHTTPInfo",n);let d={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getClusterStatus({clusters:n},o){y("clusters","getClusterStatus",n);let d={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(d,o)},getClusterStatusWithHTTPInfo({clusters:n},o){y("clusters","getClusterStatusWithHTTPInfo",n);let d={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getIncidents(n){let l={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return i.request(l,n)},getIncidentsWithHTTPInfo(n){let l={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return i.requestWithHttpInfo(l,n)},getIndexingTime({clusters:n},o){y("clusters","getIndexingTime",n);let d={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(d,o)},getIndexingTimeWithHTTPInfo({clusters:n},o){y("clusters","getIndexingTimeWithHTTPInfo",n);let d={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getLatency({clusters:n},o){y("clusters","getLatency",n);let d={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(d,o)},getLatencyWithHTTPInfo({clusters:n},o){y("clusters","getLatencyWithHTTPInfo",n);let d={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getMetrics({metric:n,period:o},a){y("metric","getMetrics",n),y("period","getMetrics",o);let f={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(n)).replace("{period}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.request(f,a)},getMetricsWithHTTPInfo({metric:n,period:o},a){y("metric","getMetricsWithHTTPInfo",n),y("period","getMetricsWithHTTPInfo",o);let f={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(n)).replace("{period}",encodeURIComponent(o)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(f,a)},getReachability({clusters:n},o){y("clusters","getReachability",n);let d={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.request(d,o)},getReachabilityWithHTTPInfo({clusters:n},o){y("clusters","getReachabilityWithHTTPInfo",n);let d={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(n)),queryParameters:{},headers:{}};return i.requestWithHttpInfo(d,o)},getServers(n){let l={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return i.request(l,n)},getServersWithHTTPInfo(n){let l={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return i.requestWithHttpInfo(l,n)},getStatus(n){let l={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return i.request(l,n)},getStatusWithHTTPInfo(n){let l={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return i.requestWithHttpInfo(l,n)}}}function Tt(e,t,r){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,...u}=r||{};return me({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:oe(),requester:de(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:k(),requestsCache:k({serializable:false}),hostsCache:S({caches:[re({key:`${_}-${e}`}),k()]}),...u})}
|
|
12
12
|
|
|
13
|
-
exports.apiClientVersion =
|
|
14
|
-
exports.monitoringClient =
|
|
13
|
+
exports.apiClientVersion = _;
|
|
14
|
+
exports.monitoringClient = Tt;
|
|
15
15
|
|
|
16
16
|
}));
|
package/dist/builds/fetch.js
CHANGED
|
@@ -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.
|
|
8
|
+
var apiClientVersion = "1.57.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
|
}
|