Skip to content

Commit

Permalink
Query requests in chunks as well
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Mar 8, 2024
1 parent 1cc0fa2 commit 9b68089
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 23 deletions.
166 changes: 162 additions & 4 deletions packages/api-client/lib/openapi/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8898,10 +8898,30 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration
/**
*
* @summary Task States Count
* @param {string} [taskId] comma separated list of task ids
* @param {string} [category] comma separated list of task categories
* @param {string} [requester] comma separated list of requester names
* @param {string} [pickup] comma separated list of pickup names
* @param {string} [destination] comma separated list of destination names
* @param {string} [assignedTo] comma separated list of assigned robot names
* @param {string} [status] comma separated list of statuses
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of starting time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finishing time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000. \&quot;-60000\&quot; - Fetches logs in the last minute.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
taskStatesCountTasksCountGet: async (
taskId?: string,
category?: string,
requester?: string,
pickup?: string,
destination?: string,
assignedTo?: string,
status?: string,
requestTimeBetween?: string,
startTimeBetween?: string,
finishTimeBetween?: string,
options: AxiosRequestConfig = {},
): Promise<RequestArgs> => {
const localVarPath = `/tasks/count`;
Expand All @@ -8916,6 +8936,46 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

if (taskId !== undefined) {
localVarQueryParameter['task_id'] = taskId;
}

if (category !== undefined) {
localVarQueryParameter['category'] = category;
}

if (requester !== undefined) {
localVarQueryParameter['requester'] = requester;
}

if (pickup !== undefined) {
localVarQueryParameter['pickup'] = pickup;
}

if (destination !== undefined) {
localVarQueryParameter['destination'] = destination;
}

if (assignedTo !== undefined) {
localVarQueryParameter['assigned_to'] = assignedTo;
}

if (status !== undefined) {
localVarQueryParameter['status'] = status;
}

if (requestTimeBetween !== undefined) {
localVarQueryParameter['request_time_between'] = requestTimeBetween;
}

if (startTimeBetween !== undefined) {
localVarQueryParameter['start_time_between'] = startTimeBetween;
}

if (finishTimeBetween !== undefined) {
localVarQueryParameter['finish_time_between'] = finishTimeBetween;
}

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
Expand Down Expand Up @@ -9496,13 +9556,43 @@ export const TasksApiFp = function (configuration?: Configuration) {
/**
*
* @summary Task States Count
* @param {string} [taskId] comma separated list of task ids
* @param {string} [category] comma separated list of task categories
* @param {string} [requester] comma separated list of requester names
* @param {string} [pickup] comma separated list of pickup names
* @param {string} [destination] comma separated list of destination names
* @param {string} [assignedTo] comma separated list of assigned robot names
* @param {string} [status] comma separated list of statuses
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of starting time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finishing time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000. \&quot;-60000\&quot; - Fetches logs in the last minute.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async taskStatesCountTasksCountGet(
taskId?: string,
category?: string,
requester?: string,
pickup?: string,
destination?: string,
assignedTo?: string,
status?: string,
requestTimeBetween?: string,
startTimeBetween?: string,
finishTimeBetween?: string,
options?: AxiosRequestConfig,
): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<number>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.taskStatesCountTasksCountGet(
taskId,
category,
requester,
pickup,
destination,
assignedTo,
status,
requestTimeBetween,
startTimeBetween,
finishTimeBetween,
options,
);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
Expand Down Expand Up @@ -9958,12 +10048,46 @@ export const TasksApiFactory = function (
/**
*
* @summary Task States Count
* @param {string} [taskId] comma separated list of task ids
* @param {string} [category] comma separated list of task categories
* @param {string} [requester] comma separated list of requester names
* @param {string} [pickup] comma separated list of pickup names
* @param {string} [destination] comma separated list of destination names
* @param {string} [assignedTo] comma separated list of assigned robot names
* @param {string} [status] comma separated list of statuses
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of starting time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finishing time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000. \&quot;-60000\&quot; - Fetches logs in the last minute.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
taskStatesCountTasksCountGet(options?: any): AxiosPromise<number> {
taskStatesCountTasksCountGet(
taskId?: string,
category?: string,
requester?: string,
pickup?: string,
destination?: string,
assignedTo?: string,
status?: string,
requestTimeBetween?: string,
startTimeBetween?: string,
finishTimeBetween?: string,
options?: any,
): AxiosPromise<number> {
return localVarFp
.taskStatesCountTasksCountGet(options)
.taskStatesCountTasksCountGet(
taskId,
category,
requester,
pickup,
destination,
assignedTo,
status,
requestTimeBetween,
startTimeBetween,
finishTimeBetween,
options,
)
.then((request) => request(axios, basePath));
},
/**
Expand Down Expand Up @@ -10443,13 +10567,47 @@ export class TasksApi extends BaseAPI {
/**
*
* @summary Task States Count
* @param {string} [taskId] comma separated list of task ids
* @param {string} [category] comma separated list of task categories
* @param {string} [requester] comma separated list of requester names
* @param {string} [pickup] comma separated list of pickup names
* @param {string} [destination] comma separated list of destination names
* @param {string} [assignedTo] comma separated list of assigned robot names
* @param {string} [status] comma separated list of statuses
* @param {string} [requestTimeBetween] The period of request time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [startTimeBetween] The period of starting time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000.
* @param {string} [finishTimeBetween] The period of finishing time to fetch, in unix millis. This must be a comma separated string, \&#39;X,Y\&#39; to fetch between X millis and Y millis inclusive. Example: \&quot;1000,2000\&quot; - Fetches logs between unix millis 1000 and 2000. \&quot;-60000\&quot; - Fetches logs in the last minute.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof TasksApi
*/
public taskStatesCountTasksCountGet(options?: AxiosRequestConfig) {
public taskStatesCountTasksCountGet(
taskId?: string,
category?: string,
requester?: string,
pickup?: string,
destination?: string,
assignedTo?: string,
status?: string,
requestTimeBetween?: string,
startTimeBetween?: string,
finishTimeBetween?: string,
options?: AxiosRequestConfig,
) {
return TasksApiFp(this.configuration)
.taskStatesCountTasksCountGet(options)
.taskStatesCountTasksCountGet(
taskId,
category,
requester,
pickup,
destination,
assignedTo,
status,
requestTimeBetween,
startTimeBetween,
finishTimeBetween,
options,
)
.then((request) => request(this.axios, this.basePath));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/api-client/lib/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { version as rmfModelVer } from 'rmf-models';

export const version = {
rmfModels: rmfModelVer,
rmfServer: 'f40b701e1843a78e9e57bb4d2de337c20e75fecd',
rmfServer: '1cc0fa25a937ab0736dd77757f48d964e3e19c8a',
openapiGenerator: '6.2.1',
};
124 changes: 124 additions & 0 deletions packages/api-client/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,124 @@ export default {
tags: ['Tasks'],
summary: 'Task States Count',
operationId: 'task_states_count_tasks_count_get',
parameters: [
{
description: 'comma separated list of task ids',
required: false,
schema: {
title: 'Task Id',
type: 'string',
description: 'comma separated list of task ids',
},
name: 'task_id',
in: 'query',
},
{
description: 'comma separated list of task categories',
required: false,
schema: {
title: 'Category',
type: 'string',
description: 'comma separated list of task categories',
},
name: 'category',
in: 'query',
},
{
description: 'comma separated list of requester names',
required: false,
schema: {
title: 'Requester',
type: 'string',
description: 'comma separated list of requester names',
},
name: 'requester',
in: 'query',
},
{
description: 'comma separated list of pickup names',
required: false,
schema: {
title: 'Pickup',
type: 'string',
description: 'comma separated list of pickup names',
},
name: 'pickup',
in: 'query',
},
{
description: 'comma separated list of destination names',
required: false,
schema: {
title: 'Destination',
type: 'string',
description: 'comma separated list of destination names',
},
name: 'destination',
in: 'query',
},
{
description: 'comma separated list of assigned robot names',
required: false,
schema: {
title: 'Assigned To',
type: 'string',
description: 'comma separated list of assigned robot names',
},
name: 'assigned_to',
in: 'query',
},
{
description: 'comma separated list of statuses',
required: false,
schema: {
title: 'Status',
type: 'string',
description: 'comma separated list of statuses',
},
name: 'status',
in: 'query',
},
{
description:
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
required: false,
schema: {
title: 'Request Time Between',
type: 'string',
description:
'\n The period of request time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
},
name: 'request_time_between',
in: 'query',
},
{
description:
'\n The period of starting time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
required: false,
schema: {
title: 'Start Time Between',
type: 'string',
description:
'\n The period of starting time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n ',
},
name: 'start_time_between',
in: 'query',
},
{
description:
'\n The period of finishing time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n "-60000" - Fetches logs in the last minute.\n ',
required: false,
schema: {
title: 'Finish Time Between',
type: 'string',
description:
'\n The period of finishing time to fetch, in unix millis.\n\n This must be a comma separated string, \'X,Y\' to fetch between X millis and Y millis inclusive.\n\n Example:\n "1000,2000" - Fetches logs between unix millis 1000 and 2000.\n "-60000" - Fetches logs in the last minute.\n ',
},
name: 'finish_time_between',
in: 'query',
},
],
responses: {
'200': {
description: 'Successful Response',
Expand All @@ -685,6 +803,12 @@ export default {
},
},
},
'422': {
description: 'Validation Error',
content: {
'application/json': { schema: { $ref: '#/components/schemas/HTTPValidationError' } },
},
},
},
},
},
Expand Down
1 change: 0 additions & 1 deletion packages/dashboard/src/components/app-base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ export function AppBase({ children }: React.PropsWithChildren<{}>): JSX.Element

React.useEffect(() => {
const sub = AppEvents.loadingBackdrop.subscribe((value) => {
console.log('got event');
setOpenLoadingBackdrop(value);
});
return () => sub.unsubscribe();
Expand Down
Loading

0 comments on commit 9b68089

Please sign in to comment.