Skip to content

Commit

Permalink
fix(javascript): use unknown over any (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4011

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Oct 21, 2024
1 parent 075602f commit 0ba8856
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 14 deletions.
5 changes: 4 additions & 1 deletion packages/algoliasearch/lite/model/browseResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ import type { BrowsePagination } from './browsePagination';
import type { Cursor } from './cursor';
import type { SearchHits } from './searchHits';

export type BrowseResponse<T = Record<string, any>> = BaseSearchResponse & BrowsePagination & SearchHits<T> & Cursor;
export type BrowseResponse<T = Record<string, unknown>> = BaseSearchResponse &
BrowsePagination &
SearchHits<T> &
Cursor;
2 changes: 1 addition & 1 deletion packages/algoliasearch/lite/model/hit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { SnippetResult } from './snippetResult';
/**
* Search result. A hit is a record from your index, augmented with special attributes for highlighting, snippeting, and ranking.
*/
export type Hit<T = Record<string, any>> = T & {
export type Hit<T = Record<string, unknown>> = T & {
/**
* Unique record identifier.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/algoliasearch/lite/model/searchHits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { Hit } from './hit';

export type SearchHits<T = Record<string, any>> = Record<string, any> & {
export type SearchHits<T = Record<string, unknown>> = Record<string, any> & {
/**
* Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/algoliasearch/lite/model/searchResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import type { BaseSearchResponse } from './baseSearchResponse';
import type { SearchHits } from './searchHits';
import type { SearchPagination } from './searchPagination';

export type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchPagination & SearchHits<T>;
export type SearchResponse<T = Record<string, unknown>> = BaseSearchResponse & SearchPagination & SearchHits<T>;
2 changes: 1 addition & 1 deletion packages/algoliasearch/lite/model/searchResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

import type { SearchResult } from './searchResult';

export type SearchResponses<T = Record<string, any>> = {
export type SearchResponses<T = Record<string, unknown>> = {
results: SearchResult<T>[];
};
2 changes: 1 addition & 1 deletion packages/algoliasearch/lite/model/searchResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import type { SearchForFacetValuesResponse } from './searchForFacetValuesResponse';
import type { SearchResponse } from './searchResponse';

export type SearchResult<T = Record<string, any>> = SearchResponse<T> | SearchForFacetValuesResponse;
export type SearchResult<T = Record<string, unknown>> = SearchResponse<T> | SearchForFacetValuesResponse;
5 changes: 4 additions & 1 deletion packages/client-search/model/browseResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,7 @@ import type { BrowsePagination } from './browsePagination';
import type { Cursor } from './cursor';
import type { SearchHits } from './searchHits';

export type BrowseResponse<T = Record<string, any>> = BaseSearchResponse & BrowsePagination & SearchHits<T> & Cursor;
export type BrowseResponse<T = Record<string, unknown>> = BaseSearchResponse &
BrowsePagination &
SearchHits<T> &
Cursor;
2 changes: 1 addition & 1 deletion packages/client-search/model/clientMethodProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ export type ReplaceAllObjectsOptions = {
/**
* The array of `objects` to store in the given Algolia `indexName`.
*/
objects: Array<Record<string, any>>;
objects: Array<Record<string, unknown>>;

/**
* The size of the chunk of `objects`. The number of `batch` calls will be equal to `length(objects) / batchSize`. Defaults to 1000.
Expand Down
2 changes: 1 addition & 1 deletion packages/client-search/model/getObjectsResponse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// 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.

export type GetObjectsResponse<T = Record<string, any>> = {
export type GetObjectsResponse<T = Record<string, unknown>> = {
/**
* Retrieved records.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/client-search/model/hit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { SnippetResult } from './snippetResult';
/**
* Search result. A hit is a record from your index, augmented with special attributes for highlighting, snippeting, and ranking.
*/
export type Hit<T = Record<string, any>> = T & {
export type Hit<T = Record<string, unknown>> = T & {
/**
* Unique record identifier.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/client-search/model/searchHits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { Hit } from './hit';

export type SearchHits<T = Record<string, any>> = Record<string, any> & {
export type SearchHits<T = Record<string, unknown>> = Record<string, any> & {
/**
* Search results (hits). Hits are records from your index that match the search criteria, augmented with additional attributes, such as, for highlighting.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/client-search/model/searchResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import type { BaseSearchResponse } from './baseSearchResponse';
import type { SearchHits } from './searchHits';
import type { SearchPagination } from './searchPagination';

export type SearchResponse<T = Record<string, any>> = BaseSearchResponse & SearchPagination & SearchHits<T>;
export type SearchResponse<T = Record<string, unknown>> = BaseSearchResponse & SearchPagination & SearchHits<T>;
2 changes: 1 addition & 1 deletion packages/client-search/model/searchResponses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

import type { SearchResult } from './searchResult';

export type SearchResponses<T = Record<string, any>> = {
export type SearchResponses<T = Record<string, unknown>> = {
results: SearchResult<T>[];
};
2 changes: 1 addition & 1 deletion packages/client-search/model/searchResult.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
import type { SearchForFacetValuesResponse } from './searchForFacetValuesResponse';
import type { SearchResponse } from './searchResponse';

export type SearchResult<T = Record<string, any>> = SearchResponse<T> | SearchForFacetValuesResponse;
export type SearchResult<T = Record<string, unknown>> = SearchResponse<T> | SearchForFacetValuesResponse;

0 comments on commit 0ba8856

Please sign in to comment.