@algolia/recommend 5.55.2 → 5.56.0

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/README.md CHANGED
@@ -40,11 +40,11 @@ All of our clients comes with type definition, and are available for both browse
40
40
  ### With a package manager
41
41
 
42
42
  ```bash
43
- yarn add @algolia/recommend@5.55.2
43
+ yarn add @algolia/recommend@5.56.0
44
44
  # or
45
- npm install @algolia/recommend@5.55.2
45
+ npm install @algolia/recommend@5.56.0
46
46
  # or
47
- pnpm add @algolia/recommend@5.55.2
47
+ pnpm add @algolia/recommend@5.56.0
48
48
  ```
49
49
 
50
50
  ### Without a package manager
@@ -52,7 +52,7 @@ pnpm add @algolia/recommend@5.55.2
52
52
  Add the following JavaScript snippet to the <head> of your website:
53
53
 
54
54
  ```html
55
- <script src="https://cdn.jsdelivr.net/npm/@algolia/recommend@5.55.2/dist/builds/browser.umd.js"></script>
55
+ <script src="https://cdn.jsdelivr.net/npm/@algolia/recommend@5.56.0/dist/builds/browser.umd.js"></script>
56
56
  ```
57
57
 
58
58
  ### Usage
package/dist/browser.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _algolia_client_common from '@algolia/client-common';
2
- import { CreateClientOptions, RequestOptions, ClientOptions } from '@algolia/client-common';
2
+ import { CreateClientOptions, RequestOptions, AlgoliaHttpResponse, ClientOptions } from '@algolia/client-common';
3
3
 
4
4
  /**
5
5
  * Response, taskID, and deletion timestamp.
@@ -556,7 +556,7 @@ type BaseRecommendRequest = {
556
556
  /**
557
557
  * Search parameters to use for a fallback request if there aren\'t enough recommendations.
558
558
  */
559
- type FallbackParams = BaseRecommendSearchParams & SearchParamsQuery & RecommendIndexSettings;
559
+ type FallbackParams = BaseRecommendSearchParams & SearchParamsQuery & RecommendIndexSettings & Record<string, unknown>;
560
560
 
561
561
  /**
562
562
  * Frequently bought together model. This model recommends items that have been purchased within 1 day with the item with the ID `objectID`.
@@ -1408,9 +1408,9 @@ type SearchRecommendRulesProps = {
1408
1408
  searchRecommendRulesParams?: SearchRecommendRulesParams | undefined;
1409
1409
  };
1410
1410
 
1411
- declare const apiClientVersion = "5.55.2";
1411
+ declare const apiClientVersion = "5.56.0";
1412
1412
  declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOption, authMode, algoliaAgents, ...options }: CreateClientOptions): {
1413
- transporter: _algolia_client_common.Transporter;
1413
+ transporter: _algolia_client_common.TransporterWithHttpInfo;
1414
1414
  /**
1415
1415
  * The `appId` currently in use.
1416
1416
  */
@@ -1455,6 +1455,21 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1455
1455
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1456
1456
  */
1457
1457
  batchRecommendRules({ indexName, model, recommendRule }: BatchRecommendRulesProps, requestOptions?: RequestOptions): Promise<RecommendUpdatedAtResponse>;
