@algolia/client-query-suggestions 5.0.0-alpha.2 → 5.0.0-alpha.5
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/builds/browser.d.ts +2 -2
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/node.d.ts +2 -2
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-query-suggestions.cjs.js +14 -1
- package/dist/client-query-suggestions.esm.browser.js +14 -1
- package/dist/client-query-suggestions.esm.node.js +14 -1
- package/dist/client-query-suggestions.umd.js +2 -2
- package/dist/model/logFile.d.ts.map +1 -1
- package/dist/model/querySuggestionsIndex.d.ts.map +1 -1
- package/dist/model/querySuggestionsIndexParam.d.ts.map +1 -1
- package/dist/model/sourceIndex.d.ts.map +1 -1
- package/dist/model/sourceIndexExternal.d.ts.map +1 -1
- package/dist/model/sourceIndexWithReplicas.d.ts.map +1 -1
- package/dist/model/status.d.ts.map +1 -1
- package/dist/model/successResponse.d.ts.map +1 -1
- package/dist/src/querySuggestionsClient.d.ts +9 -1
- package/dist/src/querySuggestionsClient.d.ts.map +1 -1
- package/model/logFile.ts +3 -0
- package/model/querySuggestionsIndex.ts +3 -0
- package/model/querySuggestionsIndexParam.ts +2 -0
- package/model/sourceIndex.ts +6 -0
- package/model/sourceIndexExternal.ts +1 -0
- package/model/sourceIndexWithReplicas.ts +7 -0
- package/model/status.ts +2 -0
- package/model/successResponse.ts +1 -0
- package/package.json +5 -5
package/dist/builds/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ClientOptions } from '@algolia/client-common';
|
|
2
2
|
import type { QuerySuggestionsClient, Region } from '../src/querySuggestionsClient';
|
|
3
3
|
export { apiClientVersion, QuerySuggestionsClient, } from '../src/querySuggestionsClient';
|
|
4
4
|
export * from '../model';
|
|
5
|
-
export declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?:
|
|
5
|
+
export declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): QuerySuggestionsClient;
|
|
6
6
|
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/builds/browser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAW5D,OAAO,KAAK,EACV,sBAAsB,EACtB,MAAM,EACP,MAAM,+BAA+B,CAAC;AAOvC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,cAAc,UAAU,CAAC;AAEzB,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa,GACtB,sBAAsB,CAyCxB"}
|
package/dist/builds/node.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ClientOptions } from '@algolia/client-common';
|
|
2
2
|
import type { QuerySuggestionsClient, Region } from '../src/querySuggestionsClient';
|
|
3
3
|
export { apiClientVersion, QuerySuggestionsClient, } from '../src/querySuggestionsClient';
|
|
4
4
|
export * from '../model';
|
|
5
|
-
export declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?:
|
|
5
|
+
export declare function querySuggestionsClient(appId: string, apiKey: string, region: Region, options?: ClientOptions): QuerySuggestionsClient;
|
|
6
6
|
//# sourceMappingURL=node.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/builds/node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAU5D,OAAO,KAAK,EACV,sBAAsB,EACtB,MAAM,EACP,MAAM,+BAA+B,CAAC;AAMvC,OAAO,EACL,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,+BAA+B,CAAC;AACvC,cAAc,UAAU,CAAC;AAEzB,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,aAAa,GACtB,sBAAsB,CAmCxB"}
|
|
@@ -6,7 +6,7 @@ var clientCommon = require('@algolia/client-common');
|
|
|
6
6
|
var requesterNodeHttp = require('@algolia/requester-node-http');
|
|
7
7
|
|
|
8
8
|
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
9
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
9
|
+
const apiClientVersion = '5.0.0-alpha.5';
|
|
10
10
|
const REGIONS = ['eu', 'us'];
|
|
11
11
|
function getDefaultHosts(region) {
|
|
12
12
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -35,6 +35,19 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
35
35
|
});
|
|
36
36
|
return {
|
|
37
37
|
transporter,
|
|
38
|
+
/**
|
|
39
|
+
* The `appId` currently in use.
|
|
40
|
+
*/
|
|
41
|
+
appId: appIdOption,
|
|
42
|
+
/**
|
|
43
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
44
|
+
*/
|
|
45
|
+
clearCache() {
|
|
46
|
+
return Promise.all([
|
|
47
|
+
transporter.requestsCache.clear(),
|
|
48
|
+
transporter.responsesCache.clear(),
|
|
49
|
+
]).then(() => undefined);
|
|
50
|
+
},
|
|
38
51
|
/**
|
|
39
52
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
40
53
|
*/
|
|
@@ -710,7 +710,7 @@ function createXhrRequester() {
|
|
|
710
710
|
}
|
|
711
711
|
|
|
712
712
|
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
713
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
713
|
+
const apiClientVersion = '5.0.0-alpha.5';
|
|
714
714
|
const REGIONS = ['eu', 'us'];
|
|
715
715
|
function getDefaultHosts(region) {
|
|
716
716
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -739,6 +739,19 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
739
739
|
});
|
|
740
740
|
return {
|
|
741
741
|
transporter,
|
|
742
|
+
/**
|
|
743
|
+
* The `appId` currently in use.
|
|
744
|
+
*/
|
|
745
|
+
appId: appIdOption,
|
|
746
|
+
/**
|
|
747
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
748
|
+
*/
|
|
749
|
+
clearCache() {
|
|
750
|
+
return Promise.all([
|
|
751
|
+
transporter.requestsCache.clear(),
|
|
752
|
+
transporter.responsesCache.clear(),
|
|
753
|
+
]).then(() => undefined);
|
|
754
|
+
},
|
|
742
755
|
/**
|
|
743
756
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
744
757
|
*/
|
|
@@ -2,7 +2,7 @@ import { createAuth, createTransporter, getAlgoliaAgent, DEFAULT_CONNECT_TIMEOUT
|
|
|
2
2
|
import { createHttpRequester } from '@algolia/requester-node-http';
|
|
3
3
|
|
|
4
4
|
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
5
|
-
const apiClientVersion = '5.0.0-alpha.
|
|
5
|
+
const apiClientVersion = '5.0.0-alpha.5';
|
|
6
6
|
const REGIONS = ['eu', 'us'];
|
|
7
7
|
function getDefaultHosts(region) {
|
|
8
8
|
const url = 'query-suggestions.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -31,6 +31,19 @@ function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption
|
|
|
31
31
|
});
|
|
32
32
|
return {
|
|
33
33
|
transporter,
|
|
34
|
+
/**
|
|
35
|
+
* The `appId` currently in use.
|
|
36
|
+
*/
|
|
37
|
+
appId: appIdOption,
|
|
38
|
+
/**
|
|
39
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
40
|
+
*/
|
|
41
|
+
clearCache() {
|
|
42
|
+
return Promise.all([
|
|
43
|
+
transporter.requestsCache.clear(),
|
|
44
|
+
transporter.responsesCache.clear(),
|
|
45
|
+
]).then(() => undefined);
|
|
46
|
+
},
|
|
34
47
|
/**
|
|
35
48
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
36
49
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-query-suggestions.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-query-suggestions"]={})}(this,(function(e){"use strict";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){let t;const r=`algolia-client-js-${e.key}`;function n(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(n().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=a();return s[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(r)}))}}function n(e){const t=[...e.caches],r=t.shift();return void 0===r?{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,s={miss:()=>Promise.resolve()})=>r.get(e,a,s).catch((()=>n({caches:t}).get(e,a,s))),set:(e,a)=>r.set(e,a).catch((()=>n({caches:t}).set(e,a))),delete:e=>r.delete(e).catch((()=>n({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>n({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,n,a={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const o=n();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const s=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>s},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=s}}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class d extends u{constructor(e,t,r){super(e,r,"ApiError"),i(this,"status",void 0),this.status=t}}class h extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}function m(e,t,r){const n=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}=${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 n.length&&(a+=`?${n}`),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:n,algoliaAgent:a,timeouts:s,requester:i,requestsCache:c,responsesCache:u}){async function g(c,u,g=!0){const f=[],y=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,u),P=function(e,t,r){const n={Accept:"application/json",...e,...t,...r},a={};return Object.keys(n).forEach((e=>{const t=n[e];a[e.toLowerCase()]=t})),a}(r,c.headers,u.headers),w="GET"===c.method?{...c.data,...u.data}:{},O={"x-algolia-agent":a.value,...n,...c.queryParameters,...w};if(u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?O[e]=u.queryParameters[e].toString():O[e]=u.queryParameters[e];let b=0;const v=async(e,r)=>{const n=e.pop();if(void 0===n)throw new l(function(e){return e.map((e=>p(e)))}(f));let a=u.timeout;void 0===a&&(a=g?s.read:s.write);const w={data:y,headers:P,method:c.method,url:m(n,c.path,O),connectTimeout:r(b,s.connect),responseTimeout:r(b,a)},q=t=>{const r={request:w,response:t,host:n,triesLeft:e.length};return f.push(r),r},j=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)}(j)){const a=q(j);return j.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(n,o(n,j.isTimedOut?"timed out":"down")),v(e,r)}if(function({status:e}){return 2==~~(e/100)}(j))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(j);throw q(j),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(e){}return new d(n,t,r)}(j,f)},q=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),j=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),n=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),s=[...n,...a];return{hosts:s.length>0?s:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(q);return v([...j.hosts].reverse(),j.getTimeout)}return{hostsCache:t,requester:i,timeouts:s,algoliaAgent:a,baseHeaders:r,baseQueryParameters:n,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const s=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const o={request:e,requestOptions:t,transporter:{queryParameters:n,headers:r}};return u.get(o,(()=>c.get(o,(()=>c.set(o,s()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(o,e)})},requestsCache:c,responsesCache:u}}function f({algoliaAgents:e,client:t,version:r}){const n=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=>n.add(e))),n}function y(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var P=["appId","apiKey","authMode","algoliaAgents","region"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?w(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b="5.0.0-alpha.2",v=["eu","us"];function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.apiClientVersion=b,e.querySuggestionsClient=function(e,s,o,i){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");if(!o)throw new Error("`region` is missing.");if(o&&("string"!=typeof o||!v.includes(o)))throw new Error("`region` must be one of the following: ".concat(v.join(", ")));return function(e){var t,r=e.appId,n=e.apiKey,a=e.authMode,s=e.algoliaAgents,o=e.region,i=y(e,P),c=function(e,t,r="WithinHeaders"){const n={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?n:{},queryParameters:()=>"WithinQueryParameters"===r?n:{}}}(r,n,a),u=g(O(O({hosts:(t=o,[{url:"query-suggestions.{region}.algolia.com".replace("{region}",t),accept:"readWrite",protocol:"https"}])},i),{},{algoliaAgent:f({algoliaAgents:s,client:"QuerySuggestions",version:b}),baseHeaders:O(O({"content-type":"text/plain"},c.headers()),i.baseHeaders),baseQueryParameters:O(O({},c.queryParameters()),i.baseQueryParameters)}));return{transporter:u,get _ua(){return u.algoliaAgent.value},addAlgoliaAgent:function(e,t){u.algoliaAgent.add({segment:e,version:t})},createConfig:function(e,t){if(!e)throw new Error("Parameter `querySuggestionsIndexWithIndexParam` is required when calling `createConfig`.");var r={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return u.request(r,t)},del:function(e,t){var r=e.path,n=e.parameters;if(!r)throw new Error("Parameter `path` is required when calling `del`.");var a={method:"DELETE",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(a,t)},deleteConfig:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");var n={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},get:function(e,t){var r=e.path,n=e.parameters;if(!r)throw new Error("Parameter `path` is required when calling `get`.");var a={method:"GET",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(a,t)},getAllConfigs:function(e){var t={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return u.request(t,e)},getConfig:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getConfig`.");var n={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},getConfigStatus:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");var n={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},getLogFile:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");var n={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},post:function(e,t){var r=e.path,n=e.parameters,a=e.body;if(!r)throw new Error("Parameter `path` is required when calling `post`.");var s={method:"POST",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(s,t)},put:function(e,t){var r=e.path,n=e.parameters,a=e.body;if(!r)throw new Error("Parameter `path` is required when calling `put`.");var s={method:"PUT",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(s,t)},updateConfig:function(e,t){var r=e.indexName,n=e.querySuggestionsIndexParam;if(!r)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!n)throw new Error("Parameter `querySuggestionsIndexParam` is required when calling `updateConfig`.");if(!n.sourceIndices)throw new Error("Parameter `querySuggestionsIndexParam.sourceIndices` is required when calling `updateConfig`.");var a={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:n};return u.request(a,t)}}}(function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?q(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appId:e,apiKey:s,region:o,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 n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),e),a=n(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(a),s=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:n({caches:[r({key:"".concat(b,"-").concat(e)}),a()]})},i))}}));
|
|
1
|
+
/*! client-query-suggestions.umd.js | 5.0.0-alpha.5 | © 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-query-suggestions"]={})}(this,(function(e){"use strict";function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){let t;const r=`algolia-client-js-${e.key}`;function n(){return void 0===t&&(t=e.localStorage||window.localStorage),t}function a(){return JSON.parse(n().getItem(r)||"{}")}return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((([e,t])=>Promise.all([e,t||r.miss(e)]))).then((([e])=>e)),set:(e,t)=>Promise.resolve().then((()=>{const s=a();return s[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(s)),t})),delete:e=>Promise.resolve().then((()=>{const t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))})),clear:()=>Promise.resolve().then((()=>{n().removeItem(r)}))}}function n(e){const t=[...e.caches],r=t.shift();return void 0===r?{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,s={miss:()=>Promise.resolve()})=>r.get(e,a,s).catch((()=>n({caches:t}).get(e,a,s))),set:(e,a)=>r.set(e,a).catch((()=>n({caches:t}).set(e,a))),delete:e=>r.delete(e).catch((()=>n({caches:t}).delete(e))),clear:()=>r.clear().catch((()=>n({caches:t}).clear()))}}function a(e={serializable:!0}){let t={};return{get(r,n,a={miss:()=>Promise.resolve()}){const s=JSON.stringify(r);if(s in t)return Promise.resolve(e.serializable?JSON.parse(t[s]):t[s]);const o=n();return o.then((e=>a.miss(e))).then((()=>o))},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}const s=12e4;function o(e,t="up"){const r=Date.now();return{...e,status:t,lastUpdate:r,isUp:function(){return"up"===t||Date.now()-r>s},isTimedOut:function(){return"timed out"===t&&Date.now()-r<=s}}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class c extends Error{constructor(e,t){super(e),i(this,"name","AlgoliaError"),t&&(this.name=t)}}class u extends c{constructor(e,t,r){super(e,r),i(this,"stackTrace",void 0),this.stackTrace=t}}class l extends u{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class d extends u{constructor(e,t,r){super(e,r,"ApiError"),i(this,"status",void 0),this.status=t}}class h extends c{constructor(e,t){super(e,"DeserializationError"),i(this,"response",void 0),this.response=t}}function m(e,t,r){const n=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}=${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 n.length&&(a+=`?${n}`),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:n,algoliaAgent:a,timeouts:s,requester:i,requestsCache:c,responsesCache:u}){async function g(c,u,g=!0){const f=[],y=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,u),P=function(e,t,r){const n={Accept:"application/json",...e,...t,...r},a={};return Object.keys(n).forEach((e=>{const t=n[e];a[e.toLowerCase()]=t})),a}(r,c.headers,u.headers),w="GET"===c.method?{...c.data,...u.data}:{},O={"x-algolia-agent":a.value,...n,...c.queryParameters,...w};if(u&&u.queryParameters)for(const e of Object.keys(u.queryParameters))u.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(u.queryParameters[e])?O[e]=u.queryParameters[e].toString():O[e]=u.queryParameters[e];let b=0;const v=async(e,r)=>{const n=e.pop();if(void 0===n)throw new l(function(e){return e.map((e=>p(e)))}(f));let a=u.timeout;void 0===a&&(a=g?s.read:s.write);const w={data:y,headers:P,method:c.method,url:m(n,c.path,O),connectTimeout:r(b,s.connect),responseTimeout:r(b,a)},q=t=>{const r={request:w,response:t,host:n,triesLeft:e.length};return f.push(r),r},j=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)}(j)){const a=q(j);return j.isTimedOut&&b++,console.log("Retryable failure",p(a)),await t.set(n,o(n,j.isTimedOut?"timed out":"down")),v(e,r)}if(function({status:e}){return 2==~~(e/100)}(j))return function(e){try{return JSON.parse(e.content)}catch(t){throw new h(t.message,e)}}(j);throw q(j),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(e){}return new d(n,t,r)}(j,f)},q=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),j=await async function(e){const r=await Promise.all(e.map((e=>t.get(e,(()=>Promise.resolve(o(e))))))),n=r.filter((e=>e.isUp())),a=r.filter((e=>e.isTimedOut())),s=[...n,...a];return{hosts:s.length>0?s:e,getTimeout:(e,t)=>(0===a.length&&0===e?1:a.length+3+e)*t}}(q);return v([...j.hosts].reverse(),j.getTimeout)}return{hostsCache:t,requester:i,timeouts:s,algoliaAgent:a,baseHeaders:r,baseQueryParameters:n,hosts:e,request:function(e,t={}){const a=e.useReadTransporter||"GET"===e.method;if(!a)return g(e,t,a);const s=()=>g(e,t);if(!0!==(t.cacheable||e.cacheable))return s();const o={request:e,requestOptions:t,transporter:{queryParameters:n,headers:r}};return u.get(o,(()=>c.get(o,(()=>c.set(o,s()).then((e=>Promise.all([c.delete(o),e])),(e=>Promise.all([c.delete(o),Promise.reject(e)]))).then((([e,t])=>t))))),{miss:e=>u.set(o,e)})},requestsCache:c,responsesCache:u}}function f({algoliaAgents:e,client:t,version:r}){const n=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=>n.add(e))),n}function y(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var P=["appId","apiKey","authMode","algoliaAgents","region"];function w(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function O(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?w(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b="5.0.0-alpha.5",v=["eu","us"];function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.apiClientVersion=b,e.querySuggestionsClient=function(e,s,o,i){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");if(!o)throw new Error("`region` is missing.");if(o&&("string"!=typeof o||!v.includes(o)))throw new Error("`region` must be one of the following: ".concat(v.join(", ")));return function(e){var t,r=e.appId,n=e.apiKey,a=e.authMode,s=e.algoliaAgents,o=e.region,i=y(e,P),c=function(e,t,r="WithinHeaders"){const n={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===r?n:{},queryParameters:()=>"WithinQueryParameters"===r?n:{}}}(r,n,a),u=g(O(O({hosts:(t=o,[{url:"query-suggestions.{region}.algolia.com".replace("{region}",t),accept:"readWrite",protocol:"https"}])},i),{},{algoliaAgent:f({algoliaAgents:s,client:"QuerySuggestions",version:b}),baseHeaders:O(O({"content-type":"text/plain"},c.headers()),i.baseHeaders),baseQueryParameters:O(O({},c.queryParameters()),i.baseQueryParameters)}));return{transporter:u,appId:r,clearCache:function(){return Promise.all([u.requestsCache.clear(),u.responsesCache.clear()]).then((function(){}))},get _ua(){return u.algoliaAgent.value},addAlgoliaAgent:function(e,t){u.algoliaAgent.add({segment:e,version:t})},createConfig:function(e,t){if(!e)throw new Error("Parameter `querySuggestionsIndexWithIndexParam` is required when calling `createConfig`.");var r={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:e};return u.request(r,t)},del:function(e,t){var r=e.path,n=e.parameters;if(!r)throw new Error("Parameter `path` is required when calling `del`.");var a={method:"DELETE",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(a,t)},deleteConfig:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");var n={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},get:function(e,t){var r=e.path,n=e.parameters;if(!r)throw new Error("Parameter `path` is required when calling `get`.");var a={method:"GET",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{}};return u.request(a,t)},getAllConfigs:function(e){var t={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return u.request(t,e)},getConfig:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getConfig`.");var n={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},getConfigStatus:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");var n={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},getLogFile:function(e,t){var r=e.indexName;if(!r)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");var n={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return u.request(n,t)},post:function(e,t){var r=e.path,n=e.parameters,a=e.body;if(!r)throw new Error("Parameter `path` is required when calling `post`.");var s={method:"POST",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(s,t)},put:function(e,t){var r=e.path,n=e.parameters,a=e.body;if(!r)throw new Error("Parameter `path` is required when calling `put`.");var s={method:"PUT",path:"/1{path}".replace("{path}",r),queryParameters:n||{},headers:{},data:a||{}};return u.request(s,t)},updateConfig:function(e,t){var r=e.indexName,n=e.querySuggestionsIndexParam;if(!r)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!n)throw new Error("Parameter `querySuggestionsIndexParam` is required when calling `updateConfig`.");if(!n.sourceIndices)throw new Error("Parameter `querySuggestionsIndexParam.sourceIndices` is required when calling `updateConfig`.");var a={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:n};return u.request(a,t)}}}(function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?q(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appId:e,apiKey:s,region:o,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 n=(e,n)=>setTimeout((()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})}),e),a=n(e.connectTimeout,"Connection timeout");let s;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===s&&(clearTimeout(a),s=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(a),clearTimeout(s),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(a),clearTimeout(s),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:a(),requestsCache:a({serializable:!1}),hostsCache:n({caches:[r({key:"".concat(b,"-").concat(e)}),a()]})},i))}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logFile.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/logFile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,OAAO,GAAG;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"logFile.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/logFile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,oBAAY,OAAO,GAAG;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB,KAAK,EAAE,QAAQ,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsIndex.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/querySuggestionsIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,oBAAY,qBAAqB,GAAG;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"querySuggestionsIndex.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/querySuggestionsIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEzE,oBAAY,qBAAqB,GAAG;IAClC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,EAAE,uBAAuB,EAAE,CAAC;IAEzC;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsIndexParam.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/querySuggestionsIndexParam.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,oBAAY,0BAA0B,GAAG;IACvC;;OAEG;IACH,aAAa,EAAE,WAAW,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"querySuggestionsIndexParam.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/querySuggestionsIndexParam.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,oBAAY,0BAA0B,GAAG;IACvC;;OAEG;IACH,aAAa,EAAE,WAAW,EAAE,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceIndex.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/sourceIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,oBAAY,WAAW,GAAG;IACxB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sourceIndex.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/sourceIndex.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,oBAAY,WAAW,GAAG;IACxB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAEpC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceIndexExternal.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/sourceIndexExternal.ts"],"names":[],"mappings":"AAEA,oBAAY,mBAAmB,GAAG;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sourceIndexExternal.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/sourceIndexExternal.ts"],"names":[],"mappings":"AAEA,oBAAY,mBAAmB,GAAG;IAChC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceIndexWithReplicas.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/sourceIndexWithReplicas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;GAEG;AACH,oBAAY,uBAAuB,GAAG;IACpC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"sourceIndexWithReplicas.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/sourceIndexWithReplicas.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;GAEG;AACH,oBAAY,uBAAuB,GAAG;IACpC;;OAEG;IACH,QAAQ,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IAEnC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,MAAM,EAAE,EAAE,CAAC;IAErB;;OAEG;IACH,QAAQ,EAAE,mBAAmB,EAAE,CAAC;CACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/status.ts"],"names":[],"mappings":"AAEA,oBAAY,MAAM,GAAG;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/status.ts"],"names":[],"mappings":"AAEA,oBAAY,MAAM,GAAG;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"successResponse.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/successResponse.ts"],"names":[],"mappings":"AAEA,oBAAY,eAAe,GAAG;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"successResponse.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/model/successResponse.ts"],"names":[],"mappings":"AAEA,oBAAY,eAAe,GAAG;IAC5B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
@@ -5,13 +5,21 @@ import type { QuerySuggestionsIndex } from '../model/querySuggestionsIndex';
|
|
|
5
5
|
import type { QuerySuggestionsIndexWithIndexParam } from '../model/querySuggestionsIndexWithIndexParam';
|
|
6
6
|
import type { Status } from '../model/status';
|
|
7
7
|
import type { SuccessResponse } from '../model/successResponse';
|
|
8
|
-
export declare const apiClientVersion = "5.0.0-alpha.
|
|
8
|
+
export declare const apiClientVersion = "5.0.0-alpha.5";
|
|
9
9
|
export declare const REGIONS: readonly ["eu", "us"];
|
|
10
10
|
export declare type Region = typeof REGIONS[number];
|
|
11
11
|
export declare function createQuerySuggestionsClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, region: regionOption, ...options }: CreateClientOptions & {
|
|
12
12
|
region: Region;
|
|
13
13
|
}): {
|
|
14
14
|
transporter: import("@algolia/client-common").Transporter;
|
|
15
|
+
/**
|
|
16
|
+
* The `appId` currently in use.
|
|
17
|
+
*/
|
|
18
|
+
appId: string;
|
|
19
|
+
/**
|
|
20
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
21
|
+
*/
|
|
22
|
+
clearCache(): Promise<void>;
|
|
15
23
|
/**
|
|
16
24
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
17
25
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"querySuggestionsClient.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/src/querySuggestionsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAC;AACxG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,oBAAY,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAY5C,wBAAgB,4BAA4B,CAAC,EAC3C,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,YAAY,EACpB,GAAG,OAAO,EACX,EAAE,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;
|
|
1
|
+
{"version":3,"file":"querySuggestionsClient.d.ts","sourceRoot":"","sources":["../../../../packages/client-query-suggestions/src/querySuggestionsClient.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,mBAAmB,EAInB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EACV,QAAQ,EACR,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,SAAS,EACT,QAAQ,EACR,iBAAiB,EAClB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,8CAA8C,CAAC;AACxG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,eAAO,MAAM,OAAO,uBAAwB,CAAC;AAC7C,oBAAY,MAAM,GAAG,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC;AAY5C,wBAAgB,4BAA4B,CAAC,EAC3C,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,QAAQ,EACR,aAAa,EACb,MAAM,EAAE,YAAY,EACpB,GAAG,OAAO,EACX,EAAE,mBAAmB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;IAwBvC;;OAEG;;IAGH;;OAEG;kBACW,QAAQ,IAAI,CAAC;IAO3B;;OAEG;;IAKH;;;;;OAKG;6BACsB,MAAM,YAAY,MAAM,GAAG,IAAI;IAIxD;;;;;;OAMG;sDAEoC,mCAAmC,mBACvD,cAAc,GAC9B,QAAQ,eAAe,CAAC;IAsB3B;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;;;OAOG;gCAEc,iBAAiB,mBACf,cAAc,GAC9B,QAAQ,eAAe,CAAC;IAwB3B;;;;;;;;OAQG;8BAEqB,QAAQ,mBACb,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAmB/B;;;;;OAKG;mCAEgB,cAAc,GAC9B,QAAQ,qBAAqB,EAAE,CAAC;IAenC;;;;;;;OAOG;6BAEc,cAAc,mBACZ,cAAc,GAC9B,QAAQ,qBAAqB,CAAC;IAwBjC;;;;;;;OAOG;mCAEc,oBAAoB,mBAClB,cAAc,GAC9B,QAAQ,MAAM,CAAC;IAwBlB;;;;;;;OAOG;8BAEc,eAAe,mBACb,cAAc,GAC9B,QAAQ,OAAO,EAAE,CAAC;IAwBrB;;;;;;;;;OASG;qCAE2B,SAAS,mBACpB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAoB/B;;;;;;;;;OASG;oCAE2B,QAAQ,mBACnB,cAAc,GAC9B,QAAQ,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IAoB/B;;;;;;;;OAQG;4DAE0C,iBAAiB,mBAC3C,cAAc,GAC9B,QAAQ,eAAe,CAAC;EAqC9B;AAED;;GAEG;AACH,oBAAY,sBAAsB,GAAG,UAAU,CAC7C,OAAO,4BAA4B,CACpC,CAAC"}
|
package/model/logFile.ts
CHANGED
|
@@ -7,11 +7,14 @@ export type LogFile = {
|
|
|
7
7
|
* Date and time of creation of the record.
|
|
8
8
|
*/
|
|
9
9
|
timestamp: string;
|
|
10
|
+
|
|
10
11
|
level: LogLevel;
|
|
12
|
+
|
|
11
13
|
/**
|
|
12
14
|
* Detailed description of what happened.
|
|
13
15
|
*/
|
|
14
16
|
message: string;
|
|
17
|
+
|
|
15
18
|
/**
|
|
16
19
|
* Indicates the hierarchy of the records. For example, a record with contextLevel=1 belongs to a preceding record with contextLevel=0.
|
|
17
20
|
*/
|
|
@@ -7,14 +7,17 @@ export type QuerySuggestionsIndex = {
|
|
|
7
7
|
* Index name to target.
|
|
8
8
|
*/
|
|
9
9
|
indexName: string;
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* List of source indices used to generate a Query Suggestions index.
|
|
12
13
|
*/
|
|
13
14
|
sourceIndices: SourceIndexWithReplicas[];
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
|
|
16
18
|
*/
|
|
17
19
|
languages: string[];
|
|
20
|
+
|
|
18
21
|
/**
|
|
19
22
|
* List of words and patterns to exclude from the Query Suggestions index.
|
|
20
23
|
*/
|
|
@@ -7,10 +7,12 @@ export type QuerySuggestionsIndexParam = {
|
|
|
7
7
|
* List of source indices used to generate a Query Suggestions index.
|
|
8
8
|
*/
|
|
9
9
|
sourceIndices: SourceIndex[];
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* De-duplicate singular and plural suggestions. For example, let\'s say your index contains English content, and that two suggestions “shoe” and “shoes” end up in your Query Suggestions index. If the English language is configured, only the most popular of those two suggestions would remain.
|
|
12
13
|
*/
|
|
13
14
|
languages?: string[];
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* List of words and patterns to exclude from the Query Suggestions index.
|
|
16
18
|
*/
|
package/model/sourceIndex.ts
CHANGED
|
@@ -7,26 +7,32 @@ export type SourceIndex = {
|
|
|
7
7
|
* Source index name.
|
|
8
8
|
*/
|
|
9
9
|
indexName: string;
|
|
10
|
+
|
|
10
11
|
/**
|
|
11
12
|
* List of analytics tags to filter the popular searches per tag.
|
|
12
13
|
*/
|
|
13
14
|
analyticsTags?: string[];
|
|
15
|
+
|
|
14
16
|
/**
|
|
15
17
|
* List of facets to define as categories for the query suggestions.
|
|
16
18
|
*/
|
|
17
19
|
facets?: Array<Record<string, any>>;
|
|
20
|
+
|
|
18
21
|
/**
|
|
19
22
|
* Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
|
|
20
23
|
*/
|
|
21
24
|
minHits?: number;
|
|
25
|
+
|
|
22
26
|
/**
|
|
23
27
|
* Minimum number of required letters for a suggestion to remain.
|
|
24
28
|
*/
|
|
25
29
|
minLetters?: number;
|
|
30
|
+
|
|
26
31
|
/**
|
|
27
32
|
* List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC).
|
|
28
33
|
*/
|
|
29
34
|
generate?: string[][];
|
|
35
|
+
|
|
30
36
|
/**
|
|
31
37
|
* List of external indices to use to generate custom Query Suggestions.
|
|
32
38
|
*/
|
|
@@ -10,30 +10,37 @@ export type SourceIndexWithReplicas = {
|
|
|
10
10
|
* True if the Query Suggestions index is a replicas.
|
|
11
11
|
*/
|
|
12
12
|
replicas: boolean;
|
|
13
|
+
|
|
13
14
|
/**
|
|
14
15
|
* Source index name.
|
|
15
16
|
*/
|
|
16
17
|
indexName: string;
|
|
18
|
+
|
|
17
19
|
/**
|
|
18
20
|
* List of analytics tags to filter the popular searches per tag.
|
|
19
21
|
*/
|
|
20
22
|
analyticsTags: string[];
|
|
23
|
+
|
|
21
24
|
/**
|
|
22
25
|
* List of facets to define as categories for the query suggestions.
|
|
23
26
|
*/
|
|
24
27
|
facets: Array<Record<string, any>>;
|
|
28
|
+
|
|
25
29
|
/**
|
|
26
30
|
* Minimum number of hits (e.g., matching records in the source index) to generate a suggestions.
|
|
27
31
|
*/
|
|
28
32
|
minHits: number;
|
|
33
|
+
|
|
29
34
|
/**
|
|
30
35
|
* Minimum number of required letters for a suggestion to remain.
|
|
31
36
|
*/
|
|
32
37
|
minLetters: number;
|
|
38
|
+
|
|
33
39
|
/**
|
|
34
40
|
* List of facet attributes used to generate Query Suggestions. The resulting suggestions are every combination of the facets in the nested list (e.g., (facetA and facetB) and facetC).
|
|
35
41
|
*/
|
|
36
42
|
generate: string[][];
|
|
43
|
+
|
|
37
44
|
/**
|
|
38
45
|
* List of external indices to use to generate custom Query Suggestions.
|
|
39
46
|
*/
|
package/model/status.ts
CHANGED
package/model/successResponse.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@algolia/client-query-suggestions",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.5",
|
|
4
4
|
"description": "JavaScript client for client-query-suggestions",
|
|
5
5
|
"repository": "algolia/algoliasearch-client-javascript",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"clean": "rm -rf ./dist"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@algolia/client-common": "5.0.0-alpha.
|
|
25
|
-
"@algolia/requester-browser-xhr": "5.0.0-alpha.
|
|
26
|
-
"@algolia/requester-node-http": "5.0.0-alpha.
|
|
24
|
+
"@algolia/client-common": "5.0.0-alpha.5",
|
|
25
|
+
"@algolia/requester-browser-xhr": "5.0.0-alpha.5",
|
|
26
|
+
"@algolia/requester-node-http": "5.0.0-alpha.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "16.11.
|
|
29
|
+
"@types/node": "16.11.47",
|
|
30
30
|
"typescript": "4.7.4"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|