@algolia/client-search 5.0.0-alpha.53 → 5.0.0-alpha.55
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 +5 -5
- package/dist/builds/node.d.ts +5 -5
- package/dist/client-search.cjs.js +1997 -1995
- package/dist/client-search.esm.browser.js +2130 -2128
- package/dist/client-search.esm.node.js +1997 -1995
- package/dist/client-search.umd.js +2 -2
- package/dist/model/acl.d.ts +4 -4
- package/dist/model/action.d.ts +4 -4
- package/dist/model/addApiKeyResponse.d.ts +10 -10
- package/dist/model/advancedSyntaxFeatures.d.ts +1 -1
- package/dist/model/alternativesAsExact.d.ts +1 -1
- package/dist/model/anchoring.d.ts +4 -4
- package/dist/model/apiKey.d.ts +38 -38
- package/dist/model/aroundRadius.d.ts +5 -5
- package/dist/model/aroundRadiusAll.d.ts +1 -1
- package/dist/model/assignUserIdParams.d.ts +9 -9
- package/dist/model/attributeToUpdate.d.ts +2 -2
- package/dist/model/automaticFacetFilter.d.ts +17 -17
- package/dist/model/automaticFacetFilters.d.ts +5 -5
- package/dist/model/baseGetApiKeyResponse.d.ts +10 -10
- package/dist/model/baseIndexSettings.d.ts +62 -62
- package/dist/model/baseSearchParams.d.ts +3 -3
- package/dist/model/baseSearchParamsWithoutQuery.d.ts +122 -122
- package/dist/model/baseSearchResponse.d.ts +101 -101
- package/dist/model/batchAssignUserIdsParams.d.ts +13 -13
- package/dist/model/batchDictionaryEntriesParams.d.ts +14 -14
- package/dist/model/batchDictionaryEntriesRequest.d.ts +6 -6
- package/dist/model/batchParams.d.ts +7 -7
- package/dist/model/batchRequest.d.ts +8 -8
- package/dist/model/batchResponse.d.ts +10 -10
- package/dist/model/batchWriteParams.d.ts +7 -7
- package/dist/model/browseParams.d.ts +3 -3
- package/dist/model/browseParamsObject.d.ts +3 -3
- package/dist/model/browseResponse.d.ts +4 -4
- package/dist/model/builtInOperation.d.ts +11 -11
- package/dist/model/builtInOperationType.d.ts +4 -4
- package/dist/model/clientMethodProps.d.ts +715 -715
- package/dist/model/condition.d.ts +16 -16
- package/dist/model/consequence.d.ts +25 -25
- package/dist/model/consequenceHide.d.ts +9 -9
- package/dist/model/consequenceParams.d.ts +4 -4
- package/dist/model/consequenceQuery.d.ts +5 -5
- package/dist/model/consequenceQueryObject.d.ts +11 -11
- package/dist/model/createdAtResponse.d.ts +9 -9
- package/dist/model/cursor.d.ts +6 -6
- package/dist/model/deleteApiKeyResponse.d.ts +6 -6
- package/dist/model/deleteByParams.d.ts +26 -26
- package/dist/model/deleteSourceResponse.d.ts +6 -6
- package/dist/model/deletedAtResponse.d.ts +13 -13
- package/dist/model/dictionaryAction.d.ts +4 -4
- package/dist/model/dictionaryEntry.d.ts +27 -27
- package/dist/model/dictionaryEntryState.d.ts +4 -4
- package/dist/model/dictionaryLanguage.d.ts +9 -9
- package/dist/model/dictionarySettingsParams.d.ts +7 -7
- package/dist/model/dictionaryType.d.ts +1 -1
- package/dist/model/distinct.d.ts +4 -4
- package/dist/model/edit.d.ts +12 -12
- package/dist/model/editType.d.ts +4 -4
- package/dist/model/errorBase.d.ts +6 -6
- package/dist/model/exactOnSingleWordQuery.d.ts +4 -4
- package/dist/model/facetFilters.d.ts +5 -5
- package/dist/model/facetHits.d.ts +14 -14
- package/dist/model/facetOrdering.d.ts +12 -12
- package/dist/model/facets.d.ts +9 -9
- package/dist/model/facetsStats.d.ts +18 -18
- package/dist/model/fetchedIndex.d.ts +46 -46
- package/dist/model/getApiKeyResponse.d.ts +3 -3
- package/dist/model/getDictionarySettingsResponse.d.ts +4 -4
- package/dist/model/getLogsResponse.d.ts +4 -4
- package/dist/model/getObjectsParams.d.ts +7 -7
- package/dist/model/getObjectsRequest.d.ts +17 -17
- package/dist/model/getObjectsResponse.d.ts +6 -6
- package/dist/model/getTaskResponse.d.ts +4 -4
- package/dist/model/getTopUserIdsResponse.d.ts +10 -10
- package/dist/model/hasPendingMappingsResponse.d.ts +10 -10
- package/dist/model/highlightResult.d.ts +2 -2
- package/dist/model/highlightResultOption.d.ts +19 -19
- package/dist/model/hit.d.ts +22 -22
- package/dist/model/ignorePlurals.d.ts +4 -4
- package/dist/model/index.d.ts +154 -154
- package/dist/model/indexSettings.d.ts +6 -6
- package/dist/model/indexSettingsAsSearchParams.d.ts +156 -156
- package/dist/model/languages.d.ts +9 -9
- package/dist/model/listApiKeysResponse.d.ts +7 -7
- package/dist/model/listClustersResponse.d.ts +9 -9
- package/dist/model/listIndicesResponse.d.ts +11 -11
- package/dist/model/listUserIdsResponse.d.ts +10 -10
- package/dist/model/log.d.ts +63 -63
- package/dist/model/logQuery.d.ts +14 -14
- package/dist/model/logType.d.ts +1 -1
- package/dist/model/matchLevel.d.ts +4 -4
- package/dist/model/matchedGeoLocation.d.ts +14 -14
- package/dist/model/mixedSearchFilters.d.ts +1 -1
- package/dist/model/multipleBatchRequest.d.ts +12 -12
- package/dist/model/multipleBatchResponse.d.ts +10 -10
- package/dist/model/numericFilters.d.ts +5 -5
- package/dist/model/operationIndexParams.d.ts +13 -13
- package/dist/model/operationType.d.ts +4 -4
- package/dist/model/optionalFilters.d.ts +5 -5
- package/dist/model/params.d.ts +12 -12
- package/dist/model/personalization.d.ts +14 -14
- package/dist/model/promote.d.ts +3 -3
- package/dist/model/promoteObjectID.d.ts +13 -13
- package/dist/model/promoteObjectIDs.d.ts +13 -13
- package/dist/model/queryType.d.ts +4 -4
- package/dist/model/rankingInfo.d.ts +50 -50
- package/dist/model/reRankingApplyFilter.d.ts +5 -5
- package/dist/model/removeStopWords.d.ts +4 -4
- package/dist/model/removeUserIdResponse.d.ts +6 -6
- package/dist/model/removeWordsIfNoResults.d.ts +4 -4
- package/dist/model/renderingContent.d.ts +7 -7
- package/dist/model/replaceSourceResponse.d.ts +6 -6
- package/dist/model/rule.d.ts +29 -29
- package/dist/model/saveObjectResponse.d.ts +11 -11
- package/dist/model/saveSynonymResponse.d.ts +14 -14
- package/dist/model/scopeType.d.ts +1 -1
- package/dist/model/searchDictionaryEntriesParams.d.ts +21 -21
- package/dist/model/searchForFacetValuesRequest.d.ts +14 -14
- package/dist/model/searchForFacetValuesResponse.d.ts +4 -4
- package/dist/model/searchForFacets.d.ts +3 -3
- package/dist/model/searchForFacetsOptions.d.ts +20 -20
- package/dist/model/searchForHits.d.ts +3 -3
- package/dist/model/searchForHitsOptions.d.ts +12 -12
- package/dist/model/searchHits.d.ts +4 -4
- package/dist/model/searchMethodParams.d.ts +6 -6
- package/dist/model/searchParams.d.ts +3 -3
- package/dist/model/searchParamsObject.d.ts +3 -3
- package/dist/model/searchParamsQuery.d.ts +6 -6
- package/dist/model/searchParamsString.d.ts +6 -6
- package/dist/model/searchQuery.d.ts +3 -3
- package/dist/model/searchResponse.d.ts +3 -3
- package/dist/model/searchResponses.d.ts +4 -4
- package/dist/model/searchRulesParams.d.ts +31 -31
- package/dist/model/searchRulesResponse.d.ts +19 -19
- package/dist/model/searchStrategy.d.ts +1 -1
- package/dist/model/searchSynonymsParams.d.ts +6 -6
- package/dist/model/searchSynonymsResponse.d.ts +11 -11
- package/dist/model/searchTypeDefault.d.ts +4 -4
- package/dist/model/searchTypeFacet.d.ts +4 -4
- package/dist/model/searchUserIdsParams.d.ts +21 -21
- package/dist/model/searchUserIdsResponse.d.ts +26 -26
- package/dist/model/snippetResult.d.ts +2 -2
- package/dist/model/snippetResultOption.d.ts +11 -11
- package/dist/model/sortRemainingBy.d.ts +4 -4
- package/dist/model/source.d.ts +13 -13
- package/dist/model/standardEntries.d.ts +17 -17
- package/dist/model/synonymHit.d.ts +35 -35
- package/dist/model/synonymType.d.ts +4 -4
- package/dist/model/tagFilters.d.ts +5 -5
- package/dist/model/taskStatus.d.ts +1 -1
- package/dist/model/timeRange.d.ts +10 -10
- package/dist/model/typoTolerance.d.ts +5 -5
- package/dist/model/typoToleranceEnum.d.ts +1 -1
- package/dist/model/updateApiKeyResponse.d.ts +10 -10
- package/dist/model/updatedAtResponse.d.ts +13 -13
- package/dist/model/updatedAtWithObjectIdResponse.d.ts +17 -17
- package/dist/model/updatedRuleResponse.d.ts +14 -14
- package/dist/model/userHighlightResult.d.ts +11 -11
- package/dist/model/userHit.d.ts +24 -24
- package/dist/model/userId.d.ts +21 -21
- package/dist/model/value.d.ts +8 -8
- package/dist/src/searchClient.d.ts +723 -723
- package/model/acl.ts +1 -1
- package/model/action.ts +1 -1
- package/model/addApiKeyResponse.ts +1 -1
- package/model/advancedSyntaxFeatures.ts +1 -1
- package/model/alternativesAsExact.ts +1 -1
- package/model/anchoring.ts +1 -1
- package/model/apiKey.ts +1 -1
- package/model/aroundRadius.ts +1 -1
- package/model/aroundRadiusAll.ts +1 -1
- package/model/assignUserIdParams.ts +1 -1
- package/model/attributeToUpdate.ts +1 -1
- package/model/automaticFacetFilter.ts +1 -1
- package/model/automaticFacetFilters.ts +1 -1
- package/model/baseGetApiKeyResponse.ts +1 -1
- package/model/baseIndexSettings.ts +1 -1
- package/model/baseSearchParams.ts +1 -1
- package/model/baseSearchParamsWithoutQuery.ts +1 -1
- package/model/baseSearchResponse.ts +1 -1
- package/model/batchAssignUserIdsParams.ts +1 -1
- package/model/batchDictionaryEntriesParams.ts +1 -1
- package/model/batchDictionaryEntriesRequest.ts +1 -1
- package/model/batchParams.ts +1 -1
- package/model/batchRequest.ts +1 -1
- package/model/batchResponse.ts +1 -1
- package/model/batchWriteParams.ts +1 -1
- package/model/browseParams.ts +1 -1
- package/model/browseParamsObject.ts +1 -1
- package/model/browseResponse.ts +1 -1
- package/model/builtInOperation.ts +1 -1
- package/model/builtInOperationType.ts +1 -1
- package/model/clientMethodProps.ts +1 -1
- package/model/condition.ts +1 -1
- package/model/consequence.ts +1 -1
- package/model/consequenceHide.ts +1 -1
- package/model/consequenceParams.ts +1 -1
- package/model/consequenceQuery.ts +1 -1
- package/model/consequenceQueryObject.ts +1 -1
- package/model/createdAtResponse.ts +1 -1
- package/model/cursor.ts +1 -1
- package/model/deleteApiKeyResponse.ts +1 -1
- package/model/deleteByParams.ts +1 -1
- package/model/deleteSourceResponse.ts +1 -1
- package/model/deletedAtResponse.ts +1 -1
- package/model/dictionaryAction.ts +1 -1
- package/model/dictionaryEntry.ts +1 -1
- package/model/dictionaryEntryState.ts +1 -1
- package/model/dictionaryLanguage.ts +1 -1
- package/model/dictionarySettingsParams.ts +1 -1
- package/model/dictionaryType.ts +1 -1
- package/model/distinct.ts +1 -1
- package/model/edit.ts +1 -1
- package/model/editType.ts +1 -1
- package/model/errorBase.ts +1 -1
- package/model/exactOnSingleWordQuery.ts +1 -1
- package/model/facetFilters.ts +1 -1
- package/model/facetHits.ts +1 -1
- package/model/facetOrdering.ts +1 -1
- package/model/facets.ts +1 -1
- package/model/facetsStats.ts +1 -1
- package/model/fetchedIndex.ts +1 -1
- package/model/getApiKeyResponse.ts +1 -1
- package/model/getDictionarySettingsResponse.ts +1 -1
- package/model/getLogsResponse.ts +1 -1
- package/model/getObjectsParams.ts +1 -1
- package/model/getObjectsRequest.ts +1 -1
- package/model/getObjectsResponse.ts +1 -1
- package/model/getTaskResponse.ts +1 -1
- package/model/getTopUserIdsResponse.ts +1 -1
- package/model/hasPendingMappingsResponse.ts +1 -1
- package/model/highlightResult.ts +1 -1
- package/model/highlightResultOption.ts +1 -1
- package/model/hit.ts +1 -1
- package/model/ignorePlurals.ts +1 -1
- package/model/index.ts +1 -1
- package/model/indexSettings.ts +1 -1
- package/model/indexSettingsAsSearchParams.ts +1 -1
- package/model/languages.ts +1 -1
- package/model/listApiKeysResponse.ts +1 -1
- package/model/listClustersResponse.ts +1 -1
- package/model/listIndicesResponse.ts +1 -1
- package/model/listUserIdsResponse.ts +1 -1
- package/model/log.ts +1 -1
- package/model/logQuery.ts +1 -1
- package/model/logType.ts +1 -1
- package/model/matchLevel.ts +1 -1
- package/model/matchedGeoLocation.ts +1 -1
- package/model/mixedSearchFilters.ts +1 -1
- package/model/multipleBatchRequest.ts +1 -1
- package/model/multipleBatchResponse.ts +1 -1
- package/model/numericFilters.ts +1 -1
- package/model/operationIndexParams.ts +1 -1
- package/model/operationType.ts +1 -1
- package/model/optionalFilters.ts +1 -1
- package/model/params.ts +1 -1
- package/model/personalization.ts +1 -1
- package/model/promote.ts +1 -1
- package/model/promoteObjectID.ts +1 -1
- package/model/promoteObjectIDs.ts +1 -1
- package/model/queryType.ts +1 -1
- package/model/rankingInfo.ts +1 -1
- package/model/reRankingApplyFilter.ts +1 -1
- package/model/removeStopWords.ts +1 -1
- package/model/removeUserIdResponse.ts +1 -1
- package/model/removeWordsIfNoResults.ts +1 -1
- package/model/renderingContent.ts +1 -1
- package/model/replaceSourceResponse.ts +1 -1
- package/model/rule.ts +1 -1
- package/model/saveObjectResponse.ts +1 -1
- package/model/saveSynonymResponse.ts +1 -1
- package/model/scopeType.ts +1 -1
- package/model/searchDictionaryEntriesParams.ts +1 -1
- package/model/searchForFacetValuesRequest.ts +1 -1
- package/model/searchForFacetValuesResponse.ts +1 -1
- package/model/searchForFacets.ts +1 -1
- package/model/searchForFacetsOptions.ts +1 -1
- package/model/searchForHits.ts +1 -1
- package/model/searchForHitsOptions.ts +1 -1
- package/model/searchHits.ts +1 -1
- package/model/searchMethodParams.ts +1 -1
- package/model/searchParams.ts +1 -1
- package/model/searchParamsObject.ts +1 -1
- package/model/searchParamsQuery.ts +1 -1
- package/model/searchParamsString.ts +1 -1
- package/model/searchQuery.ts +1 -1
- package/model/searchResponse.ts +1 -1
- package/model/searchResponses.ts +1 -1
- package/model/searchRulesParams.ts +1 -1
- package/model/searchRulesResponse.ts +1 -1
- package/model/searchStrategy.ts +1 -1
- package/model/searchSynonymsParams.ts +1 -1
- package/model/searchSynonymsResponse.ts +1 -1
- package/model/searchTypeDefault.ts +1 -1
- package/model/searchTypeFacet.ts +1 -1
- package/model/searchUserIdsParams.ts +1 -1
- package/model/searchUserIdsResponse.ts +1 -1
- package/model/snippetResult.ts +1 -1
- package/model/snippetResultOption.ts +1 -1
- package/model/sortRemainingBy.ts +1 -1
- package/model/source.ts +1 -1
- package/model/standardEntries.ts +1 -1
- package/model/synonymHit.ts +1 -1
- package/model/synonymType.ts +1 -1
- package/model/tagFilters.ts +1 -1
- package/model/taskStatus.ts +1 -1
- package/model/timeRange.ts +1 -1
- package/model/typoTolerance.ts +1 -1
- package/model/typoToleranceEnum.ts +1 -1
- package/model/updateApiKeyResponse.ts +1 -1
- package/model/updatedAtResponse.ts +1 -1
- package/model/updatedAtWithObjectIdResponse.ts +1 -1
- package/model/updatedRuleResponse.ts +1 -1
- package/model/userHighlightResult.ts +1 -1
- package/model/userHit.ts +1 -1
- package/model/userId.ts +1 -1
- package/model/value.ts +1 -1
- package/package.json +6 -6
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! client-search.umd.js | 5.0.0-alpha.
|
|
2
|
-
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-search"]={})}(this,(function(e){"use strict";function r({func:e,validate:r,aggregator:t,error:a,timeout:n=(()=>0)}){const s=i=>new Promise(((o,c)=>{e(i).then((e=>(t&&t(e),r(e)?o(e):a&&a.validate(e)?c(new Error(a.message(e))):setTimeout((()=>{s(e).then(o).catch(c)}),n())))).catch((e=>{c(e)}))}));return s()}function t(e){let r;const t=`algolia-client-js-${e.key}`;function a(){return void 0===r&&(r=e.localStorage||window.localStorage),r}function n(){return JSON.parse(a().getItem(t)||"{}")}return{get:(e,r,t={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const t=JSON.stringify(e),a=n()[t];return Promise.all([a||r(),void 0!==a])})).then((([e,r])=>Promise.all([e,r||t.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const s=n();return s[JSON.stringify(e)]=r,a().setItem(t,JSON.stringify(s)),r})),delete:e=>Promise.resolve().then((()=>{const r=n();delete r[JSON.stringify(e)],a().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(t)}))}}function a(e){const r=[...e.caches],t=r.shift();return void 0===t?{get:(e,r,t={miss:()=>Promise.resolve()})=>r().then((e=>Promise.all([e,t.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve(r),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,s={miss:()=>Promise.resolve()})=>t.get(e,n,s).catch((()=>a({caches:r}).get(e,n,s))),set:(e,n)=>t.set(e,n).catch((()=>a({caches:r}).set(e,n))),delete:e=>t.delete(e).catch((()=>a({caches:r}).delete(e))),clear:()=>t.clear().catch((()=>a({caches:r}).clear()))}}function n(e={serializable:!0}){let r={};return{get(t,a,n={miss:()=>Promise.resolve()}){const s=JSON.stringify(t);if(s in r)return Promise.resolve(e.serializable?JSON.parse(r[s]):r[s]);const i=a();return i.then((e=>n.miss(e))).then((()=>i))},set:(t,a)=>(r[JSON.stringify(t)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete r[JSON.stringify(e)],Promise.resolve()),clear:()=>(r={},Promise.resolve())}}const s=12e4;function i(e,r="up"){const t=Date.now();return{...e,status:r,lastUpdate:t,isUp:function(){return"up"===r||Date.now()-t>s},isTimedOut:function(){return"timed out"===r&&Date.now()-t<=s}}}function o(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,r||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class c extends Error{constructor(e,r){super(e),o(this,"name","AlgoliaError"),r&&(this.name=r)}}class d extends c{constructor(e,r,t){super(e,t),o(this,"stackTrace",void 0),this.stackTrace=r}}class u extends d{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class m extends d{constructor(e,r,t,a="ApiError"){super(e,t,a),o(this,"status",void 0),this.status=r}}class l extends c{constructor(e,r){super(e,"DeserializationError"),o(this,"response",void 0),this.response=r}}class h extends m{constructor(e,r,t,a){super(e,r,a,"DetailedApiError"),o(this,"error",void 0),this.error=t}}function p(e,r,t){const a=function(e){const r=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((t=>`${t}=${encodeURIComponent(r(e[t])?JSON.stringify(e[t]):e[t])}`)).join("&")}(t);let n=`${e.protocol}://${e.url}/${"/"===r.charAt(0)?r.substr(1):r}`;return a.length&&(n+=`?${a}`),n}function w(e){const r=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...r}}}}function g({hosts:e,hostsCache:r,baseHeaders:t,baseQueryParameters:a,algoliaAgent:n,timeouts:s,requester:o,requestsCache:c,responsesCache:d}){async function g(c,d,g=!0){const y=[],P=function(e,r){if("GET"===e.method||void 0===e.data&&void 0===r.data)return;const t=Array.isArray(e.data)?e.data:{...e.data,...r.data};return JSON.stringify(t)}(c,d),q=function(e,r,t){const a={Accept:"application/json",...e,...r,...t},n={};return Object.keys(a).forEach((e=>{const r=a[e];n[e.toLowerCase()]=r})),n}(t,c.headers,d.headers),f="GET"===c.method?{...c.data,...d.data}:{},x={...a,...c.queryParameters,...f};if(n.value&&(x["x-algolia-agent"]=n.value),d&&d.queryParameters)for(const e of Object.keys(d.queryParameters))d.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(d.queryParameters[e])?x[e]=d.queryParameters[e].toString():x[e]=d.queryParameters[e];let E=0;const b=async(e,t)=>{const a=e.pop();if(void 0===a)throw new u(function(e){return e.map((e=>w(e)))}(y));let n=d.timeout;void 0===n&&(n=g?s.read:s.write);const f={data:P,headers:q,method:c.method,url:p(a,c.path,x),connectTimeout:t(E,s.connect),responseTimeout:t(E,n)},I=r=>{const t={request:f,response:r,host:a,triesLeft:e.length};return y.push(t),t},N=await o.send(f);if(function({isTimedOut:e,status:r}){return e||function({isTimedOut:e,status:r}){return!e&&0==~~r}({isTimedOut:e,status:r})||2!=~~(r/100)&&4!=~~(r/100)}(N)){const n=I(N);return N.isTimedOut&&E++,console.log("Retryable failure",w(n)),await r.set(a,i(a,N.isTimedOut?"timed out":"down")),b(e,t)}if(function({status:e}){return 2==~~(e/100)}(N))return function(e){try{return JSON.parse(e.content)}catch(r){throw new l(r.message,e)}}(N);throw I(N),function({content:e,status:r},t){try{const a=JSON.parse(e);return"error"in a?new h(a.message,r,a.error,t):new m(a.message,r,t)}catch(e){}return new m(e,r,t)}(N,y)},I=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),N=await async function(e){const t=await Promise.all(e.map((e=>r.get(e,(()=>Promise.resolve(i(e))))))),a=t.filter((e=>e.isUp())),n=t.filter((e=>e.isTimedOut())),s=[...a,...n];return{hosts:s.length>0?s:e,getTimeout:(e,r)=>(0===n.length&&0===e?1:n.length+3+e)*r}}(I);return b([...N.hosts].reverse(),N.getTimeout)}return{hostsCache:r,requester:o,timeouts:s,algoliaAgent:n,baseHeaders:t,baseQueryParameters:a,hosts:e,request:function(e,r={}){const n=e.useReadTransporter||"GET"===e.method;if(!n)return g(e,r,n);const s=()=>g(e,r);if(!0!==(r.cacheable||e.cacheable))return s();const i={request:e,requestOptions:r,transporter:{queryParameters:a,headers:t}};return d.get(i,(()=>c.get(i,(()=>c.set(i,s()).then((e=>Promise.all([c.delete(i),e])),(e=>Promise.all([c.delete(i),Promise.reject(e)]))).then((([e,r])=>r))))),{miss:e=>d.set(i,e)})},requestsCache:c,responsesCache:d}}function y({algoliaAgents:e,client:r,version:t}){const a=function(e){const r={value:`Algolia for JavaScript (${e})`,add(e){const t=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===r.value.indexOf(t)&&(r.value=`${r.value}${t}`),r}};return r}(t).add({segment:r,version:t});return e.forEach((e=>a.add(e))),a}const P=1e3,q=2e3,f=3e4;const x="5.0.0-alpha.53";function E(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const r=e;for(let t=e.length-1;t>0;t--){const a=Math.floor(Math.random()*(t+1)),n=e[t];r[t]=e[a],r[a]=n}return r}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=x,e.searchClient=function(e,s,i){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:a,algoliaAgents:n,...s}){const i=function(e,r,t="WithinHeaders"){const a={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===t?a:{},queryParameters:()=>"WithinQueryParameters"===t?a:{}}}(e,t,a),o=g({hosts:E(e),...s,algoliaAgent:y({algoliaAgents:n,client:"Search",version:x}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});return{transporter:o,appId:e,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((()=>{})),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},waitForTask({indexName:e,taskID:t,maxRetries:a=50,timeout:n=(e=>Math.min(200*e,5e3))},s){let i=0;return r({func:()=>this.getTask({indexName:e,taskID:t},s),validate:e=>"published"===e.status,aggregator:()=>i+=1,error:{validate:()=>i>=a,message:()=>`The maximum number of retries exceeded. (${i}/${a})`},timeout:()=>n(i)})},waitForApiKey({operation:e,key:t,apiKey:a,maxRetries:n=50,timeout:s=(e=>Math.min(200*e,5e3))},i){let o=0;const c={aggregator:()=>o+=1,error:{validate:()=>o>=n,message:()=>`The maximum number of retries exceeded. (${o}/${n})`},timeout:()=>s(o)};if("update"===e){if(!a)throw new Error("`apiKey` is required when waiting for an `update` operation.");return r({...c,func:()=>this.getApiKey({key:t},i),validate:e=>{for(const r of Object.keys(a))if(Array.isArray(a[r])){if(a[r].length!==e[r].length||a[r].some(((t,a)=>t!==e[r][a])))return!1}else if(e[r]!==a[r])return!1;return!0}})}return r({...c,func:()=>this.getApiKey({key:t},i).catch((e=>e)),validate:r=>"add"===e?404!==r.status:404===r.status})},browseObjects({indexName:e,browseParams:t,...a},n){return r({func:r=>this.browse({indexName:e,browseParams:{cursor:r?r.cursor:void 0,...t}},n),validate:e=>void 0===e.cursor,...a})},browseRules({indexName:e,searchRulesParams:t,...a},n){const s={hitsPerPage:1e3,...t};return r({func:r=>this.searchRules({indexName:e,searchRulesParams:{...s,page:r?r.page+1:s.page||0}},n),validate:e=>e.nbHits<s.hitsPerPage,...a})},browseSynonyms({indexName:e,validate:t,aggregator:a,...n},s){const i={hitsPerPage:1e3,...n};return r({func:r=>this.searchSynonyms({...i,indexName:e,page:r?r.page+1:n.page||0},s),validate:e=>e.nbHits<i.hitsPerPage,...n})},addApiKey(e,r){if(!e)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!e.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");const t={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:e};return o.request(t,r)},addOrUpdateObject({indexName:e,objectID:r,body:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!t)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");const n={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t};return o.request(n,a)},appendSource(e,r){if(!e)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!e.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");const t={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:e};return o.request(t,r)},assignUserId({xAlgoliaUserID:e,assignUserIdParams:r},t){if(!e)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!r)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!r.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");const a={};void 0!==e&&(a["X-Algolia-User-ID"]=e.toString());const n={method:"POST",path:"/1/clusters/mapping",queryParameters:{},headers:a,data:r};return o.request(n,t)},batch({indexName:e,batchWriteParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!r)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!r.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");const a={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},batchAssignUserIds({xAlgoliaUserID:e,batchAssignUserIdsParams:r},t){if(!e)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!r)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!r.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!r.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");const a={};void 0!==e&&(a["X-Algolia-User-ID"]=e.toString());const n={method:"POST",path:"/1/clusters/mapping/batch",queryParameters:{},headers:a,data:r};return o.request(n,t)},batchDictionaryEntries({dictionaryName:e,batchDictionaryEntriesParams:r},t){if(!e)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!r)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!r.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");const a={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},browse({indexName:e,browseParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `browse`.");const a={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return o.request(a,t)},clearAllSynonyms({indexName:e,forwardToReplicas:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `clearAllSynonyms`.");const a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),n={};void 0!==r&&(n.forwardToReplicas=r.toString());const s={method:"POST",path:a,queryParameters:n,headers:{}};return o.request(s,t)},clearObjects({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");const t={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},clearRules({indexName:e,forwardToReplicas:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `clearRules`.");const a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),n={};void 0!==r&&(n.forwardToReplicas=r.toString());const s={method:"POST",path:a,queryParameters:n,headers:{}};return o.request(s,t)},del({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const a={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},deleteApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");const t={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteBy({indexName:e,deleteByParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!r)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");const a={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},deleteIndex({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");const t={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteObject({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");const a={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},deleteRule({indexName:e,objectID:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");const n="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const i={method:"DELETE",path:n,queryParameters:s,headers:{}};return o.request(i,a)},deleteSource({source:e},r){if(!e)throw new Error("Parameter `source` is required when calling `deleteSource`.");const t={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteSynonym({indexName:e,objectID:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");const n="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const i={method:"DELETE",path:n,queryParameters:s,headers:{}};return o.request(i,a)},get({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const a={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},getApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `getApiKey`.");const t={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getDictionaryLanguages(e){const r={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return o.request(r,e)},getDictionarySettings(e){const r={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return o.request(r,e)},getLogs({offset:e,length:r,indexName:t,type:a}={},n=undefined){const s={};void 0!==e&&(s.offset=e.toString()),void 0!==r&&(s.length=r.toString()),void 0!==t&&(s.indexName=t.toString()),void 0!==a&&(s.type=a.toString());const i={method:"GET",path:"/1/logs",queryParameters:s,headers:{}};return o.request(i,n)},getObject({indexName:e,objectID:r,attributesToRetrieve:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getObject`.");const n="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.attributesToRetrieve=t.toString());const i={method:"GET",path:n,queryParameters:s,headers:{}};return o.request(i,a)},getObjects(e,r){if(!e)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!e.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");const t={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(t,r)},getRule({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRule`.");const a={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},getSettings({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getSettings`.");const t={method:"GET",path:"/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getSources(e){const r={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return o.request(r,e)},getSynonym({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");const a={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},getTask({indexName:e,taskID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getTask`.");const a={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},getTopUserIds(e){const r={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return o.request(r,e)},getUserId({userID:e},r){if(!e)throw new Error("Parameter `userID` is required when calling `getUserId`.");const t={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},hasPendingMappings({getClusters:e}={},r=undefined){const t={};void 0!==e&&(t.getClusters=e.toString());const a={method:"GET",path:"/1/clusters/mapping/pending",queryParameters:t,headers:{}};return o.request(a,r)},listApiKeys(e){const r={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return o.request(r,e)},listClusters(e){const r={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return o.request(r,e)},listIndices({page:e}={},r=undefined){const t={};void 0!==e&&(t.page=e.toString());const a={method:"GET",path:"/1/indexes",queryParameters:t,headers:{}};return o.request(a,r)},listUserIds({page:e,hitsPerPage:r}={},t=undefined){const a={};void 0!==e&&(a.page=e.toString()),void 0!==r&&(a.hitsPerPage=r.toString());const n={method:"GET",path:"/1/clusters/mapping",queryParameters:a,headers:{}};return o.request(n,t)},multipleBatch(e,r){if(!e)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!e.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");const t={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:e};return o.request(t,r)},operationIndex({indexName:e,operationIndexParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!r)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!r.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!r.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");const a={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},partialUpdateObject({indexName:e,objectID:r,attributesToUpdate:t,createIfNotExists:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!t)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");const s="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),i={};void 0!==a&&(i.createIfNotExists=a.toString());const c={method:"POST",path:s,queryParameters:i,headers:{},data:t};return o.request(c,n)},post({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const n={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},put({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const n={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},removeUserId({userID:e},r){if(!e)throw new Error("Parameter `userID` is required when calling `removeUserId`.");const t={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},replaceSources({source:e},r){if(!e)throw new Error("Parameter `source` is required when calling `replaceSources`.");const t={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return o.request(t,r)},restoreApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");const t={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},saveObject({indexName:e,body:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!r)throw new Error("Parameter `body` is required when calling `saveObject`.");const a={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},saveRule({indexName:e,objectID:r,rule:t,forwardToReplicas:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!t)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!t.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");const s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),i={};void 0!==a&&(i.forwardToReplicas=a.toString());const c={method:"PUT",path:s,queryParameters:i,headers:{},data:t};return o.request(c,n)},saveRules({indexName:e,rules:r,forwardToReplicas:t,clearExistingRules:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!r)throw new Error("Parameter `rules` is required when calling `saveRules`.");const s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),i={};void 0!==t&&(i.forwardToReplicas=t.toString()),void 0!==a&&(i.clearExistingRules=a.toString());const c={method:"POST",path:s,queryParameters:i,headers:{},data:r};return o.request(c,n)},saveSynonym({indexName:e,objectID:r,synonymHit:t,forwardToReplicas:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!t)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!t.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!t.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");const s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),i={};void 0!==a&&(i.forwardToReplicas=a.toString());const c={method:"PUT",path:s,queryParameters:i,headers:{},data:t};return o.request(c,n)},saveSynonyms({indexName:e,synonymHit:r,forwardToReplicas:t,replaceExistingSynonyms:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!r)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");const s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),i={};void 0!==t&&(i.forwardToReplicas=t.toString()),void 0!==a&&(i.replaceExistingSynonyms=a.toString());const c={method:"POST",path:s,queryParameters:i,headers:{},data:r};return o.request(c,n)},search(e,r){if(e&&Array.isArray(e)){const r={requests:e.map((({params:e,...r})=>"facet"===r.type?{...r,...e,type:"facet"}:{...r,...e,facet:void 0,maxFacetHits:void 0,facetQuery:void 0}))};e=r}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");const t={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(t,r)},searchDictionaryEntries({dictionaryName:e,searchDictionaryEntriesParams:r},t){if(!e)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!r)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!r.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");const a={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return o.request(a,t)},searchForFacetValues({indexName:e,facetName:r,searchForFacetValuesRequest:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!r)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");const n={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(e)).replace("{facetName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0};return o.request(n,a)},searchRules({indexName:e,searchRulesParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRules`.");const a={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return o.request(a,t)},searchSingleIndex({indexName:e,searchParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");const a={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return o.request(a,t)},searchSynonyms({indexName:e,type:r,page:t,hitsPerPage:a,searchSynonymsParams:n},s){if(!e)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");const i="/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(e)),c={};void 0!==r&&(c.type=r.toString()),void 0!==t&&(c.page=t.toString()),void 0!==a&&(c.hitsPerPage=a.toString());const d={method:"POST",path:i,queryParameters:c,headers:{},data:n||{},useReadTransporter:!0,cacheable:!0};return o.request(d,s)},searchUserIds(e,r){if(!e)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!e.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");const t={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(t,r)},setDictionarySettings(e,r){if(!e)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!e.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");const t={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:e};return o.request(t,r)},setSettings({indexName:e,indexSettings:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!r)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");const n="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const i={method:"PUT",path:n,queryParameters:s,headers:{},data:r};return o.request(i,a)},updateApiKey({key:e,apiKey:r},t){if(!e)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!r)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!r.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");const a={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)}}}({appId:e,apiKey:s,timeouts:{connect:P,read:q,write:f},requester:{send:function(e){return new Promise((r=>{const t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach((r=>t.setRequestHeader(r,e.headers[r])));const a=(e,a)=>setTimeout((()=>{t.abort(),r({status:0,content:a,isTimedOut:!0})}),e),n=a(e.connectTimeout,"Connection timeout");let s;t.onreadystatechange=()=>{t.readyState>t.OPENED&&void 0===s&&(clearTimeout(n),s=a(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{0===t.status&&(clearTimeout(n),clearTimeout(s),r({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(n),clearTimeout(s),r({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:n(),requestsCache:n({serializable:!1}),hostsCache:a({caches:[t({key:`${x}-${e}`}),n()]}),...i})}}));
|
|
1
|
+
/*! client-search.umd.js | 5.0.0-alpha.55 | © Algolia, inc. | https://github.com/algolia/algoliasearch-client-javascript */
|
|
2
|
+
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["@algolia/client-search"]={})}(this,(function(e){"use strict";function r({func:e,validate:r,aggregator:t,error:a,timeout:n=(()=>0)}){const s=i=>new Promise(((o,c)=>{e(i).then((e=>(t&&t(e),r(e)?o(e):a&&a.validate(e)?c(new Error(a.message(e))):setTimeout((()=>{s(e).then(o).catch(c)}),n())))).catch((e=>{c(e)}))}));return s()}function t(e){let r;const t=`algolia-client-js-${e.key}`;function a(){return void 0===r&&(r=e.localStorage||window.localStorage),r}function n(){return JSON.parse(a().getItem(t)||"{}")}return{get:(e,r,t={miss:()=>Promise.resolve()})=>Promise.resolve().then((()=>{const t=JSON.stringify(e),a=n()[t];return Promise.all([a||r(),void 0!==a])})).then((([e,r])=>Promise.all([e,r||t.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve().then((()=>{const s=n();return s[JSON.stringify(e)]=r,a().setItem(t,JSON.stringify(s)),r})),delete:e=>Promise.resolve().then((()=>{const r=n();delete r[JSON.stringify(e)],a().setItem(t,JSON.stringify(r))})),clear:()=>Promise.resolve().then((()=>{a().removeItem(t)}))}}function a(e){const r=[...e.caches],t=r.shift();return void 0===t?{get:(e,r,t={miss:()=>Promise.resolve()})=>r().then((e=>Promise.all([e,t.miss(e)]))).then((([e])=>e)),set:(e,r)=>Promise.resolve(r),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,s={miss:()=>Promise.resolve()})=>t.get(e,n,s).catch((()=>a({caches:r}).get(e,n,s))),set:(e,n)=>t.set(e,n).catch((()=>a({caches:r}).set(e,n))),delete:e=>t.delete(e).catch((()=>a({caches:r}).delete(e))),clear:()=>t.clear().catch((()=>a({caches:r}).clear()))}}function n(e={serializable:!0}){let r={};return{get(t,a,n={miss:()=>Promise.resolve()}){const s=JSON.stringify(t);if(s in r)return Promise.resolve(e.serializable?JSON.parse(r[s]):r[s]);const i=a();return i.then((e=>n.miss(e))).then((()=>i))},set:(t,a)=>(r[JSON.stringify(t)]=e.serializable?JSON.stringify(a):a,Promise.resolve(a)),delete:e=>(delete r[JSON.stringify(e)],Promise.resolve()),clear:()=>(r={},Promise.resolve())}}const s=12e4;function i(e,r="up"){const t=Date.now();return{...e,status:r,lastUpdate:t,isUp:function(){return"up"===r||Date.now()-t>s},isTimedOut:function(){return"timed out"===r&&Date.now()-t<=s}}}function o(e,r,t){return(r=function(e){var r=function(e,r){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var a=t.call(e,r||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"==typeof r?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}class c extends Error{constructor(e,r){super(e),o(this,"name","AlgoliaError"),r&&(this.name=r)}}class d extends c{constructor(e,r,t){super(e,t),o(this,"stackTrace",void 0),this.stackTrace=r}}class u extends d{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",e,"RetryError")}}class m extends d{constructor(e,r,t,a="ApiError"){super(e,t,a),o(this,"status",void 0),this.status=r}}class l extends c{constructor(e,r){super(e,"DeserializationError"),o(this,"response",void 0),this.response=r}}class h extends m{constructor(e,r,t,a){super(e,r,a,"DetailedApiError"),o(this,"error",void 0),this.error=t}}function p(e,r,t){const a=function(e){const r=e=>"[object Object]"===Object.prototype.toString.call(e)||"[object Array]"===Object.prototype.toString.call(e);return Object.keys(e).map((t=>`${t}=${encodeURIComponent(r(e[t])?JSON.stringify(e[t]):e[t])}`)).join("&")}(t);let n=`${e.protocol}://${e.url}/${"/"===r.charAt(0)?r.substr(1):r}`;return a.length&&(n+=`?${a}`),n}function w(e){const r=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...r}}}}function g({hosts:e,hostsCache:r,baseHeaders:t,baseQueryParameters:a,algoliaAgent:n,timeouts:s,requester:o,requestsCache:c,responsesCache:d}){async function g(c,d,g=!0){const y=[],P=function(e,r){if("GET"===e.method||void 0===e.data&&void 0===r.data)return;const t=Array.isArray(e.data)?e.data:{...e.data,...r.data};return JSON.stringify(t)}(c,d),q=function(e,r,t){const a={Accept:"application/json",...e,...r,...t},n={};return Object.keys(a).forEach((e=>{const r=a[e];n[e.toLowerCase()]=r})),n}(t,c.headers,d.headers),f="GET"===c.method?{...c.data,...d.data}:{},x={...a,...c.queryParameters,...f};if(n.value&&(x["x-algolia-agent"]=n.value),d&&d.queryParameters)for(const e of Object.keys(d.queryParameters))d.queryParameters[e]&&"[object Object]"!==Object.prototype.toString.call(d.queryParameters[e])?x[e]=d.queryParameters[e].toString():x[e]=d.queryParameters[e];let E=0;const b=async(e,t)=>{const a=e.pop();if(void 0===a)throw new u(function(e){return e.map((e=>w(e)))}(y));let n=d.timeout;void 0===n&&(n=g?s.read:s.write);const f={data:P,headers:q,method:c.method,url:p(a,c.path,x),connectTimeout:t(E,s.connect),responseTimeout:t(E,n)},I=r=>{const t={request:f,response:r,host:a,triesLeft:e.length};return y.push(t),t},N=await o.send(f);if(function({isTimedOut:e,status:r}){return e||function({isTimedOut:e,status:r}){return!e&&0==~~r}({isTimedOut:e,status:r})||2!=~~(r/100)&&4!=~~(r/100)}(N)){const n=I(N);return N.isTimedOut&&E++,console.log("Retryable failure",w(n)),await r.set(a,i(a,N.isTimedOut?"timed out":"down")),b(e,t)}if(function({status:e}){return 2==~~(e/100)}(N))return function(e){try{return JSON.parse(e.content)}catch(r){throw new l(r.message,e)}}(N);throw I(N),function({content:e,status:r},t){try{const a=JSON.parse(e);return"error"in a?new h(a.message,r,a.error,t):new m(a.message,r,t)}catch(e){}return new m(e,r,t)}(N,y)},I=e.filter((e=>"readWrite"===e.accept||(g?"read"===e.accept:"write"===e.accept))),N=await async function(e){const t=await Promise.all(e.map((e=>r.get(e,(()=>Promise.resolve(i(e))))))),a=t.filter((e=>e.isUp())),n=t.filter((e=>e.isTimedOut())),s=[...a,...n];return{hosts:s.length>0?s:e,getTimeout:(e,r)=>(0===n.length&&0===e?1:n.length+3+e)*r}}(I);return b([...N.hosts].reverse(),N.getTimeout)}return{hostsCache:r,requester:o,timeouts:s,algoliaAgent:n,baseHeaders:t,baseQueryParameters:a,hosts:e,request:function(e,r={}){const n=e.useReadTransporter||"GET"===e.method;if(!n)return g(e,r,n);const s=()=>g(e,r);if(!0!==(r.cacheable||e.cacheable))return s();const i={request:e,requestOptions:r,transporter:{queryParameters:a,headers:t}};return d.get(i,(()=>c.get(i,(()=>c.set(i,s()).then((e=>Promise.all([c.delete(i),e])),(e=>Promise.all([c.delete(i),Promise.reject(e)]))).then((([e,r])=>r))))),{miss:e=>d.set(i,e)})},requestsCache:c,responsesCache:d}}function y({algoliaAgents:e,client:r,version:t}){const a=function(e){const r={value:`Algolia for JavaScript (${e})`,add(e){const t=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===r.value.indexOf(t)&&(r.value=`${r.value}${t}`),r}};return r}(t).add({segment:r,version:t});return e.forEach((e=>a.add(e))),a}const P="5.0.0-alpha.55";function q(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(function(e){const r=e;for(let t=e.length-1;t>0;t--){const a=Math.floor(Math.random()*(t+1)),n=e[t];r[t]=e[a],r[a]=n}return r}([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}e.apiClientVersion=P,e.searchClient=function(e,s,i){if(!e||"string"!=typeof e)throw new Error("`appId` is missing.");if(!s||"string"!=typeof s)throw new Error("`apiKey` is missing.");return function({appId:e,apiKey:t,authMode:a,algoliaAgents:n,...s}){const i=function(e,r,t="WithinHeaders"){const a={"x-algolia-api-key":r,"x-algolia-application-id":e};return{headers:()=>"WithinHeaders"===t?a:{},queryParameters:()=>"WithinQueryParameters"===t?a:{}}}(e,t,a),o=g({hosts:q(e),...s,algoliaAgent:y({algoliaAgents:n,client:"Search",version:P}),baseHeaders:{"content-type":"text/plain",...i.headers(),...s.baseHeaders},baseQueryParameters:{...i.queryParameters(),...s.baseQueryParameters}});return{transporter:o,appId:e,clearCache:()=>Promise.all([o.requestsCache.clear(),o.responsesCache.clear()]).then((()=>{})),get _ua(){return o.algoliaAgent.value},addAlgoliaAgent(e,r){o.algoliaAgent.add({segment:e,version:r})},waitForTask({indexName:e,taskID:t,maxRetries:a=50,timeout:n=(e=>Math.min(200*e,5e3))},s){let i=0;return r({func:()=>this.getTask({indexName:e,taskID:t},s),validate:e=>"published"===e.status,aggregator:()=>i+=1,error:{validate:()=>i>=a,message:()=>`The maximum number of retries exceeded. (${i}/${a})`},timeout:()=>n(i)})},waitForApiKey({operation:e,key:t,apiKey:a,maxRetries:n=50,timeout:s=(e=>Math.min(200*e,5e3))},i){let o=0;const c={aggregator:()=>o+=1,error:{validate:()=>o>=n,message:()=>`The maximum number of retries exceeded. (${o}/${n})`},timeout:()=>s(o)};if("update"===e){if(!a)throw new Error("`apiKey` is required when waiting for an `update` operation.");return r({...c,func:()=>this.getApiKey({key:t},i),validate:e=>{for(const r of Object.keys(a)){const t=a[r],n=e[r];if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length||t.some(((e,r)=>e!==n[r])))return!1}else if(t!==n)return!1}return!0}})}return r({...c,func:()=>this.getApiKey({key:t},i).catch((e=>e)),validate:r=>"add"===e?404!==r.status:404===r.status})},browseObjects({indexName:e,browseParams:t,...a},n){return r({func:r=>this.browse({indexName:e,browseParams:{cursor:r?r.cursor:void 0,...t}},n),validate:e=>void 0===e.cursor,...a})},browseRules({indexName:e,searchRulesParams:t,...a},n){const s={hitsPerPage:1e3,...t};return r({func:r=>this.searchRules({indexName:e,searchRulesParams:{...s,page:r?r.page+1:s.page||0}},n),validate:e=>e.nbHits<s.hitsPerPage,...a})},browseSynonyms({indexName:e,validate:t,aggregator:a,...n},s){const i={hitsPerPage:1e3,...n};return r({func:r=>this.searchSynonyms({...i,indexName:e,page:r?r.page+1:n.page||0},s),validate:e=>e.nbHits<i.hitsPerPage,...n})},addApiKey(e,r){if(!e)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!e.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");const t={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:e};return o.request(t,r)},addOrUpdateObject({indexName:e,objectID:r,body:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!t)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");const n={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t};return o.request(n,a)},appendSource(e,r){if(!e)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!e.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");const t={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:e};return o.request(t,r)},assignUserId({xAlgoliaUserID:e,assignUserIdParams:r},t){if(!e)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!r)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!r.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");const a={};void 0!==e&&(a["X-Algolia-User-ID"]=e.toString());const n={method:"POST",path:"/1/clusters/mapping",queryParameters:{},headers:a,data:r};return o.request(n,t)},batch({indexName:e,batchWriteParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!r)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!r.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");const a={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},batchAssignUserIds({xAlgoliaUserID:e,batchAssignUserIdsParams:r},t){if(!e)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!r)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!r.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!r.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");const a={};void 0!==e&&(a["X-Algolia-User-ID"]=e.toString());const n={method:"POST",path:"/1/clusters/mapping/batch",queryParameters:{},headers:a,data:r};return o.request(n,t)},batchDictionaryEntries({dictionaryName:e,batchDictionaryEntriesParams:r},t){if(!e)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!r)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!r.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");const a={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},browse({indexName:e,browseParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `browse`.");const a={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{}};return o.request(a,t)},clearAllSynonyms({indexName:e,forwardToReplicas:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `clearAllSynonyms`.");const a="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(e)),n={};void 0!==r&&(n.forwardToReplicas=r.toString());const s={method:"POST",path:a,queryParameters:n,headers:{}};return o.request(s,t)},clearObjects({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");const t={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},clearRules({indexName:e,forwardToReplicas:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `clearRules`.");const a="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(e)),n={};void 0!==r&&(n.forwardToReplicas=r.toString());const s={method:"POST",path:a,queryParameters:n,headers:{}};return o.request(s,t)},del({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `del`.");const a={method:"DELETE",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},deleteApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");const t={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteBy({indexName:e,deleteByParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!r)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");const a={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},deleteIndex({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");const t={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteObject({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");const a={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},deleteRule({indexName:e,objectID:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");const n="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const i={method:"DELETE",path:n,queryParameters:s,headers:{}};return o.request(i,a)},deleteSource({source:e},r){if(!e)throw new Error("Parameter `source` is required when calling `deleteSource`.");const t={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},deleteSynonym({indexName:e,objectID:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");const n="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const i={method:"DELETE",path:n,queryParameters:s,headers:{}};return o.request(i,a)},get({path:e,parameters:r},t){if(!e)throw new Error("Parameter `path` is required when calling `get`.");const a={method:"GET",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{}};return o.request(a,t)},getApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `getApiKey`.");const t={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getDictionaryLanguages(e){const r={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return o.request(r,e)},getDictionarySettings(e){const r={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return o.request(r,e)},getLogs({offset:e,length:r,indexName:t,type:a}={},n=undefined){const s={};void 0!==e&&(s.offset=e.toString()),void 0!==r&&(s.length=r.toString()),void 0!==t&&(s.indexName=t.toString()),void 0!==a&&(s.type=a.toString());const i={method:"GET",path:"/1/logs",queryParameters:s,headers:{}};return o.request(i,n)},getObject({indexName:e,objectID:r,attributesToRetrieve:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getObject`.");const n="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),s={};void 0!==t&&(s.attributesToRetrieve=t.toString());const i={method:"GET",path:n,queryParameters:s,headers:{}};return o.request(i,a)},getObjects(e,r){if(!e)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!e.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");const t={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(t,r)},getRule({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRule`.");const a={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},getSettings({indexName:e},r){if(!e)throw new Error("Parameter `indexName` is required when calling `getSettings`.");const t={method:"GET",path:"/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},getSources(e){const r={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return o.request(r,e)},getSynonym({indexName:e,objectID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");const a={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},getTask({indexName:e,taskID:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getTask`.");const a={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(e)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return o.request(a,t)},getTopUserIds(e){const r={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return o.request(r,e)},getUserId({userID:e},r){if(!e)throw new Error("Parameter `userID` is required when calling `getUserId`.");const t={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},hasPendingMappings({getClusters:e}={},r=undefined){const t={};void 0!==e&&(t.getClusters=e.toString());const a={method:"GET",path:"/1/clusters/mapping/pending",queryParameters:t,headers:{}};return o.request(a,r)},listApiKeys(e){const r={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return o.request(r,e)},listClusters(e){const r={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return o.request(r,e)},listIndices({page:e}={},r=undefined){const t={};void 0!==e&&(t.page=e.toString());const a={method:"GET",path:"/1/indexes",queryParameters:t,headers:{}};return o.request(a,r)},listUserIds({page:e,hitsPerPage:r}={},t=undefined){const a={};void 0!==e&&(a.page=e.toString()),void 0!==r&&(a.hitsPerPage=r.toString());const n={method:"GET",path:"/1/clusters/mapping",queryParameters:a,headers:{}};return o.request(n,t)},multipleBatch(e,r){if(!e)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!e.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");const t={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:e};return o.request(t,r)},operationIndex({indexName:e,operationIndexParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!r)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!r.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!r.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");const a={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},partialUpdateObject({indexName:e,objectID:r,attributesToUpdate:t,createIfNotExists:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!t)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");const s="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),i={};void 0!==a&&(i.createIfNotExists=a.toString());const c={method:"POST",path:s,queryParameters:i,headers:{},data:t};return o.request(c,n)},post({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `post`.");const n={method:"POST",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},put({path:e,parameters:r,body:t},a){if(!e)throw new Error("Parameter `path` is required when calling `put`.");const n={method:"PUT",path:"/1{path}".replace("{path}",e),queryParameters:r||{},headers:{},data:t||{}};return o.request(n,a)},removeUserId({userID:e},r){if(!e)throw new Error("Parameter `userID` is required when calling `removeUserId`.");const t={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},replaceSources({source:e},r){if(!e)throw new Error("Parameter `source` is required when calling `replaceSources`.");const t={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:e};return o.request(t,r)},restoreApiKey({key:e},r){if(!e)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");const t={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{}};return o.request(t,r)},saveObject({indexName:e,body:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!r)throw new Error("Parameter `body` is required when calling `saveObject`.");const a={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)},saveRule({indexName:e,objectID:r,rule:t,forwardToReplicas:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!t)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!t.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");const s="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),i={};void 0!==a&&(i.forwardToReplicas=a.toString());const c={method:"PUT",path:s,queryParameters:i,headers:{},data:t};return o.request(c,n)},saveRules({indexName:e,rules:r,forwardToReplicas:t,clearExistingRules:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!r)throw new Error("Parameter `rules` is required when calling `saveRules`.");const s="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(e)),i={};void 0!==t&&(i.forwardToReplicas=t.toString()),void 0!==a&&(i.clearExistingRules=a.toString());const c={method:"POST",path:s,queryParameters:i,headers:{},data:r};return o.request(c,n)},saveSynonym({indexName:e,objectID:r,synonymHit:t,forwardToReplicas:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!t)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!t.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!t.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");const s="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(e)).replace("{objectID}",encodeURIComponent(r)),i={};void 0!==a&&(i.forwardToReplicas=a.toString());const c={method:"PUT",path:s,queryParameters:i,headers:{},data:t};return o.request(c,n)},saveSynonyms({indexName:e,synonymHit:r,forwardToReplicas:t,replaceExistingSynonyms:a},n){if(!e)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!r)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");const s="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(e)),i={};void 0!==t&&(i.forwardToReplicas=t.toString()),void 0!==a&&(i.replaceExistingSynonyms=a.toString());const c={method:"POST",path:s,queryParameters:i,headers:{},data:r};return o.request(c,n)},search(e,r){if(e&&Array.isArray(e)){const r={requests:e.map((({params:e,...r})=>"facet"===r.type?{...r,...e,type:"facet"}:{...r,...e,facet:void 0,maxFacetHits:void 0,facetQuery:void 0}))};e=r}if(!e)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!e.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");const t={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(t,r)},searchDictionaryEntries({dictionaryName:e,searchDictionaryEntriesParams:r},t){if(!e)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!r)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!r.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");const a={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return o.request(a,t)},searchForFacetValues({indexName:e,facetName:r,searchForFacetValuesRequest:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!r)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");const n={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(e)).replace("{facetName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:t||{},useReadTransporter:!0,cacheable:!0};return o.request(n,a)},searchRules({indexName:e,searchRulesParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `searchRules`.");const a={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return o.request(a,t)},searchSingleIndex({indexName:e,searchParams:r},t){if(!e)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");const a={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return o.request(a,t)},searchSynonyms({indexName:e,type:r,page:t,hitsPerPage:a,searchSynonymsParams:n},s){if(!e)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");const i="/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(e)),c={};void 0!==r&&(c.type=r.toString()),void 0!==t&&(c.page=t.toString()),void 0!==a&&(c.hitsPerPage=a.toString());const d={method:"POST",path:i,queryParameters:c,headers:{},data:n||{},useReadTransporter:!0,cacheable:!0};return o.request(d,s)},searchUserIds(e,r){if(!e)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!e.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");const t={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:e,useReadTransporter:!0,cacheable:!0};return o.request(t,r)},setDictionarySettings(e,r){if(!e)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!e.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");const t={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:e};return o.request(t,r)},setSettings({indexName:e,indexSettings:r,forwardToReplicas:t},a){if(!e)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!r)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");const n="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(e)),s={};void 0!==t&&(s.forwardToReplicas=t.toString());const i={method:"PUT",path:n,queryParameters:s,headers:{},data:r};return o.request(i,a)},updateApiKey({key:e,apiKey:r},t){if(!e)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!r)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!r.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");const a={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(e)),queryParameters:{},headers:{},data:r};return o.request(a,t)}}}({appId:e,apiKey:s,timeouts:{connect:1e3,read:2e3,write:3e4},requester:{send:function(e){return new Promise((r=>{const t=new XMLHttpRequest;t.open(e.method,e.url,!0),Object.keys(e.headers).forEach((r=>t.setRequestHeader(r,e.headers[r])));const a=(e,a)=>setTimeout((()=>{t.abort(),r({status:0,content:a,isTimedOut:!0})}),e),n=a(e.connectTimeout,"Connection timeout");let s;t.onreadystatechange=()=>{t.readyState>t.OPENED&&void 0===s&&(clearTimeout(n),s=a(e.responseTimeout,"Socket timeout"))},t.onerror=()=>{0===t.status&&(clearTimeout(n),clearTimeout(s),r({content:t.responseText||"Network request failed",status:t.status,isTimedOut:!1}))},t.onload=()=>{clearTimeout(n),clearTimeout(s),r({content:t.responseText,status:t.status,isTimedOut:!1})},t.send(e.data)}))}},algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:n(),requestsCache:n({serializable:!1}),hostsCache:a({caches:[t({key:`${P}-${e}`}),n()]}),...i})}}));
|
package/dist/model/acl.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List of rights for the API key. The following rights can be used: addObject: allows to add/update an object in the index (copy/move index are also allowed with this right). Analytics: allows to retrieve the analytics through the Analytics API. Browse: allows to retrieve all index content via the browse API. DeleteIndex: allows to delete or clear index content. DeleteObject: allows to delete objects from the index. EditSettings: allows to change index settings. ListIndexes: allows to list all accessible indices. Logs: allows to get the logs. Recommendation: Allows usage of the Personalization dashboard and the Recommendation API. Search: allows to search the index. SeeUnretrievableAttributes: disable unretrievableAttributes feature for all operations returning records. Settings: allows to get index settings.
|
|
3
|
-
*/
|
|
4
|
-
export type Acl = 'addObject' | 'analytics' | 'browse' | 'deleteIndex' | 'deleteObject' | 'editSettings' | 'listIndexes' | 'logs' | 'personalization' | 'recommendation' | 'search' | 'seeUnretrievableAttributes' | 'settings' | 'usage';
|
|
1
|
+
/**
|
|
2
|
+
* List of rights for the API key. The following rights can be used: addObject: allows to add/update an object in the index (copy/move index are also allowed with this right). Analytics: allows to retrieve the analytics through the Analytics API. Browse: allows to retrieve all index content via the browse API. DeleteIndex: allows to delete or clear index content. DeleteObject: allows to delete objects from the index. EditSettings: allows to change index settings. ListIndexes: allows to list all accessible indices. Logs: allows to get the logs. Recommendation: Allows usage of the Personalization dashboard and the Recommendation API. Search: allows to search the index. SeeUnretrievableAttributes: disable unretrievableAttributes feature for all operations returning records. Settings: allows to get index settings.
|
|
3
|
+
*/
|
|
4
|
+
export type Acl = 'addObject' | 'analytics' | 'browse' | 'deleteIndex' | 'deleteObject' | 'editSettings' | 'listIndexes' | 'logs' | 'personalization' | 'recommendation' | 'search' | 'seeUnretrievableAttributes' | 'settings' | 'usage';
|
|
5
5
|
//# sourceMappingURL=acl.d.ts.map
|
package/dist/model/action.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type of operation.
|
|
3
|
-
*/
|
|
4
|
-
export type Action = 'addObject' | 'clear' | 'delete' | 'deleteObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'updateObject';
|
|
1
|
+
/**
|
|
2
|
+
* Type of operation.
|
|
3
|
+
*/
|
|
4
|
+
export type Action = 'addObject' | 'clear' | 'delete' | 'deleteObject' | 'partialUpdateObject' | 'partialUpdateObjectNoCreate' | 'updateObject';
|
|
5
5
|
//# sourceMappingURL=action.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export type AddApiKeyResponse = {
|
|
2
|
-
/**
|
|
3
|
-
* The API key.
|
|
4
|
-
*/
|
|
5
|
-
key: string;
|
|
6
|
-
/**
|
|
7
|
-
* Date of creation (ISO-8601 format).
|
|
8
|
-
*/
|
|
9
|
-
createdAt: string;
|
|
10
|
-
};
|
|
1
|
+
export type AddApiKeyResponse = {
|
|
2
|
+
/**
|
|
3
|
+
* The API key.
|
|
4
|
+
*/
|
|
5
|
+
key: string;
|
|
6
|
+
/**
|
|
7
|
+
* Date of creation (ISO-8601 format).
|
|
8
|
+
*/
|
|
9
|
+
createdAt: string;
|
|
10
|
+
};
|
|
11
11
|
//# sourceMappingURL=addApiKeyResponse.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
|
|
1
|
+
export type AdvancedSyntaxFeatures = 'exactPhrase' | 'excludeWords';
|
|
2
2
|
//# sourceMappingURL=advancedSyntaxFeatures.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type AlternativesAsExact = 'ignorePlurals' | 'multiWordsSynonym' | 'singleWordSynonym';
|
|
1
|
+
export type AlternativesAsExact = 'ignorePlurals' | 'multiWordsSynonym' | 'singleWordSynonym';
|
|
2
2
|
//# sourceMappingURL=alternativesAsExact.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Whether the pattern parameter must match the beginning or the end of the query string, or both, or none.
|
|
3
|
-
*/
|
|
4
|
-
export type Anchoring = 'contains' | 'endsWith' | 'is' | 'startsWith';
|
|
1
|
+
/**
|
|
2
|
+
* Whether the pattern parameter must match the beginning or the end of the query string, or both, or none.
|
|
3
|
+
*/
|
|
4
|
+
export type Anchoring = 'contains' | 'endsWith' | 'is' | 'startsWith';
|
|
5
5
|
//# sourceMappingURL=anchoring.d.ts.map
|
package/dist/model/apiKey.d.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import type { Acl } from './acl';
|
|
2
|
-
/**
|
|
3
|
-
* Api Key object.
|
|
4
|
-
*/
|
|
5
|
-
export type ApiKey = {
|
|
6
|
-
/**
|
|
7
|
-
* Set of permissions associated with the key.
|
|
8
|
-
*/
|
|
9
|
-
acl: Acl[];
|
|
10
|
-
/**
|
|
11
|
-
* A comment used to identify a key more easily in the dashboard. It is not interpreted by the API.
|
|
12
|
-
*/
|
|
13
|
-
description?: string;
|
|
14
|
-
/**
|
|
15
|
-
* Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed.
|
|
16
|
-
*/
|
|
17
|
-
indexes?: string[];
|
|
18
|
-
/**
|
|
19
|
-
* Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced.
|
|
20
|
-
*/
|
|
21
|
-
maxHitsPerQuery?: number;
|
|
22
|
-
/**
|
|
23
|
-
* Maximum number of API calls per hour allowed from a given IP address or a user token.
|
|
24
|
-
*/
|
|
25
|
-
maxQueriesPerIPPerHour?: number;
|
|
26
|
-
/**
|
|
27
|
-
* URL-encoded query string. Force some query parameters to be applied for each query made with this API key.
|
|
28
|
-
*/
|
|
29
|
-
queryParameters?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Restrict this new API key to specific referers. If empty or blank, defaults to all referers.
|
|
32
|
-
*/
|
|
33
|
-
referers?: string[];
|
|
34
|
-
/**
|
|
35
|
-
* Validity limit for this key in seconds. The key will automatically be removed after this period of time.
|
|
36
|
-
*/
|
|
37
|
-
validity?: number;
|
|
38
|
-
};
|
|
1
|
+
import type { Acl } from './acl';
|
|
2
|
+
/**
|
|
3
|
+
* Api Key object.
|
|
4
|
+
*/
|
|
5
|
+
export type ApiKey = {
|
|
6
|
+
/**
|
|
7
|
+
* Set of permissions associated with the key.
|
|
8
|
+
*/
|
|
9
|
+
acl: Acl[];
|
|
10
|
+
/**
|
|
11
|
+
* A comment used to identify a key more easily in the dashboard. It is not interpreted by the API.
|
|
12
|
+
*/
|
|
13
|
+
description?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed.
|
|
16
|
+
*/
|
|
17
|
+
indexes?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced.
|
|
20
|
+
*/
|
|
21
|
+
maxHitsPerQuery?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Maximum number of API calls per hour allowed from a given IP address or a user token.
|
|
24
|
+
*/
|
|
25
|
+
maxQueriesPerIPPerHour?: number;
|
|
26
|
+
/**
|
|
27
|
+
* URL-encoded query string. Force some query parameters to be applied for each query made with this API key.
|
|
28
|
+
*/
|
|
29
|
+
queryParameters?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Restrict this new API key to specific referers. If empty or blank, defaults to all referers.
|
|
32
|
+
*/
|
|
33
|
+
referers?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* Validity limit for this key in seconds. The key will automatically be removed after this period of time.
|
|
36
|
+
*/
|
|
37
|
+
validity?: number;
|
|
38
|
+
};
|
|
39
39
|
//# sourceMappingURL=apiKey.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AroundRadiusAll } from './aroundRadiusAll';
|
|
2
|
-
/**
|
|
3
|
-
* Define the maximum radius for a geo search (in meters).
|
|
4
|
-
*/
|
|
5
|
-
export type AroundRadius = AroundRadiusAll | number;
|
|
1
|
+
import type { AroundRadiusAll } from './aroundRadiusAll';
|
|
2
|
+
/**
|
|
3
|
+
* Define the maximum radius for a geo search (in meters).
|
|
4
|
+
*/
|
|
5
|
+
export type AroundRadius = AroundRadiusAll | number;
|
|
6
6
|
//# sourceMappingURL=aroundRadius.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type AroundRadiusAll = 'all';
|
|
1
|
+
export type AroundRadiusAll = 'all';
|
|
2
2
|
//# sourceMappingURL=aroundRadiusAll.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Assign userID parameters.
|
|
3
|
-
*/
|
|
4
|
-
export type AssignUserIdParams = {
|
|
5
|
-
/**
|
|
6
|
-
* Name of the cluster.
|
|
7
|
-
*/
|
|
8
|
-
cluster: string;
|
|
9
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Assign userID parameters.
|
|
3
|
+
*/
|
|
4
|
+
export type AssignUserIdParams = {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the cluster.
|
|
7
|
+
*/
|
|
8
|
+
cluster: string;
|
|
9
|
+
};
|
|
10
10
|
//# sourceMappingURL=assignUserIdParams.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BuiltInOperation } from './builtInOperation';
|
|
2
|
-
export type AttributeToUpdate = BuiltInOperation | string;
|
|
1
|
+
import type { BuiltInOperation } from './builtInOperation';
|
|
2
|
+
export type AttributeToUpdate = BuiltInOperation | string;
|
|
3
3
|
//# sourceMappingURL=attributeToUpdate.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Automatic facet Filter.
|
|
3
|
-
*/
|
|
4
|
-
export type AutomaticFacetFilter = {
|
|
5
|
-
/**
|
|
6
|
-
* Attribute to filter on. This must match a facet placeholder in the Rule\'s pattern.
|
|
7
|
-
*/
|
|
8
|
-
facet: string;
|
|
9
|
-
/**
|
|
10
|
-
* Score for the filter. Typically used for optional or disjunctive filters.
|
|
11
|
-
*/
|
|
12
|
-
score?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the filter is disjunctive (true) or conjunctive (false).
|
|
15
|
-
*/
|
|
16
|
-
disjunctive?: boolean;
|
|
17
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* Automatic facet Filter.
|
|
3
|
+
*/
|
|
4
|
+
export type AutomaticFacetFilter = {
|
|
5
|
+
/**
|
|
6
|
+
* Attribute to filter on. This must match a facet placeholder in the Rule\'s pattern.
|
|
7
|
+
*/
|
|
8
|
+
facet: string;
|
|
9
|
+
/**
|
|
10
|
+
* Score for the filter. Typically used for optional or disjunctive filters.
|
|
11
|
+
*/
|
|
12
|
+
score?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the filter is disjunctive (true) or conjunctive (false).
|
|
15
|
+
*/
|
|
16
|
+
disjunctive?: boolean;
|
|
17
|
+
};
|
|
18
18
|
//# sourceMappingURL=automaticFacetFilter.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AutomaticFacetFilter } from './automaticFacetFilter';
|
|
2
|
-
/**
|
|
3
|
-
* Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
|
|
4
|
-
*/
|
|
5
|
-
export type AutomaticFacetFilters = AutomaticFacetFilter[] | string[];
|
|
1
|
+
import type { AutomaticFacetFilter } from './automaticFacetFilter';
|
|
2
|
+
/**
|
|
3
|
+
* Names of facets to which automatic filtering must be applied; they must match the facet name of a facet value placeholder in the query pattern.
|
|
4
|
+
*/
|
|
5
|
+
export type AutomaticFacetFilters = AutomaticFacetFilter[] | string[];
|
|
6
6
|
//# sourceMappingURL=automaticFacetFilters.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export type BaseGetApiKeyResponse = {
|
|
2
|
-
/**
|
|
3
|
-
* The API key.
|
|
4
|
-
*/
|
|
5
|
-
value?: string;
|
|
6
|
-
/**
|
|
7
|
-
* Time of the event expressed in milliseconds since the Unix epoch.
|
|
8
|
-
*/
|
|
9
|
-
createdAt: number;
|
|
10
|
-
};
|
|
1
|
+
export type BaseGetApiKeyResponse = {
|
|
2
|
+
/**
|
|
3
|
+
* The API key.
|
|
4
|
+
*/
|
|
5
|
+
value?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Time of the event expressed in milliseconds since the Unix epoch.
|
|
8
|
+
*/
|
|
9
|
+
createdAt: number;
|
|
10
|
+
};
|
|
11
11
|
//# sourceMappingURL=baseGetApiKeyResponse.d.ts.map
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
export type BaseIndexSettings = {
|
|
2
|
-
/**
|
|
3
|
-
* Creates replicas, exact copies of an index.
|
|
4
|
-
*/
|
|
5
|
-
replicas?: string[];
|
|
6
|
-
/**
|
|
7
|
-
* Set the maximum number of hits accessible via pagination.
|
|
8
|
-
*/
|
|
9
|
-
paginationLimitedTo?: number;
|
|
10
|
-
/**
|
|
11
|
-
* List of attributes that can\'t be retrieved at query time.
|
|
12
|
-
*/
|
|
13
|
-
unretrievableAttributes?: string[];
|
|
14
|
-
/**
|
|
15
|
-
* A list of words for which you want to turn off typo tolerance.
|
|
16
|
-
*/
|
|
17
|
-
disableTypoToleranceOnWords?: string[];
|
|
18
|
-
/**
|
|
19
|
-
* Specify on which attributes in your index Algolia should apply Japanese transliteration to make words indexed in Katakana or Kanji searchable in Hiragana.
|
|
20
|
-
*/
|
|
21
|
-
attributesToTransliterate?: string[];
|
|
22
|
-
/**
|
|
23
|
-
* List of attributes on which to do a decomposition of camel case words.
|
|
24
|
-
*/
|
|
25
|
-
camelCaseAttributes?: string[];
|
|
26
|
-
/**
|
|
27
|
-
* Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding.
|
|
28
|
-
*/
|
|
29
|
-
decompoundedAttributes?: Record<string, any>;
|
|
30
|
-
/**
|
|
31
|
-
* Sets the languages at the index level for language-specific processing such as tokenization and normalization.
|
|
32
|
-
*/
|
|
33
|
-
indexLanguages?: string[];
|
|
34
|
-
/**
|
|
35
|
-
* List of attributes on which you want to disable prefix matching.
|
|
36
|
-
*/
|
|
37
|
-
disablePrefixOnAttributes?: string[];
|
|
38
|
-
/**
|
|
39
|
-
* Enables compression of large integer arrays.
|
|
40
|
-
*/
|
|
41
|
-
allowCompressionOfIntegerArray?: boolean;
|
|
42
|
-
/**
|
|
43
|
-
* List of numeric attributes that can be used as numerical filters.
|
|
44
|
-
*/
|
|
45
|
-
numericAttributesForFiltering?: string[];
|
|
46
|
-
/**
|
|
47
|
-
* Control which separators are indexed.
|
|
48
|
-
*/
|
|
49
|
-
separatorsToIndex?: string;
|
|
50
|
-
/**
|
|
51
|
-
* The complete list of attributes used for searching.
|
|
52
|
-
*/
|
|
53
|
-
searchableAttributes?: string[];
|
|
54
|
-
/**
|
|
55
|
-
* Lets you store custom data in your indices.
|
|
56
|
-
*/
|
|
57
|
-
userData?: Record<string, any>;
|
|
58
|
-
/**
|
|
59
|
-
* Overrides Algolia\'s default normalization.
|
|
60
|
-
*/
|
|
61
|
-
customNormalization?: Record<string, Record<string, string>>;
|
|
62
|
-
};
|
|
1
|
+
export type BaseIndexSettings = {
|
|
2
|
+
/**
|
|
3
|
+
* Creates replicas, exact copies of an index.
|
|
4
|
+
*/
|
|
5
|
+
replicas?: string[];
|
|
6
|
+
/**
|
|
7
|
+
* Set the maximum number of hits accessible via pagination.
|
|
8
|
+
*/
|
|
9
|
+
paginationLimitedTo?: number;
|
|
10
|
+
/**
|
|
11
|
+
* List of attributes that can\'t be retrieved at query time.
|
|
12
|
+
*/
|
|
13
|
+
unretrievableAttributes?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* A list of words for which you want to turn off typo tolerance.
|
|
16
|
+
*/
|
|
17
|
+
disableTypoToleranceOnWords?: string[];
|
|
18
|
+
/**
|
|
19
|
+
* Specify on which attributes in your index Algolia should apply Japanese transliteration to make words indexed in Katakana or Kanji searchable in Hiragana.
|
|
20
|
+
*/
|
|
21
|
+
attributesToTransliterate?: string[];
|
|
22
|
+
/**
|
|
23
|
+
* List of attributes on which to do a decomposition of camel case words.
|
|
24
|
+
*/
|
|
25
|
+
camelCaseAttributes?: string[];
|
|
26
|
+
/**
|
|
27
|
+
* Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding.
|
|
28
|
+
*/
|
|
29
|
+
decompoundedAttributes?: Record<string, any>;
|
|
30
|
+
/**
|
|
31
|
+
* Sets the languages at the index level for language-specific processing such as tokenization and normalization.
|
|
32
|
+
*/
|
|
33
|
+
indexLanguages?: string[];
|
|
34
|
+
/**
|
|
35
|
+
* List of attributes on which you want to disable prefix matching.
|
|
36
|
+
*/
|
|
37
|
+
disablePrefixOnAttributes?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Enables compression of large integer arrays.
|
|
40
|
+
*/
|
|
41
|
+
allowCompressionOfIntegerArray?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* List of numeric attributes that can be used as numerical filters.
|
|
44
|
+
*/
|
|
45
|
+
numericAttributesForFiltering?: string[];
|
|
46
|
+
/**
|
|
47
|
+
* Control which separators are indexed.
|
|
48
|
+
*/
|
|
49
|
+
separatorsToIndex?: string;
|
|
50
|
+
/**
|
|
51
|
+
* The complete list of attributes used for searching.
|
|
52
|
+
*/
|
|
53
|
+
searchableAttributes?: string[];
|
|
54
|
+
/**
|
|
55
|
+
* Lets you store custom data in your indices.
|
|
56
|
+
*/
|
|
57
|
+
userData?: Record<string, any>;
|
|
58
|
+
/**
|
|
59
|
+
* Overrides Algolia\'s default normalization.
|
|
60
|
+
*/
|
|
61
|
+
customNormalization?: Record<string, Record<string, string>>;
|
|
62
|
+
};
|
|
63
63
|
//# sourceMappingURL=baseIndexSettings.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseSearchParamsWithoutQuery } from './baseSearchParamsWithoutQuery';
|
|
2
|
-
import type { SearchParamsQuery } from './searchParamsQuery';
|
|
3
|
-
export type BaseSearchParams = BaseSearchParamsWithoutQuery & SearchParamsQuery;
|
|
1
|
+
import type { BaseSearchParamsWithoutQuery } from './baseSearchParamsWithoutQuery';
|
|
2
|
+
import type { SearchParamsQuery } from './searchParamsQuery';
|
|
3
|
+
export type BaseSearchParams = BaseSearchParamsWithoutQuery & SearchParamsQuery;
|
|
4
4
|
//# sourceMappingURL=baseSearchParams.d.ts.map
|