@algolia/client-insights
Advanced tools
Comparing version 5.7.0 to 5.8.0
@@ -5,72 +5,2 @@ import * as _algolia_client_common from '@algolia/client-common'; | ||
/** | ||
* Properties for the `customDelete` method. | ||
*/ | ||
type CustomDeleteProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
}; | ||
/** | ||
* Properties for the `customGet` method. | ||
*/ | ||
type CustomGetProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
}; | ||
/** | ||
* Properties for the `customPost` method. | ||
*/ | ||
type CustomPostProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `customPut` method. | ||
*/ | ||
type CustomPutProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `deleteUserToken` method. | ||
*/ | ||
type DeleteUserTokenProps = { | ||
/** | ||
* User token for which to delete all associated events. | ||
*/ | ||
userToken: string; | ||
}; | ||
/** | ||
* The response of the Insights API. | ||
@@ -134,3 +64,3 @@ */ | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -151,3 +81,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
/** | ||
@@ -194,3 +124,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -211,3 +141,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectDataAfterSearch[]; | ||
objectData?: Array<ObjectDataAfterSearch>; | ||
/** | ||
@@ -238,3 +168,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -270,3 +200,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -302,7 +232,7 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
* Position of the clicked item the search results. You must provide 1 `position` for each `objectID`. | ||
*/ | ||
positions: number[]; | ||
positions: Array<number>; | ||
/** | ||
@@ -339,3 +269,3 @@ * Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -371,3 +301,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -403,3 +333,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -442,3 +372,3 @@ * Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -459,3 +389,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
/** | ||
@@ -485,3 +415,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -502,3 +432,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData: ObjectDataAfterSearch[]; | ||
objectData: Array<ObjectDataAfterSearch>; | ||
/** | ||
@@ -529,3 +459,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -561,3 +491,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -577,3 +507,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
type EventsItems = AddedToCartObjectIDs | AddedToCartObjectIDsAfterSearch | ClickedFilters | ClickedObjectIDs | ClickedObjectIDsAfterSearch | ConvertedFilters | ConvertedObjectIDs | ConvertedObjectIDsAfterSearch | PurchasedObjectIDs | PurchasedObjectIDsAfterSearch | ViewedFilters | ViewedObjectIDs; | ||
type EventsItems = ClickedObjectIDsAfterSearch | AddedToCartObjectIDsAfterSearch | PurchasedObjectIDsAfterSearch | ConvertedObjectIDsAfterSearch | ClickedObjectIDs | PurchasedObjectIDs | AddedToCartObjectIDs | ConvertedObjectIDs | ClickedFilters | ConvertedFilters | ViewedObjectIDs | ViewedFilters; | ||
@@ -584,6 +514,84 @@ type InsightsEvents = { | ||
*/ | ||
events: EventsItems[]; | ||
events: Array<EventsItems>; | ||
}; | ||
declare const apiClientVersion = "5.7.0"; | ||
/** | ||
* Properties for the `customDelete` method. | ||
*/ | ||
type CustomDeleteProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
/** | ||
* Properties for the `customGet` method. | ||
*/ | ||
type CustomGetProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
/** | ||
* Properties for the `customPost` method. | ||
*/ | ||
type CustomPostProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `customPut` method. | ||
*/ | ||
type CustomPutProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `deleteUserToken` method. | ||
*/ | ||
type DeleteUserTokenProps = { | ||
/** | ||
* User token for which to delete all associated events. | ||
*/ | ||
userToken: string; | ||
}; | ||
declare const apiClientVersion = "5.8.0"; | ||
declare const REGIONS: readonly ["de", "us"]; | ||
@@ -625,3 +633,2 @@ type Region = (typeof REGIONS)[number]; | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
@@ -635,3 +642,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
@@ -645,3 +651,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
@@ -656,3 +661,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
@@ -667,3 +671,2 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see `Delete a user profile` in the Personalization API. | ||
* | ||
* @param deleteUserToken - The deleteUserToken object. | ||
@@ -676,3 +679,2 @@ * @param deleteUserToken.userToken - User token for which to delete all associated events. | ||
* Sends a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB. | ||
* | ||
* @param insightsEvents - The insightsEvents object. | ||
@@ -691,6 +693,5 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. | ||
declare function insightsClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): InsightsClient; | ||
type InsightsClient = ReturnType<typeof createInsightsClient>; | ||
declare function insightsClient(appId: string, apiKey: string, region?: Region, options?: ClientOptions): InsightsClient; | ||
export { type AddToCartEvent, type AddedToCartObjectIDs, type AddedToCartObjectIDsAfterSearch, type ClickEvent, type ClickedFilters, type ClickedObjectIDs, type ClickedObjectIDsAfterSearch, type ConversionEvent, type ConvertedFilters, type ConvertedObjectIDs, type ConvertedObjectIDsAfterSearch, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteUserTokenProps, type Discount, type ErrorBase, type EventsItems, type EventsResponse, type InsightsClient, type InsightsEvents, type ObjectData, type ObjectDataAfterSearch, type Price, type PurchaseEvent, type PurchasedObjectIDs, type PurchasedObjectIDsAfterSearch, type Region, type Value, type ViewEvent, type ViewedFilters, type ViewedObjectIDs, apiClientVersion, insightsClient }; |
// builds/browser.ts | ||
import { createXhrRequester } from "@algolia/requester-browser-xhr"; | ||
import { | ||
createBrowserLocalStorageCache, | ||
createFallbackableCache, | ||
createMemoryCache, | ||
createNullLogger, | ||
createMemoryCache, | ||
createFallbackableCache, | ||
createBrowserLocalStorageCache, | ||
DEFAULT_CONNECT_TIMEOUT_BROWSER, | ||
@@ -11,7 +12,6 @@ DEFAULT_READ_TIMEOUT_BROWSER, | ||
} from "@algolia/client-common"; | ||
import { createXhrRequester } from "@algolia/requester-browser-xhr"; | ||
// src/insightsClient.ts | ||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
var apiClientVersion = "5.7.0"; | ||
var apiClientVersion = "5.8.0"; | ||
var REGIONS = ["de", "us"]; | ||
@@ -91,3 +91,2 @@ function getDefaultHosts(region) { | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
@@ -115,3 +114,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
@@ -139,3 +137,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
@@ -165,3 +162,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
@@ -191,3 +187,2 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see `Delete a user profile` in the Personalization API. | ||
* | ||
* @param deleteUserToken - The deleteUserToken object. | ||
@@ -214,3 +209,2 @@ * @param deleteUserToken.userToken - User token for which to delete all associated events. | ||
* Sends a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB. | ||
* | ||
* @param insightsEvents - The insightsEvents object. | ||
@@ -217,0 +211,0 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. |
@@ -1,2 +0,2 @@ | ||
function $(r){let e,o=`algolia-client-js-${r.key}`;function t(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function n(){return JSON.parse(t().getItem(o)||"{}")}function l(a){t().setItem(o,JSON.stringify(a))}function h(){let a=r.timeToLive?r.timeToLive*1e3:null,s=n(),i=Object.fromEntries(Object.entries(s).filter(([,p])=>p.timestamp!==void 0));if(l(i),!a)return;let m=Object.fromEntries(Object.entries(i).filter(([,p])=>{let y=new Date().getTime();return!(p.timestamp+a<y)}));l(m)}return{get(a,s,i={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(h(),n()[JSON.stringify(a)])).then(m=>Promise.all([m?m.value:s(),m!==void 0])).then(([m,p])=>Promise.all([m,p||i.miss(m)])).then(([m])=>m)},set(a,s){return Promise.resolve().then(()=>{let i=n();return i[JSON.stringify(a)]={timestamp:new Date().getTime(),value:s},t().setItem(o,JSON.stringify(i)),s})},delete(a){return Promise.resolve().then(()=>{let s=n();delete s[JSON.stringify(a)],t().setItem(o,JSON.stringify(s))})},clear(){return Promise.resolve().then(()=>{t().removeItem(o)})}}}function ee(){return{get(r,e,o={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,o.miss(n)])).then(([n])=>n)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function R(r){let e=[...r.caches],o=e.shift();return o===void 0?ee():{get(t,n,l={miss:()=>Promise.resolve()}){return o.get(t,n,l).catch(()=>R({caches:e}).get(t,n,l))},set(t,n){return o.set(t,n).catch(()=>R({caches:e}).set(t,n))},delete(t){return o.delete(t).catch(()=>R({caches:e}).delete(t))},clear(){return o.clear().catch(()=>R({caches:e}).clear())}}}function q(r={serializable:!0}){let e={};return{get(o,t,n={miss:()=>Promise.resolve()}){let l=JSON.stringify(o);if(l in e)return Promise.resolve(r.serializable?JSON.parse(e[l]):e[l]);let h=t();return h.then(a=>n.miss(a)).then(()=>h)},set(o,t){return e[JSON.stringify(o)]=r.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete(o){return delete e[JSON.stringify(o)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}var j=1e3,J=2e3,M=3e4;function re(r){let e={value:`Algolia for JavaScript (${r})`,add(o){let t=`; ${o.segment}${o.version!==void 0?` (${o.version})`:""}`;return e.value.indexOf(t)===-1&&(e.value=`${e.value}${t}`),e}};return e}function z(r,e,o="WithinHeaders"){let t={"x-algolia-api-key":e,"x-algolia-application-id":r};return{headers(){return o==="WithinHeaders"?t:{}},queryParameters(){return o==="WithinQueryParameters"?t:{}}}}function Q({algoliaAgents:r,client:e,version:o}){let t=re(o).add({segment:e,version:o});return r.forEach(n=>t.add(n)),t}function F(){return{debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var W=2*60*1e3;function H(r,e="up"){let o=Date.now();function t(){return e==="up"||Date.now()-o>W}function n(){return e==="timed out"&&Date.now()-o<=W}return{...r,status:e,lastUpdate:o,isUp:t,isTimedOut:n}}var G=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e)}},B=class extends G{stackTrace;constructor(r,e,o){super(r,o),this.stackTrace=e}},te=class extends B{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",r,"RetryError")}},_=class extends B{status;constructor(r,e,o,t="ApiError"){super(r,o,t),this.status=e}},oe=class extends G{response;constructor(r,e){super(r,"DeserializationError"),this.response=e}},se=class extends _{error;constructor(r,e,o,t){super(r,e,t,"DetailedApiError"),this.error=o}};function ne(r,e,o){let t=ae(o),n=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return t.length&&(n+=`?${t}`),n}function ae(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replaceAll("+","%20")}`).join("&")}function ie(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let o=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(o)}function ce(r,e,o){let t={Accept:"application/json",...r,...e,...o},n={};return Object.keys(t).forEach(l=>{let h=t[l];n[l.toLowerCase()]=h}),n}function ue(r){try{return JSON.parse(r.content)}catch(e){throw new oe(e.message,r)}}function le({content:r,status:e},o){try{let t=JSON.parse(r);return"error"in t?new se(t.message,e,t.error,o):new _(t.message,e,o)}catch{}return new _(r,e,o)}function me({isTimedOut:r,status:e}){return!r&&~~e===0}function de({isTimedOut:r,status:e}){return r||me({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:r}){return~~(r/100)===2}function pe(r){return r.map(e=>X(e))}function X(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function K({hosts:r,hostsCache:e,baseHeaders:o,logger:t,baseQueryParameters:n,algoliaAgent:l,timeouts:h,requester:a,requestsCache:s,responsesCache:i}){async function m(c){let u=await Promise.all(c.map(d=>e.get(d,()=>Promise.resolve(H(d))))),g=u.filter(d=>d.isUp()),P=u.filter(d=>d.isTimedOut()),w=[...g,...P];return{hosts:w.length>0?w:c,getTimeout(d,T){return(P.length===0&&d===0?1:P.length+3+d)*T}}}async function p(c,u,g=!0){let P=[],w=ie(c,u),E=ce(o,c.headers,u.headers),d=c.method==="GET"?{...c.data,...u.data}:{},T={...n,...c.queryParameters,...d};if(l.value&&(T["x-algolia-agent"]=l.value),u&&u.queryParameters)for(let f of Object.keys(u.queryParameters))!u.queryParameters[f]||Object.prototype.toString.call(u.queryParameters[f])==="[object Object]"?T[f]=u.queryParameters[f]:T[f]=u.queryParameters[f].toString();let x=0,D=async(f,S)=>{let O=f.pop();if(O===void 0)throw new te(pe(P));let C={...h,...u.timeouts},k={data:w,headers:E,method:c.method,url:ne(O,c.path,T),connectTimeout:S(x,C.connect),responseTimeout:S(x,g?C.read:C.write)},U=b=>{let L={request:k,response:b,host:O,triesLeft:f.length};return P.push(L),L},v=await a.send(k);if(de(v)){let b=U(v);return v.isTimedOut&&x++,t.info("Retryable failure",X(b)),await e.set(O,H(O,v.isTimedOut?"timed out":"down")),D(f,S)}if(he(v))return ue(v);throw U(v),le(v,P)},Z=r.filter(f=>f.accept==="readWrite"||(g?f.accept==="read":f.accept==="write")),I=await m(Z);return D([...I.hosts].reverse(),I.getTimeout)}function y(c,u={}){let g=c.useReadTransporter||c.method==="GET";if(!g)return p(c,u,g);let P=()=>p(c,u);if((u.cacheable||c.cacheable)!==!0)return P();let E={request:c,requestOptions:u,transporter:{queryParameters:n,headers:o}};return i.get(E,()=>s.get(E,()=>s.set(E,P()).then(d=>Promise.all([s.delete(E),d]),d=>Promise.all([s.delete(E),Promise.reject(d)])).then(([d,T])=>T)),{miss:d=>i.set(E,d)})}return{hostsCache:e,requester:a,timeouts:h,logger:t,algoliaAgent:l,baseHeaders:o,baseQueryParameters:n,hosts:r,request:y,requestsCache:s,responsesCache:i}}function V(){function r(e){return new Promise(o=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>t.setRequestHeader(a,e.headers[a]));let n=(a,s)=>setTimeout(()=>{t.abort(),o({status:0,content:s,isTimedOut:!0})},a),l=n(e.connectTimeout,"Connection timeout"),h;t.onreadystatechange=()=>{t.readyState>t.OPENED&&h===void 0&&(clearTimeout(l),h=n(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{t.status===0&&(clearTimeout(l),clearTimeout(h),o({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(l),clearTimeout(h),o({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)})}return{send:r}}var A="5.7.0",N=["de","us"];function fe(r){return[{url:r?"insights.{region}.algolia.io".replace("{region}",r):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Y({appId:r,apiKey:e,authMode:o,algoliaAgents:t,region:n,...l}){let h=z(r,e,o),a=K({hosts:fe(n),...l,algoliaAgent:Q({algoliaAgents:t,client:"Insights",version:A}),baseHeaders:{"content-type":"text/plain",...h.headers(),...l.baseHeaders},baseQueryParameters:{...h.queryParameters(),...l.baseQueryParameters}});return{transporter:a,appId:r,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(s,i){a.algoliaAgent.add({segment:s,version:i})},setClientApiKey({apiKey:s}){!o||o==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=s:a.baseQueryParameters["x-algolia-api-key"]=s},customDelete({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customDelete`.");let u={method:"DELETE",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customGet({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customGet`.");let u={method:"GET",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customPost({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPost`.");let g={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},customPut({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPut`.");let g={method:"PUT",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},deleteUserToken({userToken:s},i){if(!s)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");let c={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return a.request(c,i)},pushEvents(s,i){if(!s)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!s.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");let c={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:s};return a.request(c,i)}}}function tr(r,e,o,t){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(o&&(typeof o!="string"||!N.includes(o)))throw new Error(`\`region\` must be one of the following: ${N.join(", ")}`);return Y({appId:r,apiKey:e,region:o,timeouts:{connect:j,read:J,write:M},logger:F(),requester:V(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:q(),requestsCache:q({serializable:!1}),hostsCache:R({caches:[$({key:`${A}-${r}`}),q()]}),...t})}export{A as apiClientVersion,tr as insightsClient}; | ||
function W(){function r(e){return new Promise(o=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>t.setRequestHeader(a,e.headers[a]));let n=(a,s)=>setTimeout(()=>{t.abort(),o({status:0,content:s,isTimedOut:!0})},a),l=n(e.connectTimeout,"Connection timeout"),h;t.onreadystatechange=()=>{t.readyState>t.OPENED&&h===void 0&&(clearTimeout(l),h=n(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{t.status===0&&(clearTimeout(l),clearTimeout(h),o({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(l),clearTimeout(h),o({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)})}return{send:r}}function j(r){let e,o=`algolia-client-js-${r.key}`;function t(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function n(){return JSON.parse(t().getItem(o)||"{}")}function l(a){t().setItem(o,JSON.stringify(a))}function h(){let a=r.timeToLive?r.timeToLive*1e3:null,s=n(),i=Object.fromEntries(Object.entries(s).filter(([,p])=>p.timestamp!==void 0));if(l(i),!a)return;let m=Object.fromEntries(Object.entries(i).filter(([,p])=>{let E=new Date().getTime();return!(p.timestamp+a<E)}));l(m)}return{get(a,s,i={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(h(),n()[JSON.stringify(a)])).then(m=>Promise.all([m?m.value:s(),m!==void 0])).then(([m,p])=>Promise.all([m,p||i.miss(m)])).then(([m])=>m)},set(a,s){return Promise.resolve().then(()=>{let i=n();return i[JSON.stringify(a)]={timestamp:new Date().getTime(),value:s},t().setItem(o,JSON.stringify(i)),s})},delete(a){return Promise.resolve().then(()=>{let s=n();delete s[JSON.stringify(a)],t().setItem(o,JSON.stringify(s))})},clear(){return Promise.resolve().then(()=>{t().removeItem(o)})}}}function ee(){return{get(r,e,o={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,o.miss(n)])).then(([n])=>n)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function R(r){let e=[...r.caches],o=e.shift();return o===void 0?ee():{get(t,n,l={miss:()=>Promise.resolve()}){return o.get(t,n,l).catch(()=>R({caches:e}).get(t,n,l))},set(t,n){return o.set(t,n).catch(()=>R({caches:e}).set(t,n))},delete(t){return o.delete(t).catch(()=>R({caches:e}).delete(t))},clear(){return o.clear().catch(()=>R({caches:e}).clear())}}}function q(r={serializable:!0}){let e={};return{get(o,t,n={miss:()=>Promise.resolve()}){let l=JSON.stringify(o);if(l in e)return Promise.resolve(r.serializable?JSON.parse(e[l]):e[l]);let h=t();return h.then(a=>n.miss(a)).then(()=>h)},set(o,t){return e[JSON.stringify(o)]=r.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete(o){return delete e[JSON.stringify(o)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}var J=1e3,M=2e3,z=3e4;function re(r){let e={value:`Algolia for JavaScript (${r})`,add(o){let t=`; ${o.segment}${o.version!==void 0?` (${o.version})`:""}`;return e.value.indexOf(t)===-1&&(e.value=`${e.value}${t}`),e}};return e}function Q(r,e,o="WithinHeaders"){let t={"x-algolia-api-key":e,"x-algolia-application-id":r};return{headers(){return o==="WithinHeaders"?t:{}},queryParameters(){return o==="WithinQueryParameters"?t:{}}}}function F({algoliaAgents:r,client:e,version:o}){let t=re(o).add({segment:e,version:o});return r.forEach(n=>t.add(n)),t}function G(){return{debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var H=2*60*1e3;function $(r,e="up"){let o=Date.now();function t(){return e==="up"||Date.now()-o>H}function n(){return e==="timed out"&&Date.now()-o<=H}return{...r,status:e,lastUpdate:o,isUp:t,isTimedOut:n}}var B=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e)}},X=class extends B{stackTrace;constructor(r,e,o){super(r,o),this.stackTrace=e}},te=class extends X{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",r,"RetryError")}},_=class extends X{status;constructor(r,e,o,t="ApiError"){super(r,o,t),this.status=e}},oe=class extends B{response;constructor(r,e){super(r,"DeserializationError"),this.response=e}},se=class extends _{error;constructor(r,e,o,t){super(r,e,t,"DetailedApiError"),this.error=o}};function ne(r,e,o){let t=ae(o),n=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return t.length&&(n+=`?${t}`),n}function ae(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replace(/\+/g,"%20")}`).join("&")}function ie(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let o=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(o)}function ce(r,e,o){let t={Accept:"application/json",...r,...e,...o},n={};return Object.keys(t).forEach(l=>{let h=t[l];n[l.toLowerCase()]=h}),n}function ue(r){try{return JSON.parse(r.content)}catch(e){throw new oe(e.message,r)}}function le({content:r,status:e},o){try{let t=JSON.parse(r);return"error"in t?new se(t.message,e,t.error,o):new _(t.message,e,o)}catch{}return new _(r,e,o)}function me({isTimedOut:r,status:e}){return!r&&~~e===0}function de({isTimedOut:r,status:e}){return r||me({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:r}){return~~(r/100)===2}function pe(r){return r.map(e=>K(e))}function K(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function V({hosts:r,hostsCache:e,baseHeaders:o,logger:t,baseQueryParameters:n,algoliaAgent:l,timeouts:h,requester:a,requestsCache:s,responsesCache:i}){async function m(c){let u=await Promise.all(c.map(d=>e.get(d,()=>Promise.resolve($(d))))),g=u.filter(d=>d.isUp()),P=u.filter(d=>d.isTimedOut()),w=[...g,...P];return{hosts:w.length>0?w:c,getTimeout(d,T){return(P.length===0&&d===0?1:P.length+3+d)*T}}}async function p(c,u,g=!0){let P=[],w=ie(c,u),y=ce(o,c.headers,u.headers),d=c.method==="GET"?{...c.data,...u.data}:{},T={...n,...c.queryParameters,...d};if(l.value&&(T["x-algolia-agent"]=l.value),u&&u.queryParameters)for(let f of Object.keys(u.queryParameters))!u.queryParameters[f]||Object.prototype.toString.call(u.queryParameters[f])==="[object Object]"?T[f]=u.queryParameters[f]:T[f]=u.queryParameters[f].toString();let x=0,D=async(f,S)=>{let O=f.pop();if(O===void 0)throw new te(pe(P));let C={...h,...u.timeouts},k={data:w,headers:y,method:c.method,url:ne(O,c.path,T),connectTimeout:S(x,C.connect),responseTimeout:S(x,g?C.read:C.write)},U=b=>{let L={request:k,response:b,host:O,triesLeft:f.length};return P.push(L),L},v=await a.send(k);if(de(v)){let b=U(v);return v.isTimedOut&&x++,t.info("Retryable failure",K(b)),await e.set(O,$(O,v.isTimedOut?"timed out":"down")),D(f,S)}if(he(v))return ue(v);throw U(v),le(v,P)},Z=r.filter(f=>f.accept==="readWrite"||(g?f.accept==="read":f.accept==="write")),I=await m(Z);return D([...I.hosts].reverse(),I.getTimeout)}function E(c,u={}){let g=c.useReadTransporter||c.method==="GET";if(!g)return p(c,u,g);let P=()=>p(c,u);if((u.cacheable||c.cacheable)!==!0)return P();let y={request:c,requestOptions:u,transporter:{queryParameters:n,headers:o}};return i.get(y,()=>s.get(y,()=>s.set(y,P()).then(d=>Promise.all([s.delete(y),d]),d=>Promise.all([s.delete(y),Promise.reject(d)])).then(([d,T])=>T)),{miss:d=>i.set(y,d)})}return{hostsCache:e,requester:a,timeouts:h,logger:t,algoliaAgent:l,baseHeaders:o,baseQueryParameters:n,hosts:r,request:E,requestsCache:s,responsesCache:i}}var A="5.8.0",N=["de","us"];function fe(r){return[{url:r?"insights.{region}.algolia.io".replace("{region}",r):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Y({appId:r,apiKey:e,authMode:o,algoliaAgents:t,region:n,...l}){let h=Q(r,e,o),a=V({hosts:fe(n),...l,algoliaAgent:F({algoliaAgents:t,client:"Insights",version:A}),baseHeaders:{"content-type":"text/plain",...h.headers(),...l.baseHeaders},baseQueryParameters:{...h.queryParameters(),...l.baseQueryParameters}});return{transporter:a,appId:r,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(s,i){a.algoliaAgent.add({segment:s,version:i})},setClientApiKey({apiKey:s}){!o||o==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=s:a.baseQueryParameters["x-algolia-api-key"]=s},customDelete({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customDelete`.");let u={method:"DELETE",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customGet({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customGet`.");let u={method:"GET",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customPost({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPost`.");let g={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},customPut({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPut`.");let g={method:"PUT",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},deleteUserToken({userToken:s},i){if(!s)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");let c={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return a.request(c,i)},pushEvents(s,i){if(!s)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!s.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");let c={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:s};return a.request(c,i)}}}function nr(r,e,o,t){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(o&&(typeof o!="string"||!N.includes(o)))throw new Error(`\`region\` must be one of the following: ${N.join(", ")}`);return Y({appId:r,apiKey:e,region:o,timeouts:{connect:J,read:M,write:z},logger:G(),requester:W(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:q(),requestsCache:q({serializable:!1}),hostsCache:R({caches:[j({key:`${A}-${r}`}),q()]}),...t})}export{A as apiClientVersion,nr as insightsClient}; | ||
//# sourceMappingURL=browser.min.js.map |
@@ -7,7 +7,7 @@ (function (global, factory) { | ||
function $(r){let e,o=`algolia-client-js-${r.key}`;function t(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function n(){return JSON.parse(t().getItem(o)||"{}")}function l(a){t().setItem(o,JSON.stringify(a));}function h(){let a=r.timeToLive?r.timeToLive*1e3:null,s=n(),i=Object.fromEntries(Object.entries(s).filter(([,p])=>p.timestamp!==void 0));if(l(i),!a)return;let m=Object.fromEntries(Object.entries(i).filter(([,p])=>{let y=new Date().getTime();return !(p.timestamp+a<y)}));l(m);}return {get(a,s,i={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(h(),n()[JSON.stringify(a)])).then(m=>Promise.all([m?m.value:s(),m!==void 0])).then(([m,p])=>Promise.all([m,p||i.miss(m)])).then(([m])=>m)},set(a,s){return Promise.resolve().then(()=>{let i=n();return i[JSON.stringify(a)]={timestamp:new Date().getTime(),value:s},t().setItem(o,JSON.stringify(i)),s})},delete(a){return Promise.resolve().then(()=>{let s=n();delete s[JSON.stringify(a)],t().setItem(o,JSON.stringify(s));})},clear(){return Promise.resolve().then(()=>{t().removeItem(o);})}}}function ee(){return {get(r,e,o={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,o.miss(n)])).then(([n])=>n)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function R(r){let e=[...r.caches],o=e.shift();return o===void 0?ee():{get(t,n,l={miss:()=>Promise.resolve()}){return o.get(t,n,l).catch(()=>R({caches:e}).get(t,n,l))},set(t,n){return o.set(t,n).catch(()=>R({caches:e}).set(t,n))},delete(t){return o.delete(t).catch(()=>R({caches:e}).delete(t))},clear(){return o.clear().catch(()=>R({caches:e}).clear())}}}function q(r={serializable:!0}){let e={};return {get(o,t,n={miss:()=>Promise.resolve()}){let l=JSON.stringify(o);if(l in e)return Promise.resolve(r.serializable?JSON.parse(e[l]):e[l]);let h=t();return h.then(a=>n.miss(a)).then(()=>h)},set(o,t){return e[JSON.stringify(o)]=r.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete(o){return delete e[JSON.stringify(o)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}var j=1e3,J=2e3,M=3e4;function re(r){let e={value:`Algolia for JavaScript (${r})`,add(o){let t=`; ${o.segment}${o.version!==void 0?` (${o.version})`:""}`;return e.value.indexOf(t)===-1&&(e.value=`${e.value}${t}`),e}};return e}function z(r,e,o="WithinHeaders"){let t={"x-algolia-api-key":e,"x-algolia-application-id":r};return {headers(){return o==="WithinHeaders"?t:{}},queryParameters(){return o==="WithinQueryParameters"?t:{}}}}function Q({algoliaAgents:r,client:e,version:o}){let t=re(o).add({segment:e,version:o});return r.forEach(n=>t.add(n)),t}function F(){return {debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var W=2*60*1e3;function H(r,e="up"){let o=Date.now();function t(){return e==="up"||Date.now()-o>W}function n(){return e==="timed out"&&Date.now()-o<=W}return {...r,status:e,lastUpdate:o,isUp:t,isTimedOut:n}}var G=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e);}},B=class extends G{stackTrace;constructor(r,e,o){super(r,o),this.stackTrace=e;}},te=class extends B{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",r,"RetryError");}},_=class extends B{status;constructor(r,e,o,t="ApiError"){super(r,o,t),this.status=e;}},oe=class extends G{response;constructor(r,e){super(r,"DeserializationError"),this.response=e;}},se=class extends _{error;constructor(r,e,o,t){super(r,e,t,"DetailedApiError"),this.error=o;}};function ne(r,e,o){let t=ae(o),n=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return t.length&&(n+=`?${t}`),n}function ae(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replaceAll("+","%20")}`).join("&")}function ie(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let o=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(o)}function ce(r,e,o){let t={Accept:"application/json",...r,...e,...o},n={};return Object.keys(t).forEach(l=>{let h=t[l];n[l.toLowerCase()]=h;}),n}function ue(r){try{return JSON.parse(r.content)}catch(e){throw new oe(e.message,r)}}function le({content:r,status:e},o){try{let t=JSON.parse(r);return "error"in t?new se(t.message,e,t.error,o):new _(t.message,e,o)}catch{}return new _(r,e,o)}function me({isTimedOut:r,status:e}){return !r&&~~e===0}function de({isTimedOut:r,status:e}){return r||me({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:r}){return ~~(r/100)===2}function pe(r){return r.map(e=>X(e))}function X(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function K({hosts:r,hostsCache:e,baseHeaders:o,logger:t,baseQueryParameters:n,algoliaAgent:l,timeouts:h,requester:a,requestsCache:s,responsesCache:i}){async function m(c){let u=await Promise.all(c.map(d=>e.get(d,()=>Promise.resolve(H(d))))),g=u.filter(d=>d.isUp()),P=u.filter(d=>d.isTimedOut()),w=[...g,...P];return {hosts:w.length>0?w:c,getTimeout(d,T){return (P.length===0&&d===0?1:P.length+3+d)*T}}}async function p(c,u,g=!0){let P=[],w=ie(c,u),E=ce(o,c.headers,u.headers),d=c.method==="GET"?{...c.data,...u.data}:{},T={...n,...c.queryParameters,...d};if(l.value&&(T["x-algolia-agent"]=l.value),u&&u.queryParameters)for(let f of Object.keys(u.queryParameters))!u.queryParameters[f]||Object.prototype.toString.call(u.queryParameters[f])==="[object Object]"?T[f]=u.queryParameters[f]:T[f]=u.queryParameters[f].toString();let x=0,D=async(f,S)=>{let O=f.pop();if(O===void 0)throw new te(pe(P));let C={...h,...u.timeouts},k={data:w,headers:E,method:c.method,url:ne(O,c.path,T),connectTimeout:S(x,C.connect),responseTimeout:S(x,g?C.read:C.write)},U=b=>{let L={request:k,response:b,host:O,triesLeft:f.length};return P.push(L),L},v=await a.send(k);if(de(v)){let b=U(v);return v.isTimedOut&&x++,t.info("Retryable failure",X(b)),await e.set(O,H(O,v.isTimedOut?"timed out":"down")),D(f,S)}if(he(v))return ue(v);throw U(v),le(v,P)},Z=r.filter(f=>f.accept==="readWrite"||(g?f.accept==="read":f.accept==="write")),I=await m(Z);return D([...I.hosts].reverse(),I.getTimeout)}function y(c,u={}){let g=c.useReadTransporter||c.method==="GET";if(!g)return p(c,u,g);let P=()=>p(c,u);if((u.cacheable||c.cacheable)!==!0)return P();let E={request:c,requestOptions:u,transporter:{queryParameters:n,headers:o}};return i.get(E,()=>s.get(E,()=>s.set(E,P()).then(d=>Promise.all([s.delete(E),d]),d=>Promise.all([s.delete(E),Promise.reject(d)])).then(([d,T])=>T)),{miss:d=>i.set(E,d)})}return {hostsCache:e,requester:a,timeouts:h,logger:t,algoliaAgent:l,baseHeaders:o,baseQueryParameters:n,hosts:r,request:y,requestsCache:s,responsesCache:i}}function V(){function r(e){return new Promise(o=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>t.setRequestHeader(a,e.headers[a]));let n=(a,s)=>setTimeout(()=>{t.abort(),o({status:0,content:s,isTimedOut:!0});},a),l=n(e.connectTimeout,"Connection timeout"),h;t.onreadystatechange=()=>{t.readyState>t.OPENED&&h===void 0&&(clearTimeout(l),h=n(e.responseTimeout,"Socket timeout"));},t.onerror=()=>{t.status===0&&(clearTimeout(l),clearTimeout(h),o({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}));},t.onload=()=>{clearTimeout(l),clearTimeout(h),o({content:t.responseText,status:t.status,isTimedOut:!1});},t.send(e.data);})}return {send:r}}var A="5.7.0",N=["de","us"];function fe(r){return [{url:r?"insights.{region}.algolia.io".replace("{region}",r):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Y({appId:r,apiKey:e,authMode:o,algoliaAgents:t,region:n,...l}){let h=z(r,e,o),a=K({hosts:fe(n),...l,algoliaAgent:Q({algoliaAgents:t,client:"Insights",version:A}),baseHeaders:{"content-type":"text/plain",...h.headers(),...l.baseHeaders},baseQueryParameters:{...h.queryParameters(),...l.baseQueryParameters}});return {transporter:a,appId:r,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(s,i){a.algoliaAgent.add({segment:s,version:i});},setClientApiKey({apiKey:s}){!o||o==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=s:a.baseQueryParameters["x-algolia-api-key"]=s;},customDelete({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customDelete`.");let u={method:"DELETE",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customGet({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customGet`.");let u={method:"GET",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customPost({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPost`.");let g={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},customPut({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPut`.");let g={method:"PUT",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},deleteUserToken({userToken:s},i){if(!s)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");let c={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return a.request(c,i)},pushEvents(s,i){if(!s)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!s.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");let c={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:s};return a.request(c,i)}}}function tr(r,e,o,t){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(o&&(typeof o!="string"||!N.includes(o)))throw new Error(`\`region\` must be one of the following: ${N.join(", ")}`);return Y({appId:r,apiKey:e,region:o,timeouts:{connect:j,read:J,write:M},logger:F(),requester:V(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:q(),requestsCache:q({serializable:!1}),hostsCache:R({caches:[$({key:`${A}-${r}`}),q()]}),...t})} | ||
function W(){function r(e){return new Promise(o=>{let t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach(a=>t.setRequestHeader(a,e.headers[a]));let n=(a,s)=>setTimeout(()=>{t.abort(),o({status:0,content:s,isTimedOut:!0});},a),l=n(e.connectTimeout,"Connection timeout"),h;t.onreadystatechange=()=>{t.readyState>t.OPENED&&h===void 0&&(clearTimeout(l),h=n(e.responseTimeout,"Socket timeout"));},t.onerror=()=>{t.status===0&&(clearTimeout(l),clearTimeout(h),o({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}));},t.onload=()=>{clearTimeout(l),clearTimeout(h),o({content:t.responseText,status:t.status,isTimedOut:!1});},t.send(e.data);})}return {send:r}}function j(r){let e,o=`algolia-client-js-${r.key}`;function t(){return e===void 0&&(e=r.localStorage||window.localStorage),e}function n(){return JSON.parse(t().getItem(o)||"{}")}function l(a){t().setItem(o,JSON.stringify(a));}function h(){let a=r.timeToLive?r.timeToLive*1e3:null,s=n(),i=Object.fromEntries(Object.entries(s).filter(([,p])=>p.timestamp!==void 0));if(l(i),!a)return;let m=Object.fromEntries(Object.entries(i).filter(([,p])=>{let E=new Date().getTime();return !(p.timestamp+a<E)}));l(m);}return {get(a,s,i={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(h(),n()[JSON.stringify(a)])).then(m=>Promise.all([m?m.value:s(),m!==void 0])).then(([m,p])=>Promise.all([m,p||i.miss(m)])).then(([m])=>m)},set(a,s){return Promise.resolve().then(()=>{let i=n();return i[JSON.stringify(a)]={timestamp:new Date().getTime(),value:s},t().setItem(o,JSON.stringify(i)),s})},delete(a){return Promise.resolve().then(()=>{let s=n();delete s[JSON.stringify(a)],t().setItem(o,JSON.stringify(s));})},clear(){return Promise.resolve().then(()=>{t().removeItem(o);})}}}function ee(){return {get(r,e,o={miss:()=>Promise.resolve()}){return e().then(n=>Promise.all([n,o.miss(n)])).then(([n])=>n)},set(r,e){return Promise.resolve(e)},delete(r){return Promise.resolve()},clear(){return Promise.resolve()}}}function R(r){let e=[...r.caches],o=e.shift();return o===void 0?ee():{get(t,n,l={miss:()=>Promise.resolve()}){return o.get(t,n,l).catch(()=>R({caches:e}).get(t,n,l))},set(t,n){return o.set(t,n).catch(()=>R({caches:e}).set(t,n))},delete(t){return o.delete(t).catch(()=>R({caches:e}).delete(t))},clear(){return o.clear().catch(()=>R({caches:e}).clear())}}}function q(r={serializable:!0}){let e={};return {get(o,t,n={miss:()=>Promise.resolve()}){let l=JSON.stringify(o);if(l in e)return Promise.resolve(r.serializable?JSON.parse(e[l]):e[l]);let h=t();return h.then(a=>n.miss(a)).then(()=>h)},set(o,t){return e[JSON.stringify(o)]=r.serializable?JSON.stringify(t):t,Promise.resolve(t)},delete(o){return delete e[JSON.stringify(o)],Promise.resolve()},clear(){return e={},Promise.resolve()}}}var J=1e3,M=2e3,z=3e4;function re(r){let e={value:`Algolia for JavaScript (${r})`,add(o){let t=`; ${o.segment}${o.version!==void 0?` (${o.version})`:""}`;return e.value.indexOf(t)===-1&&(e.value=`${e.value}${t}`),e}};return e}function Q(r,e,o="WithinHeaders"){let t={"x-algolia-api-key":e,"x-algolia-application-id":r};return {headers(){return o==="WithinHeaders"?t:{}},queryParameters(){return o==="WithinQueryParameters"?t:{}}}}function F({algoliaAgents:r,client:e,version:o}){let t=re(o).add({segment:e,version:o});return r.forEach(n=>t.add(n)),t}function G(){return {debug(r,e){return Promise.resolve()},info(r,e){return Promise.resolve()},error(r,e){return Promise.resolve()}}}var H=2*60*1e3;function $(r,e="up"){let o=Date.now();function t(){return e==="up"||Date.now()-o>H}function n(){return e==="timed out"&&Date.now()-o<=H}return {...r,status:e,lastUpdate:o,isUp:t,isTimedOut:n}}var B=class extends Error{name="AlgoliaError";constructor(r,e){super(r),e&&(this.name=e);}},X=class extends B{stackTrace;constructor(r,e,o){super(r,o),this.stackTrace=e;}},te=class extends X{constructor(r){super("Unreachable hosts - your application id may be incorrect. If the error persists, please reach out to the Algolia Support team: https://alg.li/support.",r,"RetryError");}},_=class extends X{status;constructor(r,e,o,t="ApiError"){super(r,o,t),this.status=e;}},oe=class extends B{response;constructor(r,e){super(r,"DeserializationError"),this.response=e;}},se=class extends _{error;constructor(r,e,o,t){super(r,e,t,"DetailedApiError"),this.error=o;}};function ne(r,e,o){let t=ae(o),n=`${r.protocol}://${r.url}${r.port?`:${r.port}`:""}/${e.charAt(0)==="/"?e.substring(1):e}`;return t.length&&(n+=`?${t}`),n}function ae(r){return Object.keys(r).filter(e=>r[e]!==void 0).sort().map(e=>`${e}=${encodeURIComponent(Object.prototype.toString.call(r[e])==="[object Array]"?r[e].join(","):r[e]).replace(/\+/g,"%20")}`).join("&")}function ie(r,e){if(r.method==="GET"||r.data===void 0&&e.data===void 0)return;let o=Array.isArray(r.data)?r.data:{...r.data,...e.data};return JSON.stringify(o)}function ce(r,e,o){let t={Accept:"application/json",...r,...e,...o},n={};return Object.keys(t).forEach(l=>{let h=t[l];n[l.toLowerCase()]=h;}),n}function ue(r){try{return JSON.parse(r.content)}catch(e){throw new oe(e.message,r)}}function le({content:r,status:e},o){try{let t=JSON.parse(r);return "error"in t?new se(t.message,e,t.error,o):new _(t.message,e,o)}catch{}return new _(r,e,o)}function me({isTimedOut:r,status:e}){return !r&&~~e===0}function de({isTimedOut:r,status:e}){return r||me({isTimedOut:r,status:e})||~~(e/100)!==2&&~~(e/100)!==4}function he({status:r}){return ~~(r/100)===2}function pe(r){return r.map(e=>K(e))}function K(r){let e=r.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return {...r,request:{...r.request,headers:{...r.request.headers,...e}}}}function V({hosts:r,hostsCache:e,baseHeaders:o,logger:t,baseQueryParameters:n,algoliaAgent:l,timeouts:h,requester:a,requestsCache:s,responsesCache:i}){async function m(c){let u=await Promise.all(c.map(d=>e.get(d,()=>Promise.resolve($(d))))),g=u.filter(d=>d.isUp()),P=u.filter(d=>d.isTimedOut()),w=[...g,...P];return {hosts:w.length>0?w:c,getTimeout(d,T){return (P.length===0&&d===0?1:P.length+3+d)*T}}}async function p(c,u,g=!0){let P=[],w=ie(c,u),y=ce(o,c.headers,u.headers),d=c.method==="GET"?{...c.data,...u.data}:{},T={...n,...c.queryParameters,...d};if(l.value&&(T["x-algolia-agent"]=l.value),u&&u.queryParameters)for(let f of Object.keys(u.queryParameters))!u.queryParameters[f]||Object.prototype.toString.call(u.queryParameters[f])==="[object Object]"?T[f]=u.queryParameters[f]:T[f]=u.queryParameters[f].toString();let x=0,D=async(f,S)=>{let O=f.pop();if(O===void 0)throw new te(pe(P));let C={...h,...u.timeouts},k={data:w,headers:y,method:c.method,url:ne(O,c.path,T),connectTimeout:S(x,C.connect),responseTimeout:S(x,g?C.read:C.write)},U=b=>{let L={request:k,response:b,host:O,triesLeft:f.length};return P.push(L),L},v=await a.send(k);if(de(v)){let b=U(v);return v.isTimedOut&&x++,t.info("Retryable failure",K(b)),await e.set(O,$(O,v.isTimedOut?"timed out":"down")),D(f,S)}if(he(v))return ue(v);throw U(v),le(v,P)},Z=r.filter(f=>f.accept==="readWrite"||(g?f.accept==="read":f.accept==="write")),I=await m(Z);return D([...I.hosts].reverse(),I.getTimeout)}function E(c,u={}){let g=c.useReadTransporter||c.method==="GET";if(!g)return p(c,u,g);let P=()=>p(c,u);if((u.cacheable||c.cacheable)!==!0)return P();let y={request:c,requestOptions:u,transporter:{queryParameters:n,headers:o}};return i.get(y,()=>s.get(y,()=>s.set(y,P()).then(d=>Promise.all([s.delete(y),d]),d=>Promise.all([s.delete(y),Promise.reject(d)])).then(([d,T])=>T)),{miss:d=>i.set(y,d)})}return {hostsCache:e,requester:a,timeouts:h,logger:t,algoliaAgent:l,baseHeaders:o,baseQueryParameters:n,hosts:r,request:E,requestsCache:s,responsesCache:i}}var A="5.8.0",N=["de","us"];function fe(r){return [{url:r?"insights.{region}.algolia.io".replace("{region}",r):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Y({appId:r,apiKey:e,authMode:o,algoliaAgents:t,region:n,...l}){let h=Q(r,e,o),a=V({hosts:fe(n),...l,algoliaAgent:F({algoliaAgents:t,client:"Insights",version:A}),baseHeaders:{"content-type":"text/plain",...h.headers(),...l.baseHeaders},baseQueryParameters:{...h.queryParameters(),...l.baseQueryParameters}});return {transporter:a,appId:r,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(s,i){a.algoliaAgent.add({segment:s,version:i});},setClientApiKey({apiKey:s}){!o||o==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=s:a.baseQueryParameters["x-algolia-api-key"]=s;},customDelete({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customDelete`.");let u={method:"DELETE",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customGet({path:s,parameters:i},m){if(!s)throw new Error("Parameter `path` is required when calling `customGet`.");let u={method:"GET",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{}};return a.request(u,m)},customPost({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPost`.");let g={method:"POST",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},customPut({path:s,parameters:i,body:m},p){if(!s)throw new Error("Parameter `path` is required when calling `customPut`.");let g={method:"PUT",path:"/{path}".replace("{path}",s),queryParameters:i||{},headers:{},data:m||{}};return a.request(g,p)},deleteUserToken({userToken:s},i){if(!s)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");let c={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(s)),queryParameters:{},headers:{}};return a.request(c,i)},pushEvents(s,i){if(!s)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!s.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");let c={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:s};return a.request(c,i)}}}function nr(r,e,o,t){if(!r||typeof r!="string")throw new Error("`appId` is missing.");if(!e||typeof e!="string")throw new Error("`apiKey` is missing.");if(o&&(typeof o!="string"||!N.includes(o)))throw new Error(`\`region\` must be one of the following: ${N.join(", ")}`);return Y({appId:r,apiKey:e,region:o,timeouts:{connect:J,read:M,write:z},logger:G(),requester:W(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:q(),requestsCache:q({serializable:!1}),hostsCache:R({caches:[j({key:`${A}-${r}`}),q()]}),...t})} | ||
exports.apiClientVersion = A; | ||
exports.insightsClient = tr; | ||
exports.insightsClient = nr; | ||
})); |
// builds/fetch.ts | ||
import { | ||
createNullLogger, | ||
createMemoryCache, | ||
createNullCache, | ||
createNullLogger, | ||
DEFAULT_CONNECT_TIMEOUT_NODE, | ||
@@ -14,3 +14,3 @@ DEFAULT_READ_TIMEOUT_NODE, | ||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
var apiClientVersion = "5.7.0"; | ||
var apiClientVersion = "5.8.0"; | ||
var REGIONS = ["de", "us"]; | ||
@@ -90,3 +90,2 @@ function getDefaultHosts(region) { | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
@@ -114,3 +113,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
@@ -138,3 +136,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
@@ -164,3 +161,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
@@ -190,3 +186,2 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see `Delete a user profile` in the Personalization API. | ||
* | ||
* @param deleteUserToken - The deleteUserToken object. | ||
@@ -213,3 +208,2 @@ * @param deleteUserToken.userToken - User token for which to delete all associated events. | ||
* Sends a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB. | ||
* | ||
* @param insightsEvents - The insightsEvents object. | ||
@@ -216,0 +210,0 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. |
// builds/node.ts | ||
import { createHttpRequester } from "@algolia/requester-node-http"; | ||
import { | ||
createNullLogger, | ||
createMemoryCache, | ||
createNullCache, | ||
createNullLogger, | ||
DEFAULT_CONNECT_TIMEOUT_NODE, | ||
@@ -10,7 +11,6 @@ DEFAULT_READ_TIMEOUT_NODE, | ||
} from "@algolia/client-common"; | ||
import { createHttpRequester } from "@algolia/requester-node-http"; | ||
// src/insightsClient.ts | ||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
var apiClientVersion = "5.7.0"; | ||
var apiClientVersion = "5.8.0"; | ||
var REGIONS = ["de", "us"]; | ||
@@ -90,3 +90,2 @@ function getDefaultHosts(region) { | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
@@ -114,3 +113,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
@@ -138,3 +136,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
@@ -164,3 +161,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
@@ -190,3 +186,2 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see `Delete a user profile` in the Personalization API. | ||
* | ||
* @param deleteUserToken - The deleteUserToken object. | ||
@@ -213,3 +208,2 @@ * @param deleteUserToken.userToken - User token for which to delete all associated events. | ||
* Sends a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB. | ||
* | ||
* @param insightsEvents - The insightsEvents object. | ||
@@ -216,0 +210,0 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. |
@@ -5,72 +5,2 @@ import * as _algolia_client_common from '@algolia/client-common'; | ||
/** | ||
* Properties for the `customDelete` method. | ||
*/ | ||
type CustomDeleteProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
}; | ||
/** | ||
* Properties for the `customGet` method. | ||
*/ | ||
type CustomGetProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
}; | ||
/** | ||
* Properties for the `customPost` method. | ||
*/ | ||
type CustomPostProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `customPut` method. | ||
*/ | ||
type CustomPutProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `deleteUserToken` method. | ||
*/ | ||
type DeleteUserTokenProps = { | ||
/** | ||
* User token for which to delete all associated events. | ||
*/ | ||
userToken: string; | ||
}; | ||
/** | ||
* The response of the Insights API. | ||
@@ -134,3 +64,3 @@ */ | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -151,3 +81,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
/** | ||
@@ -194,3 +124,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -211,3 +141,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectDataAfterSearch[]; | ||
objectData?: Array<ObjectDataAfterSearch>; | ||
/** | ||
@@ -238,3 +168,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -270,3 +200,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -302,7 +232,7 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
* Position of the clicked item the search results. You must provide 1 `position` for each `objectID`. | ||
*/ | ||
positions: number[]; | ||
positions: Array<number>; | ||
/** | ||
@@ -339,3 +269,3 @@ * Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -371,3 +301,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -403,3 +333,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -442,3 +372,3 @@ * Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -459,3 +389,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
/** | ||
@@ -485,3 +415,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -502,3 +432,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData: ObjectDataAfterSearch[]; | ||
objectData: Array<ObjectDataAfterSearch>; | ||
/** | ||
@@ -529,3 +459,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -561,3 +491,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -577,3 +507,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
type EventsItems = AddedToCartObjectIDs | AddedToCartObjectIDsAfterSearch | ClickedFilters | ClickedObjectIDs | ClickedObjectIDsAfterSearch | ConvertedFilters | ConvertedObjectIDs | ConvertedObjectIDsAfterSearch | PurchasedObjectIDs | PurchasedObjectIDsAfterSearch | ViewedFilters | ViewedObjectIDs; | ||
type EventsItems = ClickedObjectIDsAfterSearch | AddedToCartObjectIDsAfterSearch | PurchasedObjectIDsAfterSearch | ConvertedObjectIDsAfterSearch | ClickedObjectIDs | PurchasedObjectIDs | AddedToCartObjectIDs | ConvertedObjectIDs | ClickedFilters | ConvertedFilters | ViewedObjectIDs | ViewedFilters; | ||
@@ -584,6 +514,84 @@ type InsightsEvents = { | ||
*/ | ||
events: EventsItems[]; | ||
events: Array<EventsItems>; | ||
}; | ||
declare const apiClientVersion = "5.7.0"; | ||
/** | ||
* Properties for the `customDelete` method. | ||
*/ | ||
type CustomDeleteProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
/** | ||
* Properties for the `customGet` method. | ||
*/ | ||
type CustomGetProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
/** | ||
* Properties for the `customPost` method. | ||
*/ | ||
type CustomPostProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `customPut` method. | ||
*/ | ||
type CustomPutProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `deleteUserToken` method. | ||
*/ | ||
type DeleteUserTokenProps = { | ||
/** | ||
* User token for which to delete all associated events. | ||
*/ | ||
userToken: string; | ||
}; | ||
declare const apiClientVersion = "5.8.0"; | ||
declare const REGIONS: readonly ["de", "us"]; | ||
@@ -625,3 +633,2 @@ type Region = (typeof REGIONS)[number]; | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
@@ -635,3 +642,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
@@ -645,3 +651,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
@@ -656,3 +661,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
@@ -667,3 +671,2 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see `Delete a user profile` in the Personalization API. | ||
* | ||
* @param deleteUserToken - The deleteUserToken object. | ||
@@ -676,3 +679,2 @@ * @param deleteUserToken.userToken - User token for which to delete all associated events. | ||
* Sends a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB. | ||
* | ||
* @param insightsEvents - The insightsEvents object. | ||
@@ -679,0 +681,0 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. |
@@ -5,72 +5,2 @@ import * as _algolia_client_common from '@algolia/client-common'; | ||
/** | ||
* Properties for the `customDelete` method. | ||
*/ | ||
type CustomDeleteProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
}; | ||
/** | ||
* Properties for the `customGet` method. | ||
*/ | ||
type CustomGetProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
}; | ||
/** | ||
* Properties for the `customPost` method. | ||
*/ | ||
type CustomPostProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `customPut` method. | ||
*/ | ||
type CustomPutProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: Record<string, any>; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `deleteUserToken` method. | ||
*/ | ||
type DeleteUserTokenProps = { | ||
/** | ||
* User token for which to delete all associated events. | ||
*/ | ||
userToken: string; | ||
}; | ||
/** | ||
* The response of the Insights API. | ||
@@ -134,3 +64,3 @@ */ | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -151,3 +81,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
/** | ||
@@ -194,3 +124,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -211,3 +141,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectDataAfterSearch[]; | ||
objectData?: Array<ObjectDataAfterSearch>; | ||
/** | ||
@@ -238,3 +168,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -270,3 +200,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -302,7 +232,7 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
* Position of the clicked item the search results. You must provide 1 `position` for each `objectID`. | ||
*/ | ||
positions: number[]; | ||
positions: Array<number>; | ||
/** | ||
@@ -339,3 +269,3 @@ * Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -371,3 +301,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -403,3 +333,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -442,3 +372,3 @@ * Unique identifier for a search query. The query ID is required for events related to search or browse requests. If you add `clickAnalytics: true` as a search request parameter, the query ID is included in the API response. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -459,3 +389,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
/** | ||
@@ -485,3 +415,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -502,3 +432,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectData: ObjectDataAfterSearch[]; | ||
objectData: Array<ObjectDataAfterSearch>; | ||
/** | ||
@@ -529,3 +459,3 @@ * Timestamp of the event, measured in milliseconds since the Unix epoch. By default, the Insights API uses the time it receives an event as its timestamp. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
/** | ||
@@ -561,3 +491,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
/** | ||
@@ -577,3 +507,3 @@ * Anonymous or pseudonymous user identifier. Don\'t use personally identifiable information in user tokens. For more information, see [User token](https://www.algolia.com/doc/guides/sending-events/concepts/usertoken/). | ||
type EventsItems = AddedToCartObjectIDs | AddedToCartObjectIDsAfterSearch | ClickedFilters | ClickedObjectIDs | ClickedObjectIDsAfterSearch | ConvertedFilters | ConvertedObjectIDs | ConvertedObjectIDsAfterSearch | PurchasedObjectIDs | PurchasedObjectIDsAfterSearch | ViewedFilters | ViewedObjectIDs; | ||
type EventsItems = ClickedObjectIDsAfterSearch | AddedToCartObjectIDsAfterSearch | PurchasedObjectIDsAfterSearch | ConvertedObjectIDsAfterSearch | ClickedObjectIDs | PurchasedObjectIDs | AddedToCartObjectIDs | ConvertedObjectIDs | ClickedFilters | ConvertedFilters | ViewedObjectIDs | ViewedFilters; | ||
@@ -584,6 +514,84 @@ type InsightsEvents = { | ||
*/ | ||
events: EventsItems[]; | ||
events: Array<EventsItems>; | ||
}; | ||
declare const apiClientVersion = "5.7.0"; | ||
/** | ||
* Properties for the `customDelete` method. | ||
*/ | ||
type CustomDeleteProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
/** | ||
* Properties for the `customGet` method. | ||
*/ | ||
type CustomGetProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
}; | ||
/** | ||
* Properties for the `customPost` method. | ||
*/ | ||
type CustomPostProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `customPut` method. | ||
*/ | ||
type CustomPutProps = { | ||
/** | ||
* Path of the endpoint, anything after \"/1\" must be specified. | ||
*/ | ||
path: string; | ||
/** | ||
* Query parameters to apply to the current query. | ||
*/ | ||
parameters?: { | ||
[key: string]: any; | ||
}; | ||
/** | ||
* Parameters to send with the custom request. | ||
*/ | ||
body?: Record<string, unknown>; | ||
}; | ||
/** | ||
* Properties for the `deleteUserToken` method. | ||
*/ | ||
type DeleteUserTokenProps = { | ||
/** | ||
* User token for which to delete all associated events. | ||
*/ | ||
userToken: string; | ||
}; | ||
declare const apiClientVersion = "5.8.0"; | ||
declare const REGIONS: readonly ["de", "us"]; | ||
@@ -625,3 +633,2 @@ type Region = (typeof REGIONS)[number]; | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
@@ -635,3 +642,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
@@ -645,3 +651,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
@@ -656,3 +661,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
@@ -667,3 +671,2 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see `Delete a user profile` in the Personalization API. | ||
* | ||
* @param deleteUserToken - The deleteUserToken object. | ||
@@ -676,3 +679,2 @@ * @param deleteUserToken.userToken - User token for which to delete all associated events. | ||
* Sends a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB. | ||
* | ||
* @param insightsEvents - The insightsEvents object. | ||
@@ -679,0 +681,0 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. |
// src/insightsClient.ts | ||
import { createAuth, createTransporter, getAlgoliaAgent } from "@algolia/client-common"; | ||
var apiClientVersion = "5.7.0"; | ||
var apiClientVersion = "5.8.0"; | ||
var REGIONS = ["de", "us"]; | ||
@@ -78,3 +78,2 @@ function getDefaultHosts(region) { | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customDelete - The customDelete object. | ||
@@ -102,3 +101,2 @@ * @param customDelete.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customGet - The customGet object. | ||
@@ -126,3 +124,2 @@ * @param customGet.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPost - The customPost object. | ||
@@ -152,3 +149,2 @@ * @param customPost.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* This method allow you to send requests to the Algolia REST API. | ||
* | ||
* @param customPut - The customPut object. | ||
@@ -178,3 +174,2 @@ * @param customPut.path - Path of the endpoint, anything after \"/1\" must be specified. | ||
* Deletes all events related to the specified user token from events metrics and analytics. The deletion is asynchronous, and processed within 48 hours. To delete a personalization user profile, see `Delete a user profile` in the Personalization API. | ||
* | ||
* @param deleteUserToken - The deleteUserToken object. | ||
@@ -201,3 +196,2 @@ * @param deleteUserToken.userToken - User token for which to delete all associated events. | ||
* Sends a list of events to the Insights API. You can include up to 1,000 events in a single request, but the request body must be smaller than 2 MB. | ||
* | ||
* @param insightsEvents - The insightsEvents object. | ||
@@ -204,0 +198,0 @@ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions. |
// eslint-disable-next-line import/no-commonjs,import/extensions | ||
module.exports = require('./dist/builds/node.cjs'); | ||
module.exports = require('./dist/builds/node.cjs'); |
@@ -29,3 +29,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -50,3 +50,3 @@ /** | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
@@ -53,0 +53,0 @@ /** |
@@ -34,3 +34,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -55,3 +55,3 @@ /** | ||
*/ | ||
objectData?: ObjectDataAfterSearch[]; | ||
objectData?: Array<ObjectDataAfterSearch>; | ||
@@ -58,0 +58,0 @@ /** |
@@ -24,3 +24,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
@@ -27,0 +27,0 @@ /** |
@@ -24,3 +24,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -27,0 +27,0 @@ /** |
@@ -24,3 +24,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -30,3 +30,3 @@ /** | ||
*/ | ||
positions: number[]; | ||
positions: Array<number>; | ||
@@ -33,0 +33,0 @@ /** |
@@ -14,3 +14,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
parameters?: Record<string, any>; | ||
parameters?: { [key: string]: any }; | ||
}; | ||
@@ -29,3 +29,3 @@ | ||
*/ | ||
parameters?: Record<string, any>; | ||
parameters?: { [key: string]: any }; | ||
}; | ||
@@ -44,3 +44,3 @@ | ||
*/ | ||
parameters?: Record<string, any>; | ||
parameters?: { [key: string]: any }; | ||
/** | ||
@@ -63,3 +63,3 @@ * Parameters to send with the custom request. | ||
*/ | ||
parameters?: Record<string, any>; | ||
parameters?: { [key: string]: any }; | ||
/** | ||
@@ -66,0 +66,0 @@ * Parameters to send with the custom request. |
@@ -21,3 +21,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
@@ -24,0 +24,0 @@ /** |
@@ -24,3 +24,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -27,0 +27,0 @@ /** |
@@ -24,3 +24,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -27,0 +27,0 @@ /** |
@@ -11,4 +11,6 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
import type { ConvertedObjectIDsAfterSearch } from './convertedObjectIDsAfterSearch'; | ||
import type { PurchasedObjectIDs } from './purchasedObjectIDs'; | ||
import type { PurchasedObjectIDsAfterSearch } from './purchasedObjectIDsAfterSearch'; | ||
import type { ViewedFilters } from './viewedFilters'; | ||
@@ -18,13 +20,13 @@ import type { ViewedObjectIDs } from './viewedObjectIDs'; | ||
export type EventsItems = | ||
| ClickedObjectIDsAfterSearch | ||
| AddedToCartObjectIDsAfterSearch | ||
| PurchasedObjectIDsAfterSearch | ||
| ConvertedObjectIDsAfterSearch | ||
| ClickedObjectIDs | ||
| PurchasedObjectIDs | ||
| AddedToCartObjectIDs | ||
| AddedToCartObjectIDsAfterSearch | ||
| ConvertedObjectIDs | ||
| ClickedFilters | ||
| ClickedObjectIDs | ||
| ClickedObjectIDsAfterSearch | ||
| ConvertedFilters | ||
| ConvertedObjectIDs | ||
| ConvertedObjectIDsAfterSearch | ||
| PurchasedObjectIDs | ||
| PurchasedObjectIDsAfterSearch | ||
| ViewedFilters | ||
| ViewedObjectIDs; | ||
| ViewedObjectIDs | ||
| ViewedFilters; |
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
export * from './addToCartEvent'; | ||
export * from './addedToCartObjectIDs'; | ||
export * from './addedToCartObjectIDsAfterSearch'; | ||
export * from './clickEvent'; | ||
export * from './addToCartEvent'; | ||
export * from './clickedFilters'; | ||
export * from './clickedObjectIDs'; | ||
export * from './clickedObjectIDsAfterSearch'; | ||
export * from './clickEvent'; | ||
export * from './clientMethodProps'; | ||
export * from './conversionEvent'; | ||
@@ -22,9 +23,8 @@ export * from './convertedFilters'; | ||
export * from './price'; | ||
export * from './purchaseEvent'; | ||
export * from './purchasedObjectIDs'; | ||
export * from './purchasedObjectIDsAfterSearch'; | ||
export * from './purchaseEvent'; | ||
export * from './value'; | ||
export * from './viewEvent'; | ||
export * from './viewedFilters'; | ||
export * from './viewedObjectIDs'; | ||
export * from './clientMethodProps'; | ||
export * from './viewEvent'; |
@@ -9,3 +9,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
events: EventsItems[]; | ||
events: Array<EventsItems>; | ||
}; |
@@ -29,3 +29,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -50,3 +50,3 @@ /** | ||
*/ | ||
objectData?: ObjectData[]; | ||
objectData?: Array<ObjectData>; | ||
@@ -53,0 +53,0 @@ /** |
@@ -29,3 +29,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -50,3 +50,3 @@ /** | ||
*/ | ||
objectData: ObjectDataAfterSearch[]; | ||
objectData: Array<ObjectDataAfterSearch>; | ||
@@ -53,0 +53,0 @@ /** |
@@ -24,3 +24,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
filters: string[]; | ||
filters: Array<string>; | ||
@@ -27,0 +27,0 @@ /** |
@@ -24,3 +24,3 @@ // Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
*/ | ||
objectIDs: string[]; | ||
objectIDs: Array<string>; | ||
@@ -27,0 +27,0 @@ /** |
{ | ||
"version": "5.7.0", | ||
"version": "5.8.0", | ||
"repository": { | ||
@@ -52,6 +52,6 @@ "type": "git", | ||
"dependencies": { | ||
"@algolia/client-common": "5.7.0", | ||
"@algolia/requester-browser-xhr": "5.7.0", | ||
"@algolia/requester-fetch": "5.7.0", | ||
"@algolia/requester-node-http": "5.7.0" | ||
"@algolia/client-common": "5.8.0", | ||
"@algolia/requester-browser-xhr": "5.8.0", | ||
"@algolia/requester-fetch": "5.8.0", | ||
"@algolia/requester-node-http": "5.8.0" | ||
}, | ||
@@ -62,3 +62,3 @@ "devDependencies": { | ||
"publint": "0.2.11", | ||
"rollup": "4.22.5", | ||
"rollup": "4.24.0", | ||
"tsup": "8.3.0", | ||
@@ -65,0 +65,0 @@ "typescript": "5.6.2" |
@@ -35,3 +35,2 @@ <p align="center"> | ||
To get started, you first need to install @algolia/client-insights (or any other available API client package). | ||
@@ -42,9 +41,8 @@ All of our clients comes with type definition, and are available for both browser and node environments. | ||
```bash | ||
yarn add @algolia/client-insights@5.7.0 | ||
yarn add @algolia/client-insights@5.8.0 | ||
# or | ||
npm install @algolia/client-insights@5.7.0 | ||
npm install @algolia/client-insights@5.8.0 | ||
# or | ||
pnpm add @algolia/client-insights@5.7.0 | ||
pnpm add @algolia/client-insights@5.8.0 | ||
``` | ||
@@ -57,3 +55,3 @@ | ||
```html | ||
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-insights@5.7.0/dist/builds/browser.umd.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/@algolia/client-insights@5.8.0/dist/builds/browser.umd.js"></script> | ||
``` | ||
@@ -79,2 +77,2 @@ | ||
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE). | ||
The Algolia JavaScript API Client is an open-sourced software licensed under the [MIT license](LICENSE). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
414010
4251
75
+ Added@algolia/client-common@5.8.0(transitive)
+ Added@algolia/requester-browser-xhr@5.8.0(transitive)
+ Added@algolia/requester-fetch@5.8.0(transitive)
+ Added@algolia/requester-node-http@5.8.0(transitive)
- Removed@algolia/client-common@5.7.0(transitive)
- Removed@algolia/requester-browser-xhr@5.7.0(transitive)
- Removed@algolia/requester-fetch@5.7.0(transitive)
- Removed@algolia/requester-node-http@5.7.0(transitive)
Updated@algolia/client-common@5.8.0