From b3ecb2dde86bc000b6971a23e92ad8b60452d1c5 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Tue, 26 Aug 2025 10:54:46 +0800 Subject: [PATCH 1/2] Remove activity discovery endpoint Signed-off-by: Aaron Chong --- packages/api-server/api_server/routes/tasks/tasks.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/api-server/api_server/routes/tasks/tasks.py b/packages/api-server/api_server/routes/tasks/tasks.py index eba52ec03..0ba17671f 100644 --- a/packages/api-server/api_server/routes/tasks/tasks.py +++ b/packages/api-server/api_server/routes/tasks/tasks.py @@ -190,16 +190,6 @@ async def sub_task_log(_req: SubscriptionRequest, task_id: str): ) -@router.post("/activity_discovery", response_model=mdl.ActivityDiscovery) -async def post_activity_discovery( - request: Annotated[mdl.ActivityDiscoveryRequest, Body(...)], - tasks_service: Annotated[RmfService, Depends(get_tasks_service)], -): - return RawJSONResponse( - await tasks_service.call(request.model_dump_json(exclude_none=True)) - ) - - @router.post("/cancel_task", response_model=mdl.TaskCancelResponse) async def post_cancel_task( request: Annotated[mdl.CancelTaskRequest, Body(...)], From 1c0af6a1b7e6758d6bf28b22c069531c94855596 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Tue, 26 Aug 2025 10:55:13 +0800 Subject: [PATCH 2/2] Update api-client Signed-off-by: Aaron Chong --- packages/api-client/lib/openapi/api.ts | 190 ----------------------- packages/api-client/lib/openapi/index.ts | 2 +- packages/api-client/lib/version.ts | 2 +- packages/api-client/schema/index.ts | 98 ------------ 4 files changed, 2 insertions(+), 290 deletions(-) diff --git a/packages/api-client/lib/openapi/api.ts b/packages/api-client/lib/openapi/api.ts index a24e171e0..87405799a 100644 --- a/packages/api-client/lib/openapi/api.ts +++ b/packages/api-client/lib/openapi/api.ts @@ -48,65 +48,6 @@ export const Action = { export type Action = (typeof Action)[keyof typeof Action]; -/** - * - * @export - * @interface Activity - */ -export interface Activity { - /** - * The category of this activity. There must not be any duplicate activity categories per fleet. - * @type {string} - * @memberof Activity - */ - category: string; - /** - * Details about the behavior of the activity. - * @type {string} - * @memberof Activity - */ - detail: string; - /** - * - * @type {object} - * @memberof Activity - */ - description_schema?: object | null; -} -/** - * - * @export - * @interface ActivityDiscovery - */ -export interface ActivityDiscovery { - /** - * - * @type {Array} - * @memberof ActivityDiscovery - */ - data?: Array | null; -} -/** - * - * @export - * @interface ActivityDiscoveryRequest - */ -export interface ActivityDiscoveryRequest { - /** - * Indicate that this is an activity discovery request - * @type {string} - * @memberof ActivityDiscoveryRequest - */ - type: ActivityDiscoveryRequestTypeEnum; -} - -export const ActivityDiscoveryRequestTypeEnum = { - ActivitiyDiscoveryRequest: 'activitiy_discovery_request', -} as const; - -export type ActivityDiscoveryRequestTypeEnum = - (typeof ActivityDiscoveryRequestTypeEnum)[keyof typeof ActivityDiscoveryRequestTypeEnum]; - /** * * @export @@ -624,25 +565,6 @@ export interface Data { */ tasks?: Array | null; } -/** - * - * @export - * @interface Datum - */ -export interface Datum { - /** - * Name of the fleet that supports these activities - * @type {string} - * @memberof Datum - */ - fleet_name: string; - /** - * List of activities that the fleet supports - * @type {Array} - * @memberof Datum - */ - activities: Array; -} /** * * @export @@ -9694,57 +9616,6 @@ export const TasksApiAxiosParamCreator = function (configuration?: Configuration options: localVarRequestOptions, }; }, - /** - * - * @summary Post Activity Discovery - * @param {ActivityDiscoveryRequest} activityDiscoveryRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postActivityDiscoveryTasksActivityDiscoveryPost: async ( - activityDiscoveryRequest: ActivityDiscoveryRequest, - options: RawAxiosRequestConfig = {}, - ): Promise => { - // verify required parameter 'activityDiscoveryRequest' is not null or undefined - assertParamExists( - 'postActivityDiscoveryTasksActivityDiscoveryPost', - 'activityDiscoveryRequest', - activityDiscoveryRequest, - ); - const localVarPath = `/tasks/activity_discovery`; - // 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: 'POST', ...baseOptions, ...options }; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication OpenIdConnect required - - localVarHeaderParameter['Content-Type'] = 'application/json'; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = { - ...localVarHeaderParameter, - ...headersFromBaseOptions, - ...options.headers, - }; - localVarRequestOptions.data = serializeDataIfNeeded( - activityDiscoveryRequest, - localVarRequestOptions, - configuration, - ); - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, /** * * @summary Post Cancel Task @@ -10860,35 +10731,6 @@ export const TasksApiFp = function (configuration?: Configuration) { configuration, )(axios, localVarOperationServerBasePath || basePath); }, - /** - * - * @summary Post Activity Discovery - * @param {ActivityDiscoveryRequest} activityDiscoveryRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async postActivityDiscoveryTasksActivityDiscoveryPost( - activityDiscoveryRequest: ActivityDiscoveryRequest, - options?: RawAxiosRequestConfig, - ): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = - await localVarAxiosParamCreator.postActivityDiscoveryTasksActivityDiscoveryPost( - activityDiscoveryRequest, - options, - ); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = - operationServerMap['TasksApi.postActivityDiscoveryTasksActivityDiscoveryPost']?.[ - localVarOperationServerIndex - ]?.url; - return (axios, basePath) => - createRequestFunction( - localVarAxiosArgs, - globalAxios, - BASE_PATH, - configuration, - )(axios, localVarOperationServerBasePath || basePath); - }, /** * * @summary Post Cancel Task @@ -11523,21 +11365,6 @@ export const TasksApiFactory = function ( .getTaskStateTasksTaskIdStateGet(taskId, options) .then((request) => request(axios, basePath)); }, - /** - * - * @summary Post Activity Discovery - * @param {ActivityDiscoveryRequest} activityDiscoveryRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - postActivityDiscoveryTasksActivityDiscoveryPost( - activityDiscoveryRequest: ActivityDiscoveryRequest, - options?: any, - ): AxiosPromise { - return localVarFp - .postActivityDiscoveryTasksActivityDiscoveryPost(activityDiscoveryRequest, options) - .then((request) => request(axios, basePath)); - }, /** * * @summary Post Cancel Task @@ -11980,23 +11807,6 @@ export class TasksApi extends BaseAPI { .then((request) => request(this.axios, this.basePath)); } - /** - * - * @summary Post Activity Discovery - * @param {ActivityDiscoveryRequest} activityDiscoveryRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof TasksApi - */ - public postActivityDiscoveryTasksActivityDiscoveryPost( - activityDiscoveryRequest: ActivityDiscoveryRequest, - options?: RawAxiosRequestConfig, - ) { - return TasksApiFp(this.configuration) - .postActivityDiscoveryTasksActivityDiscoveryPost(activityDiscoveryRequest, options) - .then((request) => request(this.axios, this.basePath)); - } - /** * * @summary Post Cancel Task diff --git a/packages/api-client/lib/openapi/index.ts b/packages/api-client/lib/openapi/index.ts index 950014808..016918014 100644 --- a/packages/api-client/lib/openapi/index.ts +++ b/packages/api-client/lib/openapi/index.ts @@ -1,5 +1,5 @@ /* tslint:disable */ - +/* eslint-disable */ /** * RMF API Server * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) diff --git a/packages/api-client/lib/version.ts b/packages/api-client/lib/version.ts index c5ca30f93..0418a6cf4 100644 --- a/packages/api-client/lib/version.ts +++ b/packages/api-client/lib/version.ts @@ -1,5 +1,5 @@ // THIS FILE IS GENERATED export const version = { - rmfServer: '2344900c986ce9c874881569105c61d4f575fd63', + rmfServer: '22fc6c2951971c8e141c602ae189efedbfce34ba', openapiGenerator: '', }; diff --git a/packages/api-client/schema/index.ts b/packages/api-client/schema/index.ts index db6a1ce47..0eb056512 100644 --- a/packages/api-client/schema/index.ts +++ b/packages/api-client/schema/index.ts @@ -1022,36 +1022,6 @@ export default { }, }, }, - '/tasks/activity_discovery': { - post: { - tags: ['Tasks'], - summary: 'Post Activity Discovery', - operationId: 'post_activity_discovery_tasks_activity_discovery_post', - requestBody: { - content: { - 'application/json': { - schema: { $ref: '#/components/schemas/ActivityDiscoveryRequest' }, - }, - }, - required: true, - }, - responses: { - '200': { - description: 'Successful Response', - content: { - 'application/json': { schema: { $ref: '#/components/schemas/ActivityDiscovery' } }, - }, - }, - '422': { - description: 'Validation Error', - content: { - 'application/json': { schema: { $ref: '#/components/schemas/HTTPValidationError' } }, - }, - }, - }, - security: [{ OpenIdConnect: [] }], - }, - }, '/tasks/cancel_task': { post: { tags: ['Tasks'], @@ -2519,56 +2489,6 @@ export default { enum: ['waiting', 'cancel', 'override', 'resume'], title: 'Action', }, - Activity: { - properties: { - category: { - type: 'string', - title: 'Category', - description: - 'The category of this activity. There must not be any duplicate activity categories per fleet.', - }, - detail: { - type: 'string', - title: 'Detail', - description: 'Details about the behavior of the activity.', - }, - description_schema: { - anyOf: [{ type: 'object' }, { type: 'null' }], - title: 'Description Schema', - description: 'The schema for this activity description', - }, - }, - type: 'object', - required: ['category', 'detail'], - title: 'Activity', - }, - ActivityDiscovery: { - properties: { - data: { - anyOf: [ - { items: { $ref: '#/components/schemas/Datum' }, type: 'array' }, - { type: 'null' }, - ], - title: 'Data', - }, - }, - type: 'object', - title: 'ActivityDiscovery', - }, - ActivityDiscoveryRequest: { - properties: { - type: { - type: 'string', - enum: ['activitiy_discovery_request'], - const: 'activitiy_discovery_request', - title: 'Type', - description: 'Indicate that this is an activity discovery request', - }, - }, - type: 'object', - required: ['type'], - title: 'ActivityDiscoveryRequest', - }, AddExceptDateRequest: { properties: { except_date: { type: 'string', format: 'date-time', title: 'Except Date' } }, type: 'object', @@ -2805,24 +2725,6 @@ export default { type: 'object', title: 'Data', }, - Datum: { - properties: { - fleet_name: { - type: 'string', - title: 'Fleet Name', - description: 'Name of the fleet that supports these activities', - }, - activities: { - items: { $ref: '#/components/schemas/Activity' }, - type: 'array', - title: 'Activities', - description: 'List of activities that the fleet supports', - }, - }, - type: 'object', - required: ['fleet_name', 'activities'], - title: 'Datum', - }, DeliveryAlert: { properties: { id: { type: 'string', title: 'Id', deprecated: true },