Skip to content

Commit

Permalink
Merge branch 'main' into feat/APIC-227/javascript-group-parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Dec 16, 2021
2 parents 5130062 + e4eb3a4 commit 1e1749c
Show file tree
Hide file tree
Showing 31 changed files with 759 additions and 52 deletions.
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;
};
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',
}
}
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;
};
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;
};
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;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export type KeyObjectAllOf = {
/**
* Date of creation (ISO-8601 format).
*/
createdAt: Date;
};
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[];
};
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
/* eslint-disable no-param-reassign */
import type { RequestOptions } from '../utils/types';

export * from './addApiKeyResponse';
export * from './apiKey';
export * from './baseIndexSettings';
export * from './baseSearchParams';
export * from './baseSearchResponse';
export * from './baseSearchResponseFacetsStats';
export * from './batchObject';
export * from './batchResponse';
export * from './clearAllSynonymsResponse';
export * from './createdAtObject';
export * from './deleteApiKeyResponse';
export * from './deleteIndexResponse';
export * from './deleteSynonymResponse';
export * from './errorBase';
Expand All @@ -19,6 +23,8 @@ export * from './highlightResult';
export * from './index';
export * from './indexSettings';
export * from './indexSettingsAsSearchParams';
export * from './keyObject';
export * from './listApiKeysResponse';
export * from './listIndicesResponse';
export * from './multipleQueries';
export * from './multipleQueriesObject';
Expand All @@ -41,6 +47,7 @@ export * from './setSettingsResponse';
export * from './snippetResult';
export * from './synonymHit';
export * from './synonymHitHighlightResult';
export * from './updateApiKeyResponse';

export interface Authentication {
/**
Expand Down
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;
};
Loading

0 comments on commit 1e1749c

Please sign in to comment.