diff --git a/clients/algoliasearch-client-dart/melos.yaml b/clients/algoliasearch-client-dart/melos.yaml index 08eb386fcb..cea86117ff 100644 --- a/clients/algoliasearch-client-dart/melos.yaml +++ b/clients/algoliasearch-client-dart/melos.yaml @@ -43,6 +43,10 @@ scripts: exec: dart pub upgrade description: Run `dart pub upgrade` in all packages + outdated: + exec: dart pub outdated + description: Run `dart pub outdated` in all packages + clear: exec: rm -rf .dart_tool description: Clear build folders, i.e. `.dart_tool` in all packages @@ -50,4 +54,4 @@ scripts: command: version: hooks: - post: ./sync.sh \ No newline at end of file + post: ./sync.sh diff --git a/generators/src/main/java/com/algolia/codegen/AlgoliaSwiftGenerator.java b/generators/src/main/java/com/algolia/codegen/AlgoliaSwiftGenerator.java index 5c36ed1918..e1a7e46878 100644 --- a/generators/src/main/java/com/algolia/codegen/AlgoliaSwiftGenerator.java +++ b/generators/src/main/java/com/algolia/codegen/AlgoliaSwiftGenerator.java @@ -38,6 +38,7 @@ public class AlgoliaSwiftGenerator extends Swift5ClientCodegen { "aroundradiusall", "automaticfacetfilter", "automaticfacetfilters", + "baseindexsettings", "basesearchparams", "basesearchparamswithoutquery", "basesearchresponse", @@ -84,8 +85,8 @@ public class AlgoliaSwiftGenerator extends Swift5ClientCodegen { "range", "rankinginfo", "redirect", - "redirectruleindexmetadata", "redirectruleindexdata", + "redirectruleindexmetadata", "redirecturl", "region", "removestopwords", diff --git a/scripts/cts/runCts.ts b/scripts/cts/runCts.ts index 321577e85a..9df2b600d1 100644 --- a/scripts/cts/runCts.ts +++ b/scripts/cts/runCts.ts @@ -128,8 +128,7 @@ export async function runCts( ): Promise { const withBenchmarkServer = suites.benchmark && (clients.includes('search') || clients.includes('all') || languages.includes('swift')); - const withClientServer = - suites.client && (clients.includes('search') || clients.includes('all') || process.platform === 'darwin'); // the macos swift CI also runs the clients tests + const withClientServer = suites.client; const closeTestServer = await startTestServer({ ...suites, benchmark: withBenchmarkServer, @@ -142,7 +141,8 @@ export async function runCts( await closeTestServer(); - if (withClientServer) { + if (withClientServer && (clients.includes('search') || clients.includes('all') || process.platform === 'darwin')) { + // the macos swift CI also runs the clients tests const skip = (lang: Language): number => (languages.includes(lang) ? 1 : 0); assertValidTimeouts(languages.length); diff --git a/specs/recommend/common/schemas/IndexSettings.yml b/specs/recommend/common/schemas/IndexSettings.yml new file mode 100644 index 0000000000..11331503d7 --- /dev/null +++ b/specs/recommend/common/schemas/IndexSettings.yml @@ -0,0 +1,88 @@ +recommendIndexSettings: + description: Index settings. + allOf: + - $ref: '../../../common/schemas/IndexSettings.yml#/baseIndexSettings' + - $ref: '#/baseRecommendIndexSettings' + +baseRecommendIndexSettings: + type: object + additionalProperties: false + properties: + attributesToRetrieve: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributesToRetrieve' + ranking: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/ranking' + relevancyStrictness: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/relevancyStrictness' + attributesToHighlight: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributesToHighlight' + attributesToSnippet: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributesToSnippet' + highlightPreTag: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/highlightPreTag' + highlightPostTag: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/highlightPostTag' + snippetEllipsisText: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/snippetEllipsisText' + restrictHighlightAndSnippetArrays: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/restrictHighlightAndSnippetArrays' + minWordSizefor1Typo: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/minWordSizefor1Typo' + minWordSizefor2Typos: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/minWordSizefor2Typos' + typoTolerance: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/typoTolerance' + allowTyposOnNumericTokens: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/allowTyposOnNumericTokens' + disableTypoToleranceOnAttributes: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/disableTypoToleranceOnAttributes' + ignorePlurals: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/ignorePlurals' + removeStopWords: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/removeStopWords' + queryLanguages: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/queryLanguages' + decompoundQuery: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/decompoundQuery' + enableRules: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/enableRules' + enablePersonalization: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/enablePersonalization' + queryType: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/queryType' + removeWordsIfNoResults: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/removeWordsIfNoResults' + advancedSyntax: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/advancedSyntax' + optionalWords: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/optionalWords' + disableExactOnAttributes: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/disableExactOnAttributes' + exactOnSingleWordQuery: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/exactOnSingleWordQuery' + alternativesAsExact: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/alternativesAsExact' + advancedSyntaxFeatures: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/advancedSyntaxFeatures' + distinct: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/distinct' + replaceSynonymsInHighlight: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/replaceSynonymsInHighlight' + minProximity: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/minProximity' + responseFields: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/responseFields' + maxFacetHits: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/maxFacetHits' + maxValuesPerFacet: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/maxValuesPerFacet' + sortFacetValuesBy: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/sortFacetValuesBy' + attributeCriteriaComputedByMinProximity: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/attributeCriteriaComputedByMinProximity' + renderingContent: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/renderingContent' + enableReRanking: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/enableReRanking' + reRankingApplyFilter: + $ref: '../../../common/schemas/IndexSettings.yml#/indexSettingsAsSearchParams/properties/reRankingApplyFilter' diff --git a/specs/recommend/common/schemas/LookingSimilarQuery.yml b/specs/recommend/common/schemas/LookingSimilarQuery.yml index 58804ce66e..e22d490931 100644 --- a/specs/recommend/common/schemas/LookingSimilarQuery.yml +++ b/specs/recommend/common/schemas/LookingSimilarQuery.yml @@ -12,7 +12,7 @@ lookingSimilar: objectID: $ref: '../../../common/parameters.yml#/objectID' fallbackParameters: - $ref: './RecommendationsRequest.yml#/fallbackParams' + $ref: './QueryParameters.yml#/fallbackParams' required: - model - objectID diff --git a/specs/recommend/common/schemas/QueryParameters.yml b/specs/recommend/common/schemas/QueryParameters.yml new file mode 100644 index 0000000000..cbb340743c --- /dev/null +++ b/specs/recommend/common/schemas/QueryParameters.yml @@ -0,0 +1,75 @@ +recommendSearchParams: + title: Search parameters as object + description: Search parameters for filtering the recommendations. + allOf: + - $ref: '#/baseRecommendSearchParams' + - $ref: '../../../common/schemas/SearchParams.yml#/searchParamsQuery' + - $ref: './IndexSettings.yml#/recommendIndexSettings' + +fallbackParams: + title: fallbackParameters + allOf: + - $ref: './QueryParameters.yml#/recommendSearchParams' + - type: object + description: Search parameters to use for a fallback request if there aren't enough recommendations. + +baseRecommendSearchParams: + type: object + additionalProperties: false + properties: + similarQuery: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/similarQuery' + filters: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/filters' + facetFilters: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/facetFilters' + optionalFilters: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/optionalFilters' + numericFilters: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/numericFilters' + tagFilters: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/tagFilters' + sumOrFiltersScores: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/sumOrFiltersScores' + restrictSearchableAttributes: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/restrictSearchableAttributes' + facets: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/facets' + facetingAfterDistinct: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/facetingAfterDistinct' + aroundLatLng: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundLatLng' + aroundLatLngViaIP: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundLatLngViaIP' + aroundRadius: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundRadius' + aroundPrecision: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/aroundPrecision' + minimumAroundRadius: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/minimumAroundRadius' + insideBoundingBox: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/insideBoundingBox' + insidePolygon: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/insidePolygon' + naturalLanguages: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/naturalLanguages' + ruleContexts: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/ruleContexts' + personalizationImpact: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/personalizationImpact' + userToken: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/userToken' + getRankingInfo: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/getRankingInfo' + synonyms: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/synonyms' + clickAnalytics: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/clickAnalytics' + analytics: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/analytics' + analyticsTags: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/analyticsTags' + percentileComputation: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/percentileComputation' + enableABTest: + $ref: '../../../common/schemas/SearchParams.yml#/baseSearchParamsWithoutQuery/properties/enableABTest' diff --git a/specs/recommend/common/schemas/RecommendRule.yml b/specs/recommend/common/schemas/RecommendRule.yml index 328da173fc..ea5ff74f12 100644 --- a/specs/recommend/common/schemas/RecommendRule.yml +++ b/specs/recommend/common/schemas/RecommendRule.yml @@ -32,7 +32,7 @@ Condition: If not specified, the rule is triggered for all recommendations. properties: filters: - $ref: '../../../common/schemas/SearchParams.yml#/filters' + $ref: './QueryParameters.yml#/baseRecommendSearchParams/properties/filters' context: $ref: '../../../common/schemas/Rule.yml#/context' @@ -89,7 +89,7 @@ ParamsConsequence: items: $ref: '#/AutoFacetFilter' filters: - $ref: '../../../common/schemas/SearchParams.yml#/filters' + $ref: './QueryParameters.yml#/baseRecommendSearchParams/properties/filters' optionalFilters: type: array description: | diff --git a/specs/recommend/common/schemas/RecommendationsRequest.yml b/specs/recommend/common/schemas/RecommendationsRequest.yml index de0b8f6ef9..7154085a43 100644 --- a/specs/recommend/common/schemas/RecommendationsRequest.yml +++ b/specs/recommend/common/schemas/RecommendationsRequest.yml @@ -30,22 +30,7 @@ baseRecommendRequest: Depending on the available recommendations and the other request parameters, the actual number of recommendations may be lower than this value. queryParameters: - $ref: '#/searchParams' + $ref: './QueryParameters.yml#/recommendSearchParams' required: - indexName - threshold - -searchParams: - title: queryParameters - allOf: - # TODO: This isn't correct. `page`, `hitsPerPage`, `offset`, and `length` aren't allowed - - $ref: '../../../common/schemas/SearchParams.yml#/searchParamsObject' - - type: object - description: Search parameters for filtering the recommendations. - -fallbackParams: - title: fallbackParameters - allOf: - - $ref: '../../../common/schemas/SearchParams.yml#/searchParamsObject' - - type: object - description: Search parameters to use for a fallback request if there aren't enough recommendations. diff --git a/specs/recommend/common/schemas/RecommendedForYouQuery.yml b/specs/recommend/common/schemas/RecommendedForYouQuery.yml index 2490df6194..a4f0ecb699 100644 --- a/specs/recommend/common/schemas/RecommendedForYouQuery.yml +++ b/specs/recommend/common/schemas/RecommendedForYouQuery.yml @@ -10,7 +10,7 @@ recommendedForYou: model: $ref: '#/recommendedForYouModel' fallbackParameters: - $ref: './RecommendationsRequest.yml#/fallbackParams' + $ref: './QueryParameters.yml#/fallbackParams' required: - model diff --git a/specs/recommend/common/schemas/RelatedQuery.yml b/specs/recommend/common/schemas/RelatedQuery.yml index 38b88a9a6f..5b64703e66 100644 --- a/specs/recommend/common/schemas/RelatedQuery.yml +++ b/specs/recommend/common/schemas/RelatedQuery.yml @@ -12,7 +12,7 @@ relatedProducts: objectID: $ref: '../../../common/parameters.yml#/objectID' fallbackParameters: - $ref: './RecommendationsRequest.yml#/fallbackParams' + $ref: './QueryParameters.yml#/fallbackParams' required: - model - objectID diff --git a/specs/recommend/common/schemas/TrendingFacetsQuery.yml b/specs/recommend/common/schemas/TrendingFacetsQuery.yml index 6b75d723ca..15721aeabc 100644 --- a/specs/recommend/common/schemas/TrendingFacetsQuery.yml +++ b/specs/recommend/common/schemas/TrendingFacetsQuery.yml @@ -12,7 +12,7 @@ trendingFacets: model: $ref: '#/trendingFacetsModel' fallbackParameters: - $ref: './RecommendationsRequest.yml#/fallbackParams' + $ref: './QueryParameters.yml#/fallbackParams' required: - facetName - model diff --git a/specs/recommend/common/schemas/TrendingItemsQuery.yml b/specs/recommend/common/schemas/TrendingItemsQuery.yml index 2f86cf42ab..fe3cc71c1a 100644 --- a/specs/recommend/common/schemas/TrendingItemsQuery.yml +++ b/specs/recommend/common/schemas/TrendingItemsQuery.yml @@ -14,7 +14,7 @@ trendingItems: model: $ref: '#/trendingItemsModel' fallbackParameters: - $ref: '../../../common/schemas/SearchParams.yml#/searchParamsObject' + $ref: './QueryParameters.yml#/fallbackParams' required: - model diff --git a/templates/dart/tests/param_object.mustache b/templates/dart/tests/param_object.mustache index 4c989974cc..b01ef3bc9b 100644 --- a/templates/dart/tests/param_object.mustache +++ b/templates/dart/tests/param_object.mustache @@ -1,4 +1,4 @@ -{{{objectName}}}( +{{#lambda.pascalcase}}{{{objectName}}}{{/lambda.pascalcase}}( {{#value}} {{> tests/request_param}} {{/value}} diff --git a/templates/javascript/clients/algoliasearch/builds/models.mustache b/templates/javascript/clients/algoliasearch/builds/models.mustache index 52e3bdc67b..b470638cd7 100644 --- a/templates/javascript/clients/algoliasearch/builds/models.mustache +++ b/templates/javascript/clients/algoliasearch/builds/models.mustache @@ -14,6 +14,7 @@ import type { AutomaticFacetFilter, AutomaticFacetFilters, BaseSearchParams, + BaseIndexSettings, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString, @@ -99,6 +100,7 @@ export { AutomaticFacetFilter, AutomaticFacetFilters, BaseSearchParams, + BaseIndexSettings, BaseSearchParamsWithoutQuery, BaseSearchResponse, BooleanString,