Skip to content

Commit

Permalink
fix: re-arranged the interfaces of ApiKeys
Browse files Browse the repository at this point in the history
  • Loading branch information
shivam-pareek committed Oct 7, 2024
1 parent 5ad3ccf commit eb94985
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions src/apis/apiKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,14 @@ export interface ApiKeysAddParams {
scopes: string[];
defaults?: Record<string, unknown>;
}

export interface ApiKeysGetParams {
id?: string;
}

export interface ApiKeysUpdateParams {
id?: string;
name?: string;
description?: string;
rate_limits?: Record<string, unknown>[];
usage_limits?: Record<string, unknown>;
scopes?: string[];
defaults?: Record<string, unknown>;
}
export interface ApiKeysListParams {
page_size?: number;
current_page?: number;
workspace_id?: string;
}
export interface ApiKeysDeleteParams {
id?: string;
}
export interface ApiKeysAddResponse extends APIResponseType {
id?: string;
key?: string;
object?: string;
}
export interface ApiKeysGetParams {
id?: string;
}
export interface ApiKeysGetResponse extends APIResponseType {
id?: string;
key?: string;
Expand All @@ -62,16 +43,34 @@ export interface ApiKeysGetResponse extends APIResponseType {
defaults?: Record<string, unknown>;
object?: string;
}
export interface ApiKeysListResponse extends APIResponseType {
total?: number;
object?: string;
data?: Record<string, unknown>[];
export interface ApiKeysUpdateParams {
id?: string;
name?: string;
description?: string;
rate_limits?: Record<string, unknown>[];
usage_limits?: Record<string, unknown>;
scopes?: string[];
defaults?: Record<string, unknown>;
}
export interface ApiKeysUpdateResponse extends APIResponseType {
object?: string;
total?:number;
data?: Record<string, unknown>[];
}
export interface ApiKeysListParams {
page_size?: number;
current_page?: number;
workspace_id?: string;
}
export interface ApiKeysListResponse extends APIResponseType {
total?: number;
object?: string;
data?: Record<string, unknown>[];
}
export interface ApiKeysDeleteParams {
id?: string;
}

function toQueryParams(params?: ApiKeysListParams): string {
if (!params) {
return '';
Expand Down

0 comments on commit eb94985

Please sign in to comment.