update history
This commit is contained in:
1 parent
ac78a5ea6f
commit
96708de3a4
12 files changed
+407
-95
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,2 @@
|
||||
export * from './operator';
|
||||
export * from './models';
|
||||
@@ -0,0 +1,19 @@
|
||||
import { IApi } from '../api';
|
||||
|
||||
export interface IApiUsage {
|
||||
id?: string;
|
||||
api?: IApi;
|
||||
api_id?: string;
|
||||
application_id?: string;
|
||||
trace_id?: string;
|
||||
metadata?: any;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
export interface IApiUsageListResponse {
|
||||
count: number;
|
||||
items: IApiUsage[];
|
||||
}
|
||||
|
||||
export type IApiUsageDetailResponse = IApiUsage;
|
||||
@@ -0,0 +1,27 @@
|
||||
import { AxiosResponse } from 'axios';
|
||||
import { httpClient } from '../instance';
|
||||
import { IApiUsageDetailResponse, IApiUsageListResponse } from './models';
|
||||
|
||||
export interface IApiUsageQuery {
|
||||
user_id?: string;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
application_id?: string;
|
||||
ordering?: string;
|
||||
}
|
||||
|
||||
class ApiUsageOperator {
|
||||
key = 'usage/apis';
|
||||
|
||||
async getAll(query: IApiUsageQuery): Promise<AxiosResponse<IApiUsageListResponse>> {
|
||||
return await httpClient.get(`/${this.key}/`, {
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
async get(id: string): Promise<AxiosResponse<IApiUsageDetailResponse>> {
|
||||
return await httpClient.get(`/${this.key}/${id}`);
|
||||
}
|
||||
}
|
||||
|
||||
export const apiUsageOperator = new ApiUsageOperator();
|
||||
Reference in new issue
Block a user