@algolia/client-insights 5.0.0-alpha.85 → 5.0.0-alpha.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-insights.cjs +1 -1
- package/dist/client-insights.esm.browser.js +1 -1
- package/dist/client-insights.esm.node.js +1 -1
- package/dist/client-insights.umd.js +2 -2
- package/dist/model/addToCartEvent.d.ts +2 -0
- package/dist/model/addToCartEvent.d.ts.map +1 -0
- package/dist/model/addedToCartObjectIDs.d.ts +39 -0
- package/dist/model/addedToCartObjectIDs.d.ts.map +1 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts +43 -0
- package/dist/model/addedToCartObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/model/discount.d.ts +5 -0
- package/dist/model/discount.d.ts.map +1 -0
- package/dist/model/eventsItems.d.ts +5 -1
- package/dist/model/eventsItems.d.ts.map +1 -1
- package/dist/model/index.d.ts +10 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/objectData.d.ts +11 -0
- package/dist/model/objectData.d.ts.map +1 -0
- package/dist/model/objectDataAfterSearch.d.ts +15 -0
- package/dist/model/objectDataAfterSearch.d.ts.map +1 -0
- package/dist/model/price.d.ts +5 -0
- package/dist/model/price.d.ts.map +1 -0
- package/dist/model/purchaseEvent.d.ts +2 -0
- package/dist/model/purchaseEvent.d.ts.map +1 -0
- package/dist/model/purchasedObjectIDs.d.ts +39 -0
- package/dist/model/purchasedObjectIDs.d.ts.map +1 -0
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts +43 -0
- package/dist/model/purchasedObjectIDsAfterSearch.d.ts.map +1 -0
- package/dist/src/insightsClient.d.ts +1 -1
- package/model/addToCartEvent.ts +3 -0
- package/model/addedToCartObjectIDs.ts +49 -0
- package/model/addedToCartObjectIDsAfterSearch.ts +54 -0
- package/model/discount.ts +6 -0
- package/model/eventsItems.ts +8 -0
- package/model/index.ts +10 -0
- package/model/objectData.ts +15 -0
- package/model/objectDataAfterSearch.ts +20 -0
- package/model/price.ts +6 -0
- package/model/purchaseEvent.ts +3 -0
- package/model/purchasedObjectIDs.ts +49 -0
- package/model/purchasedObjectIDsAfterSearch.ts +54 -0
- package/package.json +6 -6
package/dist/client-insights.cjs
CHANGED
|
@@ -4,7 +4,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
4
4
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
5
5
|
|
|
6
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.
|
|
7
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
7
|
+
const apiClientVersion = '5.0.0-alpha.87';
|
|
8
8
|
const REGIONS = ['de', 'us'];
|
|
9
9
|
function getDefaultHosts(region) {
|
|
10
10
|
const url = !region
|
|
@@ -662,7 +662,7 @@ function createXhrRequester() {
|
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
// 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.
|
|
665
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
665
|
+
const apiClientVersion = '5.0.0-alpha.87';
|
|
666
666
|
const REGIONS = ['de', 'us'];
|
|
667
667
|
function getDefaultHosts(region) {
|
|
668
668
|
const url = !region
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// 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.
|
|
5
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.87';
|
|
6
6
|
const REGIONS = ['de', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = !region
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-insights.umd.js | 5.0.0-alpha.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-insights"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class h extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class d extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const y=[],v=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),P=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,g.headers),w="GET"===c.method?{...c.data,...g.data}:{},b={...s,...c.queryParameters,...w};if(a.value&&(b["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?b[e]=g.queryParameters[e].toString():b[e]=g.queryParameters[e];let q=0;const O=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=g.timeout;void 0===a&&(a=f?o.read:o.write);const w={data:v,headers:P,method:c.method,url:m(s,c.path,b),connectTimeout:r(q,o.connect),responseTimeout:r(q,a)},T=t=>{const r={request:w,response:t,host:s,triesLeft:e.length};return y.push(r),r},E=await i.send(w);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const a=T(E);return E.isTimedOut&&q++,console.log("Retryable failure",p(a)),await t.set(s,n(s,E.isTimedOut?"timed out":"down")),O(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(E);throw T(E),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(E,y)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(T);return O([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return g.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(o,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-alpha.85",v=["de","us"];e.apiClientVersion=y,e.insightsClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!v.includes(n)))throw new Error(`\`region\` must be one of the following: ${v.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=g({hosts:(c=a,[{url:c?"insights.{region}.algolia.io".replace("{region}",c):"insights.algolia.io",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:f({algoliaAgents:s,client:"Insights",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},pushEvents(e,t){if(!e)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!e.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");const r={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:e};return i.request(r,t)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})}}));
|
|
1
|
+
/*! client-insights.umd.js | 5.0.0-alpha.87 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-insights"]={})}(this,(function(e){"use strict";function t(e){let t;const r=`algolia-client-js-${e.key}`;function s(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(s().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),s=a()[r];return Promise.all([s||t(),void 0!==s])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const n=a();return n[JSON.stringify(e)]=t,s().setItem(r,JSON.stringify(n)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],s().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{s().removeItem(r)}))}}function r(e){const t=[...e.caches],s=t.shift();return void 0===s?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then((e=>Promise.all([e,r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,a,n={miss:()=>Promise.resolve()})=>s.get(e,a,n).catch((()=>r({caches:t}).get(e,a,n))),set:(e,a)=>s.set(e,a).catch((()=>r({caches:t}).set(e,a))),delete:e=>s.delete(e).catch((()=>r({caches:t}).delete(e))),clear:()=>s.clear().catch((()=>r({caches:t}).clear()))}}function s(e={serializable:!0}){let t={};return{get(r,s,a={miss:()=>Promise.resolve()}){const n=JSON.stringify(r);if(n in t)return Promise.resolve(e.serializable?JSON.parse(t[n]):t[n]);const o=s();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,s)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(s):s,Promise.resolve(s)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const a=12e4;function n(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>a},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=a}}}function o(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var s=r.call(e,t||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class i extends Error{constructor(e,t){super(e),o(this,"name","AlgoliaError"),t&&(this.name=t)}}class c extends i{constructor(e,t,r){super(e,r),o(this,"stackTrace",void 0),this.stackTrace=t}}class u extends c{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class l extends c{constructor(e,t,r,s="ApiError"){super(e,r,s),o(this,"status",void 0),this.status=t}}class h extends i{constructor(e,t){super(e,"DeserializationError"),o(this,"response",void 0),this.response=t}}class d extends l{constructor(e,t,r,s){super(e,t,s,"DetailedApiError"),o(this,"error",void 0),this.error=r}}function m(e,t,r){const s=function(e){const t=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((r=>`${r}=${encodeURIComponent(t(e[r])?JSON.stringify(e[r]):e[r])}`)).join("&")}(r);let a=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return s.length&&(a+=`?${s}`),a}function p(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function g({hosts:e,hostsCache:t,baseHeaders:r,baseQueryParameters:s,algoliaAgent:a,timeouts:o,requester:i,requestsCache:c,responsesCache:g}){async function f(c,g,f=!0){const y=[],v=function(e,t){if("GET"===e.method||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(c,g),P=function(e,t,r){const s={Accept:"application/json",...e,...t,...r},a={};return Object.keys(s).forEach((e=>{const t=s[e];a[e.toLowerCase()]=t})),a}(r,c.headers,g.headers),w="GET"===c.method?{...c.data,...g.data}:{},b={...s,...c.queryParameters,...w};if(a.value&&(b["x-algolia-agent"]=a.value),g&&g.queryParameters)for(const e of Object.keys(g.queryParameters))g.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(g.queryParameters[e])?b[e]=g.queryParameters[e].toString():b[e]=g.queryParameters[e];let q=0;const O=async(e,r)=>{const s=e.pop();if(void 0===s)throw new u(function(e){return e.map((e=>p(e)))}(y));let a=g.timeout;void 0===a&&(a=f?o.read:o.write);const w={data:v,headers:P,method:c.method,url:m(s,c.path,b),connectTimeout:r(q,o.connect),responseTimeout:r(q,a)},T=t=>{const r={request:w,response:t,host:s,triesLeft:e.length};return y.push(r),r},E=await i.send(w);if(function({isTimedOut:e,status:t}){return e||function({isTimedOut:e,status:t}){return!e&&0==~~t}({isTimedOut:e,status:t})||2!=~~(t/100)&&4!=~~(t/100)}(E)){const a=T(E);return E.isTimedOut&&q++,console.log("Retryable failure",p(a)),await t.set(s,n(s,E.isTimedOut?"timed out":"down")),O(e,r)}if(function({status:e}){return 2==~~(e/100)}(E))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(E);throw T(E),function({content:e,status:t},r){try{const s=JSON.parse(e);return"error"in s?new d(s.message,t,s.error,r):new l(s.message,t,r)}catch(e){}return new l(e,t,r)}(E,y)},T=e.filter((e=>"readWrite"===e.accept||(f?"read"===e.accept:"write"===e.accept))),E=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(n(e))))))),s=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),o=[...s,...a];return{hosts:o.length>0?o:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(T);return O([...E.hosts].reverse(),E.getTimeout)}return{hostsCache:t,requester:i,timeouts:o,algoliaAgent:a,baseHeaders:r,baseQueryParameters:s,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return f(e,t,a);const n=()=>f(e,t);if(!0!==(t.cacheable||e.cacheable))return n();const o={request:e,requestOptions:t,transporter:{queryParameters:s,headers:r}};return g.get(o,(()=>c.get(o,(()=>c.set(o,n()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>g.set(o,e)})},requestsCache:c,responsesCache:g}}function f({algoliaAgents:e,client:t,version:r}){const s=function(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}(r).add({segment:t,version:r});return e.forEach((e=>s.add(e))),s}const y="5.0.0-alpha.87",v=["de","us"];e.apiClientVersion=y,e.insightsClient=function(e,a,n,o){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!a||"string"!=typeof a)throw new Error("`apiKey` is missing.");if(n&&("string"!=typeof n||!v.includes(n)))throw new Error(`\`region\` must be one of the following: ${v.join(", ")}`);return function({appId:e,apiKey:t,authMode:r,algoliaAgents:s,region:a,...n}){const o=function(e,t,r="WithinHeaders"){const s={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?s:{},queryParameters:()=>"WithinQueryParameters"===r?s:{}}}(e,t,r),i=g({hosts:(c=a,[{url:c?"insights.{region}.algolia.io".replace("{region}",c):"insights.algolia.io",accept:"readWrite",protocol:"https"}]),...n,algoliaAgent:f({algoliaAgents:s,client:"Insights",version:y}),baseHeaders:{"content-type":"text/plain",...o.headers(),...n.baseHeaders},baseQueryParameters:{...o.queryParameters(),...n.baseQueryParameters}});var c;return{transporter:i,appId:e,clearCache:()=>Promise.all([i.requestsCache.clear(),i.responsesCache.clear()]).then((()=>{})),get _ua(){return i.algoliaAgent.value},addAlgoliaAgent(e,t){i.algoliaAgent.add({segment:e,version:t})},del({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const s={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},get({path:e,parameters:t},r){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const s={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{}};return i.request(s,r)},post({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const a={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)},pushEvents(e,t){if(!e)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!e.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");const r={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:e};return i.request(r,t)},put({path:e,parameters:t,body:r},s){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const a={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:t||{},headers:{},data:r||{}};return i.request(a,s)}}}({appId:e,apiKey:a,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((t=>r.setRequestHeader(t,e.headers[t])));const s=(e,s)=>setTimeout((()=>{r.abort(),t({status:0,content:s,isTimedOut:!0})}),e),a=s(e.connectTimeout,"Connection timeout");let n;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=s(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:s(),requestsCache:s({serializable:!1}),hostsCache:r({caches:[t({key:`${y}-${e}`}),s()]}),...o})}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addToCartEvent.d.ts","sourceRoot":"","sources":["../../model/addToCartEvent.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AddToCartEvent } from './addToCartEvent';
|
|
2
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
3
|
+
import type { ObjectData } from './objectData';
|
|
4
|
+
/**
|
|
5
|
+
* Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track add-to-cart events related to Algolia requests, use the \"Added to cart object IDs after search\" event.
|
|
6
|
+
*/
|
|
7
|
+
export type AddedToCartObjectIDs = {
|
|
8
|
+
/**
|
|
9
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
10
|
+
*/
|
|
11
|
+
eventName: string;
|
|
12
|
+
eventType: ConversionEvent;
|
|
13
|
+
eventSubtype: AddToCartEvent;
|
|
14
|
+
/**
|
|
15
|
+
* Name of the Algolia index.
|
|
16
|
+
*/
|
|
17
|
+
index: string;
|
|
18
|
+
/**
|
|
19
|
+
* List of object identifiers for items of an Algolia index.
|
|
20
|
+
*/
|
|
21
|
+
objectIDs: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
24
|
+
*/
|
|
25
|
+
objectData?: ObjectData[];
|
|
26
|
+
/**
|
|
27
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
28
|
+
*/
|
|
29
|
+
currency?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
32
|
+
*/
|
|
33
|
+
userToken: string;
|
|
34
|
+
/**
|
|
35
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
36
|
+
*/
|
|
37
|
+
timestamp?: number;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=addedToCartObjectIDs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addedToCartObjectIDs.d.ts","sourceRoot":"","sources":["../../model/addedToCartObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AddToCartEvent } from './addToCartEvent';
|
|
2
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
3
|
+
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
4
|
+
/**
|
|
5
|
+
* Use this event to track when users add items to their shopping cart after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
6
|
+
*/
|
|
7
|
+
export type AddedToCartObjectIDsAfterSearch = {
|
|
8
|
+
/**
|
|
9
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
10
|
+
*/
|
|
11
|
+
eventName: string;
|
|
12
|
+
eventType: ConversionEvent;
|
|
13
|
+
eventSubtype: AddToCartEvent;
|
|
14
|
+
/**
|
|
15
|
+
* Name of the Algolia index.
|
|
16
|
+
*/
|
|
17
|
+
index: string;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
*/
|
|
21
|
+
queryID: string;
|
|
22
|
+
/**
|
|
23
|
+
* List of object identifiers for items of an Algolia index.
|
|
24
|
+
*/
|
|
25
|
+
objectIDs: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
28
|
+
*/
|
|
29
|
+
objectData?: ObjectDataAfterSearch[];
|
|
30
|
+
/**
|
|
31
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
32
|
+
*/
|
|
33
|
+
currency?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
36
|
+
*/
|
|
37
|
+
userToken: string;
|
|
38
|
+
/**
|
|
39
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
40
|
+
*/
|
|
41
|
+
timestamp?: number;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=addedToCartObjectIDsAfterSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addedToCartObjectIDsAfterSearch.d.ts","sourceRoot":"","sources":["../../model/addedToCartObjectIDsAfterSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,cAAc,CAAC;IAE7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discount.d.ts","sourceRoot":"","sources":["../../model/discount.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import type { AddedToCartObjectIDs } from './addedToCartObjectIDs';
|
|
2
|
+
import type { AddedToCartObjectIDsAfterSearch } from './addedToCartObjectIDsAfterSearch';
|
|
1
3
|
import type { ClickedFilters } from './clickedFilters';
|
|
2
4
|
import type { ClickedObjectIDs } from './clickedObjectIDs';
|
|
3
5
|
import type { ClickedObjectIDsAfterSearch } from './clickedObjectIDsAfterSearch';
|
|
4
6
|
import type { ConvertedFilters } from './convertedFilters';
|
|
5
7
|
import type { ConvertedObjectIDs } from './convertedObjectIDs';
|
|
6
8
|
import type { ConvertedObjectIDsAfterSearch } from './convertedObjectIDsAfterSearch';
|
|
9
|
+
import type { PurchasedObjectIDs } from './purchasedObjectIDs';
|
|
10
|
+
import type { PurchasedObjectIDsAfterSearch } from './purchasedObjectIDsAfterSearch';
|
|
7
11
|
import type { ViewedFilters } from './viewedFilters';
|
|
8
12
|
import type { ViewedObjectIDs } from './viewedObjectIDs';
|
|
9
|
-
export type EventsItems = ClickedFilters | ClickedObjectIDs | ClickedObjectIDsAfterSearch | ConvertedFilters | ConvertedObjectIDs | ConvertedObjectIDsAfterSearch | ViewedFilters | ViewedObjectIDs;
|
|
13
|
+
export type EventsItems = AddedToCartObjectIDs | AddedToCartObjectIDsAfterSearch | ClickedFilters | ClickedObjectIDs | ClickedObjectIDsAfterSearch | ConvertedFilters | ConvertedObjectIDs | ConvertedObjectIDsAfterSearch | PurchasedObjectIDs | PurchasedObjectIDsAfterSearch | ViewedFilters | ViewedObjectIDs;
|
|
10
14
|
//# sourceMappingURL=eventsItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventsItems.d.ts","sourceRoot":"","sources":["../../model/eventsItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,gBAAgB,GAChB,2BAA2B,GAC3B,gBAAgB,GAChB,kBAAkB,GAClB,6BAA6B,GAC7B,aAAa,GACb,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"eventsItems.d.ts","sourceRoot":"","sources":["../../model/eventsItems.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,MAAM,MAAM,WAAW,GACnB,oBAAoB,GACpB,+BAA+B,GAC/B,cAAc,GACd,gBAAgB,GAChB,2BAA2B,GAC3B,gBAAgB,GAChB,kBAAkB,GAClB,6BAA6B,GAC7B,kBAAkB,GAClB,6BAA6B,GAC7B,aAAa,GACb,eAAe,CAAC"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export * from './addToCartEvent';
|
|
2
|
+
export * from './addedToCartObjectIDs';
|
|
3
|
+
export * from './addedToCartObjectIDsAfterSearch';
|
|
1
4
|
export * from './clickEvent';
|
|
2
5
|
export * from './clickedFilters';
|
|
3
6
|
export * from './clickedObjectIDs';
|
|
@@ -6,10 +9,17 @@ export * from './conversionEvent';
|
|
|
6
9
|
export * from './convertedFilters';
|
|
7
10
|
export * from './convertedObjectIDs';
|
|
8
11
|
export * from './convertedObjectIDsAfterSearch';
|
|
12
|
+
export * from './discount';
|
|
9
13
|
export * from './errorBase';
|
|
10
14
|
export * from './eventsItems';
|
|
11
15
|
export * from './eventsResponse';
|
|
12
16
|
export * from './insightsEvents';
|
|
17
|
+
export * from './objectData';
|
|
18
|
+
export * from './objectDataAfterSearch';
|
|
19
|
+
export * from './price';
|
|
20
|
+
export * from './purchaseEvent';
|
|
21
|
+
export * from './purchasedObjectIDs';
|
|
22
|
+
export * from './purchasedObjectIDsAfterSearch';
|
|
13
23
|
export * from './viewEvent';
|
|
14
24
|
export * from './viewedFilters';
|
|
15
25
|
export * from './viewedObjectIDs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../model/index.ts"],"names":[],"mappings":"AAEA,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Discount } from './discount';
|
|
2
|
+
import type { Price } from './price';
|
|
3
|
+
export type ObjectData = {
|
|
4
|
+
price?: Price;
|
|
5
|
+
/**
|
|
6
|
+
* The quantity of the purchased or added-to-cart item. The total value of a purchase is the sum of `quantity` multiplied with the `price` for each purchased item.
|
|
7
|
+
*/
|
|
8
|
+
quantity?: number;
|
|
9
|
+
discount?: Discount;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=objectData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectData.d.ts","sourceRoot":"","sources":["../../model/objectData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Discount } from './discount';
|
|
2
|
+
import type { Price } from './price';
|
|
3
|
+
export type ObjectDataAfterSearch = {
|
|
4
|
+
/**
|
|
5
|
+
* ID of the query that this specific record is attributable to. Used to track purchase events with multiple items originating from different searches.
|
|
6
|
+
*/
|
|
7
|
+
queryID?: string;
|
|
8
|
+
price?: Price;
|
|
9
|
+
/**
|
|
10
|
+
* The quantity of the purchased or added-to-cart item. The total value of a purchase is the sum of `quantity` multiplied with the `price` for each purchased item.
|
|
11
|
+
*/
|
|
12
|
+
quantity?: number;
|
|
13
|
+
discount?: Discount;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=objectDataAfterSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectDataAfterSearch.d.ts","sourceRoot":"","sources":["../../model/objectDataAfterSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAErC,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price.d.ts","sourceRoot":"","sources":["../../model/price.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchaseEvent.d.ts","sourceRoot":"","sources":["../../model/purchaseEvent.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
2
|
+
import type { ObjectData } from './objectData';
|
|
3
|
+
import type { PurchaseEvent } from './purchaseEvent';
|
|
4
|
+
/**
|
|
5
|
+
* Use this event to track when users make a purchase unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track purchase events related to Algolia requests, use the \"Purchased object IDs after search\" event.
|
|
6
|
+
*/
|
|
7
|
+
export type PurchasedObjectIDs = {
|
|
8
|
+
/**
|
|
9
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
10
|
+
*/
|
|
11
|
+
eventName: string;
|
|
12
|
+
eventType: ConversionEvent;
|
|
13
|
+
eventSubtype: PurchaseEvent;
|
|
14
|
+
/**
|
|
15
|
+
* Name of the Algolia index.
|
|
16
|
+
*/
|
|
17
|
+
index: string;
|
|
18
|
+
/**
|
|
19
|
+
* List of object identifiers for items of an Algolia index.
|
|
20
|
+
*/
|
|
21
|
+
objectIDs: string[];
|
|
22
|
+
/**
|
|
23
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
24
|
+
*/
|
|
25
|
+
objectData?: ObjectData[];
|
|
26
|
+
/**
|
|
27
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
28
|
+
*/
|
|
29
|
+
currency?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
32
|
+
*/
|
|
33
|
+
userToken: string;
|
|
34
|
+
/**
|
|
35
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
36
|
+
*/
|
|
37
|
+
timestamp?: number;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=purchasedObjectIDs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchasedObjectIDs.d.ts","sourceRoot":"","sources":["../../model/purchasedObjectIDs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,aAAa,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
2
|
+
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
3
|
+
import type { PurchaseEvent } from './purchaseEvent';
|
|
4
|
+
/**
|
|
5
|
+
* Use this event to track when users make a purchase after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
6
|
+
*/
|
|
7
|
+
export type PurchasedObjectIDsAfterSearch = {
|
|
8
|
+
/**
|
|
9
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
10
|
+
*/
|
|
11
|
+
eventName: string;
|
|
12
|
+
eventType: ConversionEvent;
|
|
13
|
+
eventSubtype: PurchaseEvent;
|
|
14
|
+
/**
|
|
15
|
+
* Name of the Algolia index.
|
|
16
|
+
*/
|
|
17
|
+
index: string;
|
|
18
|
+
/**
|
|
19
|
+
* 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.
|
|
20
|
+
*/
|
|
21
|
+
queryID: string;
|
|
22
|
+
/**
|
|
23
|
+
* List of object identifiers for items of an Algolia index.
|
|
24
|
+
*/
|
|
25
|
+
objectIDs: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
28
|
+
*/
|
|
29
|
+
objectData?: ObjectDataAfterSearch[];
|
|
30
|
+
/**
|
|
31
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
32
|
+
*/
|
|
33
|
+
currency?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
36
|
+
*/
|
|
37
|
+
userToken: string;
|
|
38
|
+
/**
|
|
39
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
40
|
+
*/
|
|
41
|
+
timestamp?: number;
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=purchasedObjectIDsAfterSearch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchasedObjectIDsAfterSearch.d.ts","sourceRoot":"","sources":["../../model/purchasedObjectIDsAfterSearch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,6BAA6B,GAAG;IAC1C;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,eAAe,CAAC;IAE3B,YAAY,EAAE,aAAa,CAAC;IAE5B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAErC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -2,7 +2,7 @@ import type { CreateClientOptions, RequestOptions } from '@algolia/client-common
|
|
|
2
2
|
import type { DelProps, GetProps, PostProps, PutProps } from '../model/clientMethodProps';
|
|
3
3
|
import type { EventsResponse } from '../model/eventsResponse';
|
|
4
4
|
import type { InsightsEvents } from '../model/insightsEvents';
|
|
5
|
-
export declare const apiClientVersion = "5.0.0-alpha.
|
|
5
|
+
export declare const apiClientVersion = "5.0.0-alpha.87";
|
|
6
6
|
export declare const REGIONS: readonly ["de", "us"];
|
|
7
7
|
export type Region = (typeof REGIONS)[number];
|
|
8
8
|
export declare function createInsightsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
import type { AddToCartEvent } from './addToCartEvent';
|
|
4
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
5
|
+
import type { ObjectData } from './objectData';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use this event to track when users add items to their shopping cart unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track add-to-cart events related to Algolia requests, use the \"Added to cart object IDs after search\" event.
|
|
9
|
+
*/
|
|
10
|
+
export type AddedToCartObjectIDs = {
|
|
11
|
+
/**
|
|
12
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
13
|
+
*/
|
|
14
|
+
eventName: string;
|
|
15
|
+
|
|
16
|
+
eventType: ConversionEvent;
|
|
17
|
+
|
|
18
|
+
eventSubtype: AddToCartEvent;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Name of the Algolia index.
|
|
22
|
+
*/
|
|
23
|
+
index: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List of object identifiers for items of an Algolia index.
|
|
27
|
+
*/
|
|
28
|
+
objectIDs: string[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
32
|
+
*/
|
|
33
|
+
objectData?: ObjectData[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
37
|
+
*/
|
|
38
|
+
currency?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
42
|
+
*/
|
|
43
|
+
userToken: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
47
|
+
*/
|
|
48
|
+
timestamp?: number;
|
|
49
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
import type { AddToCartEvent } from './addToCartEvent';
|
|
4
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
5
|
+
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use this event to track when users add items to their shopping cart after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
9
|
+
*/
|
|
10
|
+
export type AddedToCartObjectIDsAfterSearch = {
|
|
11
|
+
/**
|
|
12
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
13
|
+
*/
|
|
14
|
+
eventName: string;
|
|
15
|
+
|
|
16
|
+
eventType: ConversionEvent;
|
|
17
|
+
|
|
18
|
+
eventSubtype: AddToCartEvent;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Name of the Algolia index.
|
|
22
|
+
*/
|
|
23
|
+
index: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 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.
|
|
27
|
+
*/
|
|
28
|
+
queryID: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* List of object identifiers for items of an Algolia index.
|
|
32
|
+
*/
|
|
33
|
+
objectIDs: string[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
37
|
+
*/
|
|
38
|
+
objectData?: ObjectDataAfterSearch[];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
42
|
+
*/
|
|
43
|
+
currency?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
47
|
+
*/
|
|
48
|
+
userToken: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
52
|
+
*/
|
|
53
|
+
timestamp?: number;
|
|
54
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Absolute value of the discount in effect for this object, measured in `currency`.
|
|
5
|
+
*/
|
|
6
|
+
export type Discount = number | string;
|
package/model/eventsItems.ts
CHANGED
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
// 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.
|
|
2
2
|
|
|
3
|
+
import type { AddedToCartObjectIDs } from './addedToCartObjectIDs';
|
|
4
|
+
import type { AddedToCartObjectIDsAfterSearch } from './addedToCartObjectIDsAfterSearch';
|
|
3
5
|
import type { ClickedFilters } from './clickedFilters';
|
|
4
6
|
import type { ClickedObjectIDs } from './clickedObjectIDs';
|
|
5
7
|
import type { ClickedObjectIDsAfterSearch } from './clickedObjectIDsAfterSearch';
|
|
6
8
|
import type { ConvertedFilters } from './convertedFilters';
|
|
7
9
|
import type { ConvertedObjectIDs } from './convertedObjectIDs';
|
|
8
10
|
import type { ConvertedObjectIDsAfterSearch } from './convertedObjectIDsAfterSearch';
|
|
11
|
+
import type { PurchasedObjectIDs } from './purchasedObjectIDs';
|
|
12
|
+
import type { PurchasedObjectIDsAfterSearch } from './purchasedObjectIDsAfterSearch';
|
|
9
13
|
import type { ViewedFilters } from './viewedFilters';
|
|
10
14
|
import type { ViewedObjectIDs } from './viewedObjectIDs';
|
|
11
15
|
|
|
12
16
|
export type EventsItems =
|
|
17
|
+
| AddedToCartObjectIDs
|
|
18
|
+
| AddedToCartObjectIDsAfterSearch
|
|
13
19
|
| ClickedFilters
|
|
14
20
|
| ClickedObjectIDs
|
|
15
21
|
| ClickedObjectIDsAfterSearch
|
|
16
22
|
| ConvertedFilters
|
|
17
23
|
| ConvertedObjectIDs
|
|
18
24
|
| ConvertedObjectIDsAfterSearch
|
|
25
|
+
| PurchasedObjectIDs
|
|
26
|
+
| PurchasedObjectIDsAfterSearch
|
|
19
27
|
| ViewedFilters
|
|
20
28
|
| ViewedObjectIDs;
|
package/model/index.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
// 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.
|
|
2
2
|
|
|
3
|
+
export * from './addToCartEvent';
|
|
4
|
+
export * from './addedToCartObjectIDs';
|
|
5
|
+
export * from './addedToCartObjectIDsAfterSearch';
|
|
3
6
|
export * from './clickEvent';
|
|
4
7
|
export * from './clickedFilters';
|
|
5
8
|
export * from './clickedObjectIDs';
|
|
@@ -8,10 +11,17 @@ export * from './conversionEvent';
|
|
|
8
11
|
export * from './convertedFilters';
|
|
9
12
|
export * from './convertedObjectIDs';
|
|
10
13
|
export * from './convertedObjectIDsAfterSearch';
|
|
14
|
+
export * from './discount';
|
|
11
15
|
export * from './errorBase';
|
|
12
16
|
export * from './eventsItems';
|
|
13
17
|
export * from './eventsResponse';
|
|
14
18
|
export * from './insightsEvents';
|
|
19
|
+
export * from './objectData';
|
|
20
|
+
export * from './objectDataAfterSearch';
|
|
21
|
+
export * from './price';
|
|
22
|
+
export * from './purchaseEvent';
|
|
23
|
+
export * from './purchasedObjectIDs';
|
|
24
|
+
export * from './purchasedObjectIDsAfterSearch';
|
|
15
25
|
export * from './viewEvent';
|
|
16
26
|
export * from './viewedFilters';
|
|
17
27
|
export * from './viewedObjectIDs';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
import type { Discount } from './discount';
|
|
4
|
+
import type { Price } from './price';
|
|
5
|
+
|
|
6
|
+
export type ObjectData = {
|
|
7
|
+
price?: Price;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The quantity of the purchased or added-to-cart item. The total value of a purchase is the sum of `quantity` multiplied with the `price` for each purchased item.
|
|
11
|
+
*/
|
|
12
|
+
quantity?: number;
|
|
13
|
+
|
|
14
|
+
discount?: Discount;
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
import type { Discount } from './discount';
|
|
4
|
+
import type { Price } from './price';
|
|
5
|
+
|
|
6
|
+
export type ObjectDataAfterSearch = {
|
|
7
|
+
/**
|
|
8
|
+
* ID of the query that this specific record is attributable to. Used to track purchase events with multiple items originating from different searches.
|
|
9
|
+
*/
|
|
10
|
+
queryID?: string;
|
|
11
|
+
|
|
12
|
+
price?: Price;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The quantity of the purchased or added-to-cart item. The total value of a purchase is the sum of `quantity` multiplied with the `price` for each purchased item.
|
|
16
|
+
*/
|
|
17
|
+
quantity?: number;
|
|
18
|
+
|
|
19
|
+
discount?: Discount;
|
|
20
|
+
};
|
package/model/price.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The price of the item. This should be the final price, inclusive of any discounts in effect.
|
|
5
|
+
*/
|
|
6
|
+
export type Price = number | string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
4
|
+
import type { ObjectData } from './objectData';
|
|
5
|
+
import type { PurchaseEvent } from './purchaseEvent';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use this event to track when users make a purchase unrelated to a previous Algolia request. For example, if you don\'t use Algolia to build your category pages, use this event. To track purchase events related to Algolia requests, use the \"Purchased object IDs after search\" event.
|
|
9
|
+
*/
|
|
10
|
+
export type PurchasedObjectIDs = {
|
|
11
|
+
/**
|
|
12
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
13
|
+
*/
|
|
14
|
+
eventName: string;
|
|
15
|
+
|
|
16
|
+
eventType: ConversionEvent;
|
|
17
|
+
|
|
18
|
+
eventSubtype: PurchaseEvent;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Name of the Algolia index.
|
|
22
|
+
*/
|
|
23
|
+
index: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* List of object identifiers for items of an Algolia index.
|
|
27
|
+
*/
|
|
28
|
+
objectIDs: string[];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
32
|
+
*/
|
|
33
|
+
objectData?: ObjectData[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
37
|
+
*/
|
|
38
|
+
currency?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
42
|
+
*/
|
|
43
|
+
userToken: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
47
|
+
*/
|
|
48
|
+
timestamp?: number;
|
|
49
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// 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.
|
|
2
|
+
|
|
3
|
+
import type { ConversionEvent } from './conversionEvent';
|
|
4
|
+
import type { ObjectDataAfterSearch } from './objectDataAfterSearch';
|
|
5
|
+
import type { PurchaseEvent } from './purchaseEvent';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Use this event to track when users make a purchase after a previous Algolia request. If you\'re building your category pages with Algolia, you\'ll also use this event.
|
|
9
|
+
*/
|
|
10
|
+
export type PurchasedObjectIDsAfterSearch = {
|
|
11
|
+
/**
|
|
12
|
+
* Can contain up to 64 ASCII characters. Consider naming events consistently—for example, by adopting Segment\'s [object-action](https://segment.com/academy/collecting-data/naming-conventions-for-clean-data/#the-object-action-framework) framework.
|
|
13
|
+
*/
|
|
14
|
+
eventName: string;
|
|
15
|
+
|
|
16
|
+
eventType: ConversionEvent;
|
|
17
|
+
|
|
18
|
+
eventSubtype: PurchaseEvent;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Name of the Algolia index.
|
|
22
|
+
*/
|
|
23
|
+
index: string;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 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.
|
|
27
|
+
*/
|
|
28
|
+
queryID: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* List of object identifiers for items of an Algolia index.
|
|
32
|
+
*/
|
|
33
|
+
objectIDs: string[];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Extra information about the records involved in the event—for example, to add price and quantities of purchased products. If provided, must be the same length as `objectIDs`.
|
|
37
|
+
*/
|
|
38
|
+
objectData?: ObjectDataAfterSearch[];
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* If you include pricing information in the `objectData` parameter, you must also specify the currency as ISO-4217 currency code, such as USD or EUR.
|
|
42
|
+
*/
|
|
43
|
+
currency?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Anonymous or pseudonymous user identifier. > **Note**: Never include personally identifiable information in user tokens.
|
|
47
|
+
*/
|
|
48
|
+
userToken: string;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Time of the event in milliseconds in [Unix epoch time](https://wikipedia.org/wiki/Unix_time). By default, the Insights API uses the time it receives an event as its timestamp.
|
|
52
|
+
*/
|
|
53
|
+
timestamp?: number;
|
|
54
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/client-insights",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.87",
|
|
4
4
|
"description": "JavaScript client for client-insights",
|
|
5
5
|
"repository": "algolia/algoliasearch-client-javascript",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,13 +39,13 @@
|
|
|
39
39
|
"clean": "rm -rf ./dist || true"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@algolia/client-common": "5.0.0-alpha.
|
|
43
|
-
"@algolia/requester-browser-xhr": "5.0.0-alpha.
|
|
44
|
-
"@algolia/requester-node-http": "5.0.0-alpha.
|
|
42
|
+
"@algolia/client-common": "5.0.0-alpha.88",
|
|
43
|
+
"@algolia/requester-browser-xhr": "5.0.0-alpha.88",
|
|
44
|
+
"@algolia/requester-node-http": "5.0.0-alpha.88"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/node": "18.
|
|
48
|
-
"rollup": "3.29.
|
|
47
|
+
"@types/node": "18.18.1",
|
|
48
|
+
"rollup": "3.29.4",
|
|
49
49
|
"typescript": "5.2.2"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|