1458
+ /**
1459
+ * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn\'t require a facet value placeholder (it tries to match the data source item\'s attributes instead).
1460
+ *
1461
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1462
+ *
1463
+ * Required API Key ACLs:
1464
+ * - editSettings
1465
+ * @param batchRecommendRules - The batchRecommendRules object.
1466
+ * @param batchRecommendRules.indexName - Name of the index on which to perform the operation.
1467
+ * @param batchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
1468
+ * @param batchRecommendRules.recommendRule - The recommendRule object.
1469
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1470
+ * @see batchRecommendRules for the plain version.
1471
+ */
1472
+ batchRecommendRulesWithHTTPInfo({ indexName, model, recommendRule }: BatchRecommendRulesProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<RecommendUpdatedAtResponse>>;
1458
1473
  /**
1459
1474
  * This method lets you send requests to the Algolia REST API.
1460
1475
  * @param customDelete - The customDelete object.
@@ -1463,6 +1478,17 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1463
1478
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1464
1479
  */
1465
1480
  customDelete({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
1481
+ /**
1482
+ * This method lets you send requests to the Algolia REST API.
1483
+ *
1484
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1485
+ * @param customDelete - The customDelete object.
1486
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
1487
+ * @param customDelete.parameters - Query parameters to apply to the current query.
1488
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1489
+ * @see customDelete for the plain version.
1490
+ */
1491
+ customDeleteWithHTTPInfo({ path, parameters }: CustomDeleteProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<Record<string, unknown>>>;
1466
1492
  /**
1467
1493
  * This method lets you send requests to the Algolia REST API.
1468
1494
  * @param customGet - The customGet object.
@@ -1471,6 +1497,17 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1471
1497
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1472
1498
  */
1473
1499
  customGet({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
1500
+ /**
1501
+ * This method lets you send requests to the Algolia REST API.
1502
+ *
1503
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1504
+ * @param customGet - The customGet object.
1505
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
1506
+ * @param customGet.parameters - Query parameters to apply to the current query.
1507
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1508
+ * @see customGet for the plain version.
1509
+ */
1510
+ customGetWithHTTPInfo({ path, parameters }: CustomGetProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<Record<string, unknown>>>;
1474
1511
  /**
1475
1512
  * This method lets you send requests to the Algolia REST API.
1476
1513
  * @param customPost - The customPost object.
@@ -1480,6 +1517,18 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1480
1517
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1481
1518
  */
1482
1519
  customPost({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
1520
+ /**
1521
+ * This method lets you send requests to the Algolia REST API.
1522
+ *
1523
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1524
+ * @param customPost - The customPost object.
1525
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
1526
+ * @param customPost.parameters - Query parameters to apply to the current query.
1527
+ * @param customPost.body - Parameters to send with the custom request.
1528
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1529
+ * @see customPost for the plain version.
1530
+ */
1531
+ customPostWithHTTPInfo({ path, parameters, body }: CustomPostProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<Record<string, unknown>>>;
1483
1532
  /**
1484
1533
  * This method lets you send requests to the Algolia REST API.
1485
1534
  * @param customPut - The customPut object.
@@ -1489,6 +1538,18 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1489
1538
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1490
1539
  */
1491
1540
  customPut({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<Record<string, unknown>>;
1541
+ /**
1542
+ * This method lets you send requests to the Algolia REST API.
1543
+ *
1544
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1545
+ * @param customPut - The customPut object.
1546
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
1547
+ * @param customPut.parameters - Query parameters to apply to the current query.
1548
+ * @param customPut.body - Parameters to send with the custom request.
1549
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1550
+ * @see customPut for the plain version.
1551
+ */
1552
+ customPutWithHTTPInfo({ path, parameters, body }: CustomPutProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<Record<string, unknown>>>;
1492
1553
  /**
1493
1554
  * Deletes a Recommend rule from a recommendation scenario.
1494
1555
  *
@@ -1501,6 +1562,21 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1501
1562
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1502
1563
  */
1503
1564
  deleteRecommendRule({ indexName, model, objectID }: DeleteRecommendRuleProps, requestOptions?: RequestOptions): Promise<DeletedAtResponse>;
1565
+ /**
1566
+ * Deletes a Recommend rule from a recommendation scenario.
1567
+ *
1568
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1569
+ *
1570
+ * Required API Key ACLs:
1571
+ * - editSettings
1572
+ * @param deleteRecommendRule - The deleteRecommendRule object.
1573
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
1574
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
1575
+ * @param deleteRecommendRule.objectID - Unique record identifier.
1576
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1577
+ * @see deleteRecommendRule for the plain version.
1578
+ */
1579
+ deleteRecommendRuleWithHTTPInfo({ indexName, model, objectID }: DeleteRecommendRuleProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<DeletedAtResponse>>;
1504
1580
  /**
1505
1581
  * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
1506
1582
  *
@@ -1513,6 +1589,21 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1513
1589
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1514
1590
  */
1515
1591
  getRecommendRule({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<RecommendRule>;
1592
+ /**
1593
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
1594
+ *
1595
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1596
+ *
1597
+ * Required API Key ACLs:
1598
+ * - settings
1599
+ * @param getRecommendRule - The getRecommendRule object.
1600
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
1601
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
1602
+ * @param getRecommendRule.objectID - Unique record identifier.
1603
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1604
+ * @see getRecommendRule for the plain version.
1605
+ */
1606
+ getRecommendRuleWithHTTPInfo({ indexName, model, objectID }: GetRecommendRuleProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<RecommendRule>>;
1516
1607
  /**
1517
1608
  * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
1518
1609
  *
@@ -1525,6 +1616,21 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1525
1616
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1526
1617
  */
1527
1618
  getRecommendStatus({ indexName, model, taskID }: GetRecommendStatusProps, requestOptions?: RequestOptions): Promise<GetRecommendTaskResponse>;
1619
+ /**
1620
+ * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
1621
+ *
1622
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1623
+ *
1624
+ * Required API Key ACLs:
1625
+ * - editSettings
1626
+ * @param getRecommendStatus - The getRecommendStatus object.
1627
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
1628
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
1629
+ * @param getRecommendStatus.taskID - Unique task identifier.
1630
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1631
+ * @see getRecommendStatus for the plain version.
1632
+ */
1633
+ getRecommendStatusWithHTTPInfo({ indexName, model, taskID }: GetRecommendStatusProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<GetRecommendTaskResponse>>;
1528
1634
  /**
1529
1635
  * Retrieves recommendations from selected AI models.
1530
1636
  *
@@ -1534,6 +1640,18 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1534
1640
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1535
1641
  */
1536
1642
  getRecommendations(getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams, requestOptions?: RequestOptions): Promise<GetRecommendationsResponse>;
1643
+ /**
1644
+ * Retrieves recommendations from selected AI models.
1645
+ *
1646
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1647
+ *
1648
+ * Required API Key ACLs:
1649
+ * - search
1650
+ * @param getRecommendationsParams - The getRecommendationsParams object.
1651
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1652
+ * @see getRecommendations for the plain version.
1653
+ */
1654
+ getRecommendationsWithHTTPInfo(getRecommendationsParams: GetRecommendationsParams | LegacyGetRecommendationsParams, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<GetRecommendationsResponse>>;
1537
1655
  /**
1538
1656
  * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
1539
1657
  *
@@ -1546,6 +1664,21 @@ declare function createRecommendClient({ appId: appIdOption, apiKey: apiKeyOptio
1546
1664
  * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1547
1665
  */
1548
1666
  searchRecommendRules({ indexName, model, searchRecommendRulesParams }: SearchRecommendRulesProps, requestOptions?: RequestOptions): Promise<SearchRecommendRulesResponse>;
1667
+ /**
1668
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
1669
+ *
1670
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
1671
+ *
1672
+ * Required API Key ACLs:
1673
+ * - settings
1674
+ * @param searchRecommendRules - The searchRecommendRules object.
1675
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
1676
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
1677
+ * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
1678
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
1679
+ * @see searchRecommendRules for the plain version.
1680
+ */
1681
+ searchRecommendRulesWithHTTPInfo({ indexName, model, searchRecommendRulesParams }: SearchRecommendRulesProps, requestOptions?: RequestOptions): Promise<AlgoliaHttpResponse<SearchRecommendRulesResponse>>;
1549
1682
  };
1550
1683
 
1551
1684
  /**
@@ -1555,7 +1688,12 @@ type ErrorBase = Record<string, any> & {
1555
1688
  message?: string | undefined;
1556
1689
  };
1557
1690
 
1691
+ /**
1692
+ * Filter the search by facet values, so that only records with the same facet values are retrieved. **Prefer using the `filters` parameter, which supports all filter types and combinations with boolean operators.** - `[filter1, filter2]` is interpreted as `filter1 AND filter2`. - `[[filter1, filter2], filter3]` is interpreted as `filter1 OR filter2 AND filter3`. - `facet:-value` is interpreted as `NOT facet:value`. While it\'s best to avoid attributes that start with a `-`, you can still filter them by escaping with a backslash: `facet:\\-value`.
1693
+ */
1694
+ type FacetFilters = Array<FacetFilters> | string;
1695
+
1558
1696
  declare function recommendClient(appId: string, apiKey: string, options?: ClientOptions | undefined): RecommendClient;
1559
1697
  type RecommendClient = ReturnType<typeof createRecommendClient>;
1560
1698
 
1561
- export { type AdvancedSyntaxFeatures, type AlternativesAsExact, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutoFacetFilter, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchResponse, type BatchRecommendRulesProps, type BooleanString, type BoughtTogetherQuery, type Condition, type Consequence, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteRecommendRuleProps, type DeletedAtResponse, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetRecommendRuleProps, type GetRecommendStatusProps, type GetRecommendTaskResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HideConsequenceObject, type HighlightResult, type HighlightResultOption, type IgnorePlurals, type IndexSettingsFacets, type InsideBoundingBox, type LegacyGetRecommendationsParams, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type OptionalWords, type ParamsConsequence, type Personalization, type PromoteConsequenceObject, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendClient, type RecommendHit, type RecommendIndexSettings, type RecommendModels, type RecommendRule, type RecommendSearchParams, type RecommendUpdatedAtResponse, type RecommendationsHit, type RecommendationsHits, type RecommendationsRequest, type RecommendationsResults, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RelatedModel, type RelatedProducts, type RelatedQuery, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RuleMetadata, type SearchPagination, type SearchParamsQuery, type SearchRecommendRulesParams, type SearchRecommendRulesProps, type SearchRecommendRulesResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TaskStatus, type TimeRange, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, type Widgets, apiClientVersion, recommendClient };
1699
+ export { type AdvancedSyntaxFeatures, type AlternativesAsExact, type AroundPrecision, type AroundRadius, type AroundRadiusAll, type AutoFacetFilter, type Banner, type BannerImage, type BannerImageUrl, type BannerLink, type BaseIndexSettings, type BaseRecommendIndexSettings, type BaseRecommendRequest, type BaseRecommendSearchParams, type BaseSearchResponse, type BatchRecommendRulesProps, type BooleanString, type BoughtTogetherQuery, type Condition, type Consequence, type CustomDeleteProps, type CustomGetProps, type CustomPostProps, type CustomPutProps, type DeleteRecommendRuleProps, type DeletedAtResponse, type Distinct, type ErrorBase, type ExactOnSingleWordQuery, type Exhaustive, type FacetFilters, type FacetOrdering, type FacetStats, type FallbackParams, type FbtModel, type FrequentlyBoughtTogether, type GetRecommendRuleProps, type GetRecommendStatusProps, type GetRecommendTaskResponse, type GetRecommendationsParams, type GetRecommendationsResponse, type HideConsequenceObject, type HighlightResult, type HighlightResultOption, type IgnorePlurals, type IndexSettingsFacets, type InsideBoundingBox, type LegacyGetRecommendationsParams, type LookingSimilar, type LookingSimilarModel, type LookingSimilarQuery, type MatchLevel, type MatchedGeoLocation, type NumericFilters, type OptionalFilters, type OptionalWords, type ParamsConsequence, type Personalization, type PromoteConsequenceObject, type QueryType, type Range, type RankingInfo, type ReRankingApplyFilter, type RecommendClient, type RecommendHit, type RecommendIndexSettings, type RecommendModels, type RecommendRule, type RecommendSearchParams, type RecommendUpdatedAtResponse, type RecommendationsHit, type RecommendationsHits, type RecommendationsRequest, type RecommendationsResults, type Redirect, type RedirectRuleIndexData, type RedirectRuleIndexMetadata, type RedirectURL, type RelatedModel, type RelatedProducts, type RelatedQuery, type RemoveStopWords, type RemoveWordsIfNoResults, type RenderingContent, type RuleMetadata, type SearchPagination, type SearchParamsQuery, type SearchRecommendRulesParams, type SearchRecommendRulesProps, type SearchRecommendRulesResponse, type SnippetResult, type SnippetResultOption, type SortRemainingBy, type SupportedLanguage, type TagFilters, type TaskStatus, type TimeRange, type TrendingFacetHit, type TrendingFacets, type TrendingFacetsModel, type TrendingFacetsQuery, type TrendingItems, type TrendingItemsModel, type TrendingItemsQuery, type TypoTolerance, type TypoToleranceEnum, type Value, type Widgets, apiClientVersion, recommendClient };
@@ -9,7 +9,7 @@ import { createXhrRequester } from "@algolia/requester-browser-xhr";
9
9
 
10
10
  // src/recommendClient.ts
11
11
  import { createAuth, createTransporter, getAlgoliaAgent, shuffle, validateRequired } from "@algolia/client-common";
12
- var apiClientVersion = "5.55.2";
12
+ var apiClientVersion = "5.56.0";
13
13
  function getDefaultHosts(appId) {
14
14
  return [
15
15
  {
@@ -138,6 +138,35 @@ function createRecommendClient({
138
138
  };
139
139
  return transporter.request(request, requestOptions);
140
140
  },
141
+ /**
142
+ * Create or update a batch of Recommend Rules Each Recommend Rule is created or updated, depending on whether a Recommend Rule with the same `objectID` already exists. You may also specify `true` for `clearExistingRules`, in which case the batch will atomically replace all the existing Recommend Rules. Recommend Rules are similar to Search Rules, except that the conditions and consequences apply to a [source item](/doc/guides/algolia-recommend/overview/#recommend-models) instead of a query. The main differences are the following: - Conditions `pattern` and `anchoring` are unavailable. - Condition `filters` triggers if the source item matches the specified filters. - Condition `filters` accepts numeric filters. - Consequence `params` only covers filtering parameters. - Consequence `automaticFacetFilters` doesn\'t require a facet value placeholder (it tries to match the data source item\'s attributes instead).
143
+ *
144
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
145
+ *
146
+ * Required API Key ACLs:
147
+ * - editSettings
148
+ * @param batchRecommendRules - The batchRecommendRules object.
149
+ * @param batchRecommendRules.indexName - Name of the index on which to perform the operation.
150
+ * @param batchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
151
+ * @param batchRecommendRules.recommendRule - The recommendRule object.
152
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
153
+ * @see batchRecommendRules for the plain version.
154
+ */
155
+ batchRecommendRulesWithHTTPInfo({ indexName, model, recommendRule }, requestOptions) {
156
+ validateRequired("indexName", "batchRecommendRulesWithHTTPInfo", indexName);
157
+ validateRequired("model", "batchRecommendRulesWithHTTPInfo", model);
158
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model));
159
+ const headers = {};
160
+ const queryParameters = {};
161
+ const request = {
162
+ method: "POST",
163
+ path: requestPath,
164
+ queryParameters,
165
+ headers,
166
+ data: recommendRule ? recommendRule : {}
167
+ };
168
+ return transporter.requestWithHttpInfo(request, requestOptions);
169
+ },
141
170
  /**
142
171
  * This method lets you send requests to the Algolia REST API.
143
172
  * @param customDelete - The customDelete object.
@@ -158,6 +187,29 @@ function createRecommendClient({
158
187
  };
159
188
  return transporter.request(request, requestOptions);
160
189
  },
190
+ /**
191
+ * This method lets you send requests to the Algolia REST API.
192
+ *
193
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
194
+ * @param customDelete - The customDelete object.
195
+ * @param customDelete.path - Path of the endpoint, for example `1/newFeature`.
196
+ * @param customDelete.parameters - Query parameters to apply to the current query.
197
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
198
+ * @see customDelete for the plain version.
199
+ */
200
+ customDeleteWithHTTPInfo({ path, parameters }, requestOptions) {
201
+ validateRequired("path", "customDeleteWithHTTPInfo", path);
202
+ const requestPath = "/{path}".replace("{path}", path);
203
+ const headers = {};
204
+ const queryParameters = parameters ? parameters : {};
205
+ const request = {
206
+ method: "DELETE",
207
+ path: requestPath,
208
+ queryParameters,
209
+ headers
210
+ };
211
+ return transporter.requestWithHttpInfo(request, requestOptions);
212
+ },
161
213
  /**
162
214
  * This method lets you send requests to the Algolia REST API.
163
215
  * @param customGet - The customGet object.
@@ -178,6 +230,29 @@ function createRecommendClient({
178
230
  };
179
231
  return transporter.request(request, requestOptions);
180
232
  },
233
+ /**
234
+ * This method lets you send requests to the Algolia REST API.
235
+ *
236
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
237
+ * @param customGet - The customGet object.
238
+ * @param customGet.path - Path of the endpoint, for example `1/newFeature`.
239
+ * @param customGet.parameters - Query parameters to apply to the current query.
240
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
241
+ * @see customGet for the plain version.
242
+ */
243
+ customGetWithHTTPInfo({ path, parameters }, requestOptions) {
244
+ validateRequired("path", "customGetWithHTTPInfo", path);
245
+ const requestPath = "/{path}".replace("{path}", path);
246
+ const headers = {};
247
+ const queryParameters = parameters ? parameters : {};
248
+ const request = {
249
+ method: "GET",
250
+ path: requestPath,
251
+ queryParameters,
252
+ headers
253
+ };
254
+ return transporter.requestWithHttpInfo(request, requestOptions);
255
+ },
181
256
  /**
182
257
  * This method lets you send requests to the Algolia REST API.
183
258
  * @param customPost - The customPost object.
@@ -200,6 +275,31 @@ function createRecommendClient({
200
275
  };
201
276
  return transporter.request(request, requestOptions);
202
277
  },
278
+ /**
279
+ * This method lets you send requests to the Algolia REST API.
280
+ *
281
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
282
+ * @param customPost - The customPost object.
283
+ * @param customPost.path - Path of the endpoint, for example `1/newFeature`.
284
+ * @param customPost.parameters - Query parameters to apply to the current query.
285
+ * @param customPost.body - Parameters to send with the custom request.
286
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
287
+ * @see customPost for the plain version.
288
+ */
289
+ customPostWithHTTPInfo({ path, parameters, body }, requestOptions) {
290
+ validateRequired("path", "customPostWithHTTPInfo", path);
291
+ const requestPath = "/{path}".replace("{path}", path);
292
+ const headers = {};
293
+ const queryParameters = parameters ? parameters : {};
294
+ const request = {
295
+ method: "POST",
296
+ path: requestPath,
297
+ queryParameters,
298
+ headers,
299
+ data: body ? body : {}
300
+ };
301
+ return transporter.requestWithHttpInfo(request, requestOptions);
302
+ },
203
303
  /**
204
304
  * This method lets you send requests to the Algolia REST API.
205
305
  * @param customPut - The customPut object.
@@ -222,6 +322,31 @@ function createRecommendClient({
222
322
  };
223
323
  return transporter.request(request, requestOptions);
224
324
  },
325
+ /**
326
+ * This method lets you send requests to the Algolia REST API.
327
+ *
328
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
329
+ * @param customPut - The customPut object.
330
+ * @param customPut.path - Path of the endpoint, for example `1/newFeature`.
331
+ * @param customPut.parameters - Query parameters to apply to the current query.
332
+ * @param customPut.body - Parameters to send with the custom request.
333
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
334
+ * @see customPut for the plain version.
335
+ */
336
+ customPutWithHTTPInfo({ path, parameters, body }, requestOptions) {
337
+ validateRequired("path", "customPutWithHTTPInfo", path);
338
+ const requestPath = "/{path}".replace("{path}", path);
339
+ const headers = {};
340
+ const queryParameters = parameters ? parameters : {};
341
+ const request = {
342
+ method: "PUT",
343
+ path: requestPath,
344
+ queryParameters,
345
+ headers,
346
+ data: body ? body : {}
347
+ };
348
+ return transporter.requestWithHttpInfo(request, requestOptions);
349
+ },
225
350
  /**
226
351
  * Deletes a Recommend rule from a recommendation scenario.
227
352
  *
@@ -248,6 +373,35 @@ function createRecommendClient({
248
373
  };
249
374
  return transporter.request(request, requestOptions);
250
375
  },
376
+ /**
377
+ * Deletes a Recommend rule from a recommendation scenario.
378
+ *
379
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
380
+ *
381
+ * Required API Key ACLs:
382
+ * - editSettings
383
+ * @param deleteRecommendRule - The deleteRecommendRule object.
384
+ * @param deleteRecommendRule.indexName - Name of the index on which to perform the operation.
385
+ * @param deleteRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
386
+ * @param deleteRecommendRule.objectID - Unique record identifier.
387
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
388
+ * @see deleteRecommendRule for the plain version.
389
+ */
390
+ deleteRecommendRuleWithHTTPInfo({ indexName, model, objectID }, requestOptions) {
391
+ validateRequired("indexName", "deleteRecommendRuleWithHTTPInfo", indexName);
392
+ validateRequired("model", "deleteRecommendRuleWithHTTPInfo", model);
393
+ validateRequired("objectID", "deleteRecommendRuleWithHTTPInfo", objectID);
394
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{objectID}", encodeURIComponent(objectID));
395
+ const headers = {};
396
+ const queryParameters = {};
397
+ const request = {
398
+ method: "DELETE",
399
+ path: requestPath,
400
+ queryParameters,
401
+ headers
402
+ };
403
+ return transporter.requestWithHttpInfo(request, requestOptions);
404
+ },
251
405
  /**
252
406
  * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
253
407
  *
@@ -274,6 +428,35 @@ function createRecommendClient({
274
428
  };
275
429
  return transporter.request(request, requestOptions);
276
430
  },
431
+ /**
432
+ * Retrieves a Recommend rule that you previously created in the Algolia dashboard.
433
+ *
434
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
435
+ *
436
+ * Required API Key ACLs:
437
+ * - settings
438
+ * @param getRecommendRule - The getRecommendRule object.
439
+ * @param getRecommendRule.indexName - Name of the index on which to perform the operation.
440
+ * @param getRecommendRule.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
441
+ * @param getRecommendRule.objectID - Unique record identifier.
442
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
443
+ * @see getRecommendRule for the plain version.
444
+ */
445
+ getRecommendRuleWithHTTPInfo({ indexName, model, objectID }, requestOptions) {
446
+ validateRequired("indexName", "getRecommendRuleWithHTTPInfo", indexName);
447
+ validateRequired("model", "getRecommendRuleWithHTTPInfo", model);
448
+ validateRequired("objectID", "getRecommendRuleWithHTTPInfo", objectID);
449
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{objectID}", encodeURIComponent(objectID));
450
+ const headers = {};
451
+ const queryParameters = {};
452
+ const request = {
453
+ method: "GET",
454
+ path: requestPath,
455
+ queryParameters,
456
+ headers
457
+ };
458
+ return transporter.requestWithHttpInfo(request, requestOptions);
459
+ },
277
460
  /**
278
461
  * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
279
462
  *
@@ -300,6 +483,35 @@ function createRecommendClient({
300
483
  };
301
484
  return transporter.request(request, requestOptions);
302
485
  },
486
+ /**
487
+ * Checks the status of a given task. Deleting a Recommend rule is asynchronous. When you delete a rule, a task is created on a queue and completed depending on the load on the server. The API response includes a task ID that you can use to check the status.
488
+ *
489
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
490
+ *
491
+ * Required API Key ACLs:
492
+ * - editSettings
493
+ * @param getRecommendStatus - The getRecommendStatus object.
494
+ * @param getRecommendStatus.indexName - Name of the index on which to perform the operation.
495
+ * @param getRecommendStatus.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
496
+ * @param getRecommendStatus.taskID - Unique task identifier.
497
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
498
+ * @see getRecommendStatus for the plain version.
499
+ */
500
+ getRecommendStatusWithHTTPInfo({ indexName, model, taskID }, requestOptions) {
501
+ validateRequired("indexName", "getRecommendStatusWithHTTPInfo", indexName);
502
+ validateRequired("model", "getRecommendStatusWithHTTPInfo", model);
503
+ validateRequired("taskID", "getRecommendStatusWithHTTPInfo", taskID);
504
+ const requestPath = "/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model)).replace("{taskID}", encodeURIComponent(taskID));
505
+ const headers = {};
506
+ const queryParameters = {};
507
+ const request = {
508
+ method: "GET",
509
+ path: requestPath,
510
+ queryParameters,
511
+ headers
512
+ };
513
+ return transporter.requestWithHttpInfo(request, requestOptions);
514
+ },
303
515
  /**
304
516
  * Retrieves recommendations from selected AI models.
305
517
  *
@@ -331,6 +543,44 @@ function createRecommendClient({
331
543
  };
332
544
  return transporter.request(request, requestOptions);
333
545
  },
546
+ /**
547
+ * Retrieves recommendations from selected AI models.
548
+ *
549
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
550
+ *
551
+ * Required API Key ACLs:
552
+ * - search
553
+ * @param getRecommendationsParams - The getRecommendationsParams object.
554
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
555
+ * @see getRecommendations for the plain version.
556
+ */
557
+ getRecommendationsWithHTTPInfo(getRecommendationsParams, requestOptions) {
558
+ if (getRecommendationsParams && Array.isArray(getRecommendationsParams)) {
559
+ const newSignatureRequest = {
560
+ requests: getRecommendationsParams
561
+ };
562
+ getRecommendationsParams = newSignatureRequest;
563
+ }
564
+ validateRequired("getRecommendationsParams", "getRecommendationsWithHTTPInfo", getRecommendationsParams);
565
+ validateRequired(
566
+ "getRecommendationsParams.requests",
567
+ "getRecommendationsWithHTTPInfo",
568
+ getRecommendationsParams.requests
569
+ );
570
+ const requestPath = "/1/indexes/*/recommendations";
571
+ const headers = {};
572
+ const queryParameters = {};
573
+ const request = {
574
+ method: "POST",
575
+ path: requestPath,
576
+ queryParameters,
577
+ headers,
578
+ data: getRecommendationsParams,
579
+ useReadTransporter: true,
580
+ cacheable: true
581
+ };
582
+ return transporter.requestWithHttpInfo(request, requestOptions);
583
+ },
334
584
  /**
335
585
  * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
336
586
  *
@@ -358,6 +608,37 @@ function createRecommendClient({
358
608
  cacheable: true
359
609
  };
360
610
  return transporter.request(request, requestOptions);
611
+ },
612
+ /**
613
+ * Searches for Recommend rules. Use an empty query to list all rules for this recommendation scenario.
614
+ *
615
+ * Resolves with the full HTTP response information: status code, headers (when the requester captures them), raw body and deserialized data. Bypasses the requests and responses caches: always performs the API call.
616
+ *
617
+ * Required API Key ACLs:
618
+ * - settings
619
+ * @param searchRecommendRules - The searchRecommendRules object.
620
+ * @param searchRecommendRules.indexName - Name of the index on which to perform the operation.
621
+ * @param searchRecommendRules.model - [Recommend model](https://www.algolia.com/doc/guides/algolia-recommend/overview/#recommend-models).
622
+ * @param searchRecommendRules.searchRecommendRulesParams - The searchRecommendRulesParams object.
623
+ * @param requestOptions - The requestOptions to send along with the query, they will be merged with the transporter requestOptions.
624
+ * @see searchRecommendRules for the plain version.
625
+ */
626
+ searchRecommendRulesWithHTTPInfo({ indexName, model, searchRecommendRulesParams }, requestOptions) {
627
+ validateRequired("indexName", "searchRecommendRulesWithHTTPInfo", indexName);
628
+ validateRequired("model", "searchRecommendRulesWithHTTPInfo", model);
629
+ const requestPath = "/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}", encodeURIComponent(indexName)).replace("{model}", encodeURIComponent(model));
630
+ const headers = {};
631
+ const queryParameters = {};
632
+ const request = {
633
+ method: "POST",
634
+ path: requestPath,
635
+ queryParameters,
636
+ headers,
637
+ data: searchRecommendRulesParams ? searchRecommendRulesParams : {},
638
+ useReadTransporter: true,
639
+ cacheable: true
640
+ };
641
+ return transporter.requestWithHttpInfo(request, requestOptions);
361
642
  }
362
643
  };
363
644
  }