algoliasearch 5.2.5 → 5.3.1

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/node.d.cts CHANGED
@@ -1,17 +1,15 @@
1
- import * as _algolia_client_search from '@algolia/client-search';
2
- import { GenerateSecuredApiKeyOptions, GetSecuredApiKeyRemainingValidityOptions } from '@algolia/client-search';
3
- export * from '@algolia/client-search';
4
- export { AdvancedSyntaxFeatures, AlternativesAsExact, Anchoring, AroundPrecision, AroundRadius, AroundRadiusAll, AutomaticFacetFilter, AutomaticFacetFilters, BaseSearchParams, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString, Condition, Consequence, ConsequenceHide, ConsequenceParams, ConsequenceQuery, ConsequenceQueryObject, CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeletedAtResponse, Distinct, Edit, EditType, ErrorBase, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetOrdering, FacetStats, Facets, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, MatchLevel, MatchedGeoLocation, Mode, NumericFilters, OptionalFilters, Params, Personalization, Promote, PromoteObjectID, PromoteObjectIDs, QueryType, Range, RankingInfo, ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, SearchPagination, SearchParams, SearchParamsObject, SearchParamsQuery, SemanticSearch, SnippetResult, SnippetResultOption, SortRemainingBy, SupportedLanguage, TagFilters, TaskStatus, TypoTolerance, TypoToleranceEnum, Value, apiClientVersion } from '@algolia/client-search';
5
- import * as _algolia_client_common from '@algolia/client-common';
6
- import { ClientOptions } from '@algolia/client-common';
7
1
  import { Region as Region$1, AbtestingClient } from '@algolia/client-abtesting';
8
2
  export * from '@algolia/client-abtesting';
9
- export { Region as ABTestingRegion } from '@algolia/client-abtesting';
3
+ export { Region as AbTestingRegion } from '@algolia/client-abtesting';
10
4
  import { Region as Region$2, AnalyticsClient } from '@algolia/client-analytics';
11
5
  export * from '@algolia/client-analytics';
12
6
  export { Region as AnalyticsRegion } from '@algolia/client-analytics';
7
+ import { ClientOptions } from '@algolia/client-common';
13
8
  import { Region as Region$3, PersonalizationClient } from '@algolia/client-personalization';
14
9
  export * from '@algolia/client-personalization';
10
+ import { SearchClient } from '@algolia/client-search';
11
+ export * from '@algolia/client-search';
12
+ export { AdvancedSyntaxFeatures, AlternativesAsExact, Anchoring, AroundPrecision, AroundRadius, AroundRadiusAll, AutomaticFacetFilter, AutomaticFacetFilters, BaseSearchParams, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString, Condition, Consequence, ConsequenceHide, ConsequenceParams, ConsequenceQuery, ConsequenceQueryObject, CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeletedAtResponse, Distinct, Edit, EditType, ErrorBase, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetOrdering, FacetStats, Facets, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, MatchLevel, MatchedGeoLocation, Mode, NumericFilters, OptionalFilters, Params, Personalization, Promote, PromoteObjectID, PromoteObjectIDs, QueryType, Range, RankingInfo, ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, SearchPagination, SearchParams, SearchParamsObject, SearchParamsQuery, SemanticSearch, SnippetResult, SnippetResultOption, SortRemainingBy, SupportedLanguage, TagFilters, TaskStatus, TypoTolerance, TypoToleranceEnum, Value, apiClientVersion } from '@algolia/client-search';
15
13
  import { RecommendClient } from '@algolia/recommend';
16
14
  export * from '@algolia/recommend';
17
15
 
@@ -38,116 +36,12 @@ type InitClientRegion<TRegion> = Partial<{
38
36
  region: TRegion;
39
37
  }>;
40
38
 
