algoliasearch 5.0.0-alpha.1 → 5.0.0-alpha.4
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/builds/browser.ts +13 -10
- package/builds/models.ts +12 -6
- package/builds/node.ts +13 -10
- package/dist/algoliasearch/builds/browser.d.ts +23 -14
- package/dist/algoliasearch/builds/browser.d.ts.map +1 -1
- package/dist/algoliasearch/builds/node.d.ts +23 -14
- package/dist/algoliasearch/builds/node.d.ts.map +1 -1
- package/dist/algoliasearch/lite/builds/browser.d.ts +2 -2
- package/dist/algoliasearch/lite/builds/browser.d.ts.map +1 -1
- package/dist/algoliasearch/lite/builds/node.d.ts +2 -2
- package/dist/algoliasearch/lite/builds/node.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/acl.d.ts +3 -0
- package/dist/algoliasearch/lite/model/acl.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/addApiKeyResponse.d.ts +1 -1
- package/dist/algoliasearch/lite/model/addApiKeyResponse.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/apiKey.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/attributeToUpdate.d.ts +3 -0
- package/dist/algoliasearch/lite/model/attributeToUpdate.d.ts.map +1 -0
- package/dist/algoliasearch/lite/model/automaticFacetFilter.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/baseGetApiKeyResponse.d.ts +11 -0
- package/dist/algoliasearch/lite/model/baseGetApiKeyResponse.d.ts.map +1 -0
- package/dist/algoliasearch/lite/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/baseSearchResponse.d.ts +2 -2
- package/dist/algoliasearch/lite/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/browseResponse.d.ts +1 -1
- package/dist/algoliasearch/lite/model/browseResponse.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/builtInOperation.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/condition.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/consequence.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/consequenceQueryObject.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/dictionaryEntry.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/distinct.d.ts +5 -0
- package/dist/algoliasearch/lite/model/distinct.d.ts.map +1 -0
- package/dist/algoliasearch/lite/model/edit.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/facetOrdering.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/facetsStats.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/fetchedIndex.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/getApiKeyResponse.d.ts +4 -0
- package/dist/algoliasearch/lite/model/getApiKeyResponse.d.ts.map +1 -0
- package/dist/algoliasearch/lite/model/highlightResultOption.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/hit.d.ts +1 -1
- package/dist/algoliasearch/lite/model/hit.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/index.d.ts +4 -3
- package/dist/algoliasearch/lite/model/index.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/indexSettingsAsSearchParams.d.ts +2 -4
- package/dist/algoliasearch/lite/model/indexSettingsAsSearchParams.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/languages.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/listIndicesResponse.d.ts +1 -1
- package/dist/algoliasearch/lite/model/listIndicesResponse.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/matchedGeoLocation.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/params.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/personalization.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/promoteObjectID.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/promoteObjectIDs.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/rankingInfo.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/rule.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/searchForFacetsOptions.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/searchForHitsOptions.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/searchHits.d.ts +2 -2
- package/dist/algoliasearch/lite/model/searchHits.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/searchMethodParams.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/searchResponse.d.ts +1 -1
- package/dist/algoliasearch/lite/model/searchResponse.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/searchResponses.d.ts +1 -1
- package/dist/algoliasearch/lite/model/searchResponses.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/searchSynonymsResponse.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/snippetResultOption.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/source.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/standardEntries.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/synonymHit.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/synonymHitHighlightResult.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/timeRange.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/updatedRuleResponse.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/userId.d.ts.map +1 -1
- package/dist/algoliasearch/lite/model/value.d.ts.map +1 -1
- package/dist/algoliasearch/lite/src/liteClient.d.ts +12 -1
- package/dist/algoliasearch/lite/src/liteClient.d.ts.map +1 -1
- package/dist/algoliasearch.cjs.js +186 -28
- package/dist/algoliasearch.esm.browser.js +214 -56
- package/dist/algoliasearch.esm.node.js +187 -29
- package/dist/algoliasearch.umd.js +2 -2
- package/dist/builds/browser.d.ts +23 -14
- package/dist/builds/browser.d.ts.map +1 -1
- package/dist/builds/models.d.ts +11 -8
- package/dist/builds/models.d.ts.map +1 -1
- package/dist/builds/node.d.ts +23 -14
- package/dist/builds/node.d.ts.map +1 -1
- package/dist/client-abtesting/model/aBTest.d.ts.map +1 -1
- package/dist/client-abtesting/model/aBTestResponse.d.ts.map +1 -1
- package/dist/client-abtesting/model/abTestsVariant.d.ts.map +1 -1
- package/dist/client-abtesting/model/addABTestsRequest.d.ts.map +1 -1
- package/dist/client-abtesting/model/listABTestsResponse.d.ts.map +1 -1
- package/dist/client-abtesting/model/variant.d.ts.map +1 -1
- package/dist/client-abtesting/src/abtestingClient.d.ts +12 -1
- package/dist/client-abtesting/src/abtestingClient.d.ts.map +1 -1
- package/dist/client-analytics/model/averageClickEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/clickPosition.d.ts.map +1 -1
- package/dist/client-analytics/model/clickThroughRateEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/conversionRateEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/getAverageClickPositionResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/getClickThroughRateResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/getConversationRateResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/getNoClickRateResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/getNoResultsRateResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/getSearchesCountResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/getTopFilterAttribute.d.ts.map +1 -1
- package/dist/client-analytics/model/getTopFilterForAttribute.d.ts.map +1 -1
- package/dist/client-analytics/model/getTopFiltersNoResultsValue.d.ts.map +1 -1
- package/dist/client-analytics/model/getTopFiltersNoResultsValues.d.ts.map +1 -1
- package/dist/client-analytics/model/getUsersCountResponse.d.ts.map +1 -1
- package/dist/client-analytics/model/noClickRateEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/noResultsRateEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/searchEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/searchNoClickEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/searchNoResultEvent.d.ts.map +1 -1
- package/dist/client-analytics/model/topCountry.d.ts.map +1 -1
- package/dist/client-analytics/model/topHit.d.ts.map +1 -1
- package/dist/client-analytics/model/topHitWithAnalytics.d.ts.map +1 -1
- package/dist/client-analytics/model/topSearch.d.ts.map +1 -1
- package/dist/client-analytics/model/topSearchWithAnalytics.d.ts.map +1 -1
- package/dist/client-analytics/model/userWithDate.d.ts.map +1 -1
- package/dist/client-analytics/src/analyticsClient.d.ts +12 -1
- package/dist/client-analytics/src/analyticsClient.d.ts.map +1 -1
- package/dist/client-personalization/model/deleteUserProfileResponse.d.ts.map +1 -1
- package/dist/client-personalization/model/eventScoring.d.ts.map +1 -1
- package/dist/client-personalization/model/facetScoring.d.ts.map +1 -1
- package/dist/client-personalization/model/getUserTokenResponse.d.ts.map +1 -1
- package/dist/client-personalization/model/personalizationStrategyParams.d.ts.map +1 -1
- package/dist/client-personalization/src/personalizationClient.d.ts +12 -1
- package/dist/client-personalization/src/personalizationClient.d.ts.map +1 -1
- package/dist/client-search/model/acl.d.ts +3 -0
- package/dist/client-search/model/acl.d.ts.map +1 -1
- package/dist/client-search/model/addApiKeyResponse.d.ts +1 -1
- package/dist/client-search/model/addApiKeyResponse.d.ts.map +1 -1
- package/dist/client-search/model/apiKey.d.ts.map +1 -1
- package/dist/client-search/model/attributeToUpdate.d.ts +3 -0
- package/dist/client-search/model/attributeToUpdate.d.ts.map +1 -0
- package/dist/client-search/model/automaticFacetFilter.d.ts.map +1 -1
- package/dist/client-search/model/baseGetApiKeyResponse.d.ts +11 -0
- package/dist/client-search/model/baseGetApiKeyResponse.d.ts.map +1 -0
- package/dist/client-search/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/client-search/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/client-search/model/baseSearchResponse.d.ts +2 -2
- package/dist/client-search/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/client-search/model/batchAssignUserIdsParams.d.ts.map +1 -1
- package/dist/client-search/model/batchDictionaryEntriesParams.d.ts.map +1 -1
- package/dist/client-search/model/batchDictionaryEntriesRequest.d.ts.map +1 -1
- package/dist/client-search/model/batchParams.d.ts +2 -2
- package/dist/client-search/model/batchParams.d.ts.map +1 -1
- package/dist/client-search/model/{batchOperation.d.ts → batchRequest.d.ts} +2 -2
- package/dist/client-search/model/batchRequest.d.ts.map +1 -0
- package/dist/client-search/model/batchResponse.d.ts.map +1 -1
- package/dist/client-search/model/batchWriteParams.d.ts +2 -2
- package/dist/client-search/model/batchWriteParams.d.ts.map +1 -1
- package/dist/client-search/model/browseRequest.d.ts.map +1 -1
- package/dist/client-search/model/browseResponse.d.ts +1 -1
- package/dist/client-search/model/browseResponse.d.ts.map +1 -1
- package/dist/client-search/model/builtInOperation.d.ts.map +1 -1
- package/dist/client-search/model/clientMethodProps.d.ts +21 -8
- package/dist/client-search/model/clientMethodProps.d.ts.map +1 -1
- package/dist/client-search/model/condition.d.ts.map +1 -1
- package/dist/client-search/model/consequence.d.ts.map +1 -1
- package/dist/client-search/model/consequenceQueryObject.d.ts.map +1 -1
- package/dist/client-search/model/deletedAtResponse.d.ts.map +1 -1
- package/dist/client-search/model/dictionaryEntry.d.ts.map +1 -1
- package/dist/client-search/model/distinct.d.ts +5 -0
- package/dist/client-search/model/distinct.d.ts.map +1 -0
- package/dist/client-search/model/edit.d.ts.map +1 -1
- package/dist/client-search/model/facetHits.d.ts.map +1 -1
- package/dist/client-search/model/facetOrdering.d.ts.map +1 -1
- package/dist/client-search/model/facetsStats.d.ts.map +1 -1
- package/dist/client-search/model/fetchedIndex.d.ts.map +1 -1
- package/dist/client-search/model/getApiKeyResponse.d.ts +4 -0
- package/dist/client-search/model/getApiKeyResponse.d.ts.map +1 -0
- package/dist/client-search/model/getObjectsParams.d.ts +2 -2
- package/dist/client-search/model/getObjectsParams.d.ts.map +1 -1
- package/dist/client-search/model/{multipleGetObjectsParams.d.ts → getObjectsRequest.d.ts} +2 -2
- package/dist/client-search/model/getObjectsRequest.d.ts.map +1 -0
- package/dist/client-search/model/getObjectsResponse.d.ts +2 -2
- package/dist/client-search/model/getObjectsResponse.d.ts.map +1 -1
- package/dist/client-search/model/hasPendingMappingsResponse.d.ts.map +1 -1
- package/dist/client-search/model/highlightResultOption.d.ts.map +1 -1
- package/dist/client-search/model/hit.d.ts +1 -1
- package/dist/client-search/model/hit.d.ts.map +1 -1
- package/dist/client-search/model/index.d.ts +7 -6
- package/dist/client-search/model/index.d.ts.map +1 -1
- package/dist/client-search/model/indexSettingsAsSearchParams.d.ts +2 -4
- package/dist/client-search/model/indexSettingsAsSearchParams.d.ts.map +1 -1
- package/dist/client-search/model/languages.d.ts.map +1 -1
- package/dist/client-search/model/listApiKeysResponse.d.ts +2 -2
- package/dist/client-search/model/listApiKeysResponse.d.ts.map +1 -1
- package/dist/client-search/model/listIndicesResponse.d.ts +1 -1
- package/dist/client-search/model/listIndicesResponse.d.ts.map +1 -1
- package/dist/client-search/model/log.d.ts.map +1 -1
- package/dist/client-search/model/logQuery.d.ts.map +1 -1
- package/dist/client-search/model/matchedGeoLocation.d.ts.map +1 -1
- package/dist/client-search/model/{multipleBatchOperation.d.ts → multipleBatchRequest.d.ts} +5 -5
- package/dist/client-search/model/multipleBatchRequest.d.ts.map +1 -0
- package/dist/client-search/model/multipleBatchResponse.d.ts +2 -2
- package/dist/client-search/model/multipleBatchResponse.d.ts.map +1 -1
- package/dist/client-search/model/operationIndexParams.d.ts.map +1 -1
- package/dist/client-search/model/params.d.ts.map +1 -1
- package/dist/client-search/model/personalization.d.ts.map +1 -1
- package/dist/client-search/model/promoteObjectID.d.ts.map +1 -1
- package/dist/client-search/model/promoteObjectIDs.d.ts.map +1 -1
- package/dist/client-search/model/rankingInfo.d.ts.map +1 -1
- package/dist/client-search/model/rule.d.ts.map +1 -1
- package/dist/client-search/model/saveObjectResponse.d.ts +2 -2
- package/dist/client-search/model/saveObjectResponse.d.ts.map +1 -1
- package/dist/client-search/model/saveSynonymResponse.d.ts.map +1 -1
- package/dist/client-search/model/searchDictionaryEntriesParams.d.ts.map +1 -1
- package/dist/client-search/model/searchForFacetValuesRequest.d.ts.map +1 -1
- package/dist/client-search/model/searchForFacetsOptions.d.ts.map +1 -1
- package/dist/client-search/model/searchForHitsOptions.d.ts.map +1 -1
- package/dist/client-search/model/searchHits.d.ts +2 -2
- package/dist/client-search/model/searchHits.d.ts.map +1 -1
- package/dist/client-search/model/searchMethodParams.d.ts.map +1 -1
- package/dist/client-search/model/searchResponse.d.ts +1 -1
- package/dist/client-search/model/searchResponse.d.ts.map +1 -1
- package/dist/client-search/model/searchResponses.d.ts +1 -1
- package/dist/client-search/model/searchResponses.d.ts.map +1 -1
- package/dist/client-search/model/searchRulesParams.d.ts.map +1 -1
- package/dist/client-search/model/searchRulesResponse.d.ts.map +1 -1
- package/dist/client-search/model/searchSynonymsResponse.d.ts.map +1 -1
- package/dist/client-search/model/searchUserIdsParams.d.ts.map +1 -1
- package/dist/client-search/model/searchUserIdsResponse.d.ts.map +1 -1
- package/dist/client-search/model/snippetResultOption.d.ts.map +1 -1
- package/dist/client-search/model/source.d.ts.map +1 -1
- package/dist/client-search/model/standardEntries.d.ts.map +1 -1
- package/dist/client-search/model/synonymHit.d.ts.map +1 -1
- package/dist/client-search/model/synonymHitHighlightResult.d.ts.map +1 -1
- package/dist/client-search/model/timeRange.d.ts.map +1 -1
- package/dist/client-search/model/updateApiKeyResponse.d.ts +1 -1
- package/dist/client-search/model/updateApiKeyResponse.d.ts.map +1 -1
- package/dist/client-search/model/updatedAtResponse.d.ts.map +1 -1
- package/dist/client-search/model/updatedAtWithObjectIdResponse.d.ts.map +1 -1
- package/dist/client-search/model/updatedRuleResponse.d.ts.map +1 -1
- package/dist/client-search/model/userHighlightResult.d.ts.map +1 -1
- package/dist/client-search/model/userHit.d.ts.map +1 -1
- package/dist/client-search/model/userId.d.ts.map +1 -1
- package/dist/client-search/model/value.d.ts.map +1 -1
- package/dist/client-search/src/searchClient.d.ts +65 -15
- package/dist/client-search/src/searchClient.d.ts.map +1 -1
- package/dist/lite/builds/browser.d.ts +23 -14
- package/dist/lite/builds/browser.d.ts.map +1 -1
- package/dist/lite/builds/models.d.ts +11 -8
- package/dist/lite/builds/models.d.ts.map +1 -1
- package/dist/lite/builds/node.d.ts +23 -14
- package/dist/lite/builds/node.d.ts.map +1 -1
- package/dist/lite/lite/builds/browser.d.ts +2 -2
- package/dist/lite/lite/builds/browser.d.ts.map +1 -1
- package/dist/lite/lite/builds/node.d.ts +2 -2
- package/dist/lite/lite/builds/node.d.ts.map +1 -1
- package/dist/lite/lite/model/acl.d.ts +3 -0
- package/dist/lite/lite/model/acl.d.ts.map +1 -1
- package/dist/lite/lite/model/addApiKeyResponse.d.ts +1 -1
- package/dist/lite/lite/model/addApiKeyResponse.d.ts.map +1 -1
- package/dist/lite/lite/model/apiKey.d.ts.map +1 -1
- package/dist/lite/lite/model/attributeToUpdate.d.ts +3 -0
- package/dist/lite/lite/model/attributeToUpdate.d.ts.map +1 -0
- package/dist/lite/lite/model/automaticFacetFilter.d.ts.map +1 -1
- package/dist/lite/lite/model/baseGetApiKeyResponse.d.ts +11 -0
- package/dist/lite/lite/model/baseGetApiKeyResponse.d.ts.map +1 -0
- package/dist/lite/lite/model/baseIndexSettings.d.ts.map +1 -1
- package/dist/lite/lite/model/baseSearchParamsWithoutQuery.d.ts.map +1 -1
- package/dist/lite/lite/model/baseSearchResponse.d.ts +2 -2
- package/dist/lite/lite/model/baseSearchResponse.d.ts.map +1 -1
- package/dist/lite/lite/model/browseResponse.d.ts +1 -1
- package/dist/lite/lite/model/browseResponse.d.ts.map +1 -1
- package/dist/lite/lite/model/builtInOperation.d.ts.map +1 -1
- package/dist/lite/lite/model/condition.d.ts.map +1 -1
- package/dist/lite/lite/model/consequence.d.ts.map +1 -1
- package/dist/lite/lite/model/consequenceQueryObject.d.ts.map +1 -1
- package/dist/lite/lite/model/dictionaryEntry.d.ts.map +1 -1
- package/dist/lite/lite/model/distinct.d.ts +5 -0
- package/dist/lite/lite/model/distinct.d.ts.map +1 -0
- package/dist/lite/lite/model/edit.d.ts.map +1 -1
- package/dist/lite/lite/model/facetOrdering.d.ts.map +1 -1
- package/dist/lite/lite/model/facetsStats.d.ts.map +1 -1
- package/dist/lite/lite/model/fetchedIndex.d.ts.map +1 -1
- package/dist/lite/lite/model/getApiKeyResponse.d.ts +4 -0
- package/dist/lite/lite/model/getApiKeyResponse.d.ts.map +1 -0
- package/dist/lite/lite/model/highlightResultOption.d.ts.map +1 -1
- package/dist/lite/lite/model/hit.d.ts +1 -1
- package/dist/lite/lite/model/hit.d.ts.map +1 -1
- package/dist/lite/lite/model/index.d.ts +4 -3
- package/dist/lite/lite/model/index.d.ts.map +1 -1
- package/dist/lite/lite/model/indexSettingsAsSearchParams.d.ts +2 -4
- package/dist/lite/lite/model/indexSettingsAsSearchParams.d.ts.map +1 -1
- package/dist/lite/lite/model/languages.d.ts.map +1 -1
- package/dist/lite/lite/model/listIndicesResponse.d.ts +1 -1
- package/dist/lite/lite/model/listIndicesResponse.d.ts.map +1 -1
- package/dist/lite/lite/model/matchedGeoLocation.d.ts.map +1 -1
- package/dist/lite/lite/model/params.d.ts.map +1 -1
- package/dist/lite/lite/model/personalization.d.ts.map +1 -1
- package/dist/lite/lite/model/promoteObjectID.d.ts.map +1 -1
- package/dist/lite/lite/model/promoteObjectIDs.d.ts.map +1 -1
- package/dist/lite/lite/model/rankingInfo.d.ts.map +1 -1
- package/dist/lite/lite/model/rule.d.ts.map +1 -1
- package/dist/lite/lite/model/searchForFacetsOptions.d.ts.map +1 -1
- package/dist/lite/lite/model/searchForHitsOptions.d.ts.map +1 -1
- package/dist/lite/lite/model/searchHits.d.ts +2 -2
- package/dist/lite/lite/model/searchHits.d.ts.map +1 -1
- package/dist/lite/lite/model/searchMethodParams.d.ts.map +1 -1
- package/dist/lite/lite/model/searchResponse.d.ts +1 -1
- package/dist/lite/lite/model/searchResponse.d.ts.map +1 -1
- package/dist/lite/lite/model/searchResponses.d.ts +1 -1
- package/dist/lite/lite/model/searchResponses.d.ts.map +1 -1
- package/dist/lite/lite/model/searchSynonymsResponse.d.ts.map +1 -1
- package/dist/lite/lite/model/snippetResultOption.d.ts.map +1 -1
- package/dist/lite/lite/model/source.d.ts.map +1 -1
- package/dist/lite/lite/model/standardEntries.d.ts.map +1 -1
- package/dist/lite/lite/model/synonymHit.d.ts.map +1 -1
- package/dist/lite/lite/model/synonymHitHighlightResult.d.ts.map +1 -1
- package/dist/lite/lite/model/timeRange.d.ts.map +1 -1
- package/dist/lite/lite/model/updatedRuleResponse.d.ts.map +1 -1
- package/dist/lite/lite/model/userId.d.ts.map +1 -1
- package/dist/lite/lite/model/value.d.ts.map +1 -1
- package/dist/lite/lite/src/liteClient.d.ts +12 -1
- package/dist/lite/lite/src/liteClient.d.ts.map +1 -1
- package/dist/lite/lite.cjs.js +14 -1
- package/dist/lite/lite.esm.browser.js +14 -1
- package/dist/lite/lite.esm.node.js +14 -1
- package/dist/lite/lite.umd.js +2 -2
- package/lite/builds/browser.ts +2 -2
- package/lite/builds/node.ts +2 -2
- package/lite/model/acl.ts +3 -0
- package/lite/model/addApiKeyResponse.ts +2 -1
- package/lite/model/apiKey.ts +7 -0
- package/lite/model/{attributeOrBuiltInOperation.ts → attributeToUpdate.ts} +1 -1
- package/lite/model/automaticFacetFilter.ts +2 -0
- package/lite/model/baseGetApiKeyResponse.ts +13 -0
- package/lite/model/baseIndexSettings.ts +13 -0
- package/lite/model/baseSearchParamsWithoutQuery.ts +32 -0
- package/lite/model/baseSearchResponse.ts +26 -2
- package/lite/model/browseResponse.ts +1 -1
- package/lite/model/builtInOperation.ts +1 -0
- package/lite/model/condition.ts +3 -0
- package/lite/model/consequence.ts +4 -0
- package/lite/model/consequenceQueryObject.ts +1 -0
- package/lite/model/dictionaryEntry.ts +5 -0
- package/lite/model/{createdAtObject.ts → distinct.ts} +4 -6
- package/lite/model/edit.ts +2 -0
- package/lite/model/facetOrdering.ts +1 -0
- package/lite/model/facetsStats.ts +3 -0
- package/lite/model/fetchedIndex.ts +10 -0
- package/lite/model/{key.ts → getApiKeyResponse.ts} +2 -2
- package/lite/model/highlightResultOption.ts +3 -0
- package/lite/model/hit.ts +5 -1
- package/lite/model/index.ts +4 -3
- package/lite/model/indexSettingsAsSearchParams.ts +43 -4
- package/lite/model/languages.ts +2 -0
- package/lite/model/listIndicesResponse.ts +2 -1
- package/lite/model/matchedGeoLocation.ts +2 -0
- package/lite/model/params.ts +3 -0
- package/lite/model/personalization.ts +2 -0
- package/lite/model/promoteObjectID.ts +1 -0
- package/lite/model/promoteObjectIDs.ts +1 -0
- package/lite/model/rankingInfo.ts +12 -0
- package/lite/model/rule.ts +5 -0
- package/lite/model/searchForFacetsOptions.ts +4 -0
- package/lite/model/searchForHitsOptions.ts +1 -0
- package/lite/model/searchHits.ts +2 -2
- package/lite/model/searchMethodParams.ts +1 -0
- package/lite/model/searchResponse.ts +2 -1
- package/lite/model/searchResponses.ts +1 -1
- package/lite/model/searchSynonymsResponse.ts +1 -0
- package/lite/model/snippetResultOption.ts +1 -0
- package/lite/model/source.ts +1 -0
- package/lite/model/standardEntries.ts +2 -0
- package/lite/model/synonymHit.ts +8 -0
- package/lite/model/synonymHitHighlightResult.ts +1 -0
- package/lite/model/timeRange.ts +1 -0
- package/lite/model/updatedRuleResponse.ts +2 -0
- package/lite/model/userId.ts +3 -0
- package/lite/model/value.ts +1 -0
- package/lite/src/liteClient.ts +22 -1
- package/package.json +9 -9
- package/dist/algoliasearch/lite/model/attributeOrBuiltInOperation.d.ts +0 -3
- package/dist/algoliasearch/lite/model/attributeOrBuiltInOperation.d.ts.map +0 -1
- package/dist/algoliasearch/lite/model/createdAtObject.d.ts +0 -7
- package/dist/algoliasearch/lite/model/createdAtObject.d.ts.map +0 -1
- package/dist/algoliasearch/lite/model/key.d.ts +0 -4
- package/dist/algoliasearch/lite/model/key.d.ts.map +0 -1
- package/dist/client-search/model/attributeOrBuiltInOperation.d.ts +0 -3
- package/dist/client-search/model/attributeOrBuiltInOperation.d.ts.map +0 -1
- package/dist/client-search/model/batchOperation.d.ts.map +0 -1
- package/dist/client-search/model/createdAtObject.d.ts +0 -7
- package/dist/client-search/model/createdAtObject.d.ts.map +0 -1
- package/dist/client-search/model/key.d.ts +0 -4
- package/dist/client-search/model/key.d.ts.map +0 -1
- package/dist/client-search/model/multipleBatchOperation.d.ts.map +0 -1
- package/dist/client-search/model/multipleGetObjectsParams.d.ts.map +0 -1
- package/dist/lite/lite/model/attributeOrBuiltInOperation.d.ts +0 -3
- package/dist/lite/lite/model/attributeOrBuiltInOperation.d.ts.map +0 -1
- package/dist/lite/lite/model/createdAtObject.d.ts +0 -7
- package/dist/lite/lite/model/createdAtObject.d.ts.map +0 -1
- package/dist/lite/lite/model/key.d.ts +0 -4
- package/dist/lite/lite/model/key.d.ts.map +0 -1
|
@@ -15,43 +15,43 @@ function createAuth(appId, apiKey, authMode = 'WithinHeaders') {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const DEFAULT_MAX_RETRIES = 50;
|
|
19
|
-
const DEFAULT_TIMEOUT = retryCount => Math.min(retryCount * 200, 5000);
|
|
20
18
|
/**
|
|
21
|
-
*
|
|
19
|
+
* Helper: Returns the promise of a given `func` to iterate on, based on a given `validate` condition.
|
|
22
20
|
*
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
21
|
+
* @param createIterator - The createIterator options.
|
|
22
|
+
* @param createIterator.func - The function to run, which returns a promise.
|
|
23
|
+
* @param createIterator.validate - The validator function. It receives the resolved return of `func`.
|
|
24
|
+
* @param createIterator.aggregator - The function that runs right after the `func` method has been executed, allows you to do anything with the response before `validate`.
|
|
25
|
+
* @param createIterator.error - The `validate` condition to throw an error, and its message.
|
|
26
|
+
* @param createIterator.timeout - The function to decide how long to wait between iterations.
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
|
-
function createRetryablePromise({
|
|
28
|
+
function createIterablePromise({
|
|
31
29
|
func,
|
|
32
30
|
validate,
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
aggregator,
|
|
32
|
+
error,
|
|
33
|
+
timeout = () => 0
|
|
35
34
|
}) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const retry = () => {
|
|
35
|
+
const retry = previousResponse => {
|
|
39
36
|
return new Promise((resolve, reject) => {
|
|
40
|
-
func().then(response => {
|
|
41
|
-
|
|
37
|
+
func(previousResponse).then(response => {
|
|
38
|
+
if (aggregator) {
|
|
39
|
+
aggregator(response);
|
|
40
|
+
}
|
|
42
41
|
|
|
43
|
-
if (
|
|
44
|
-
resolve(response);
|
|
45
|
-
} else if (retryCount + 1 >= maxRetries) {
|
|
46
|
-
reject(new Error(`The maximum number of retries exceeded. (${retryCount + 1}/${maxRetries})`));
|
|
47
|
-
} else {
|
|
48
|
-
retryCount += 1;
|
|
49
|
-
setTimeout(() => {
|
|
50
|
-
retry().then(resolve).catch(reject);
|
|
51
|
-
}, timeout(retryCount));
|
|
42
|
+
if (validate(response)) {
|
|
43
|
+
return resolve(response);
|
|
52
44
|
}
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
|
|
46
|
+
if (error && error.validate(response)) {
|
|
47
|
+
return reject(new Error(error.message(response)));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return setTimeout(() => {
|
|
51
|
+
retry(response).then(resolve).catch(reject);
|
|
52
|
+
}, timeout());
|
|
53
|
+
}).catch(err => {
|
|
54
|
+
reject(err);
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -715,7 +715,7 @@ const DEFAULT_READ_TIMEOUT_BROWSER = 2000;
|
|
|
715
715
|
const DEFAULT_WRITE_TIMEOUT_BROWSER = 30000;
|
|
716
716
|
|
|
717
717
|
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
718
|
-
const apiClientVersion$4 = '5.0.0-alpha.
|
|
718
|
+
const apiClientVersion$4 = '5.0.0-alpha.4';
|
|
719
719
|
const REGIONS$2 = ['de', 'us'];
|
|
720
720
|
function getDefaultHosts$3(region) {
|
|
721
721
|
const url = !region
|
|
@@ -746,6 +746,19 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
746
746
|
});
|
|
747
747
|
return {
|
|
748
748
|
transporter,
|
|
749
|
+
/**
|
|
750
|
+
* The `appId` currently in use.
|
|
751
|
+
*/
|
|
752
|
+
appId: appIdOption,
|
|
753
|
+
/**
|
|
754
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
755
|
+
*/
|
|
756
|
+
clearCache() {
|
|
757
|
+
return Promise.all([
|
|
758
|
+
transporter.requestsCache.clear(),
|
|
759
|
+
transporter.responsesCache.clear(),
|
|
760
|
+
]).then(() => undefined);
|
|
761
|
+
},
|
|
749
762
|
/**
|
|
750
763
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
751
764
|
*/
|
|
@@ -993,7 +1006,7 @@ function createAbtestingClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
993
1006
|
}
|
|
994
1007
|
|
|
995
1008
|
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
996
|
-
const apiClientVersion$3 = '5.0.0-alpha.
|
|
1009
|
+
const apiClientVersion$3 = '5.0.0-alpha.4';
|
|
997
1010
|
const REGIONS$1 = ['de', 'us'];
|
|
998
1011
|
function getDefaultHosts$2(region) {
|
|
999
1012
|
const url = !region
|
|
@@ -1024,6 +1037,19 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1024
1037
|
});
|
|
1025
1038
|
return {
|
|
1026
1039
|
transporter,
|
|
1040
|
+
/**
|
|
1041
|
+
* The `appId` currently in use.
|
|
1042
|
+
*/
|
|
1043
|
+
appId: appIdOption,
|
|
1044
|
+
/**
|
|
1045
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1046
|
+
*/
|
|
1047
|
+
clearCache() {
|
|
1048
|
+
return Promise.all([
|
|
1049
|
+
transporter.requestsCache.clear(),
|
|
1050
|
+
transporter.responsesCache.clear(),
|
|
1051
|
+
]).then(() => undefined);
|
|
1052
|
+
},
|
|
1027
1053
|
/**
|
|
1028
1054
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
1029
1055
|
*/
|
|
@@ -1877,7 +1903,7 @@ function createAnalyticsClient({ appId: appIdOption, apiKey: apiKeyOption, authM
|
|
|
1877
1903
|
}
|
|
1878
1904
|
|
|
1879
1905
|
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
1880
|
-
const apiClientVersion$2 = '5.0.0-alpha.
|
|
1906
|
+
const apiClientVersion$2 = '5.0.0-alpha.4';
|
|
1881
1907
|
const REGIONS = ['eu', 'us'];
|
|
1882
1908
|
function getDefaultHosts$1(region) {
|
|
1883
1909
|
const url = 'personalization.{region}.algolia.com'.replace('{region}', region);
|
|
@@ -1906,6 +1932,19 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
1906
1932
|
});
|
|
1907
1933
|
return {
|
|
1908
1934
|
transporter,
|
|
1935
|
+
/**
|
|
1936
|
+
* The `appId` currently in use.
|
|
1937
|
+
*/
|
|
1938
|
+
appId: appIdOption,
|
|
1939
|
+
/**
|
|
1940
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
1941
|
+
*/
|
|
1942
|
+
clearCache() {
|
|
1943
|
+
return Promise.all([
|
|
1944
|
+
transporter.requestsCache.clear(),
|
|
1945
|
+
transporter.responsesCache.clear(),
|
|
1946
|
+
]).then(() => undefined);
|
|
1947
|
+
},
|
|
1909
1948
|
/**
|
|
1910
1949
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
1911
1950
|
*/
|
|
@@ -2121,7 +2160,7 @@ function createPersonalizationClient({ appId: appIdOption, apiKey: apiKeyOption,
|
|
|
2121
2160
|
}
|
|
2122
2161
|
|
|
2123
2162
|
// This file is generated, manual changes will be lost - read more on https://github.com/algolia/api-clients-automation.
|
|
2124
|
-
const apiClientVersion$1 = '5.0.0-alpha.
|
|
2163
|
+
const apiClientVersion$1 = '5.0.0-alpha.4';
|
|
2125
2164
|
function getDefaultHosts(appId) {
|
|
2126
2165
|
return [
|
|
2127
2166
|
{
|
|
@@ -2175,6 +2214,19 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2175
2214
|
});
|
|
2176
2215
|
return {
|
|
2177
2216
|
transporter,
|
|
2217
|
+
/**
|
|
2218
|
+
* The `appId` currently in use.
|
|
2219
|
+
*/
|
|
2220
|
+
appId: appIdOption,
|
|
2221
|
+
/**
|
|
2222
|
+
* Clears the cache of the transporter for the `requestsCache` and `responsesCache` properties.
|
|
2223
|
+
*/
|
|
2224
|
+
clearCache() {
|
|
2225
|
+
return Promise.all([
|
|
2226
|
+
transporter.requestsCache.clear(),
|
|
2227
|
+
transporter.responsesCache.clear(),
|
|
2228
|
+
]).then(() => undefined);
|
|
2229
|
+
},
|
|
2178
2230
|
/**
|
|
2179
2231
|
* Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
|
|
2180
2232
|
*/
|
|
@@ -2191,38 +2243,57 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2191
2243
|
transporter.algoliaAgent.add({ segment, version });
|
|
2192
2244
|
},
|
|
2193
2245
|
/**
|
|
2194
|
-
* Helper: Wait for a task to
|
|
2246
|
+
* Helper: Wait for a task to be published (completed) for a given `indexName` and `taskID`.
|
|
2195
2247
|
*
|
|
2196
|
-
* @summary
|
|
2248
|
+
* @summary Helper method that waits for a task to be published (completed).
|
|
2197
2249
|
* @param waitForTaskOptions - The waitForTaskOptions object.
|
|
2198
2250
|
* @param waitForTaskOptions.indexName - The `indexName` where the operation was performed.
|
|
2199
2251
|
* @param waitForTaskOptions.taskID - The `taskID` returned in the method response.
|
|
2252
|
+
* @param waitForTaskOptions.maxRetries - The maximum number of retries. 50 by default.
|
|
2253
|
+
* @param waitForTaskOptions.timeout - The function to decide how long to wait between retries.
|
|
2200
2254
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getTask` method and merged with the transporter requestOptions.
|
|
2201
2255
|
*/
|
|
2202
|
-
waitForTask({ indexName, taskID,
|
|
2203
|
-
|
|
2204
|
-
|
|
2256
|
+
waitForTask({ indexName, taskID, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
|
|
2257
|
+
let retryCount = 0;
|
|
2258
|
+
return createIterablePromise({
|
|
2205
2259
|
func: () => this.getTask({ indexName, taskID }, requestOptions),
|
|
2206
2260
|
validate: (response) => response.status === 'published',
|
|
2261
|
+
aggregator: () => (retryCount += 1),
|
|
2262
|
+
error: {
|
|
2263
|
+
validate: () => retryCount >= maxRetries,
|
|
2264
|
+
message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
|
|
2265
|
+
},
|
|
2266
|
+
timeout: () => timeout(retryCount),
|
|
2207
2267
|
});
|
|
2208
2268
|
},
|
|
2209
2269
|
/**
|
|
2210
2270
|
* Helper: Wait for an API key to be added, updated or deleted based on a given `operation`.
|
|
2211
2271
|
*
|
|
2212
|
-
* @summary
|
|
2272
|
+
* @summary Helper method that waits for an API key task to be processed.
|
|
2213
2273
|
* @param waitForApiKeyOptions - The waitForApiKeyOptions object.
|
|
2214
2274
|
* @param waitForApiKeyOptions.operation - The `operation` that was done on a `key`.
|
|
2215
2275
|
* @param waitForApiKeyOptions.key - The `key` that has been added, deleted or updated.
|
|
2216
2276
|
* @param waitForApiKeyOptions.apiKey - Necessary to know if an `update` operation has been processed, compare fields of the response with it.
|
|
2277
|
+
* @param waitForApiKeyOptions.maxRetries - The maximum number of retries. 50 by default.
|
|
2278
|
+
* @param waitForApiKeyOptions.timeout - The function to decide how long to wait between retries.
|
|
2217
2279
|
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `getApikey` method and merged with the transporter requestOptions.
|
|
2218
2280
|
*/
|
|
2219
|
-
waitForApiKey({ operation, key, apiKey,
|
|
2281
|
+
waitForApiKey({ operation, key, apiKey, maxRetries = 50, timeout = (retryCount) => Math.min(retryCount * 200, 5000), }, requestOptions) {
|
|
2282
|
+
let retryCount = 0;
|
|
2283
|
+
const baseIteratorOptions = {
|
|
2284
|
+
aggregator: () => (retryCount += 1),
|
|
2285
|
+
error: {
|
|
2286
|
+
validate: () => retryCount >= maxRetries,
|
|
2287
|
+
message: () => `The maximum number of retries exceeded. (${retryCount}/${maxRetries})`,
|
|
2288
|
+
},
|
|
2289
|
+
timeout: () => timeout(retryCount),
|
|
2290
|
+
};
|
|
2220
2291
|
if (operation === 'update') {
|
|
2221
2292
|
if (!apiKey) {
|
|
2222
2293
|
throw new Error('`apiKey` is required when waiting for an `update` operation.');
|
|
2223
2294
|
}
|
|
2224
|
-
return
|
|
2225
|
-
...
|
|
2295
|
+
return createIterablePromise({
|
|
2296
|
+
...baseIteratorOptions,
|
|
2226
2297
|
func: () => this.getApiKey({ key }, requestOptions),
|
|
2227
2298
|
validate: (response) => {
|
|
2228
2299
|
for (const field of Object.keys(apiKey)) {
|
|
@@ -2240,12 +2311,99 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2240
2311
|
},
|
|
2241
2312
|
});
|
|
2242
2313
|
}
|
|
2243
|
-
return
|
|
2244
|
-
...
|
|
2314
|
+
return createIterablePromise({
|
|
2315
|
+
...baseIteratorOptions,
|
|
2245
2316
|
func: () => this.getApiKey({ key }, requestOptions).catch((error) => error),
|
|
2246
2317
|
validate: (error) => operation === 'add' ? error.status !== 404 : error.status === 404,
|
|
2247
2318
|
});
|
|
2248
2319
|
},
|
|
2320
|
+
/**
|
|
2321
|
+
* Helper: Iterate on the `browse` method of the client to allow aggregating objects of an index.
|
|
2322
|
+
*
|
|
2323
|
+
* @summary Helper method that iterates on the `browse` method.
|
|
2324
|
+
* @param browseObjects - The browseObjects object.
|
|
2325
|
+
* @param browseObjects.indexName - The index in which to perform the request.
|
|
2326
|
+
* @param browseObjects.browseRequest - The `browse` method parameters.
|
|
2327
|
+
* @param browseObjects.validate - The validator function. It receive the resolved return of the API call.
|
|
2328
|
+
* @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
|
|
2329
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `browse` method and merged with the transporter requestOptions.
|
|
2330
|
+
*/
|
|
2331
|
+
browseObjects({ indexName, browseRequest, ...browseObjectsOptions }, requestOptions) {
|
|
2332
|
+
return createIterablePromise({
|
|
2333
|
+
func: (previousResponse) => {
|
|
2334
|
+
return this.browse({
|
|
2335
|
+
indexName,
|
|
2336
|
+
browseRequest: {
|
|
2337
|
+
cursor: previousResponse ? previousResponse.cursor : undefined,
|
|
2338
|
+
...browseRequest,
|
|
2339
|
+
},
|
|
2340
|
+
}, requestOptions);
|
|
2341
|
+
},
|
|
2342
|
+
validate: (response) => response.cursor === undefined,
|
|
2343
|
+
...browseObjectsOptions,
|
|
2344
|
+
});
|
|
2345
|
+
},
|
|
2346
|
+
/**
|
|
2347
|
+
* Helper: Iterate on the `searchRules` method of the client to allow aggregating rules of an index.
|
|
2348
|
+
*
|
|
2349
|
+
* @summary Helper method that iterates on the `searchRules` method.
|
|
2350
|
+
* @param browseObjects - The browseObjects object.
|
|
2351
|
+
* @param browseObjects.indexName - The index in which to perform the request.
|
|
2352
|
+
* @param browseObjects.searchRulesParams - The `searchRules` method parameters.
|
|
2353
|
+
* @param browseObjects.validate - The validator function. It receive the resolved return of the API call.
|
|
2354
|
+
* @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
|
|
2355
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchRules` method and merged with the transporter requestOptions.
|
|
2356
|
+
*/
|
|
2357
|
+
browseRules({ indexName, searchRulesParams, ...browseRulesOptions }, requestOptions) {
|
|
2358
|
+
const params = {
|
|
2359
|
+
hitsPerPage: 1000,
|
|
2360
|
+
...searchRulesParams,
|
|
2361
|
+
};
|
|
2362
|
+
return createIterablePromise({
|
|
2363
|
+
func: (previousResponse) => {
|
|
2364
|
+
return this.searchRules({
|
|
2365
|
+
indexName,
|
|
2366
|
+
searchRulesParams: {
|
|
2367
|
+
...params,
|
|
2368
|
+
page: previousResponse
|
|
2369
|
+
? previousResponse.page + 1
|
|
2370
|
+
: params.page || 0,
|
|
2371
|
+
},
|
|
2372
|
+
}, requestOptions);
|
|
2373
|
+
},
|
|
2374
|
+
validate: (response) => response.nbHits < params.hitsPerPage,
|
|
2375
|
+
...browseRulesOptions,
|
|
2376
|
+
});
|
|
2377
|
+
},
|
|
2378
|
+
/**
|
|
2379
|
+
* Helper: Iterate on the `searchSynonyms` method of the client to allow aggregating rules of an index.
|
|
2380
|
+
*
|
|
2381
|
+
* @summary Helper method that iterates on the `searchSynonyms` method.
|
|
2382
|
+
* @param browseObjects - The browseObjects object.
|
|
2383
|
+
* @param browseObjects.indexName - The index in which to perform the request.
|
|
2384
|
+
* @param browseObjects.validate - The validator function. It receive the resolved return of the API call.
|
|
2385
|
+
* @param browseObjects.aggregator - The function that runs right after the API call has been resolved, allows you to do anything with the response before `validate`.
|
|
2386
|
+
* @param requestOptions - The requestOptions to send along with the query, they will be forwarded to the `searchSynonyms` method and merged with the transporter requestOptions.
|
|
2387
|
+
*/
|
|
2388
|
+
browseSynonyms({ indexName, validate, aggregator, ...browseSynonymsOptions }, requestOptions) {
|
|
2389
|
+
const params = {
|
|
2390
|
+
hitsPerPage: 1000,
|
|
2391
|
+
...browseSynonymsOptions,
|
|
2392
|
+
};
|
|
2393
|
+
return createIterablePromise({
|
|
2394
|
+
func: (previousResponse) => {
|
|
2395
|
+
return this.searchSynonyms({
|
|
2396
|
+
...params,
|
|
2397
|
+
indexName,
|
|
2398
|
+
page: previousResponse
|
|
2399
|
+
? previousResponse.page + 1
|
|
2400
|
+
: browseSynonymsOptions.page || 0,
|
|
2401
|
+
}, requestOptions);
|
|
2402
|
+
},
|
|
2403
|
+
validate: (response) => response.nbHits < params.hitsPerPage,
|
|
2404
|
+
...browseSynonymsOptions,
|
|
2405
|
+
});
|
|
2406
|
+
},
|
|
2249
2407
|
/**
|
|
2250
2408
|
* Add a new API Key with specific permissions/restrictions.
|
|
2251
2409
|
*
|
|
@@ -2939,6 +3097,9 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
2939
3097
|
if (!getObjectsParams) {
|
|
2940
3098
|
throw new Error('Parameter `getObjectsParams` is required when calling `getObjects`.');
|
|
2941
3099
|
}
|
|
3100
|
+
if (!getObjectsParams.requests) {
|
|
3101
|
+
throw new Error('Parameter `getObjectsParams.requests` is required when calling `getObjects`.');
|
|
3102
|
+
}
|
|
2942
3103
|
const requestPath = '/1/indexes/*/objects';
|
|
2943
3104
|
const headers = {};
|
|
2944
3105
|
const queryParameters = {};
|
|
@@ -3242,6 +3403,9 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3242
3403
|
if (!batchParams) {
|
|
3243
3404
|
throw new Error('Parameter `batchParams` is required when calling `multipleBatch`.');
|
|
3244
3405
|
}
|
|
3406
|
+
if (!batchParams.requests) {
|
|
3407
|
+
throw new Error('Parameter `batchParams.requests` is required when calling `multipleBatch`.');
|
|
3408
|
+
}
|
|
3245
3409
|
const requestPath = '/1/indexes/*/batch';
|
|
3246
3410
|
const headers = {};
|
|
3247
3411
|
const queryParameters = {};
|
|
@@ -3295,19 +3459,19 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3295
3459
|
* @param partialUpdateObject - The partialUpdateObject object.
|
|
3296
3460
|
* @param partialUpdateObject.indexName - The index in which to perform the request.
|
|
3297
3461
|
* @param partialUpdateObject.objectID - Unique identifier of an object.
|
|
3298
|
-
* @param partialUpdateObject.
|
|
3462
|
+
* @param partialUpdateObject.attributeToUpdate - List of attributes to update.
|
|
3299
3463
|
* @param partialUpdateObject.createIfNotExists - Creates the record if it does not exist yet.
|
|
3300
3464
|
* @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
|
|
3301
3465
|
*/
|
|
3302
|
-
partialUpdateObject({ indexName, objectID,
|
|
3466
|
+
partialUpdateObject({ indexName, objectID, attributeToUpdate, createIfNotExists, }, requestOptions) {
|
|
3303
3467
|
if (!indexName) {
|
|
3304
3468
|
throw new Error('Parameter `indexName` is required when calling `partialUpdateObject`.');
|
|
3305
3469
|
}
|
|
3306
3470
|
if (!objectID) {
|
|
3307
3471
|
throw new Error('Parameter `objectID` is required when calling `partialUpdateObject`.');
|
|
3308
3472
|
}
|
|
3309
|
-
if (!
|
|
3310
|
-
throw new Error('Parameter `
|
|
3473
|
+
if (!attributeToUpdate) {
|
|
3474
|
+
throw new Error('Parameter `attributeToUpdate` is required when calling `partialUpdateObject`.');
|
|
3311
3475
|
}
|
|
3312
3476
|
const requestPath = '/1/indexes/{indexName}/{objectID}/partial'
|
|
3313
3477
|
.replace('{indexName}', encodeURIComponent(indexName))
|
|
@@ -3322,7 +3486,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3322
3486
|
path: requestPath,
|
|
3323
3487
|
queryParameters,
|
|
3324
3488
|
headers,
|
|
3325
|
-
data:
|
|
3489
|
+
data: attributeToUpdate,
|
|
3326
3490
|
};
|
|
3327
3491
|
return transporter.request(request, requestOptions);
|
|
3328
3492
|
},
|
|
@@ -3760,9 +3924,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3760
3924
|
if (!indexName) {
|
|
3761
3925
|
throw new Error('Parameter `indexName` is required when calling `searchRules`.');
|
|
3762
3926
|
}
|
|
3763
|
-
if (!searchRulesParams) {
|
|
3764
|
-
throw new Error('Parameter `searchRulesParams` is required when calling `searchRules`.');
|
|
3765
|
-
}
|
|
3766
3927
|
const requestPath = '/1/indexes/{indexName}/rules/search'.replace('{indexName}', encodeURIComponent(indexName));
|
|
3767
3928
|
const headers = {};
|
|
3768
3929
|
const queryParameters = {};
|
|
@@ -3771,7 +3932,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3771
3932
|
path: requestPath,
|
|
3772
3933
|
queryParameters,
|
|
3773
3934
|
headers,
|
|
3774
|
-
data: searchRulesParams,
|
|
3935
|
+
data: searchRulesParams ? searchRulesParams : {},
|
|
3775
3936
|
useReadTransporter: true,
|
|
3776
3937
|
cacheable: true,
|
|
3777
3938
|
};
|
|
@@ -3790,9 +3951,6 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3790
3951
|
if (!indexName) {
|
|
3791
3952
|
throw new Error('Parameter `indexName` is required when calling `searchSingleIndex`.');
|
|
3792
3953
|
}
|
|
3793
|
-
if (!searchParams) {
|
|
3794
|
-
throw new Error('Parameter `searchParams` is required when calling `searchSingleIndex`.');
|
|
3795
|
-
}
|
|
3796
3954
|
const requestPath = '/1/indexes/{indexName}/query'.replace('{indexName}', encodeURIComponent(indexName));
|
|
3797
3955
|
const headers = {};
|
|
3798
3956
|
const queryParameters = {};
|
|
@@ -3801,7 +3959,7 @@ function createSearchClient({ appId: appIdOption, apiKey: apiKeyOption, authMode
|
|
|
3801
3959
|
path: requestPath,
|
|
3802
3960
|
queryParameters,
|
|
3803
3961
|
headers,
|
|
3804
|
-
data: searchParams,
|
|
3962
|
+
data: searchParams ? searchParams : {},
|
|
3805
3963
|
useReadTransporter: true,
|
|
3806
3964
|
cacheable: true,
|
|
3807
3965
|
};
|