Skip to content

Commit

Permalink
Remove unused endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth committed Jan 24, 2024
1 parent 256aea8 commit e533470
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 165 deletions.
90 changes: 0 additions & 90 deletions packages/api-client/lib/openapi/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8436,47 +8436,6 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration
options: localVarRequestOptions,
};
},
/**
* Available in socket.io
* @summary Get Task Queue Entry
* @param {string} taskId task_id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTaskQueueEntryTasksTaskIdQueueEntryGet: async (
taskId: string,
options: AxiosRequestConfig = {},
): Promise<RequestArgs> => {
// verify required parameter 'taskId' is not null or undefined
assertParamExists('getTaskQueueEntryTasksTaskIdQueueEntryGet', 'taskId', taskId);
const localVarPath = `/tasks/{task_id}/queue_entry`.replace(
`{${'task_id'}}`,
encodeURIComponent(String(taskId)),
);
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options };
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Get Task Request
Expand Down Expand Up @@ -9672,26 +9631,6 @@ export const TasksApiFp = function (configuration?: Configuration) {
);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
* Available in socket.io
* @summary Get Task Queue Entry
* @param {string} taskId task_id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getTaskQueueEntryTasksTaskIdQueueEntryGet(
taskId: string,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<ApiServerModelsTortoiseModelsTasksTaskStateLeaf>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.getTaskQueueEntryTasksTaskIdQueueEntryGet(taskId, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Get Task Request
Expand Down Expand Up @@ -10255,21 +10194,6 @@ export const TasksApiFactory = function (
.getTaskLogTasksTaskIdLogGet(taskId, between, options)
.then((request) => request(axios, basePath));
},
/**
* Available in socket.io
* @summary Get Task Queue Entry
* @param {string} taskId task_id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getTaskQueueEntryTasksTaskIdQueueEntryGet(
taskId: string,
options?: any,
): AxiosPromise<ApiServerModelsTortoiseModelsTasksTaskStateLeaf> {
return localVarFp
.getTaskQueueEntryTasksTaskIdQueueEntryGet(taskId, options)
.then((request) => request(axios, basePath));
},
/**
*
* @summary Get Task Request
Expand Down Expand Up @@ -10767,20 +10691,6 @@ export class TasksApi extends BaseAPI {
.then((request) => request(this.axios, this.basePath));
}

/**
* Available in socket.io
* @summary Get Task Queue Entry
* @param {string} taskId task_id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof TasksApi
*/
public getTaskQueueEntryTasksTaskIdQueueEntryGet(taskId: string, options?: AxiosRequestConfig) {
return TasksApiFp(this.configuration)
.getTaskQueueEntryTasksTaskIdQueueEntryGet(taskId, options)
.then((request) => request(this.axios, this.basePath));
}

/**
*
* @summary Get Task Request
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: '3641034b187d5457610280b42b05663b25444104',
rmfServer: '256aea8c511c08878cd664dff5017763d54981db',
openapiGenerator: '6.2.1',
};
35 changes: 0 additions & 35 deletions packages/api-client/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1222,41 +1222,6 @@ export default {
},
},
},
'/tasks/{task_id}/queue_entry': {
get: {
tags: ['Tasks'],
summary: 'Get Task Queue Entry',
description: 'Available in socket.io',
operationId: 'get_task_queue_entry_tasks__task_id__queue_entry_get',
parameters: [
{
description: 'task_id',
required: true,
schema: { title: 'Task Id', type: 'string', description: 'task_id' },
name: 'task_id',
in: 'path',
},
],
responses: {
'200': {
description: 'Successful Response',
content: {
'application/json': {
schema: {
$ref: '#/components/schemas/api_server.models.tortoise_models.tasks.TaskState.leaf',
},
},
},
},
'422': {
description: 'Validation Error',
content: {
'application/json': { schema: { $ref: '#/components/schemas/HTTPValidationError' } },
},
},
},
},
},
'/tasks/{task_id}/log': {
get: {
tags: ['Tasks'],
Expand Down
24 changes: 0 additions & 24 deletions packages/api-server/api_server/repositories/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
LogEntry,
Pagination,
Phases,
Status,
TaskEventLog,
TaskRequest,
TaskState,
Expand Down Expand Up @@ -272,29 +271,6 @@ async def query_task_queue_entry(
except FieldError as e:
raise HTTPException(422, str(e)) from e

async def get_task_queue_entry(
self, task_id: str
) -> Optional[TaskQueueEntryPydantic]:
# TODO: enforce with authz
result = await DbTaskState.get_or_none(id_=task_id).values(
"id_",
"assigned_to",
"unix_millis_start_time",
"unix_millis_finish_time",
"status",
"unix_millis_request_time",
"requester",
"pickup",
"destination",
)
if result is None:
return None

status = result["status"]
if status is not None and "Status." in status:
result["status"] = result["status"].split("Status.")[1]
return TaskQueueEntryPydantic(**result)

async def get_task_log(
self, task_id: str, between: Tuple[int, int]
) -> Optional[TaskEventLog]:
Expand Down
14 changes: 0 additions & 14 deletions packages/api-server/api_server/routes/tasks/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,6 @@ async def query_task_queue_entry(
)


@router.get("/{task_id}/queue_entry", response_model=TaskQueueEntryPydantic)
async def get_task_queue_entry(
task_repo: TaskRepository = Depends(task_repo_dep),
task_id: str = Path(..., description="task_id"),
):
"""
Available in socket.io
"""
result = await task_repo.get_task_queue_entry(task_id)
if result is None:
raise HTTPException(status_code=404)
return result


@router.sub("/{task_id}/state", response_model=mdl.TaskState)
async def sub_task_state(req: SubscriptionRequest, task_id: str):
user = sio_user(req)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { styled, Stack, Typography, Tooltip, useMediaQuery, SxProps, Theme } fro
import * as React from 'react';
import {
ApiServerModelsTortoiseModelsTasksTaskStateLeaf as TaskQueueEntry,
TaskState,
TaskRequest,
Status,
} from 'api-client';
Expand Down

0 comments on commit e533470

Please sign in to comment.