41
- /**
42
- * The client type.
43
- */
44
- type Algoliasearch = ReturnType<typeof algoliasearch>;
45
- declare function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): {
46
- _ua: string;
47
- initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<Region$1>) => AbtestingClient;
48
- initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<Region$2>) => AnalyticsClient;
39
+ type Algoliasearch = SearchClient & {
40
+ initRecommend: (initOptions: InitClientOptions) => RecommendClient;
41
+ initAnalytics: (initOptions: InitClientOptions & InitClientRegion<Region$2>) => AnalyticsClient;
42
+ initAbtesting: (initOptions: InitClientOptions & InitClientRegion<Region$1>) => AbtestingClient;
49
43
  initPersonalization: (initOptions: InitClientOptions & Required<InitClientRegion<Region$3>>) => PersonalizationClient;
50
- initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
51
- /**
52
- * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
53
- *
54
- * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
55
- * @param generateSecuredApiKey - The `generateSecuredApiKey` object.
56
- * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
57
- * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
58
- */
59
- generateSecuredApiKey({ parentApiKey, restrictions }: GenerateSecuredApiKeyOptions): string;
60
- /**
61
- * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
62
- *
63
- * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
64
- * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
65
- * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
66
- */
67
- getSecuredApiKeyRemainingValidity({ securedApiKey }: GetSecuredApiKeyRemainingValidityOptions): number;
68
- transporter: _algolia_client_common.Transporter;
69
- appId: string;
70
- clearCache(): Promise<void>;
71
- addAlgoliaAgent(segment: string, version?: string): void;
72
- waitForTask({ indexName, taskID, maxRetries, timeout, }: _algolia_client_search.WaitForTaskOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
73
- waitForAppTask({ taskID, maxRetries, timeout, }: _algolia_client_search.WaitForAppTaskOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
74
- waitForApiKey({ operation, key, apiKey, maxRetries, timeout, }: _algolia_client_search.WaitForApiKeyOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetApiKeyResponse | undefined>;
75
- browseObjects<T>({ indexName, browseParams, ...browseObjectsOptions }: _algolia_client_search.BrowseOptions<_algolia_client_search.BrowseResponse<T>> & _algolia_client_search.BrowseProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BrowseResponse<T>>;
76
- browseRules({ indexName, searchRulesParams, ...browseRulesOptions }: _algolia_client_search.BrowseOptions<_algolia_client_search.SearchRulesResponse> & _algolia_client_search.SearchRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchRulesResponse>;
77
- browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }: _algolia_client_search.BrowseOptions<_algolia_client_search.SearchSynonymsResponse> & _algolia_client_search.SearchSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchSynonymsResponse>;
78
- chunkedBatch({ indexName, objects, action, waitForTasks, batchSize }: _algolia_client_search.ChunkedBatchOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
79
- saveObjects({ indexName, objects }: _algolia_client_search.SaveObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
80
- deleteObjects({ indexName, objectIDs }: _algolia_client_search.DeleteObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
81
- partialUpdateObjects({ indexName, objects, createIfNotExists }: _algolia_client_search.PartialUpdateObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
82
- replaceAllObjects({ indexName, objects, batchSize }: _algolia_client_search.ReplaceAllObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ReplaceAllObjectsResponse>;
83
- searchForHits<T>(searchMethodParams: _algolia_client_search.LegacySearchMethodProps | _algolia_client_search.SearchMethodParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<{
84
- results: Array<_algolia_client_search.SearchResponse<T>>;
85
- }>;
86
- searchForFacets(searchMethodParams: _algolia_client_search.LegacySearchMethodProps | _algolia_client_search.SearchMethodParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<{
87
- results: _algolia_client_search.SearchForFacetValuesResponse[];
88
- }>;
89
- addApiKey(apiKey: _algolia_client_search.ApiKey, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.AddApiKeyResponse>;
90
- addOrUpdateObject({ indexName, objectID, body }: _algolia_client_search.AddOrUpdateObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtWithObjectIdResponse>;
91
- appendSource(source: _algolia_client_search.Source, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.CreatedAtResponse>;
92
- assignUserId({ xAlgoliaUserID, assignUserIdParams }: _algolia_client_search.AssignUserIdProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.CreatedAtResponse>;
93
- batch({ indexName, batchWriteParams }: _algolia_client_search.BatchProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse>;
94
- batchAssignUserIds({ xAlgoliaUserID, batchAssignUserIdsParams }: _algolia_client_search.BatchAssignUserIdsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.CreatedAtResponse>;
95
- batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }: _algolia_client_search.BatchDictionaryEntriesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
96
- browse<T>({ indexName, browseParams }: _algolia_client_search.BrowseProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BrowseResponse<T>>;
97
- clearObjects({ indexName }: _algolia_client_search.ClearObjectsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
98
- clearRules({ indexName, forwardToReplicas }: _algolia_client_search.ClearRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
99
- clearSynonyms({ indexName, forwardToReplicas }: _algolia_client_search.ClearSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
100
- customDelete({ path, parameters }: _algolia_client_search.CustomDeleteProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
101
- customGet({ path, parameters }: _algolia_client_search.CustomGetProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
102
- customPost({ path, parameters, body }: _algolia_client_search.CustomPostProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
103
- customPut({ path, parameters, body }: _algolia_client_search.CustomPutProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
104
- deleteApiKey({ key }: _algolia_client_search.DeleteApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeleteApiKeyResponse>;
105
- deleteBy({ indexName, deleteByParams }: _algolia_client_search.DeleteByProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
106
- deleteIndex({ indexName }: _algolia_client_search.DeleteIndexProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
107
- deleteObject({ indexName, objectID }: _algolia_client_search.DeleteObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
108
- deleteRule({ indexName, objectID, forwardToReplicas }: _algolia_client_search.DeleteRuleProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
109
- deleteSource({ source }: _algolia_client_search.DeleteSourceProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeleteSourceResponse>;
110
- deleteSynonym({ indexName, objectID, forwardToReplicas }: _algolia_client_search.DeleteSynonymProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
111
- getApiKey({ key }: _algolia_client_search.GetApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetApiKeyResponse>;
112
- getAppTask({ taskID }: _algolia_client_search.GetAppTaskProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
113
- getDictionaryLanguages(requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, _algolia_client_search.Languages>>;
114
- getDictionarySettings(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetDictionarySettingsResponse>;
115
- getLogs({ offset, length, indexName, type }?: _algolia_client_search.GetLogsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.GetLogsResponse>;
116
- getObject({ indexName, objectID, attributesToRetrieve }: _algolia_client_search.GetObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
117
- getObjects<T>(getObjectsParams: _algolia_client_search.GetObjectsParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetObjectsResponse<T>>;
118
- getRule({ indexName, objectID }: _algolia_client_search.GetRuleProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.Rule>;
119
- getSettings({ indexName }: _algolia_client_search.GetSettingsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SettingsResponse>;
120
- getSources(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.Source[]>;
121
- getSynonym({ indexName, objectID }: _algolia_client_search.GetSynonymProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SynonymHit>;
122
- getTask({ indexName, taskID }: _algolia_client_search.GetTaskProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
123
- getTopUserIds(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTopUserIdsResponse>;
124
- getUserId({ userID }: _algolia_client_search.GetUserIdProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UserId>;
125
- hasPendingMappings({ getClusters }?: _algolia_client_search.HasPendingMappingsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.HasPendingMappingsResponse>;
126
- listApiKeys(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ListApiKeysResponse>;
127
- listClusters(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ListClustersResponse>;
128
- listIndices({ page, hitsPerPage }?: _algolia_client_search.ListIndicesProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.ListIndicesResponse>;
129
- listUserIds({ page, hitsPerPage }?: _algolia_client_search.ListUserIdsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.ListUserIdsResponse>;
130
- multipleBatch(batchParams: _algolia_client_search.BatchParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.MultipleBatchResponse>;
131
- operationIndex({ indexName, operationIndexParams }: _algolia_client_search.OperationIndexProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
132
- partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }: _algolia_client_search.PartialUpdateObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtWithObjectIdResponse>;
133
- removeUserId({ userID }: _algolia_client_search.RemoveUserIdProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.RemoveUserIdResponse>;
134
- replaceSources({ source }: _algolia_client_search.ReplaceSourcesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ReplaceSourceResponse>;
135
- restoreApiKey({ key }: _algolia_client_search.RestoreApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.AddApiKeyResponse>;
136
- saveObject({ indexName, body }: _algolia_client_search.SaveObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SaveObjectResponse>;
137
- saveRule({ indexName, objectID, rule, forwardToReplicas }: _algolia_client_search.SaveRuleProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedRuleResponse>;
138
- saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }: _algolia_client_search.SaveRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
139
- saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }: _algolia_client_search.SaveSynonymProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SaveSynonymResponse>;
140
- saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }: _algolia_client_search.SaveSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
141
- search<T>(searchMethodParams: _algolia_client_search.LegacySearchMethodProps | _algolia_client_search.SearchMethodParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchResponses<T>>;
142
- searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }: _algolia_client_search.SearchDictionaryEntriesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchDictionaryEntriesResponse>;
143
- searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }: _algolia_client_search.SearchForFacetValuesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchForFacetValuesResponse>;
144
- searchRules({ indexName, searchRulesParams }: _algolia_client_search.SearchRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchRulesResponse>;
145
- searchSingleIndex<T>({ indexName, searchParams }: _algolia_client_search.SearchSingleIndexProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchResponse<T>>;
146
- searchSynonyms({ indexName, searchSynonymsParams }: _algolia_client_search.SearchSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchSynonymsResponse>;
147
- searchUserIds(searchUserIdsParams: _algolia_client_search.SearchUserIdsParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchUserIdsResponse>;
148
- setDictionarySettings(dictionarySettingsParams: _algolia_client_search.DictionarySettingsParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
149
- setSettings({ indexName, indexSettings, forwardToReplicas }: _algolia_client_search.SetSettingsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
150
- updateApiKey({ key, apiKey }: _algolia_client_search.UpdateApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdateApiKeyResponse>;
151
44
  };
45
+ declare function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch;
152
46
 
153
47
  export { type Algoliasearch, type InitClientOptions, type InitClientRegion, type Region, algoliasearch };
package/dist/node.d.ts CHANGED
@@ -1,17 +1,15 @@
1
- import * as _algolia_client_search from '@algolia/client-search';
2
- import { GenerateSecuredApiKeyOptions, GetSecuredApiKeyRemainingValidityOptions } from '@algolia/client-search';
3
- export * from '@algolia/client-search';
4
- export { AdvancedSyntaxFeatures, AlternativesAsExact, Anchoring, AroundPrecision, AroundRadius, AroundRadiusAll, AutomaticFacetFilter, AutomaticFacetFilters, BaseSearchParams, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString, Condition, Consequence, ConsequenceHide, ConsequenceParams, ConsequenceQuery, ConsequenceQueryObject, CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeletedAtResponse, Distinct, Edit, EditType, ErrorBase, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetOrdering, FacetStats, Facets, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, MatchLevel, MatchedGeoLocation, Mode, NumericFilters, OptionalFilters, Params, Personalization, Promote, PromoteObjectID, PromoteObjectIDs, QueryType, Range, RankingInfo, ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, SearchPagination, SearchParams, SearchParamsObject, SearchParamsQuery, SemanticSearch, SnippetResult, SnippetResultOption, SortRemainingBy, SupportedLanguage, TagFilters, TaskStatus, TypoTolerance, TypoToleranceEnum, Value, apiClientVersion } from '@algolia/client-search';
5
- import * as _algolia_client_common from '@algolia/client-common';
6
- import { ClientOptions } from '@algolia/client-common';
7
1
  import { Region as Region$1, AbtestingClient } from '@algolia/client-abtesting';
8
2
  export * from '@algolia/client-abtesting';
9
- export { Region as ABTestingRegion } from '@algolia/client-abtesting';
3
+ export { Region as AbTestingRegion } from '@algolia/client-abtesting';
10
4
  import { Region as Region$2, AnalyticsClient } from '@algolia/client-analytics';
11
5
  export * from '@algolia/client-analytics';
12
6
  export { Region as AnalyticsRegion } from '@algolia/client-analytics';
7
+ import { ClientOptions } from '@algolia/client-common';
13
8
  import { Region as Region$3, PersonalizationClient } from '@algolia/client-personalization';
14
9
  export * from '@algolia/client-personalization';
10
+ import { SearchClient } from '@algolia/client-search';
11
+ export * from '@algolia/client-search';
12
+ export { AdvancedSyntaxFeatures, AlternativesAsExact, Anchoring, AroundPrecision, AroundRadius, AroundRadiusAll, AutomaticFacetFilter, AutomaticFacetFilters, BaseSearchParams, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString, Condition, Consequence, ConsequenceHide, ConsequenceParams, ConsequenceQuery, ConsequenceQueryObject, CustomDeleteProps, CustomGetProps, CustomPostProps, CustomPutProps, DeletedAtResponse, Distinct, Edit, EditType, ErrorBase, ExactOnSingleWordQuery, Exhaustive, FacetFilters, FacetOrdering, FacetStats, Facets, HighlightResult, HighlightResultOption, IgnorePlurals, IndexSettingsAsSearchParams, MatchLevel, MatchedGeoLocation, Mode, NumericFilters, OptionalFilters, Params, Personalization, Promote, PromoteObjectID, PromoteObjectIDs, QueryType, Range, RankingInfo, ReRankingApplyFilter, Redirect, RedirectRuleIndexData, RedirectRuleIndexMetadata, RedirectURL, RemoveStopWords, RemoveWordsIfNoResults, RenderingContent, SearchPagination, SearchParams, SearchParamsObject, SearchParamsQuery, SemanticSearch, SnippetResult, SnippetResultOption, SortRemainingBy, SupportedLanguage, TagFilters, TaskStatus, TypoTolerance, TypoToleranceEnum, Value, apiClientVersion } from '@algolia/client-search';
15
13
  import { RecommendClient } from '@algolia/recommend';
16
14
  export * from '@algolia/recommend';
17
15
 
@@ -38,116 +36,12 @@ type InitClientRegion<TRegion> = Partial<{
38
36
  region: TRegion;
39
37
  }>;
40
38
 
41
- /**
42
- * The client type.
43
- */
44
- type Algoliasearch = ReturnType<typeof algoliasearch>;
45
- declare function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): {
46
- _ua: string;
47
- initAbtesting: (initOptions?: InitClientOptions & InitClientRegion<Region$1>) => AbtestingClient;
48
- initAnalytics: (initOptions?: InitClientOptions & InitClientRegion<Region$2>) => AnalyticsClient;
39
+ type Algoliasearch = SearchClient & {
40
+ initRecommend: (initOptions: InitClientOptions) => RecommendClient;
41
+ initAnalytics: (initOptions: InitClientOptions & InitClientRegion<Region$2>) => AnalyticsClient;
42
+ initAbtesting: (initOptions: InitClientOptions & InitClientRegion<Region$1>) => AbtestingClient;
49
43
  initPersonalization: (initOptions: InitClientOptions & Required<InitClientRegion<Region$3>>) => PersonalizationClient;
50
- initRecommend: (initOptions?: InitClientOptions) => RecommendClient;
51
- /**
52
- * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
53
- *
54
- * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
55
- * @param generateSecuredApiKey - The `generateSecuredApiKey` object.
56
- * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
57
- * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
58
- */
59
- generateSecuredApiKey({ parentApiKey, restrictions }: GenerateSecuredApiKeyOptions): string;
60
- /**
61
- * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
62
- *
63
- * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
64
- * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
65
- * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
66
- */
67
- getSecuredApiKeyRemainingValidity({ securedApiKey }: GetSecuredApiKeyRemainingValidityOptions): number;
68
- transporter: _algolia_client_common.Transporter;
69
- appId: string;
70
- clearCache(): Promise<void>;
71
- addAlgoliaAgent(segment: string, version?: string): void;
72
- waitForTask({ indexName, taskID, maxRetries, timeout, }: _algolia_client_search.WaitForTaskOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
73
- waitForAppTask({ taskID, maxRetries, timeout, }: _algolia_client_search.WaitForAppTaskOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
74
- waitForApiKey({ operation, key, apiKey, maxRetries, timeout, }: _algolia_client_search.WaitForApiKeyOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetApiKeyResponse | undefined>;
75
- browseObjects<T>({ indexName, browseParams, ...browseObjectsOptions }: _algolia_client_search.BrowseOptions<_algolia_client_search.BrowseResponse<T>> & _algolia_client_search.BrowseProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BrowseResponse<T>>;
76
- browseRules({ indexName, searchRulesParams, ...browseRulesOptions }: _algolia_client_search.BrowseOptions<_algolia_client_search.SearchRulesResponse> & _algolia_client_search.SearchRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchRulesResponse>;
77
- browseSynonyms({ indexName, searchSynonymsParams, ...browseSynonymsOptions }: _algolia_client_search.BrowseOptions<_algolia_client_search.SearchSynonymsResponse> & _algolia_client_search.SearchSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchSynonymsResponse>;
78
- chunkedBatch({ indexName, objects, action, waitForTasks, batchSize }: _algolia_client_search.ChunkedBatchOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
79
- saveObjects({ indexName, objects }: _algolia_client_search.SaveObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
80
- deleteObjects({ indexName, objectIDs }: _algolia_client_search.DeleteObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
81
- partialUpdateObjects({ indexName, objects, createIfNotExists }: _algolia_client_search.PartialUpdateObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse[]>;
82
- replaceAllObjects({ indexName, objects, batchSize }: _algolia_client_search.ReplaceAllObjectsOptions, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ReplaceAllObjectsResponse>;
83
- searchForHits<T>(searchMethodParams: _algolia_client_search.LegacySearchMethodProps | _algolia_client_search.SearchMethodParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<{
84
- results: Array<_algolia_client_search.SearchResponse<T>>;
85
- }>;
86
- searchForFacets(searchMethodParams: _algolia_client_search.LegacySearchMethodProps | _algolia_client_search.SearchMethodParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<{
87
- results: _algolia_client_search.SearchForFacetValuesResponse[];
88
- }>;
89
- addApiKey(apiKey: _algolia_client_search.ApiKey, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.AddApiKeyResponse>;
90
- addOrUpdateObject({ indexName, objectID, body }: _algolia_client_search.AddOrUpdateObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtWithObjectIdResponse>;
91
- appendSource(source: _algolia_client_search.Source, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.CreatedAtResponse>;
92
- assignUserId({ xAlgoliaUserID, assignUserIdParams }: _algolia_client_search.AssignUserIdProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.CreatedAtResponse>;
93
- batch({ indexName, batchWriteParams }: _algolia_client_search.BatchProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BatchResponse>;
94
- batchAssignUserIds({ xAlgoliaUserID, batchAssignUserIdsParams }: _algolia_client_search.BatchAssignUserIdsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.CreatedAtResponse>;
95
- batchDictionaryEntries({ dictionaryName, batchDictionaryEntriesParams }: _algolia_client_search.BatchDictionaryEntriesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
96
- browse<T>({ indexName, browseParams }: _algolia_client_search.BrowseProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.BrowseResponse<T>>;
97
- clearObjects({ indexName }: _algolia_client_search.ClearObjectsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
98
- clearRules({ indexName, forwardToReplicas }: _algolia_client_search.ClearRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
99
- clearSynonyms({ indexName, forwardToReplicas }: _algolia_client_search.ClearSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
100
- customDelete({ path, parameters }: _algolia_client_search.CustomDeleteProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
101
- customGet({ path, parameters }: _algolia_client_search.CustomGetProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
102
- customPost({ path, parameters, body }: _algolia_client_search.CustomPostProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
103
- customPut({ path, parameters, body }: _algolia_client_search.CustomPutProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
104
- deleteApiKey({ key }: _algolia_client_search.DeleteApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeleteApiKeyResponse>;
105
- deleteBy({ indexName, deleteByParams }: _algolia_client_search.DeleteByProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
106
- deleteIndex({ indexName }: _algolia_client_search.DeleteIndexProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
107
- deleteObject({ indexName, objectID }: _algolia_client_search.DeleteObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
108
- deleteRule({ indexName, objectID, forwardToReplicas }: _algolia_client_search.DeleteRuleProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
109
- deleteSource({ source }: _algolia_client_search.DeleteSourceProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeleteSourceResponse>;
110
- deleteSynonym({ indexName, objectID, forwardToReplicas }: _algolia_client_search.DeleteSynonymProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.DeletedAtResponse>;
111
- getApiKey({ key }: _algolia_client_search.GetApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetApiKeyResponse>;
112
- getAppTask({ taskID }: _algolia_client_search.GetAppTaskProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
113
- getDictionaryLanguages(requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, _algolia_client_search.Languages>>;
114
- getDictionarySettings(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetDictionarySettingsResponse>;
115
- getLogs({ offset, length, indexName, type }?: _algolia_client_search.GetLogsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.GetLogsResponse>;
116
- getObject({ indexName, objectID, attributesToRetrieve }: _algolia_client_search.GetObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<Record<string, unknown>>;
117
- getObjects<T>(getObjectsParams: _algolia_client_search.GetObjectsParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetObjectsResponse<T>>;
118
- getRule({ indexName, objectID }: _algolia_client_search.GetRuleProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.Rule>;
119
- getSettings({ indexName }: _algolia_client_search.GetSettingsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SettingsResponse>;
120
- getSources(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.Source[]>;
121
- getSynonym({ indexName, objectID }: _algolia_client_search.GetSynonymProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SynonymHit>;
122
- getTask({ indexName, taskID }: _algolia_client_search.GetTaskProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTaskResponse>;
123
- getTopUserIds(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.GetTopUserIdsResponse>;
124
- getUserId({ userID }: _algolia_client_search.GetUserIdProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UserId>;
125
- hasPendingMappings({ getClusters }?: _algolia_client_search.HasPendingMappingsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.HasPendingMappingsResponse>;
126
- listApiKeys(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ListApiKeysResponse>;
127
- listClusters(requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ListClustersResponse>;
128
- listIndices({ page, hitsPerPage }?: _algolia_client_search.ListIndicesProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.ListIndicesResponse>;
129
- listUserIds({ page, hitsPerPage }?: _algolia_client_search.ListUserIdsProps, requestOptions?: _algolia_client_common.RequestOptions | undefined): Promise<_algolia_client_search.ListUserIdsResponse>;
130
- multipleBatch(batchParams: _algolia_client_search.BatchParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.MultipleBatchResponse>;
131
- operationIndex({ indexName, operationIndexParams }: _algolia_client_search.OperationIndexProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
132
- partialUpdateObject({ indexName, objectID, attributesToUpdate, createIfNotExists }: _algolia_client_search.PartialUpdateObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtWithObjectIdResponse>;
133
- removeUserId({ userID }: _algolia_client_search.RemoveUserIdProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.RemoveUserIdResponse>;
134
- replaceSources({ source }: _algolia_client_search.ReplaceSourcesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.ReplaceSourceResponse>;
135
- restoreApiKey({ key }: _algolia_client_search.RestoreApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.AddApiKeyResponse>;
136
- saveObject({ indexName, body }: _algolia_client_search.SaveObjectProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SaveObjectResponse>;
137
- saveRule({ indexName, objectID, rule, forwardToReplicas }: _algolia_client_search.SaveRuleProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedRuleResponse>;
138
- saveRules({ indexName, rules, forwardToReplicas, clearExistingRules }: _algolia_client_search.SaveRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
139
- saveSynonym({ indexName, objectID, synonymHit, forwardToReplicas }: _algolia_client_search.SaveSynonymProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SaveSynonymResponse>;
140
- saveSynonyms({ indexName, synonymHit, forwardToReplicas, replaceExistingSynonyms }: _algolia_client_search.SaveSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
141
- search<T>(searchMethodParams: _algolia_client_search.LegacySearchMethodProps | _algolia_client_search.SearchMethodParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchResponses<T>>;
142
- searchDictionaryEntries({ dictionaryName, searchDictionaryEntriesParams }: _algolia_client_search.SearchDictionaryEntriesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchDictionaryEntriesResponse>;
143
- searchForFacetValues({ indexName, facetName, searchForFacetValuesRequest }: _algolia_client_search.SearchForFacetValuesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchForFacetValuesResponse>;
144
- searchRules({ indexName, searchRulesParams }: _algolia_client_search.SearchRulesProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchRulesResponse>;
145
- searchSingleIndex<T>({ indexName, searchParams }: _algolia_client_search.SearchSingleIndexProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchResponse<T>>;
146
- searchSynonyms({ indexName, searchSynonymsParams }: _algolia_client_search.SearchSynonymsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchSynonymsResponse>;
147
- searchUserIds(searchUserIdsParams: _algolia_client_search.SearchUserIdsParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.SearchUserIdsResponse>;
148
- setDictionarySettings(dictionarySettingsParams: _algolia_client_search.DictionarySettingsParams, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
149
- setSettings({ indexName, indexSettings, forwardToReplicas }: _algolia_client_search.SetSettingsProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdatedAtResponse>;
150
- updateApiKey({ key, apiKey }: _algolia_client_search.UpdateApiKeyProps, requestOptions?: _algolia_client_common.RequestOptions): Promise<_algolia_client_search.UpdateApiKeyResponse>;
151
44
  };
45
+ declare function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch;
152
46
 
153
47
  export { type Algoliasearch, type InitClientOptions, type InitClientRegion, type Region, algoliasearch };
package/dist/node.js CHANGED
@@ -22,21 +22,11 @@ __export(node_exports, {
22
22
  algoliasearch: () => algoliasearch,
23
23
  apiClientVersion: () => apiClientVersion
24
24
  });
25
- import { createHmac } from "node:crypto";
26
25
  import { abtestingClient } from "@algolia/client-abtesting";
27
26
  import { analyticsClient } from "@algolia/client-analytics";
28
- import {
29
- DEFAULT_CONNECT_TIMEOUT_NODE,
30
- DEFAULT_READ_TIMEOUT_NODE,
31
- DEFAULT_WRITE_TIMEOUT_NODE,
32
- createMemoryCache,
33
- createNullCache,
34
- serializeQueryParameters
35
- } from "@algolia/client-common";
36
27
  import { personalizationClient } from "@algolia/client-personalization";
37
28
  import { searchClient } from "@algolia/client-search";
38
29
  import { recommendClient } from "@algolia/recommend";
39
- import { createHttpRequester } from "@algolia/requester-node-http";
40
30
 
41
31
  // builds/models.ts
42
32
  var models_exports = {};
@@ -64,101 +54,40 @@ function algoliasearch(appId, apiKey, options) {
64
54
  if (!apiKey || typeof apiKey !== "string") {
65
55
  throw new Error("`apiKey` is missing.");
66
56
  }
67
- function initRecommend(initOptions = {}) {
68
- return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
69
- }
70
- function initAnalytics(initOptions = {}) {
71
- return analyticsClient(
72
- initOptions.appId || appId,
73
- initOptions.apiKey || apiKey,
74
- initOptions.region,
75
- initOptions.options
76
- );
77
- }
78
- function initAbtesting(initOptions = {}) {
79
- return abtestingClient(
80
- initOptions.appId || appId,
81
- initOptions.apiKey || apiKey,
82
- initOptions.region,
83
- initOptions.options
84
- );
85
- }
86
- function initPersonalization(initOptions) {
87
- return personalizationClient(
88
- initOptions.appId || appId,
89
- initOptions.apiKey || apiKey,
90
- initOptions.region,
91
- initOptions.options
92
- );
93
- }
94
57
  return {
95
- ...searchClient(appId, apiKey, {
96
- timeouts: {
97
- connect: DEFAULT_CONNECT_TIMEOUT_NODE,
98
- read: DEFAULT_READ_TIMEOUT_NODE,
99
- write: DEFAULT_WRITE_TIMEOUT_NODE
100
- },
101
- requester: createHttpRequester(),
102
- algoliaAgents: [{ segment: "Node.js", version: process.versions.node }],
103
- responsesCache: createNullCache(),
104
- requestsCache: createNullCache(),
105
- hostsCache: createMemoryCache(),
106
- ...options
107
- }),
58
+ ...searchClient(appId, apiKey, options),
108
59
  /**
109
60
  * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.
110
61
  */
111
62
  get _ua() {
112
63
  return this.transporter.algoliaAgent.value;
113
64
  },
114
- initAbtesting,
115
- initAnalytics,
116
- initPersonalization,
117
- initRecommend,
118
- /**
119
- * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
120
- *
121
- * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.
122
- * @param generateSecuredApiKey - The `generateSecuredApiKey` object.
123
- * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.
124
- * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.
125
- */
126
- generateSecuredApiKey({ parentApiKey, restrictions = {} }) {
127
- let mergedRestrictions = restrictions;
128
- if (restrictions.searchParams) {
129
- mergedRestrictions = {
130
- ...restrictions,
131
- ...restrictions.searchParams
132
- };
133
- delete mergedRestrictions.searchParams;
134
- }
135
- mergedRestrictions = Object.keys(mergedRestrictions).sort().reduce(
136
- (acc, key) => {
137
- acc[key] = mergedRestrictions[key];
138
- return acc;
139
- },
140
- {}
65
+ initRecommend: (initOptions = {}) => {
66
+ return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);
67
+ },
68
+ initAnalytics: (initOptions = {}) => {
69
+ return analyticsClient(
70
+ initOptions.appId || appId,
71
+ initOptions.apiKey || apiKey,
72
+ initOptions.region,
73
+ initOptions.options
141
74
  );
142
- const queryParameters = serializeQueryParameters(mergedRestrictions);
143
- return Buffer.from(
144
- createHmac("sha256", parentApiKey).update(queryParameters).digest("hex") + queryParameters
145
- ).toString("base64");
146
75
  },
147
- /**
148
- * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.
149
- *
150
- * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.
151
- * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.
152
- * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.
153
- */
154
- getSecuredApiKeyRemainingValidity({ securedApiKey }) {
155
- const decodedString = Buffer.from(securedApiKey, "base64").toString("ascii");
156
- const regex = /validUntil=(\d+)/;
157
- const match = decodedString.match(regex);
158
- if (match === null) {
159
- throw new Error("validUntil not found in given secured api key.");
160
- }
161
- return parseInt(match[1], 10) - Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3);
76
+ initAbtesting: (initOptions = {}) => {
77
+ return abtestingClient(
78
+ initOptions.appId || appId,
79
+ initOptions.apiKey || apiKey,
80
+ initOptions.region,
81
+ initOptions.options
82
+ );
83
+ },
84
+ initPersonalization: (initOptions) => {
85
+ return personalizationClient(
86
+ initOptions.appId || appId,
87
+ initOptions.apiKey || apiKey,
88
+ initOptions.region,
89
+ initOptions.options
90
+ );
162
91
  }
163
92
  };
164
93
  }
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../builds/node.ts","../builds/models.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport { createHmac } from 'node:crypto';\n\nimport type { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport {\n DEFAULT_CONNECT_TIMEOUT_NODE,\n DEFAULT_READ_TIMEOUT_NODE,\n DEFAULT_WRITE_TIMEOUT_NODE,\n createMemoryCache,\n createNullCache,\n serializeQueryParameters,\n} from '@algolia/client-common';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\nimport { createHttpRequester } from '@algolia/requester-node-http';\n\nimport type {\n InitClientOptions,\n InitClientRegion,\n GenerateSecuredApiKeyOptions,\n GetSecuredApiKeyRemainingValidityOptions,\n} from './models';\n\nexport * from './models';\n\n/**\n * The client type.\n */\nexport type Algoliasearch = ReturnType<typeof algoliasearch>;\n\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions) {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n function initRecommend(initOptions: InitClientOptions = {}): RecommendClient {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n }\n\n function initAnalytics(initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n function initAbtesting(initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n function initPersonalization(\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ): PersonalizationClient {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n }\n\n return {\n ...searchClient(appId, apiKey, {\n timeouts: {\n connect: DEFAULT_CONNECT_TIMEOUT_NODE,\n read: DEFAULT_READ_TIMEOUT_NODE,\n write: DEFAULT_WRITE_TIMEOUT_NODE,\n },\n requester: createHttpRequester(),\n algoliaAgents: [{ segment: 'Node.js', version: process.versions.node }],\n responsesCache: createNullCache(),\n requestsCache: createNullCache(),\n hostsCache: createMemoryCache(),\n ...options,\n }),\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n initAbtesting,\n initAnalytics,\n initPersonalization,\n initRecommend,\n /**\n * Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.\n *\n * @summary Helper: Generates a secured API key based on the given `parentApiKey` and given `restrictions`.\n * @param generateSecuredApiKey - The `generateSecuredApiKey` object.\n * @param generateSecuredApiKey.parentApiKey - The base API key from which to generate the new secured one.\n * @param generateSecuredApiKey.restrictions - A set of properties defining the restrictions of the secured API key.\n */\n generateSecuredApiKey({ parentApiKey, restrictions = {} }: GenerateSecuredApiKeyOptions): string {\n let mergedRestrictions = restrictions;\n if (restrictions.searchParams) {\n // merge searchParams with the root restrictions\n mergedRestrictions = {\n ...restrictions,\n ...restrictions.searchParams,\n };\n\n delete mergedRestrictions.searchParams;\n }\n\n mergedRestrictions = Object.keys(mergedRestrictions)\n .sort()\n .reduce(\n (acc, key) => {\n // eslint-disable-next-line no-param-reassign\n acc[key] = (mergedRestrictions as any)[key];\n return acc;\n },\n {} as Record<string, unknown>,\n );\n\n const queryParameters = serializeQueryParameters(mergedRestrictions);\n return Buffer.from(\n createHmac('sha256', parentApiKey).update(queryParameters).digest('hex') + queryParameters,\n ).toString('base64');\n },\n\n /**\n * Helper: Retrieves the remaining validity of the previous generated `securedApiKey`, the `ValidUntil` parameter must have been provided.\n *\n * @summary Helper: Retrieves the remaining validity of the previous generated `secured_api_key`, the `ValidUntil` parameter must have been provided.\n * @param getSecuredApiKeyRemainingValidity - The `getSecuredApiKeyRemainingValidity` object.\n * @param getSecuredApiKeyRemainingValidity.securedApiKey - The secured API key generated with the `generateSecuredApiKey` method.\n */\n getSecuredApiKeyRemainingValidity({ securedApiKey }: GetSecuredApiKeyRemainingValidityOptions): number {\n const decodedString = Buffer.from(securedApiKey, 'base64').toString('ascii');\n const regex = /validUntil=(\\d+)/;\n const match = decodedString.match(regex);\n\n if (match === null) {\n throw new Error('validUntil not found in given secured api key.');\n }\n\n return parseInt(match[1], 10) - Math.round(new Date().getTime() / 1000);\n },\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { Region as ABTestingRegion } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\n\ntype Region = ABTestingRegion | AnalyticsRegion;\n\nexport * from '@algolia/client-search';\nexport * from '@algolia/recommend';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-abtesting';\n\nexport {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SearchPagination,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n AnalyticsRegion,\n ABTestingRegion,\n Region,\n apiClientVersion,\n};\n\n/**\n * Options forwarded to the client initialized via the `init` method.\n */\nexport type InitClientOptions = Partial<{\n /**\n * App to target with the initialized client, defaults to the `algoliasearch` appId.\n */\n appId: string;\n /**\n * API key of the targeted app ID, defaults to the `algoliasearch` apiKey.\n */\n apiKey: string;\n options: ClientOptions;\n}>;\n\nexport type InitClientRegion<TRegion> = Partial<{\n /**\n * Available regions of the initialized client.\n */\n region: TRegion;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,SAAS,kBAAkB;AAG3B,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAGP,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAE7B,SAAS,uBAAuB;AAChC,SAAS,2BAA2B;;;ACtBpC;AAAA;AAAA;AAAA;AAmFA;AACA;AACA;AACA;AACA;AARA,SAAS,wBAAwB;AAIjC,oCAAc;AACd,gCAAc;AACd,6CAAc;AACd,uCAAc;AACd,uCAAc;;;ADxDd,yBAAc;AAQP,SAAS,cAAc,OAAe,QAAgB,SAAyB;AACpF,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AACA,WAAS,cAAc,cAAiC,CAAC,GAAoB;AAC3E,WAAO,gBAAgB,YAAY,SAAS,OAAO,YAAY,UAAU,QAAQ,YAAY,OAAO;AAAA,EACtG;AAEA,WAAS,cAAc,cAAqE,CAAC,GAAoB;AAC/G,WAAO;AAAA,MACL,YAAY,SAAS;AAAA,MACrB,YAAY,UAAU;AAAA,MACtB,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAEA,WAAS,cAAc,cAAqE,CAAC,GAAoB;AAC/G,WAAO;AAAA,MACL,YAAY,SAAS;AAAA,MACrB,YAAY,UAAU;AAAA,MACtB,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAEA,WAAS,oBACP,aACuB;AACvB,WAAO;AAAA,MACL,YAAY,SAAS;AAAA,MACrB,YAAY,UAAU;AAAA,MACtB,YAAY;AAAA,MACZ,YAAY;AAAA,IACd;AAAA,EACF;AAEA,SAAO;AAAA,IACL,GAAG,aAAa,OAAO,QAAQ;AAAA,MAC7B,UAAU;AAAA,QACR,SAAS;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MACT;AAAA,MACA,WAAW,oBAAoB;AAAA,MAC/B,eAAe,CAAC,EAAE,SAAS,WAAW,SAAS,QAAQ,SAAS,KAAK,CAAC;AAAA,MACtE,gBAAgB,gBAAgB;AAAA,MAChC,eAAe,gBAAgB;AAAA,MAC/B,YAAY,kBAAkB;AAAA,MAC9B,GAAG;AAAA,IACL,CAAC;AAAA;AAAA;AAAA;AAAA,IAID,IAAI,MAAc;AAChB,aAAO,KAAK,YAAY,aAAa;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,sBAAsB,EAAE,cAAc,eAAe,CAAC,EAAE,GAAyC;AAC/F,UAAI,qBAAqB;AACzB,UAAI,aAAa,cAAc;AAE7B,6BAAqB;AAAA,UACnB,GAAG;AAAA,UACH,GAAG,aAAa;AAAA,QAClB;AAEA,eAAO,mBAAmB;AAAA,MAC5B;AAEA,2BAAqB,OAAO,KAAK,kBAAkB,EAChD,KAAK,EACL;AAAA,QACC,CAAC,KAAK,QAAQ;AAEZ,cAAI,GAAG,IAAK,mBAA2B,GAAG;AAC1C,iBAAO;AAAA,QACT;AAAA,QACA,CAAC;AAAA,MACH;AAEF,YAAM,kBAAkB,yBAAyB,kBAAkB;AACnE,aAAO,OAAO;AAAA,QACZ,WAAW,UAAU,YAAY,EAAE,OAAO,eAAe,EAAE,OAAO,KAAK,IAAI;AAAA,MAC7E,EAAE,SAAS,QAAQ;AAAA,IACrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,kCAAkC,EAAE,cAAc,GAAqD;AACrG,YAAM,gBAAgB,OAAO,KAAK,eAAe,QAAQ,EAAE,SAAS,OAAO;AAC3E,YAAM,QAAQ;AACd,YAAM,QAAQ,cAAc,MAAM,KAAK;AAEvC,UAAI,UAAU,MAAM;AAClB,cAAM,IAAI,MAAM,gDAAgD;AAAA,MAClE;AAEA,aAAO,SAAS,MAAM,CAAC,GAAG,EAAE,IAAI,KAAK,OAAM,oBAAI,KAAK,GAAE,QAAQ,IAAI,GAAI;AAAA,IACxE;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../builds/node.ts","../builds/models.ts"],"sourcesContent":["// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { AbtestingClient, Region as AbtestingRegion } from '@algolia/client-abtesting';\nimport { abtestingClient } from '@algolia/client-abtesting';\nimport type { AnalyticsClient, Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport { analyticsClient } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type { PersonalizationClient, Region as PersonalizationRegion } from '@algolia/client-personalization';\nimport { personalizationClient } from '@algolia/client-personalization';\nimport type { SearchClient } from '@algolia/client-search';\nimport { searchClient } from '@algolia/client-search';\nimport type { RecommendClient } from '@algolia/recommend';\nimport { recommendClient } from '@algolia/recommend';\n\nimport type { InitClientOptions, InitClientRegion } from './models';\n\nexport * from './models';\n\nexport type Algoliasearch = SearchClient & {\n initRecommend: (initOptions: InitClientOptions) => RecommendClient;\n initAnalytics: (initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion>) => AnalyticsClient;\n initAbtesting: (initOptions: InitClientOptions & InitClientRegion<AbtestingRegion>) => AbtestingClient;\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ) => PersonalizationClient;\n};\n\nexport function algoliasearch(appId: string, apiKey: string, options?: ClientOptions): Algoliasearch {\n if (!appId || typeof appId !== 'string') {\n throw new Error('`appId` is missing.');\n }\n\n if (!apiKey || typeof apiKey !== 'string') {\n throw new Error('`apiKey` is missing.');\n }\n\n return {\n ...searchClient(appId, apiKey, options),\n /**\n * Get the value of the `algoliaAgent`, used by our libraries internally and telemetry system.\n */\n get _ua(): string {\n return this.transporter.algoliaAgent.value;\n },\n initRecommend: (initOptions: InitClientOptions = {}): RecommendClient => {\n return recommendClient(initOptions.appId || appId, initOptions.apiKey || apiKey, initOptions.options);\n },\n\n initAnalytics: (initOptions: InitClientOptions & InitClientRegion<AnalyticsRegion> = {}): AnalyticsClient => {\n return analyticsClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initAbtesting: (initOptions: InitClientOptions & InitClientRegion<AbtestingRegion> = {}): AbtestingClient => {\n return abtestingClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n\n initPersonalization: (\n initOptions: InitClientOptions & Required<InitClientRegion<PersonalizationRegion>>,\n ): PersonalizationClient => {\n return personalizationClient(\n initOptions.appId || appId,\n initOptions.apiKey || apiKey,\n initOptions.region,\n initOptions.options,\n );\n },\n };\n}\n","// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.\n\nimport type { Region as AbTestingRegion } from '@algolia/client-abtesting';\nimport type { Region as AnalyticsRegion } from '@algolia/client-analytics';\nimport type { ClientOptions } from '@algolia/client-common';\nimport type {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchPagination,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n} from '@algolia/client-search';\nimport { apiClientVersion } from '@algolia/client-search';\n\ntype Region = AbTestingRegion | AnalyticsRegion;\n\nexport * from '@algolia/client-search';\nexport * from '@algolia/recommend';\nexport * from '@algolia/client-personalization';\nexport * from '@algolia/client-analytics';\nexport * from '@algolia/client-abtesting';\n\nexport {\n AdvancedSyntaxFeatures,\n AlternativesAsExact,\n Anchoring,\n AroundPrecision,\n AroundRadius,\n AroundRadiusAll,\n AutomaticFacetFilter,\n AutomaticFacetFilters,\n BaseSearchParams,\n BaseSearchParamsWithoutQuery,\n BaseSearchResponse,\n BooleanString,\n Condition,\n Consequence,\n ConsequenceHide,\n ConsequenceParams,\n ConsequenceQuery,\n ConsequenceQueryObject,\n CustomDeleteProps,\n CustomGetProps,\n CustomPostProps,\n CustomPutProps,\n DeletedAtResponse,\n Distinct,\n Edit,\n EditType,\n ErrorBase,\n ExactOnSingleWordQuery,\n Exhaustive,\n FacetFilters,\n FacetOrdering,\n Facets,\n FacetStats,\n HighlightResult,\n HighlightResultOption,\n IgnorePlurals,\n IndexSettingsAsSearchParams,\n MatchLevel,\n MatchedGeoLocation,\n Mode,\n NumericFilters,\n OptionalFilters,\n Params,\n Personalization,\n Promote,\n PromoteObjectID,\n PromoteObjectIDs,\n QueryType,\n Range,\n RankingInfo,\n ReRankingApplyFilter,\n Redirect,\n RedirectRuleIndexMetadata,\n RedirectRuleIndexData,\n RedirectURL,\n RemoveStopWords,\n RemoveWordsIfNoResults,\n RenderingContent,\n SearchParams,\n SearchParamsObject,\n SearchParamsQuery,\n SemanticSearch,\n SearchPagination,\n SnippetResult,\n SnippetResultOption,\n SortRemainingBy,\n SupportedLanguage,\n TagFilters,\n TaskStatus,\n TypoTolerance,\n TypoToleranceEnum,\n Value,\n AnalyticsRegion,\n AbTestingRegion,\n Region,\n apiClientVersion,\n};\n\n/**\n * Options forwarded to the client initialized via the `init` method.\n */\nexport type InitClientOptions = Partial<{\n /**\n * App to target with the initialized client, defaults to the `algoliasearch` appId.\n */\n appId: string;\n /**\n * API key of the targeted app ID, defaults to the `algoliasearch` apiKey.\n */\n apiKey: string;\n options: ClientOptions;\n}>;\n\nexport type InitClientRegion<TRegion> = Partial<{\n /**\n * Available regions of the initialized client.\n */\n region: TRegion;\n}>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,SAAS,uBAAuB;AAEhC,SAAS,uBAAuB;AAGhC,SAAS,6BAA6B;AAEtC,SAAS,oBAAoB;AAE7B,SAAS,uBAAuB;;;ACZhC;AAAA;AAAA;AAAA;AAmFA;AACA;AACA;AACA;AACA;AARA,SAAS,wBAAwB;AAIjC,oCAAc;AACd,gCAAc;AACd,6CAAc;AACd,uCAAc;AACd,uCAAc;;;ADvEd,yBAAc;AAWP,SAAS,cAAc,OAAe,QAAgB,SAAwC;AACnG,MAAI,CAAC,SAAS,OAAO,UAAU,UAAU;AACvC,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,MAAI,CAAC,UAAU,OAAO,WAAW,UAAU;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAAA,EACxC;AAEA,SAAO;AAAA,IACL,GAAG,aAAa,OAAO,QAAQ,OAAO;AAAA;AAAA;AAAA;AAAA,IAItC,IAAI,MAAc;AAChB,aAAO,KAAK,YAAY,aAAa;AAAA,IACvC;AAAA,IACA,eAAe,CAAC,cAAiC,CAAC,MAAuB;AACvE,aAAO,gBAAgB,YAAY,SAAS,OAAO,YAAY,UAAU,QAAQ,YAAY,OAAO;AAAA,IACtG;AAAA,IAEA,eAAe,CAAC,cAAqE,CAAC,MAAuB;AAC3G,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,eAAe,CAAC,cAAqE,CAAC,MAAuB;AAC3G,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,IAEA,qBAAqB,CACnB,gBAC0B;AAC1B,aAAO;AAAA,QACL,YAAY,SAAS;AAAA,QACrB,YAAY,UAAU;AAAA,QACtB,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -13,16 +13,12 @@ import { createXhrRequester } from '@algolia/requester-browser-xhr';
13
13
 
14
14
  import { createLiteClient, apiClientVersion } from '../src/liteClient';
15
15
 
16
+ export type LiteClient = ReturnType<typeof createLiteClient>;
17
+
16
18
  export { apiClientVersion } from '../src/liteClient';
17
19
  export * from '../model';
18
20
 
19
- /**
20
- * The client type.
21
- */
22
- export type LiteClient = ReturnType<typeof liteClient>;
23
-
24
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
25
- export function liteClient(appId: string, apiKey: string, options?: ClientOptions) {
21
+ export function liteClient(appId: string, apiKey: string, options?: ClientOptions): LiteClient {
26
22
  if (!appId || typeof appId !== 'string') {
27
23
  throw new Error('`appId` is missing.');
28
24
  }
@@ -12,16 +12,12 @@ import { createHttpRequester } from '@algolia/requester-node-http';
12
12
 
13
13
  import { createLiteClient } from '../src/liteClient';
14
14
 
15
+ export type LiteClient = ReturnType<typeof createLiteClient>;
16
+
15
17
  export { apiClientVersion } from '../src/liteClient';
16
18
  export * from '../model';
17
19
 
18
- /**
19
- * The client type.
20
- */
21
- export type LiteClient = ReturnType<typeof liteClient>;
22
-
23
- // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
24
- export function liteClient(appId: string, apiKey: string, options?: ClientOptions) {
20
+ export function liteClient(appId: string, apiKey: string, options?: ClientOptions): LiteClient {
25
21
  if (!appId || typeof appId !== 'string') {
26
22
  throw new Error('`appId` is missing.');
27
23
  }