SecuredApiOptions can contain any search parameter (#38502)

And restrictIndexes can be an array of strings, rather than just a
single string

See https://www.algolia.com/doc/api-reference/api-methods/generate-secured-api-key/
This commit is contained in:
Chris Moyer
2019-09-23 10:19:26 -07:00
committed by Ben Lichtman
parent 1e47cb4c01
commit 562214ee84
2 changed files with 14 additions and 2 deletions
@@ -62,6 +62,15 @@ let _algoliaSecuredApiOptions: SecuredApiOptions = {
userToken: '',
};
let _algoliaSecuredApiOptionsAdvanced: SecuredApiOptions = {
filters: '',
validUntil: 0,
restrictIndices: ['', ''],
userToken: '',
attributesToRetrieve: ['foo', 'bar'],
restrictSearchableAttributes: [''],
};
let _algoliaIndexSettings: IndexSettings = {
attributesToIndex: [''],
attributesForFaceting: [''],
+5 -2
View File
@@ -12,6 +12,7 @@
// Peter Esenwa <https://github.com/PeterEsenwa>
// Samuel Bodin <https://github.com/bodinsamuel>
// Richard Scotten <https://github.com/rscotten>
// Chris Moyer <https://github.com/kopertio>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -998,8 +999,10 @@ declare namespace algoliasearch {
}
/**
* Describes the options used when generating new api keys
*
* @see https://www.algolia.com/doc/api-reference/api-methods/generate-secured-api-key/
*/
interface SecuredApiOptions {
interface SecuredApiOptions extends QueryParameters {
/**
* Filter the query with numeric, facet or/and tag filters
* default: ""
@@ -1012,7 +1015,7 @@ declare namespace algoliasearch {
/**
* Restricts the key to a list of index names allowed for the secured API key
*/
restrictIndices?: string;
restrictIndices?: string | string[];
/**
* Allows you to restrict a single user to performing a maximum of N API calls per hour
*/