-
Notifications
You must be signed in to change notification settings - Fork 21
feat: add keys endpoints to search client #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
459132e
feat: add keys endpoints to search client
damcou 264951e
Merge branch 'main' into feat/APIC-192/keys-endpoints
damcou 050991f
fix: some changes
damcou f7b1196
Merge branch 'feat/APIC-192/keys-endpoints' of https://github.com/alg…
damcou 76b843d
fix: add test names
damcou 6491d5a
fix: removed non-duplicated responses
damcou 3522cf6
fix: keyObject definition
damcou 83dfade
fix: update tests
damcou 5230c26
fix: line breaks
damcou 587916f
fix: line breaks
damcou d27af24
Merge branch 'main' into feat/APIC-192/keys-endpoints
damcou 7d4ab3d
fix: finish merge
damcou ea0ea0c
fix: last review
damcou e78d10e
fix: json files
shortcuts 17719ec
Merge branch 'main' into feat/APIC-192/keys-endpoints
damcou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
clients/algoliasearch-client-javascript/client-search/model/addApiKeyResponse.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export type AddApiKeyResponse = { | ||
/** | ||
* Key string. | ||
*/ | ||
key: string; | ||
/** | ||
* Date of creation (ISO-8601 format). | ||
*/ | ||
createdAt: Date; | ||
}; |
56 changes: 56 additions & 0 deletions
56
clients/algoliasearch-client-javascript/client-search/model/apiKey.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Api Key object. | ||
*/ | ||
export type ApiKey = { | ||
/** | ||
* Set of permissions associated with the key. | ||
*/ | ||
acl: ApiKey.AclEnum[]; | ||
/** | ||
* A comment used to identify a key more easily in the dashboard. It is not interpreted by the API. | ||
*/ | ||
description?: string; | ||
/** | ||
* Restrict this new API key to a list of indices or index patterns. If the list is empty, all indices are allowed. | ||
*/ | ||
indexes?: string[]; | ||
/** | ||
* Maximum number of hits this API key can retrieve in one query. If zero, no limit is enforced. | ||
*/ | ||
maxHitsPerQuery?: number; | ||
/** | ||
* Maximum number of API calls per hour allowed from a given IP address or a user token. | ||
*/ | ||
maxQueriesPerIPPerHour?: number; | ||
/** | ||
* URL-encoded query string. Force some query parameters to be applied for each query made with this API key. | ||
*/ | ||
queryParameters?: string; | ||
/** | ||
* Restrict this new API key to specific referers. If empty or blank, defaults to all referers. | ||
*/ | ||
referers?: string[]; | ||
/** | ||
* Validity limit for this key in seconds. The key will automatically be removed after this period of time. | ||
*/ | ||
validity?: number; | ||
}; | ||
|
||
export namespace ApiKey { | ||
export enum AclEnum { | ||
AddObject = 'addObject', | ||
Analytics = 'analytics', | ||
Browse = 'browse', | ||
DeleteObject = 'deleteObject', | ||
DeleteIndex = 'deleteIndex', | ||
EditSettings = 'editSettings', | ||
ListIndexes = 'listIndexes', | ||
Logs = 'logs', | ||
Personalization = 'personalization', | ||
Recommendation = 'recommendation', | ||
Search = 'search', | ||
SeeUnretrievableAttributes = 'seeUnretrievableAttributes', | ||
Settings = 'settings', | ||
Usage = 'usage', | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
clients/algoliasearch-client-javascript/client-search/model/createdAtObject.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export type CreatedAtObject = { | ||
/** | ||
* Date of creation (ISO-8601 format). | ||
*/ | ||
createdAt: Date; | ||
}; |
6 changes: 6 additions & 0 deletions
6
clients/algoliasearch-client-javascript/client-search/model/deleteApiKeyResponse.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export type DeleteApiKeyResponse = { | ||
/** | ||
* Date of deletion (ISO-8601 format). | ||
*/ | ||
deletedAt: Date; | ||
}; |
4 changes: 4 additions & 0 deletions
4
clients/algoliasearch-client-javascript/client-search/model/keyObject.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { ApiKey } from './apiKey'; | ||
import type { CreatedAtObject } from './createdAtObject'; | ||
|
||
export type KeyObject = ApiKey & CreatedAtObject; |
6 changes: 6 additions & 0 deletions
6
clients/algoliasearch-client-javascript/client-search/model/keyObjectAllOf.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export type KeyObjectAllOf = { | ||
damcou marked this conversation as resolved.
Show resolved
Hide resolved
|
||
/** | ||
* Date of creation (ISO-8601 format). | ||
*/ | ||
createdAt: Date; | ||
}; |
8 changes: 8 additions & 0 deletions
8
clients/algoliasearch-client-javascript/client-search/model/listApiKeysResponse.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { KeyObject } from './keyObject'; | ||
|
||
export type ListApiKeysResponse = { | ||
/** | ||
* List of api keys. | ||
*/ | ||
keys: KeyObject[]; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
clients/algoliasearch-client-javascript/client-search/model/updateApiKeyResponse.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export type UpdateApiKeyResponse = { | ||
/** | ||
* Key string. | ||
*/ | ||
key: string; | ||
/** | ||
* Date of last update (ISO-8601 format). | ||
*/ | ||
updatedAt: Date; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.