From 72ffb775567d25d6a7e6d46b026173241e7bbbac Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 15:43:21 +0300 Subject: [PATCH 01/19] add helper --- src/orkes/OrkesConductorClient.ts | 3 ++ .../addServicesBackwardCompatibility.ts | 41 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/orkes/helpers/addServicesBackwardCompatibility.ts diff --git a/src/orkes/OrkesConductorClient.ts b/src/orkes/OrkesConductorClient.ts index a29bbb9b..bcaa312f 100644 --- a/src/orkes/OrkesConductorClient.ts +++ b/src/orkes/OrkesConductorClient.ts @@ -6,6 +6,7 @@ import { } from "./helpers"; import type { OrkesApiConfig } from "./types"; import { createClient } from "../common/open-api/client"; +import { addServicesBackwardCompatibility } from "./helpers/addServicesBackwardCompatibility"; /** * Takes a config with keyId and keySecret returns a promise with an instance of Client @@ -41,5 +42,7 @@ export const orkesConductorClient = async ( await handleAuth(openApiClient, keyId, keySecret, refreshTokenInterval); } + addServicesBackwardCompatibility(openApiClient); // DEPRECATED, should be removed after April 2026 + return openApiClient; }; diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts new file mode 100644 index 00000000..e78b2d16 --- /dev/null +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -0,0 +1,41 @@ +import { Client } from "../../common/open-api/client/types.gen"; +import { + EventResource, + HumanTaskResource, + UserFormTemplateResource, + MetadataResource, + ServiceRegistryResource, + SchedulerResource, + TaskResource, + TokenResource, + WorkflowResource, + WorkflowBulkResource, + HealthCheckResource, +} from "../../common/open-api/sdk.gen"; + +export const addServicesBackwardCompatibility = (client: Client) => { + (client as any).eventResource = { + getQueueConfig: (queueType: string, queueName: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return EventResource.getQueueConfig({ + client, + path: { queueType, queueName }, + throwOnError: true, + }); + }, + + putQueueConfig: (queueType: string, queueName: string, body: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + EventResource.putQueueConfig({ + client, + path: { queueType, queueName }, + body, + throwOnError: true, + }); + }, + }; +}; From 5c44134f37b026f870b20aa170d4dcd122a43bf7 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 16:00:26 +0300 Subject: [PATCH 02/19] add resources up to schedulerResource --- .../addServicesBackwardCompatibility.ts | 396 ++++++++++++++++++ 1 file changed, 396 insertions(+) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index e78b2d16..b0101e72 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -37,5 +37,401 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, + + deleteQueueConfig: (queueType: string, queueName: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + EventResource.deleteQueueConfig({ + client, + path: { queueType, queueName }, + throwOnError: true, + }); + }, + + getEventHandlers: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return EventResource.getEventHandlers({ + client, + throwOnError: true, + }); + }, + + updateEventHandler: (body: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + EventResource.updateEventHandler({ + client, + body, + throwOnError: true, + }); + }, + + addEventHandler: (body: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + EventResource.addEventHandler({ + client, + body, + throwOnError: true, + }); + }, + + getQueueNames: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return EventResource.getQueueNames({ + client, + throwOnError: true, + }); + }, + + removeEventHandlerStatus: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + EventResource.removeEventHandlerStatus({ + client, + path: { name }, + throwOnError: true, + }); + }, + + getEventHandlersForEvent: (event: string, activeOnly: boolean = true) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return EventResource.getEventHandlersForEvent({ + client, + path: { event }, + query: { activeOnly }, + throwOnError: true, + }); + }, + + deleteTagForEventHandler: (name: string, body: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + EventResource.deleteTagForEventHandler({ + client, + path: { name }, + body, + throwOnError: true, + }); + }, + + getTagsForEventHandler: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return EventResource.getTagsForEventHandler({ + client, + path: { name }, + throwOnError: true, + }); + }, + + putTagForEventHandler: (name: string, body: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + EventResource.putTagForEventHandler({ + client, + path: { name }, + body, + throwOnError: true, + }); + }, + }; + + (client as any).healthCheckResource = { + doCheck: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return HealthCheckResource.doCheck({ + client, + throwOnError: true, + }); + }, + }; + + (client as any).metadataResource = { + getTaskDef: (tasktype: string, metadata: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return MetadataResource.getTaskDef({ + client, + path: { tasktype }, + query: { metadata }, + throwOnError: true, + }); + }, + + unregisterTaskDef: (tasktype: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + MetadataResource.unregisterTaskDef({ + client, + path: { tasktype }, + throwOnError: true, + }); + }, + + getAllWorkflows: ( + access: string = "READ", + metadata: boolean = false, + tagKey?: string, + tagValue?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return MetadataResource.getWorkflowDefs({ + client, + query: { access, metadata, tagKey, tagValue }, + throwOnError: true, + }); + }, + + update: (requestBody: any[], overwrite: boolean = true) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + MetadataResource.update({ + client, + body: requestBody, + query: { overwrite }, + throwOnError: true, + }); + }, + + create: (requestBody: any, overwrite: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + MetadataResource.create({ + client, + body: requestBody, + query: { overwrite }, + throwOnError: true, + }); + }, + + getTaskDefs: ( + access: string = "READ", + metadata: boolean = false, + tagKey?: string, + tagValue?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return MetadataResource.getTaskDefs({ + client, + query: { access, metadata, tagKey, tagValue }, + throwOnError: true, + }); + }, + + updateTaskDef: (requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + MetadataResource.updateTaskDef({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + registerTaskDef: (requestBody: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + MetadataResource.registerTaskDef({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + unregisterWorkflowDef: (name: string, version: number) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + MetadataResource.unregisterWorkflowDef({ + client, + path: { name, version }, + throwOnError: true, + }); + }, + + get: (name: string, version?: number, metadata: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return MetadataResource.get1({ + client, + path: { name }, + query: { version, metadata }, + throwOnError: true, + }); + }, + }; + + (client as any).schedulerResource = { + getSchedule: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return SchedulerResource.getSchedule({ + client, + path: { name }, + throwOnError: true, + }); + }, + + deleteSchedule: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + SchedulerResource.deleteSchedule({ + client, + path: { name }, + throwOnError: true, + }); + }, + + getNextFewSchedules: ( + cronExpression: string, + scheduleStartTime?: number, + scheduleEndTime?: number, + limit: number = 3 + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return SchedulerResource.getNextFewSchedules({ + client, + query: { cronExpression, scheduleStartTime, scheduleEndTime, limit }, + throwOnError: true, + }); + }, + + pauseSchedule: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + SchedulerResource.pauseSchedule({ + client, + path: { name }, + throwOnError: true, + }); + }, + + pauseAllSchedules: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return SchedulerResource.pauseAllSchedules({ + client, + throwOnError: true, + }); + }, + + resumeSchedule: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + SchedulerResource.resumeSchedule({ + client, + path: { name }, + throwOnError: true, + }); + }, + + requeueAllExecutionRecords: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return SchedulerResource.requeueAllExecutionRecords({ + client, + throwOnError: true, + }); + }, + + resumeAllSchedules: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return SchedulerResource.resumeAllSchedules({ + client, + throwOnError: true, + }); + }, + + getAllSchedules: (workflowName?: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return SchedulerResource.getAllSchedules({ + client, + query: { workflowName }, + throwOnError: true, + }); + }, + + saveSchedule: (requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + SchedulerResource.saveSchedule({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + searchV21: ( + start?: number, + size: number = 100, + sort?: string, + freeText: string = "*", + query?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return SchedulerResource.searchV2({ + client, + query: { start, size, sort, freeText, query }, + throwOnError: true, + }); + }, + + testTimeout: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/scheduler/test/timeout", + throwOnError: true, + }); + }, }; }; From d6aedcca833a7a5ac3ec4ed85b3d4b35be3f122d Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 16:16:04 +0300 Subject: [PATCH 03/19] add taskResource --- .../addServicesBackwardCompatibility.ts | 271 ++++++++++++++++++ 1 file changed, 271 insertions(+) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index b0101e72..8bb9f14f 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -434,4 +434,275 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, }; + + (client as any).taskResource = { + poll: (tasktype: string, workerid?: string, domain?: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.poll({ + client, + path: { tasktype }, + query: { workerid, domain }, + throwOnError: true, + }); + }, + + allVerbose: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.allVerbose({ + client, + throwOnError: true, + }); + }, + + updateTask: ( + workflowId: string, + taskRefName: string, + status: + | "IN_PROGRESS" + | "FAILED" + | "FAILED_WITH_TERMINAL_ERROR" + | "COMPLETED", + requestBody: any + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.updateTask1({ + client, + path: { workflowId, taskRefName, status }, + body: requestBody, + throwOnError: true, + }); + }, + + getTask: (taskId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.getTask({ + client, + path: { taskId }, + throwOnError: true, + }); + }, + + all: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.all({ + client, + throwOnError: true, + }); + }, + + requeuePendingTask: (taskType: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.requeuePendingTask({ + client, + path: { taskType }, + throwOnError: true, + }); + }, + + search: ( + start?: number, + size: number = 100, + sort?: string, + freeText: string = "*", + query?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.search2({ + client, + query: { start, size, sort, freeText, query }, + throwOnError: true, + }); + }, + + searchV22: ( + start?: number, + size: number = 100, + sort?: string, + freeText: string = "*", + query?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/tasks/search-v2", + query: { start, size, sort, freeText, query }, + throwOnError: true, + }); + }, + + getPollData: (taskType: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.getPollData({ + client, + query: { taskType }, + throwOnError: true, + }); + }, + + getTaskLogs: (taskId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.getTaskLogs({ + client, + path: { taskId }, + throwOnError: true, + }); + }, + + log: (taskId: string, requestBody: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + TaskResource.log({ + client, + path: { taskId }, + body: requestBody, + throwOnError: true, + }); + }, + + getAllPollData: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.getAllPollData({ + client, + throwOnError: true, + }); + }, + + batchPoll: ( + tasktype: string, + workerid?: string, + domain?: string, + count: number = 1, + timeout: number = 100 + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.batchPoll({ + client, + path: { tasktype }, + query: { workerid, domain, count, timeout }, + throwOnError: true, + }); + }, + + updateTask1: (requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.updateTask({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + size1: (taskType?: string[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.size({ + client, + query: { taskType }, + throwOnError: true, + }); + }, + + getExternalStorageLocation1: ( + path: string, + operation: string, + payloadType: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/tasks/externalstoragelocation", + query: { path, operation, payloadType }, + throwOnError: true, + }); + }, + + updateTaskSync: ( + workflowId: string, + taskRefName: string, + status: any, + output: any, + workerId?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.updateTaskSync({ + client, + path: { workflowId, taskRefName, status }, + query: { workerid: workerId }, + body: output, + throwOnError: true, + }); + }, + + signal: ( + workflowId: string, + status: any, + output: any, + returnStrategy: any = "TARGET_WORKFLOW" + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TaskResource.signalWorkflowTaskSync({ + client, + path: { workflowId, status }, + query: { returnStrategy }, + body: output, + throwOnError: true, + }); + }, + + signalAsync: (workflowId: string, status: any, output: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + TaskResource.signalWorkflowTaskASync({ + client, + path: { workflowId, status }, + body: output, + throwOnError: true, + }); + }, + }; }; From cc079c0bc48a2d0cc849a191e2f8e7a5c42dfa47 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 16:35:49 +0300 Subject: [PATCH 04/19] add workflowResource --- .../addServicesBackwardCompatibility.ts | 469 ++++++++++++++++++ 1 file changed, 469 insertions(+) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index 8bb9f14f..f837a2ea 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -435,6 +435,475 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; + (client as any).tokenResource = { + generateToken: (requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TokenResource.generateToken({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + getUserInfo: (claims: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return TokenResource.getUserInfo({ + client, + query: { claims }, + throwOnError: true, + }); + }, + }; + + (client as any).workflowBulkResource = { + retry: (requestBody: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowBulkResource.retry1({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + restart: (requestBody: any[], useLatestDefinitions: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowBulkResource.restart1({ + client, + body: requestBody, + query: { useLatestDefinitions }, + throwOnError: true, + }); + }, + + terminate: (requestBody: any[], reason?: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowBulkResource.terminate({ + client, + body: requestBody, + query: { reason }, + throwOnError: true, + }); + }, + + resumeWorkflow: (requestBody: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowBulkResource.resumeWorkflow1({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + pauseWorkflow1: (requestBody: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowBulkResource.pauseWorkflow1({ + client, + body: requestBody, + throwOnError: true, + }); + }, + }; + + (client as any).workflowResource = { + getRunningWorkflow: ( + name: string, + version: number = 1, + startTime?: number, + endTime?: number + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.getRunningWorkflow({ + client, + path: { name }, + query: { version, startTime, endTime }, + throwOnError: true, + }); + }, + + executeWorkflow: ( + body: any, + name: string, + version: number, + requestId?: string, + waitUntilTaskRef?: string, + waitForSeconds?: number, + consistency?: any, + returnStrategy?: any + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.executeWorkflow({ + client, + path: { name, version }, + query: { + requestId, + waitUntilTaskRef, + waitForSeconds, + consistency, + returnStrategy, + }, + body, + throwOnError: true, + }); + }, + + startWorkflow: (requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.startWorkflow({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + decide: (workflowId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.decide({ + client, + path: { workflowId }, + throwOnError: true, + }); + }, + + rerun: (workflowId: string, requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.rerun({ + client, + path: { workflowId }, + body: requestBody, + throwOnError: true, + }); + }, + + searchV21: ( + start?: number, + size: number = 100, + sort?: string, + freeText: string = "*", + query?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/workflow/search-v2", + query: { start, size, sort, freeText, query }, + throwOnError: true, + }); + }, + + pauseWorkflow: (workflowId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.pauseWorkflow({ + client, + path: { workflowId }, + throwOnError: true, + }); + }, + + skipTaskFromWorkflow: ( + workflowId: string, + taskReferenceName: string, + requestBody?: any + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.skipTaskFromWorkflow({ + client, + path: { workflowId, taskReferenceName }, + body: requestBody, + throwOnError: true, + }); + }, + + getWorkflows: ( + name: string, + requestBody: any[], + includeClosed: boolean = false, + includeTasks: boolean = false + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.getWorkflows({ + client, + path: { name }, + query: { includeClosed, includeTasks }, + body: requestBody, + throwOnError: true, + }); + }, + + getWorkflowStatusSummary: ( + workflowId: string, + includeOutput: boolean = false, + includeVariables: boolean = false + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.getWorkflowStatusSummary({ + client, + path: { workflowId }, + query: { includeOutput, includeVariables }, + throwOnError: true, + }); + }, + + getWorkflows1: ( + name: string, + correlationId: string, + includeClosed: boolean = false, + includeTasks: boolean = false + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.getWorkflows2({ + client, + path: { name, correlationId }, + query: { includeClosed, includeTasks }, + throwOnError: true, + }); + }, + + retry1: (workflowId: string, resumeSubworkflowTasks: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.retry({ + client, + path: { workflowId }, + query: { resumeSubworkflowTasks }, + throwOnError: true, + }); + }, + + getExecutionStatus: (workflowId: string, includeTasks: boolean = true) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.getExecutionStatus({ + client, + path: { workflowId }, + query: { includeTasks }, + throwOnError: true, + }); + }, + + terminate1: (workflowId: string, reason?: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.terminate1({ + client, + path: { workflowId }, + query: { reason }, + throwOnError: true, + }); + }, + + resumeWorkflow: (workflowId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.resumeWorkflow({ + client, + path: { workflowId }, + throwOnError: true, + }); + }, + + delete: (workflowId: string, archiveWorkflow: boolean = true) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.delete1({ + client, + path: { workflowId }, + query: { archiveWorkflow }, + throwOnError: true, + }); + }, + + searchWorkflowsByTasks: ( + start?: number, + size: number = 100, + sort?: string, + freeText: string = "*", + query?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/workflow/search-by-tasks", + query: { start, size, sort, freeText, query }, + throwOnError: true, + }); + }, + + getExternalStorageLocation: ( + path: string, + operation: string, + payloadType: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/workflow/externalstoragelocation", + query: { path, operation, payloadType }, + throwOnError: true, + }); + }, + + startWorkflow1: ( + name: string, + requestBody: any, + version?: number, + correlationId?: string, + priority?: number + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.startWorkflow1({ + client, + path: { name }, + query: { version, correlationId, priority }, + body: requestBody, + throwOnError: true, + }); + }, + + restart1: (workflowId: string, useLatestDefinitions: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.restart({ + client, + path: { workflowId }, + query: { useLatestDefinitions }, + throwOnError: true, + }); + }, + + search1: ( + queryId?: string, + start?: number, + size: number = 100, + sort?: string, + freeText: string = "*", + query?: string, + skipCache: boolean = false + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/workflow/search", + query: { queryId, start, size, sort, freeText, query, skipCache }, + throwOnError: true, + }); + }, + + searchWorkflowsByTasksV2: ( + start?: number, + size: number = 100, + sort?: string, + freeText: string = "*", + query?: string + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return client.get({ + security: [ + { + name: "X-Authorization", + type: "apiKey", + }, + ], + url: "/api/workflow/search-by-tasks-v2", + query: { start, size, sort, freeText, query }, + throwOnError: true, + }); + }, + + resetWorkflow: (workflowId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + WorkflowResource.resetWorkflow({ + client, + path: { workflowId }, + throwOnError: true, + }); + }, + + testWorkflow: (requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return WorkflowResource.testWorkflow({ + client, + body: requestBody, + throwOnError: true, + }); + }, + }; + (client as any).taskResource = { poll: (tasktype: string, workerid?: string, domain?: string) => { console.warn( From 4231fbf8adc8201cb754de5e2dc64c8ea479029c Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 16:43:38 +0300 Subject: [PATCH 05/19] all resources added --- .../addServicesBackwardCompatibility.ts | 388 ++++++++++++++++++ 1 file changed, 388 insertions(+) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index f837a2ea..ce85bf9b 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -1,7 +1,9 @@ import { Client } from "../../common/open-api/client/types.gen"; import { EventResource, + HumanTask, HumanTaskResource, + UserForm, UserFormTemplateResource, MetadataResource, ServiceRegistryResource, @@ -904,6 +906,392 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; + (client as any).serviceRegistryResource = { + getRegisteredServices: () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.getRegisteredServices({ + client, + throwOnError: true, + }); + }, + + removeService: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + ServiceRegistryResource.removeService({ + client, + path: { name }, + throwOnError: true, + }); + }, + + getService: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.getService({ + client, + path: { name }, + throwOnError: true, + }); + }, + + openCircuitBreaker: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.openCircuitBreaker({ + client, + path: { name }, + throwOnError: true, + }); + }, + + closeCircuitBreaker: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.closeCircuitBreaker({ + client, + path: { name }, + throwOnError: true, + }); + }, + + getCircuitBreakerStatus: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.getCircuitBreakerStatus({ + client, + path: { name }, + throwOnError: true, + }); + }, + + addOrUpdateService: (serviceRegistry: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + ServiceRegistryResource.addOrUpdateService({ + client, + body: serviceRegistry, + throwOnError: true, + }); + }, + + addOrUpdateServiceMethod: (registryName: string, method: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + ServiceRegistryResource.addOrUpdateMethod({ + client, + path: { registryName }, + body: method, + throwOnError: true, + }); + }, + + removeMethod: (registryName: string, serviceName: string, method: string, methodType: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + ServiceRegistryResource.removeMethod({ + client, + path: { registryName }, + query: { serviceName, method, methodType }, + throwOnError: true, + }); + }, + + getProtoData: (registryName: string, filename: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.getProtoData({ + client, + path: { registryName, filename }, + throwOnError: true, + }); + }, + + setProtoData: (registryName: string, filename: string, data: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + ServiceRegistryResource.setProtoData({ + client, + path: { registryName, filename }, + body: data, + throwOnError: true, + }); + }, + + deleteProto: (registryName: string, filename: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + ServiceRegistryResource.deleteProto({ + client, + path: { registryName, filename }, + throwOnError: true, + }); + }, + + getAllProtos: (registryName: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.getAllProtos({ + client, + path: { registryName }, + throwOnError: true, + }); + }, + + discover: (name: string, create: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return ServiceRegistryResource.discover({ + client, + path: { name }, + query: { create }, + throwOnError: true, + }); + }, + }; + + (client as any).humanTaskResource = { + getConductorTaskById: (taskId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return HumanTaskResource.getConductorTaskById({ + client, + path: { taskId }, + throwOnError: true, + }); + }, + }; + + (client as any).humanTask = { + deleteTaskFromHumanTaskRecords: (requestBody: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + HumanTask.deleteTaskFromHumanTaskRecords({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + deleteTaskFromHumanTaskRecords1: (taskId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + HumanTask.deleteTaskFromHumanTaskRecords1({ + client, + path: { taskId }, + throwOnError: true, + }); + }, + + search: (requestBody: any) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return HumanTask.search({ + client, + body: requestBody, + throwOnError: true, + }); + }, + + updateTaskOutputByRef: ( + workflowId: string, + taskRefName: string, + requestBody: any, + complete: boolean = false, + iteration?: any[] + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return HumanTask.updateTaskOutputByRef({ + client, + query: { + workflowId, + taskRefName, + complete, + iteration, + }, + body: requestBody, + throwOnError: true, + }); + }, + + getTask1: (taskId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return HumanTask.getTask1({ + client, + path: { taskId }, + throwOnError: true, + }); + }, + + claimTask: (taskId: string, overrideAssignment: boolean = false, withTemplate: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return HumanTask.claimTask({ + client, + path: { taskId }, + query: { overrideAssignment, withTemplate }, + throwOnError: true, + }); + }, + + assignAndClaim: ( + taskId: string, + userId: string, + overrideAssignment: boolean = false, + withTemplate: boolean = false + ) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return HumanTask.assignAndClaim({ + client, + path: { taskId, userId }, + query: { overrideAssignment, withTemplate }, + throwOnError: true, + }); + }, + + reassignTask: (taskId: string, requestBody: any[]) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + HumanTask.reassignTask({ + client, + path: { taskId }, + body: requestBody, + throwOnError: true, + }); + }, + + releaseTask: (taskId: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + HumanTask.releaseTask({ + client, + path: { taskId }, + throwOnError: true, + }); + }, + + skipTask: (taskId: string, reason?: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + HumanTask.skipTask({ + client, + path: { taskId }, + query: { reason }, + throwOnError: true, + }); + }, + + updateTaskOutput: (taskId: string, requestBody: any, complete: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + HumanTask.updateTaskOutput({ + client, + path: { taskId }, + query: { complete }, + body: requestBody, + throwOnError: true, + }); + }, + + getAllTemplates: (name?: string, version?: number) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return UserForm.getAllTemplates({ + client, + query: { name, version }, + throwOnError: true, + }); + }, + + saveTemplate: (requestBody: any, newVersion: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return UserForm.saveTemplate({ + client, + query: { newVersion }, + body: requestBody, + throwOnError: true, + }); + }, + + saveTemplates: (requestBody: any[], newVersion: boolean = false) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return UserForm.saveTemplates({ + client, + query: { newVersion }, + body: requestBody, + throwOnError: true, + }); + }, + + deleteTemplateByName: (name: string) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + UserForm.deleteTemplateByName({ + client, + path: { name }, + throwOnError: true, + }); + }, + + deleteTemplatesByNameAndVersion: (name: string, version: number) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + HumanTask.deleteTemplatesByNameAndVersion({ + client, + path: { name, version }, + throwOnError: true, + }); + }, + + getTemplateByNameAndVersion: (name: string, version: number) => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); + return UserForm.getTemplateByNameAndVersion({ + client, + path: { name, version }, + throwOnError: true, + }); + }, + }; + (client as any).taskResource = { poll: (tasktype: string, workerid?: string, domain?: string) => { console.warn( From 66cdd04e7ec1afd288c4b675cd4727e72ac150b4 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 17:45:20 +0300 Subject: [PATCH 06/19] add async/await --- .../addServicesBackwardCompatibility.ts | 578 +++++++++++------- 1 file changed, 343 insertions(+), 235 deletions(-) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index ce85bf9b..f263ef5b 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -1,10 +1,10 @@ +import { SignalResponse } from "../../common"; import { Client } from "../../common/open-api/client/types.gen"; import { EventResource, HumanTask, HumanTaskResource, UserForm, - UserFormTemplateResource, MetadataResource, ServiceRegistryResource, SchedulerResource, @@ -17,22 +17,27 @@ import { export const addServicesBackwardCompatibility = (client: Client) => { (client as any).eventResource = { - getQueueConfig: (queueType: string, queueName: string) => { + getQueueConfig: async (queueType: string, queueName: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return EventResource.getQueueConfig({ + const { data } = await EventResource.getQueueConfig({ client, path: { queueType, queueName }, throwOnError: true, }); + return data; }, - putQueueConfig: (queueType: string, queueName: string, body: string) => { + putQueueConfig: async ( + queueType: string, + queueName: string, + body: string + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - EventResource.putQueueConfig({ + await EventResource.putQueueConfig({ client, path: { queueType, queueName }, body, @@ -40,87 +45,93 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - deleteQueueConfig: (queueType: string, queueName: string) => { + deleteQueueConfig: async (queueType: string, queueName: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - EventResource.deleteQueueConfig({ + await EventResource.deleteQueueConfig({ client, path: { queueType, queueName }, throwOnError: true, }); }, - getEventHandlers: () => { + getEventHandlers: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return EventResource.getEventHandlers({ + const { data } = await EventResource.getEventHandlers({ client, throwOnError: true, }); + return data; }, - updateEventHandler: (body: any) => { + updateEventHandler: async (body: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - EventResource.updateEventHandler({ + await EventResource.updateEventHandler({ client, body, throwOnError: true, }); }, - addEventHandler: (body: any) => { + addEventHandler: async (body: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - EventResource.addEventHandler({ + await EventResource.addEventHandler({ client, body, throwOnError: true, }); }, - getQueueNames: () => { + getQueueNames: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return EventResource.getQueueNames({ + const { data } = await EventResource.getQueueNames({ client, throwOnError: true, }); + return data; }, - removeEventHandlerStatus: (name: string) => { + removeEventHandlerStatus: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - EventResource.removeEventHandlerStatus({ + await EventResource.removeEventHandlerStatus({ client, path: { name }, throwOnError: true, }); }, - getEventHandlersForEvent: (event: string, activeOnly: boolean = true) => { + getEventHandlersForEvent: async ( + event: string, + activeOnly: boolean = true + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return EventResource.getEventHandlersForEvent({ + const { data } = await EventResource.getEventHandlersForEvent({ client, path: { event }, query: { activeOnly }, throwOnError: true, }); + return data; }, - deleteTagForEventHandler: (name: string, body: any[]) => { + deleteTagForEventHandler: async (name: string, body: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - EventResource.deleteTagForEventHandler({ + await EventResource.deleteTagForEventHandler({ client, path: { name }, body, @@ -128,22 +139,23 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getTagsForEventHandler: (name: string) => { + getTagsForEventHandler: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return EventResource.getTagsForEventHandler({ + const { data } = await EventResource.getTagsForEventHandler({ client, path: { name }, throwOnError: true, }); + return data; }, - putTagForEventHandler: (name: string, body: any[]) => { + putTagForEventHandler: async (name: string, body: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - EventResource.putTagForEventHandler({ + await EventResource.putTagForEventHandler({ client, path: { name }, body, @@ -153,42 +165,44 @@ export const addServicesBackwardCompatibility = (client: Client) => { }; (client as any).healthCheckResource = { - doCheck: () => { + doCheck: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return HealthCheckResource.doCheck({ + const { data } = await HealthCheckResource.doCheck({ client, throwOnError: true, }); + return data; }, }; (client as any).metadataResource = { - getTaskDef: (tasktype: string, metadata: boolean = false) => { + getTaskDef: async (tasktype: string, metadata: boolean = false) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return MetadataResource.getTaskDef({ + const { data } = await MetadataResource.getTaskDef({ client, path: { tasktype }, query: { metadata }, throwOnError: true, }); + return data; }, - unregisterTaskDef: (tasktype: string) => { + unregisterTaskDef: async (tasktype: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - MetadataResource.unregisterTaskDef({ + await MetadataResource.unregisterTaskDef({ client, path: { tasktype }, throwOnError: true, }); }, - getAllWorkflows: ( + getAllWorkflows: async ( access: string = "READ", metadata: boolean = false, tagKey?: string, @@ -197,18 +211,19 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return MetadataResource.getWorkflowDefs({ + const { data } = await MetadataResource.getWorkflowDefs({ client, query: { access, metadata, tagKey, tagValue }, throwOnError: true, }); + return data; }, - update: (requestBody: any[], overwrite: boolean = true) => { + update: async (requestBody: any[], overwrite: boolean = true) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - MetadataResource.update({ + await MetadataResource.update({ client, body: requestBody, query: { overwrite }, @@ -216,11 +231,11 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - create: (requestBody: any, overwrite: boolean = false) => { + create: async (requestBody: any, overwrite: boolean = false) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - MetadataResource.create({ + await MetadataResource.create({ client, body: requestBody, query: { overwrite }, @@ -228,7 +243,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getTaskDefs: ( + getTaskDefs: async ( access: string = "READ", metadata: boolean = false, tagKey?: string, @@ -237,83 +252,86 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return MetadataResource.getTaskDefs({ + const { data } = await MetadataResource.getTaskDefs({ client, query: { access, metadata, tagKey, tagValue }, throwOnError: true, }); + return data; }, - updateTaskDef: (requestBody: any) => { + updateTaskDef: async (requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - MetadataResource.updateTaskDef({ + await MetadataResource.updateTaskDef({ client, body: requestBody, throwOnError: true, }); }, - registerTaskDef: (requestBody: any[]) => { + registerTaskDef: async (requestBody: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - MetadataResource.registerTaskDef({ + await MetadataResource.registerTaskDef({ client, body: requestBody, throwOnError: true, }); }, - unregisterWorkflowDef: (name: string, version: number) => { + unregisterWorkflowDef: async (name: string, version: number) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - MetadataResource.unregisterWorkflowDef({ + await MetadataResource.unregisterWorkflowDef({ client, path: { name, version }, throwOnError: true, }); }, - get: (name: string, version?: number, metadata: boolean = false) => { + get: async (name: string, version?: number, metadata: boolean = false) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return MetadataResource.get1({ + const { data } = await MetadataResource.get1({ client, path: { name }, query: { version, metadata }, throwOnError: true, }); + return data; }, }; (client as any).schedulerResource = { - getSchedule: (name: string) => { + getSchedule: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return SchedulerResource.getSchedule({ + const { data } = await SchedulerResource.getSchedule({ client, path: { name }, throwOnError: true, }); + return data; }, - deleteSchedule: (name: string) => { + deleteSchedule: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - SchedulerResource.deleteSchedule({ + await SchedulerResource.deleteSchedule({ client, path: { name }, throwOnError: true, }); }, - getNextFewSchedules: ( + getNextFewSchedules: async ( cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, @@ -322,88 +340,93 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return SchedulerResource.getNextFewSchedules({ + const { data } = await SchedulerResource.getNextFewSchedules({ client, query: { cronExpression, scheduleStartTime, scheduleEndTime, limit }, throwOnError: true, }); + return data; }, - pauseSchedule: (name: string) => { + pauseSchedule: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - SchedulerResource.pauseSchedule({ + await SchedulerResource.pauseSchedule({ client, path: { name }, throwOnError: true, }); }, - pauseAllSchedules: () => { + pauseAllSchedules: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return SchedulerResource.pauseAllSchedules({ + const { data } = await SchedulerResource.pauseAllSchedules({ client, throwOnError: true, }); + return data; }, - resumeSchedule: (name: string) => { + resumeSchedule: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - SchedulerResource.resumeSchedule({ + await SchedulerResource.resumeSchedule({ client, path: { name }, throwOnError: true, }); }, - requeueAllExecutionRecords: () => { + requeueAllExecutionRecords: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return SchedulerResource.requeueAllExecutionRecords({ + const { data } = await SchedulerResource.requeueAllExecutionRecords({ client, throwOnError: true, }); + return data; }, - resumeAllSchedules: () => { + resumeAllSchedules: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return SchedulerResource.resumeAllSchedules({ + const { data } = await SchedulerResource.resumeAllSchedules({ client, throwOnError: true, }); + return data; }, - getAllSchedules: (workflowName?: string) => { + getAllSchedules: async (workflowName?: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return SchedulerResource.getAllSchedules({ + const { data } = await SchedulerResource.getAllSchedules({ client, query: { workflowName }, throwOnError: true, }); + return data; }, - saveSchedule: (requestBody: any) => { + saveSchedule: async (requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - SchedulerResource.saveSchedule({ + await SchedulerResource.saveSchedule({ client, body: requestBody, throwOnError: true, }); }, - searchV21: ( + searchV21: async ( start?: number, size: number = 100, sort?: string, @@ -413,18 +436,19 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return SchedulerResource.searchV2({ + const { data } = await SchedulerResource.searchV2({ client, query: { start, size, sort, freeText, query }, throwOnError: true, }); + return data; }, - testTimeout: () => { + testTimeout: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -434,94 +458,105 @@ export const addServicesBackwardCompatibility = (client: Client) => { url: "/api/scheduler/test/timeout", throwOnError: true, }); + return data as any; }, }; (client as any).tokenResource = { - generateToken: (requestBody: any) => { + generateToken: async (requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TokenResource.generateToken({ + const { data } = await TokenResource.generateToken({ client, body: requestBody, throwOnError: true, }); + return data; }, - getUserInfo: (claims: boolean = false) => { + getUserInfo: async (claims: boolean = false) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TokenResource.getUserInfo({ + const { data } = await TokenResource.getUserInfo({ client, query: { claims }, throwOnError: true, }); + return data; }, }; (client as any).workflowBulkResource = { - retry: (requestBody: any[]) => { + retry: async (requestBody: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowBulkResource.retry1({ + const { data } = await WorkflowBulkResource.retry1({ client, body: requestBody, throwOnError: true, }); + return data; }, - restart: (requestBody: any[], useLatestDefinitions: boolean = false) => { + restart: async ( + requestBody: any[], + useLatestDefinitions: boolean = false + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowBulkResource.restart1({ + const { data } = await WorkflowBulkResource.restart1({ client, body: requestBody, query: { useLatestDefinitions }, throwOnError: true, }); + return data; }, - terminate: (requestBody: any[], reason?: string) => { + terminate: async (requestBody: any[], reason?: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowBulkResource.terminate({ + const { data } = await WorkflowBulkResource.terminate({ client, body: requestBody, query: { reason }, throwOnError: true, }); + return data; }, - resumeWorkflow: (requestBody: any[]) => { + resumeWorkflow: async (requestBody: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowBulkResource.resumeWorkflow1({ + const { data } = await WorkflowBulkResource.resumeWorkflow1({ client, body: requestBody, throwOnError: true, }); + return data; }, - pauseWorkflow1: (requestBody: any[]) => { + pauseWorkflow1: async (requestBody: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowBulkResource.pauseWorkflow1({ + const { data } = await WorkflowBulkResource.pauseWorkflow1({ client, body: requestBody, throwOnError: true, }); + return data; }, }; (client as any).workflowResource = { - getRunningWorkflow: ( + getRunningWorkflow: async ( name: string, version: number = 1, startTime?: number, @@ -530,15 +565,16 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.getRunningWorkflow({ + const { data } = await WorkflowResource.getRunningWorkflow({ client, path: { name }, query: { version, startTime, endTime }, throwOnError: true, }); + return data; }, - executeWorkflow: ( + executeWorkflow: async ( body: any, name: string, version: number, @@ -551,7 +587,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.executeWorkflow({ + const { data } = await WorkflowResource.executeWorkflow({ client, path: { name, version }, query: { @@ -564,43 +600,46 @@ export const addServicesBackwardCompatibility = (client: Client) => { body, throwOnError: true, }); + return data; }, - startWorkflow: (requestBody: any) => { + startWorkflow: async (requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.startWorkflow({ + const { data } = await WorkflowResource.startWorkflow({ client, body: requestBody, throwOnError: true, }); + return data; }, - decide: (workflowId: string) => { + decide: async (workflowId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.decide({ + await WorkflowResource.decide({ client, path: { workflowId }, throwOnError: true, }); }, - rerun: (workflowId: string, requestBody: any) => { + rerun: async (workflowId: string, requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.rerun({ + const { data } = await WorkflowResource.rerun({ client, path: { workflowId }, body: requestBody, throwOnError: true, }); + return data; }, - searchV21: ( + searchV21: async ( start?: number, size: number = 100, sort?: string, @@ -610,7 +649,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -621,20 +660,21 @@ export const addServicesBackwardCompatibility = (client: Client) => { query: { start, size, sort, freeText, query }, throwOnError: true, }); + return data as any; }, - pauseWorkflow: (workflowId: string) => { + pauseWorkflow: async (workflowId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.pauseWorkflow({ + await WorkflowResource.pauseWorkflow({ client, path: { workflowId }, throwOnError: true, }); }, - skipTaskFromWorkflow: ( + skipTaskFromWorkflow: async ( workflowId: string, taskReferenceName: string, requestBody?: any @@ -642,7 +682,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.skipTaskFromWorkflow({ + await WorkflowResource.skipTaskFromWorkflow({ client, path: { workflowId, taskReferenceName }, body: requestBody, @@ -650,7 +690,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getWorkflows: ( + getWorkflows: async ( name: string, requestBody: any[], includeClosed: boolean = false, @@ -659,16 +699,17 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.getWorkflows({ + const { data } = await WorkflowResource.getWorkflows({ client, path: { name }, query: { includeClosed, includeTasks }, body: requestBody, throwOnError: true, }); + return data; }, - getWorkflowStatusSummary: ( + getWorkflowStatusSummary: async ( workflowId: string, includeOutput: boolean = false, includeVariables: boolean = false @@ -676,15 +717,16 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.getWorkflowStatusSummary({ + const { data } = await WorkflowResource.getWorkflowStatusSummary({ client, path: { workflowId }, query: { includeOutput, includeVariables }, throwOnError: true, }); + return data; }, - getWorkflows1: ( + getWorkflows1: async ( name: string, correlationId: string, includeClosed: boolean = false, @@ -693,19 +735,23 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.getWorkflows2({ + const { data } = await WorkflowResource.getWorkflows2({ client, path: { name, correlationId }, query: { includeClosed, includeTasks }, throwOnError: true, }); + return data; }, - retry1: (workflowId: string, resumeSubworkflowTasks: boolean = false) => { + retry1: async ( + workflowId: string, + resumeSubworkflowTasks: boolean = false + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.retry({ + await WorkflowResource.retry({ client, path: { workflowId }, query: { resumeSubworkflowTasks }, @@ -713,23 +759,27 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getExecutionStatus: (workflowId: string, includeTasks: boolean = true) => { + getExecutionStatus: async ( + workflowId: string, + includeTasks: boolean = true + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.getExecutionStatus({ + const { data } = await WorkflowResource.getExecutionStatus({ client, path: { workflowId }, query: { includeTasks }, throwOnError: true, }); + return data; }, - terminate1: (workflowId: string, reason?: string) => { + terminate1: async (workflowId: string, reason?: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.terminate1({ + await WorkflowResource.terminate1({ client, path: { workflowId }, query: { reason }, @@ -737,22 +787,22 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - resumeWorkflow: (workflowId: string) => { + resumeWorkflow: async (workflowId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.resumeWorkflow({ + await WorkflowResource.resumeWorkflow({ client, path: { workflowId }, throwOnError: true, }); }, - delete: (workflowId: string, archiveWorkflow: boolean = true) => { + delete: async (workflowId: string, archiveWorkflow: boolean = true) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.delete1({ + await WorkflowResource.delete1({ client, path: { workflowId }, query: { archiveWorkflow }, @@ -760,7 +810,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - searchWorkflowsByTasks: ( + searchWorkflowsByTasks: async ( start?: number, size: number = 100, sort?: string, @@ -770,7 +820,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -781,9 +831,10 @@ export const addServicesBackwardCompatibility = (client: Client) => { query: { start, size, sort, freeText, query }, throwOnError: true, }); + return data as any; }, - getExternalStorageLocation: ( + getExternalStorageLocation: async ( path: string, operation: string, payloadType: string @@ -791,7 +842,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -802,9 +853,10 @@ export const addServicesBackwardCompatibility = (client: Client) => { query: { path, operation, payloadType }, throwOnError: true, }); + return data as any; }, - startWorkflow1: ( + startWorkflow1: async ( name: string, requestBody: any, version?: number, @@ -814,20 +866,24 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.startWorkflow1({ + const { data } = await WorkflowResource.startWorkflow1({ client, path: { name }, query: { version, correlationId, priority }, body: requestBody, throwOnError: true, }); + return data; }, - restart1: (workflowId: string, useLatestDefinitions: boolean = false) => { + restart1: async ( + workflowId: string, + useLatestDefinitions: boolean = false + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.restart({ + await WorkflowResource.restart({ client, path: { workflowId }, query: { useLatestDefinitions }, @@ -835,7 +891,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - search1: ( + search1: async ( queryId?: string, start?: number, size: number = 100, @@ -847,7 +903,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -858,9 +914,10 @@ export const addServicesBackwardCompatibility = (client: Client) => { query: { queryId, start, size, sort, freeText, query, skipCache }, throwOnError: true, }); + return data as any; }, - searchWorkflowsByTasksV2: ( + searchWorkflowsByTasksV2: async ( start?: number, size: number = 100, sort?: string, @@ -870,7 +927,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -881,113 +938,120 @@ export const addServicesBackwardCompatibility = (client: Client) => { query: { start, size, sort, freeText, query }, throwOnError: true, }); + return data as any; }, - resetWorkflow: (workflowId: string) => { + resetWorkflow: async (workflowId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - WorkflowResource.resetWorkflow({ + await WorkflowResource.resetWorkflow({ client, path: { workflowId }, throwOnError: true, }); }, - testWorkflow: (requestBody: any) => { + testWorkflow: async (requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return WorkflowResource.testWorkflow({ + const { data } = await WorkflowResource.testWorkflow({ client, body: requestBody, throwOnError: true, }); + return data; }, }; (client as any).serviceRegistryResource = { - getRegisteredServices: () => { + getRegisteredServices: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.getRegisteredServices({ + const { data } = await ServiceRegistryResource.getRegisteredServices({ client, throwOnError: true, }); + return data; }, - removeService: (name: string) => { + removeService: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - ServiceRegistryResource.removeService({ + await ServiceRegistryResource.removeService({ client, path: { name }, throwOnError: true, }); }, - getService: (name: string) => { + getService: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.getService({ + const { data } = await ServiceRegistryResource.getService({ client, path: { name }, throwOnError: true, }); + return data; }, - openCircuitBreaker: (name: string) => { + openCircuitBreaker: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.openCircuitBreaker({ + const { data } = await ServiceRegistryResource.openCircuitBreaker({ client, path: { name }, throwOnError: true, }); + return data; }, - closeCircuitBreaker: (name: string) => { + closeCircuitBreaker: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.closeCircuitBreaker({ + const { data } = await ServiceRegistryResource.closeCircuitBreaker({ client, path: { name }, throwOnError: true, }); + return data; }, - getCircuitBreakerStatus: (name: string) => { + getCircuitBreakerStatus: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.getCircuitBreakerStatus({ + const { data } = await ServiceRegistryResource.getCircuitBreakerStatus({ client, path: { name }, throwOnError: true, }); + return data; }, - addOrUpdateService: (serviceRegistry: any) => { + addOrUpdateService: async (serviceRegistry: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - ServiceRegistryResource.addOrUpdateService({ + await ServiceRegistryResource.addOrUpdateService({ client, body: serviceRegistry, throwOnError: true, }); }, - addOrUpdateServiceMethod: (registryName: string, method: any) => { + addOrUpdateServiceMethod: async (registryName: string, method: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - ServiceRegistryResource.addOrUpdateMethod({ + await ServiceRegistryResource.addOrUpdateMethod({ client, path: { registryName }, body: method, @@ -995,11 +1059,16 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - removeMethod: (registryName: string, serviceName: string, method: string, methodType: string) => { + removeMethod: async ( + registryName: string, + serviceName: string, + method: string, + methodType: string + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - ServiceRegistryResource.removeMethod({ + await ServiceRegistryResource.removeMethod({ client, path: { registryName }, query: { serviceName, method, methodType }, @@ -1007,22 +1076,23 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getProtoData: (registryName: string, filename: string) => { + getProtoData: async (registryName: string, filename: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.getProtoData({ + const { data } = await ServiceRegistryResource.getProtoData({ client, path: { registryName, filename }, throwOnError: true, }); + return data; }, - setProtoData: (registryName: string, filename: string, data: any) => { + setProtoData: async (registryName: string, filename: string, data: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - ServiceRegistryResource.setProtoData({ + await ServiceRegistryResource.setProtoData({ client, path: { registryName, filename }, body: data, @@ -1030,89 +1100,93 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - deleteProto: (registryName: string, filename: string) => { + deleteProto: async (registryName: string, filename: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - ServiceRegistryResource.deleteProto({ + await ServiceRegistryResource.deleteProto({ client, path: { registryName, filename }, throwOnError: true, }); }, - getAllProtos: (registryName: string) => { + getAllProtos: async (registryName: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.getAllProtos({ + const { data } = await ServiceRegistryResource.getAllProtos({ client, path: { registryName }, throwOnError: true, }); + return data; }, - discover: (name: string, create: boolean = false) => { + discover: async (name: string, create: boolean = false) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return ServiceRegistryResource.discover({ + const { data } = await ServiceRegistryResource.discover({ client, path: { name }, query: { create }, throwOnError: true, }); + return data; }, }; (client as any).humanTaskResource = { - getConductorTaskById: (taskId: string) => { + getConductorTaskById: async (taskId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return HumanTaskResource.getConductorTaskById({ + const { data } = await HumanTaskResource.getConductorTaskById({ client, path: { taskId }, throwOnError: true, }); + return data; }, }; (client as any).humanTask = { - deleteTaskFromHumanTaskRecords: (requestBody: any[]) => { + deleteTaskFromHumanTaskRecords: async (requestBody: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - HumanTask.deleteTaskFromHumanTaskRecords({ + await HumanTask.deleteTaskFromHumanTaskRecords({ client, body: requestBody, throwOnError: true, }); }, - deleteTaskFromHumanTaskRecords1: (taskId: string) => { + deleteTaskFromHumanTaskRecords1: async (taskId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - HumanTask.deleteTaskFromHumanTaskRecords1({ + await HumanTask.deleteTaskFromHumanTaskRecords1({ client, path: { taskId }, throwOnError: true, }); }, - search: (requestBody: any) => { + search: async (requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return HumanTask.search({ + const { data } = await HumanTask.search({ client, body: requestBody, throwOnError: true, }); + return data; }, - updateTaskOutputByRef: ( + updateTaskOutputByRef: async ( workflowId: string, taskRefName: string, requestBody: any, @@ -1122,7 +1196,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return HumanTask.updateTaskOutputByRef({ + const { data } = await HumanTask.updateTaskOutputByRef({ client, query: { workflowId, @@ -1133,32 +1207,39 @@ export const addServicesBackwardCompatibility = (client: Client) => { body: requestBody, throwOnError: true, }); + return data as any; }, - getTask1: (taskId: string) => { + getTask1: async (taskId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return HumanTask.getTask1({ + const { data } = await HumanTask.getTask1({ client, path: { taskId }, throwOnError: true, }); + return data; }, - claimTask: (taskId: string, overrideAssignment: boolean = false, withTemplate: boolean = false) => { + claimTask: async ( + taskId: string, + overrideAssignment: boolean = false, + withTemplate: boolean = false + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return HumanTask.claimTask({ + const { data } = await HumanTask.claimTask({ client, path: { taskId }, query: { overrideAssignment, withTemplate }, throwOnError: true, }); + return data; }, - assignAndClaim: ( + assignAndClaim: async ( taskId: string, userId: string, overrideAssignment: boolean = false, @@ -1167,19 +1248,20 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return HumanTask.assignAndClaim({ + const { data } = await HumanTask.assignAndClaim({ client, path: { taskId, userId }, query: { overrideAssignment, withTemplate }, throwOnError: true, }); + return data; }, - reassignTask: (taskId: string, requestBody: any[]) => { + reassignTask: async (taskId: string, requestBody: any[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - HumanTask.reassignTask({ + await HumanTask.reassignTask({ client, path: { taskId }, body: requestBody, @@ -1187,22 +1269,22 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - releaseTask: (taskId: string) => { + releaseTask: async (taskId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - HumanTask.releaseTask({ + await HumanTask.releaseTask({ client, path: { taskId }, throwOnError: true, }); }, - skipTask: (taskId: string, reason?: string) => { + skipTask: async (taskId: string, reason?: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - HumanTask.skipTask({ + await HumanTask.skipTask({ client, path: { taskId }, query: { reason }, @@ -1210,11 +1292,15 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - updateTaskOutput: (taskId: string, requestBody: any, complete: boolean = false) => { + updateTaskOutput: async ( + taskId: string, + requestBody: any, + complete: boolean = false + ) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - HumanTask.updateTaskOutput({ + await HumanTask.updateTaskOutput({ client, path: { taskId }, query: { complete }, @@ -1223,99 +1309,105 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getAllTemplates: (name?: string, version?: number) => { + getAllTemplates: async (name?: string, version?: number) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return UserForm.getAllTemplates({ + const { data } = await UserForm.getAllTemplates({ client, query: { name, version }, throwOnError: true, }); + return data; }, - saveTemplate: (requestBody: any, newVersion: boolean = false) => { + saveTemplate: async (requestBody: any, newVersion: boolean = false) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return UserForm.saveTemplate({ + const { data } = await UserForm.saveTemplate({ client, query: { newVersion }, body: requestBody, throwOnError: true, }); + return data; }, - saveTemplates: (requestBody: any[], newVersion: boolean = false) => { + saveTemplates: async (requestBody: any[], newVersion: boolean = false) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return UserForm.saveTemplates({ + const { data } = await UserForm.saveTemplates({ client, query: { newVersion }, body: requestBody, throwOnError: true, }); + return data; }, - deleteTemplateByName: (name: string) => { + deleteTemplateByName: async (name: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - UserForm.deleteTemplateByName({ + await UserForm.deleteTemplateByName({ client, path: { name }, throwOnError: true, }); }, - deleteTemplatesByNameAndVersion: (name: string, version: number) => { + deleteTemplatesByNameAndVersion: async (name: string, version: number) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - HumanTask.deleteTemplatesByNameAndVersion({ + await HumanTask.deleteTemplatesByNameAndVersion({ client, path: { name, version }, throwOnError: true, }); }, - getTemplateByNameAndVersion: (name: string, version: number) => { + getTemplateByNameAndVersion: async (name: string, version: number) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return UserForm.getTemplateByNameAndVersion({ + const { data } = await UserForm.getTemplateByNameAndVersion({ client, path: { name, version }, throwOnError: true, }); + return data; }, }; (client as any).taskResource = { - poll: (tasktype: string, workerid?: string, domain?: string) => { + poll: async (tasktype: string, workerid?: string, domain?: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.poll({ + const { data } = await TaskResource.poll({ client, path: { tasktype }, query: { workerid, domain }, throwOnError: true, }); + return data; }, - allVerbose: () => { + allVerbose: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.allVerbose({ + const { data } = await TaskResource.allVerbose({ client, throwOnError: true, }); + return data; }, - updateTask: ( + updateTask: async ( workflowId: string, taskRefName: string, status: @@ -1328,47 +1420,51 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.updateTask1({ + const { data } = await TaskResource.updateTask1({ client, path: { workflowId, taskRefName, status }, body: requestBody, throwOnError: true, }); + return data; }, - getTask: (taskId: string) => { + getTask: async (taskId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.getTask({ + const { data } = await TaskResource.getTask({ client, path: { taskId }, throwOnError: true, }); + return data; }, - all: () => { + all: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.all({ + const { data } = await TaskResource.all({ client, throwOnError: true, }); + return data; }, - requeuePendingTask: (taskType: string) => { + requeuePendingTask: async (taskType: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.requeuePendingTask({ + const { data } = await TaskResource.requeuePendingTask({ client, path: { taskType }, throwOnError: true, }); + return data; }, - search: ( + search: async ( start?: number, size: number = 100, sort?: string, @@ -1378,14 +1474,15 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.search2({ + const { data } = await TaskResource.search2({ client, query: { start, size, sort, freeText, query }, throwOnError: true, }); + return data; }, - searchV22: ( + searchV22: async ( start?: number, size: number = 100, sort?: string, @@ -1395,7 +1492,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -1406,35 +1503,38 @@ export const addServicesBackwardCompatibility = (client: Client) => { query: { start, size, sort, freeText, query }, throwOnError: true, }); + return data as any; }, - getPollData: (taskType: string) => { + getPollData: async (taskType: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.getPollData({ + const { data } = await TaskResource.getPollData({ client, query: { taskType }, throwOnError: true, }); + return data; }, - getTaskLogs: (taskId: string) => { + getTaskLogs: async (taskId: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.getTaskLogs({ + const { data } = await TaskResource.getTaskLogs({ client, path: { taskId }, throwOnError: true, }); + return data; }, - log: (taskId: string, requestBody: string) => { + log: async (taskId: string, requestBody: string) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - TaskResource.log({ + await TaskResource.log({ client, path: { taskId }, body: requestBody, @@ -1442,17 +1542,18 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getAllPollData: () => { + getAllPollData: async () => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.getAllPollData({ + const { data } = await TaskResource.getAllPollData({ client, throwOnError: true, }); + return data; }, - batchPoll: ( + batchPoll: async ( tasktype: string, workerid?: string, domain?: string, @@ -1462,37 +1563,40 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.batchPoll({ + const { data } = await TaskResource.batchPoll({ client, path: { tasktype }, query: { workerid, domain, count, timeout }, throwOnError: true, }); + return data; }, - updateTask1: (requestBody: any) => { + updateTask1: async (requestBody: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.updateTask({ + const { data } = await TaskResource.updateTask({ client, body: requestBody, throwOnError: true, }); + return data; }, - size1: (taskType?: string[]) => { + size1: async (taskType?: string[]) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.size({ + const { data } = await TaskResource.size({ client, query: { taskType }, throwOnError: true, }); + return data; }, - getExternalStorageLocation1: ( + getExternalStorageLocation1: async ( path: string, operation: string, payloadType: string @@ -1500,7 +1604,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return client.get({ + const { data } = await client.get({ security: [ { name: "X-Authorization", @@ -1511,9 +1615,10 @@ export const addServicesBackwardCompatibility = (client: Client) => { query: { path, operation, payloadType }, throwOnError: true, }); + return data as any; }, - updateTaskSync: ( + updateTaskSync: async ( workflowId: string, taskRefName: string, status: any, @@ -1523,16 +1628,17 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.updateTaskSync({ + const { data } = await TaskResource.updateTaskSync({ client, path: { workflowId, taskRefName, status }, query: { workerid: workerId }, body: output, throwOnError: true, }); + return data; }, - signal: ( + signal: async ( workflowId: string, status: any, output: any, @@ -1541,25 +1647,27 @@ export const addServicesBackwardCompatibility = (client: Client) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - return TaskResource.signalWorkflowTaskSync({ + const { data } = await TaskResource.signalWorkflowTaskSync({ client, path: { workflowId, status }, query: { returnStrategy }, body: output, throwOnError: true, }); + return data; }, - signalAsync: (workflowId: string, status: any, output: any) => { + signalAsync: async (workflowId: string, status: any, output: any) => { console.warn( "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" ); - TaskResource.signalWorkflowTaskASync({ + const { data } = await TaskResource.signalWorkflowTaskASync({ client, path: { workflowId, status }, body: output, throwOnError: true, }); + return data as SignalResponse; }, }; }; From 892e30d87d23c88703d2b93683bf0f14b5137fbc Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 17:46:20 +0300 Subject: [PATCH 07/19] add warn func --- .../addServicesBackwardCompatibility.ts | 474 +++++------------- 1 file changed, 123 insertions(+), 351 deletions(-) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index f263ef5b..274406f0 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -15,12 +15,16 @@ import { HealthCheckResource, } from "../../common/open-api/sdk.gen"; +const warn = () => { + console.warn( + "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + ); +}; + export const addServicesBackwardCompatibility = (client: Client) => { (client as any).eventResource = { getQueueConfig: async (queueType: string, queueName: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await EventResource.getQueueConfig({ client, path: { queueType, queueName }, @@ -34,9 +38,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { queueName: string, body: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await EventResource.putQueueConfig({ client, path: { queueType, queueName }, @@ -46,9 +48,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, deleteQueueConfig: async (queueType: string, queueName: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await EventResource.deleteQueueConfig({ client, path: { queueType, queueName }, @@ -57,9 +57,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getEventHandlers: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await EventResource.getEventHandlers({ client, throwOnError: true, @@ -68,9 +66,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, updateEventHandler: async (body: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await EventResource.updateEventHandler({ client, body, @@ -79,9 +75,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, addEventHandler: async (body: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await EventResource.addEventHandler({ client, body, @@ -90,9 +84,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getQueueNames: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await EventResource.getQueueNames({ client, throwOnError: true, @@ -101,9 +93,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, removeEventHandlerStatus: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await EventResource.removeEventHandlerStatus({ client, path: { name }, @@ -115,9 +105,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { event: string, activeOnly: boolean = true ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await EventResource.getEventHandlersForEvent({ client, path: { event }, @@ -128,9 +116,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, deleteTagForEventHandler: async (name: string, body: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await EventResource.deleteTagForEventHandler({ client, path: { name }, @@ -140,9 +126,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getTagsForEventHandler: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await EventResource.getTagsForEventHandler({ client, path: { name }, @@ -152,9 +136,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, putTagForEventHandler: async (name: string, body: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await EventResource.putTagForEventHandler({ client, path: { name }, @@ -166,9 +148,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).healthCheckResource = { doCheck: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await HealthCheckResource.doCheck({ client, throwOnError: true, @@ -179,9 +159,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).metadataResource = { getTaskDef: async (tasktype: string, metadata: boolean = false) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await MetadataResource.getTaskDef({ client, path: { tasktype }, @@ -192,9 +170,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, unregisterTaskDef: async (tasktype: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await MetadataResource.unregisterTaskDef({ client, path: { tasktype }, @@ -208,9 +184,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { tagKey?: string, tagValue?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await MetadataResource.getWorkflowDefs({ client, query: { access, metadata, tagKey, tagValue }, @@ -220,9 +194,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, update: async (requestBody: any[], overwrite: boolean = true) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await MetadataResource.update({ client, body: requestBody, @@ -232,9 +204,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, create: async (requestBody: any, overwrite: boolean = false) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await MetadataResource.create({ client, body: requestBody, @@ -249,9 +219,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { tagKey?: string, tagValue?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await MetadataResource.getTaskDefs({ client, query: { access, metadata, tagKey, tagValue }, @@ -261,9 +229,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, updateTaskDef: async (requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await MetadataResource.updateTaskDef({ client, body: requestBody, @@ -272,9 +238,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, registerTaskDef: async (requestBody: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await MetadataResource.registerTaskDef({ client, body: requestBody, @@ -283,9 +247,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, unregisterWorkflowDef: async (name: string, version: number) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await MetadataResource.unregisterWorkflowDef({ client, path: { name, version }, @@ -294,9 +256,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, get: async (name: string, version?: number, metadata: boolean = false) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await MetadataResource.get1({ client, path: { name }, @@ -309,9 +269,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).schedulerResource = { getSchedule: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await SchedulerResource.getSchedule({ client, path: { name }, @@ -321,9 +279,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, deleteSchedule: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await SchedulerResource.deleteSchedule({ client, path: { name }, @@ -337,9 +293,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { scheduleEndTime?: number, limit: number = 3 ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await SchedulerResource.getNextFewSchedules({ client, query: { cronExpression, scheduleStartTime, scheduleEndTime, limit }, @@ -349,9 +303,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, pauseSchedule: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await SchedulerResource.pauseSchedule({ client, path: { name }, @@ -360,9 +312,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, pauseAllSchedules: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await SchedulerResource.pauseAllSchedules({ client, throwOnError: true, @@ -371,9 +321,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, resumeSchedule: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await SchedulerResource.resumeSchedule({ client, path: { name }, @@ -382,9 +330,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, requeueAllExecutionRecords: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await SchedulerResource.requeueAllExecutionRecords({ client, throwOnError: true, @@ -393,9 +339,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, resumeAllSchedules: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await SchedulerResource.resumeAllSchedules({ client, throwOnError: true, @@ -404,9 +348,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getAllSchedules: async (workflowName?: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await SchedulerResource.getAllSchedules({ client, query: { workflowName }, @@ -416,9 +358,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, saveSchedule: async (requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await SchedulerResource.saveSchedule({ client, body: requestBody, @@ -433,9 +373,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { freeText: string = "*", query?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await SchedulerResource.searchV2({ client, query: { start, size, sort, freeText, query }, @@ -445,9 +383,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, testTimeout: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -464,9 +400,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).tokenResource = { generateToken: async (requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TokenResource.generateToken({ client, body: requestBody, @@ -476,9 +410,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getUserInfo: async (claims: boolean = false) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TokenResource.getUserInfo({ client, query: { claims }, @@ -490,9 +422,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).workflowBulkResource = { retry: async (requestBody: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowBulkResource.retry1({ client, body: requestBody, @@ -505,9 +435,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { requestBody: any[], useLatestDefinitions: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowBulkResource.restart1({ client, body: requestBody, @@ -518,9 +446,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, terminate: async (requestBody: any[], reason?: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowBulkResource.terminate({ client, body: requestBody, @@ -531,9 +457,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, resumeWorkflow: async (requestBody: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowBulkResource.resumeWorkflow1({ client, body: requestBody, @@ -543,9 +467,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, pauseWorkflow1: async (requestBody: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowBulkResource.pauseWorkflow1({ client, body: requestBody, @@ -562,9 +484,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { startTime?: number, endTime?: number ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.getRunningWorkflow({ client, path: { name }, @@ -584,9 +504,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { consistency?: any, returnStrategy?: any ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.executeWorkflow({ client, path: { name, version }, @@ -604,9 +522,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, startWorkflow: async (requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.startWorkflow({ client, body: requestBody, @@ -616,9 +532,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, decide: async (workflowId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.decide({ client, path: { workflowId }, @@ -627,9 +541,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, rerun: async (workflowId: string, requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.rerun({ client, path: { workflowId }, @@ -646,9 +558,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { freeText: string = "*", query?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -664,9 +574,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, pauseWorkflow: async (workflowId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.pauseWorkflow({ client, path: { workflowId }, @@ -679,9 +587,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { taskReferenceName: string, requestBody?: any ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.skipTaskFromWorkflow({ client, path: { workflowId, taskReferenceName }, @@ -696,9 +602,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { includeClosed: boolean = false, includeTasks: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.getWorkflows({ client, path: { name }, @@ -714,9 +618,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { includeOutput: boolean = false, includeVariables: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.getWorkflowStatusSummary({ client, path: { workflowId }, @@ -732,9 +634,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { includeClosed: boolean = false, includeTasks: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.getWorkflows2({ client, path: { name, correlationId }, @@ -748,9 +648,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { workflowId: string, resumeSubworkflowTasks: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.retry({ client, path: { workflowId }, @@ -763,9 +661,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { workflowId: string, includeTasks: boolean = true ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.getExecutionStatus({ client, path: { workflowId }, @@ -776,9 +672,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, terminate1: async (workflowId: string, reason?: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.terminate1({ client, path: { workflowId }, @@ -788,9 +682,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, resumeWorkflow: async (workflowId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.resumeWorkflow({ client, path: { workflowId }, @@ -799,9 +691,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, delete: async (workflowId: string, archiveWorkflow: boolean = true) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.delete1({ client, path: { workflowId }, @@ -817,9 +707,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { freeText: string = "*", query?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -839,9 +727,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { operation: string, payloadType: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -863,9 +749,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { correlationId?: string, priority?: number ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.startWorkflow1({ client, path: { name }, @@ -880,9 +764,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { workflowId: string, useLatestDefinitions: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.restart({ client, path: { workflowId }, @@ -900,9 +782,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { query?: string, skipCache: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -924,9 +804,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { freeText: string = "*", query?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -942,9 +820,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, resetWorkflow: async (workflowId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await WorkflowResource.resetWorkflow({ client, path: { workflowId }, @@ -953,9 +829,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, testWorkflow: async (requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await WorkflowResource.testWorkflow({ client, body: requestBody, @@ -967,9 +841,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).serviceRegistryResource = { getRegisteredServices: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.getRegisteredServices({ client, throwOnError: true, @@ -978,9 +850,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, removeService: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await ServiceRegistryResource.removeService({ client, path: { name }, @@ -989,9 +859,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getService: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.getService({ client, path: { name }, @@ -1001,9 +869,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, openCircuitBreaker: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.openCircuitBreaker({ client, path: { name }, @@ -1013,9 +879,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, closeCircuitBreaker: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.closeCircuitBreaker({ client, path: { name }, @@ -1025,9 +889,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getCircuitBreakerStatus: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.getCircuitBreakerStatus({ client, path: { name }, @@ -1037,9 +899,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, addOrUpdateService: async (serviceRegistry: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await ServiceRegistryResource.addOrUpdateService({ client, body: serviceRegistry, @@ -1048,9 +908,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, addOrUpdateServiceMethod: async (registryName: string, method: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await ServiceRegistryResource.addOrUpdateMethod({ client, path: { registryName }, @@ -1065,9 +923,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { method: string, methodType: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await ServiceRegistryResource.removeMethod({ client, path: { registryName }, @@ -1077,9 +933,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getProtoData: async (registryName: string, filename: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.getProtoData({ client, path: { registryName, filename }, @@ -1089,9 +943,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, setProtoData: async (registryName: string, filename: string, data: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await ServiceRegistryResource.setProtoData({ client, path: { registryName, filename }, @@ -1101,9 +953,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, deleteProto: async (registryName: string, filename: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await ServiceRegistryResource.deleteProto({ client, path: { registryName, filename }, @@ -1112,9 +962,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getAllProtos: async (registryName: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.getAllProtos({ client, path: { registryName }, @@ -1124,9 +972,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, discover: async (name: string, create: boolean = false) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await ServiceRegistryResource.discover({ client, path: { name }, @@ -1139,9 +985,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).humanTaskResource = { getConductorTaskById: async (taskId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await HumanTaskResource.getConductorTaskById({ client, path: { taskId }, @@ -1153,9 +997,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).humanTask = { deleteTaskFromHumanTaskRecords: async (requestBody: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await HumanTask.deleteTaskFromHumanTaskRecords({ client, body: requestBody, @@ -1164,9 +1006,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, deleteTaskFromHumanTaskRecords1: async (taskId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await HumanTask.deleteTaskFromHumanTaskRecords1({ client, path: { taskId }, @@ -1175,9 +1015,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, search: async (requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await HumanTask.search({ client, body: requestBody, @@ -1193,9 +1031,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { complete: boolean = false, iteration?: any[] ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await HumanTask.updateTaskOutputByRef({ client, query: { @@ -1211,9 +1047,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getTask1: async (taskId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await HumanTask.getTask1({ client, path: { taskId }, @@ -1227,9 +1061,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { overrideAssignment: boolean = false, withTemplate: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await HumanTask.claimTask({ client, path: { taskId }, @@ -1245,9 +1077,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { overrideAssignment: boolean = false, withTemplate: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await HumanTask.assignAndClaim({ client, path: { taskId, userId }, @@ -1258,9 +1088,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, reassignTask: async (taskId: string, requestBody: any[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await HumanTask.reassignTask({ client, path: { taskId }, @@ -1270,9 +1098,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, releaseTask: async (taskId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await HumanTask.releaseTask({ client, path: { taskId }, @@ -1281,9 +1107,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, skipTask: async (taskId: string, reason?: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await HumanTask.skipTask({ client, path: { taskId }, @@ -1297,9 +1121,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { requestBody: any, complete: boolean = false ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await HumanTask.updateTaskOutput({ client, path: { taskId }, @@ -1310,9 +1132,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getAllTemplates: async (name?: string, version?: number) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await UserForm.getAllTemplates({ client, query: { name, version }, @@ -1322,9 +1142,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, saveTemplate: async (requestBody: any, newVersion: boolean = false) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await UserForm.saveTemplate({ client, query: { newVersion }, @@ -1335,9 +1153,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, saveTemplates: async (requestBody: any[], newVersion: boolean = false) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await UserForm.saveTemplates({ client, query: { newVersion }, @@ -1348,9 +1164,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, deleteTemplateByName: async (name: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await UserForm.deleteTemplateByName({ client, path: { name }, @@ -1359,9 +1173,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, deleteTemplatesByNameAndVersion: async (name: string, version: number) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await HumanTask.deleteTemplatesByNameAndVersion({ client, path: { name, version }, @@ -1370,9 +1182,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getTemplateByNameAndVersion: async (name: string, version: number) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await UserForm.getTemplateByNameAndVersion({ client, path: { name, version }, @@ -1384,9 +1194,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).taskResource = { poll: async (tasktype: string, workerid?: string, domain?: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.poll({ client, path: { tasktype }, @@ -1397,9 +1205,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, allVerbose: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.allVerbose({ client, throwOnError: true, @@ -1417,9 +1223,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { | "COMPLETED", requestBody: any ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.updateTask1({ client, path: { workflowId, taskRefName, status }, @@ -1430,9 +1234,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getTask: async (taskId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.getTask({ client, path: { taskId }, @@ -1442,9 +1244,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, all: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.all({ client, throwOnError: true, @@ -1453,9 +1253,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, requeuePendingTask: async (taskType: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.requeuePendingTask({ client, path: { taskType }, @@ -1471,9 +1269,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { freeText: string = "*", query?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.search2({ client, query: { start, size, sort, freeText, query }, @@ -1489,9 +1285,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { freeText: string = "*", query?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -1507,9 +1301,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getPollData: async (taskType: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.getPollData({ client, query: { taskType }, @@ -1519,9 +1311,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getTaskLogs: async (taskId: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.getTaskLogs({ client, path: { taskId }, @@ -1531,9 +1321,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, log: async (taskId: string, requestBody: string) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); await TaskResource.log({ client, path: { taskId }, @@ -1543,9 +1331,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getAllPollData: async () => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.getAllPollData({ client, throwOnError: true, @@ -1560,9 +1346,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { count: number = 1, timeout: number = 100 ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.batchPoll({ client, path: { tasktype }, @@ -1573,9 +1357,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, updateTask1: async (requestBody: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.updateTask({ client, body: requestBody, @@ -1585,9 +1367,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, size1: async (taskType?: string[]) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.size({ client, query: { taskType }, @@ -1601,9 +1381,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { operation: string, payloadType: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await client.get({ security: [ { @@ -1625,9 +1403,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { output: any, workerId?: string ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.updateTaskSync({ client, path: { workflowId, taskRefName, status }, @@ -1644,9 +1420,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { output: any, returnStrategy: any = "TARGET_WORKFLOW" ) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.signalWorkflowTaskSync({ client, path: { workflowId, status }, @@ -1658,9 +1432,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, signalAsync: async (workflowId: string, status: any, output: any) => { - console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" - ); + warn(); const { data } = await TaskResource.signalWorkflowTaskASync({ client, path: { workflowId, status }, From 5f7e56df5b78d617ca3ab28e5063fec3fe4ae5a2 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 17:50:29 +0300 Subject: [PATCH 08/19] lint fixes --- .../addServicesBackwardCompatibility.ts | 115 ++++++++---------- 1 file changed, 51 insertions(+), 64 deletions(-) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index 274406f0..cea4bc74 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -1,3 +1,5 @@ +// eslint-disable + import { SignalResponse } from "../../common"; import { Client } from "../../common/open-api/client/types.gen"; import { @@ -101,10 +103,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getEventHandlersForEvent: async ( - event: string, - activeOnly: boolean = true - ) => { + getEventHandlersForEvent: async (event: string, activeOnly = true) => { warn(); const { data } = await EventResource.getEventHandlersForEvent({ client, @@ -158,7 +157,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }; (client as any).metadataResource = { - getTaskDef: async (tasktype: string, metadata: boolean = false) => { + getTaskDef: async (tasktype: string, metadata = false) => { warn(); const { data } = await MetadataResource.getTaskDef({ client, @@ -179,8 +178,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getAllWorkflows: async ( - access: string = "READ", - metadata: boolean = false, + access = "READ", + metadata = false, tagKey?: string, tagValue?: string ) => { @@ -193,7 +192,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - update: async (requestBody: any[], overwrite: boolean = true) => { + update: async (requestBody: any[], overwrite = true) => { warn(); await MetadataResource.update({ client, @@ -203,7 +202,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - create: async (requestBody: any, overwrite: boolean = false) => { + create: async (requestBody: any, overwrite = false) => { warn(); await MetadataResource.create({ client, @@ -214,8 +213,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, getTaskDefs: async ( - access: string = "READ", - metadata: boolean = false, + access = "READ", + metadata = false, tagKey?: string, tagValue?: string ) => { @@ -255,7 +254,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - get: async (name: string, version?: number, metadata: boolean = false) => { + get: async (name: string, version?: number, metadata = false) => { warn(); const { data } = await MetadataResource.get1({ client, @@ -291,7 +290,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { cronExpression: string, scheduleStartTime?: number, scheduleEndTime?: number, - limit: number = 3 + limit = 3 ) => { warn(); const { data } = await SchedulerResource.getNextFewSchedules({ @@ -368,9 +367,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { searchV21: async ( start?: number, - size: number = 100, + size = 100, sort?: string, - freeText: string = "*", + freeText = "*", query?: string ) => { warn(); @@ -409,7 +408,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - getUserInfo: async (claims: boolean = false) => { + getUserInfo: async (claims = false) => { warn(); const { data } = await TokenResource.getUserInfo({ client, @@ -431,10 +430,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - restart: async ( - requestBody: any[], - useLatestDefinitions: boolean = false - ) => { + restart: async (requestBody: any[], useLatestDefinitions = false) => { warn(); const { data } = await WorkflowBulkResource.restart1({ client, @@ -480,7 +476,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { (client as any).workflowResource = { getRunningWorkflow: async ( name: string, - version: number = 1, + version = 1, startTime?: number, endTime?: number ) => { @@ -553,9 +549,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { searchV21: async ( start?: number, - size: number = 100, + size = 100, sort?: string, - freeText: string = "*", + freeText = "*", query?: string ) => { warn(); @@ -599,8 +595,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { getWorkflows: async ( name: string, requestBody: any[], - includeClosed: boolean = false, - includeTasks: boolean = false + includeClosed = false, + includeTasks = false ) => { warn(); const { data } = await WorkflowResource.getWorkflows({ @@ -615,8 +611,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { getWorkflowStatusSummary: async ( workflowId: string, - includeOutput: boolean = false, - includeVariables: boolean = false + includeOutput = false, + includeVariables = false ) => { warn(); const { data } = await WorkflowResource.getWorkflowStatusSummary({ @@ -631,8 +627,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { getWorkflows1: async ( name: string, correlationId: string, - includeClosed: boolean = false, - includeTasks: boolean = false + includeClosed = false, + includeTasks = false ) => { warn(); const { data } = await WorkflowResource.getWorkflows2({ @@ -644,10 +640,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - retry1: async ( - workflowId: string, - resumeSubworkflowTasks: boolean = false - ) => { + retry1: async (workflowId: string, resumeSubworkflowTasks = false) => { warn(); await WorkflowResource.retry({ client, @@ -657,10 +650,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - getExecutionStatus: async ( - workflowId: string, - includeTasks: boolean = true - ) => { + getExecutionStatus: async (workflowId: string, includeTasks = true) => { warn(); const { data } = await WorkflowResource.getExecutionStatus({ client, @@ -690,7 +680,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, - delete: async (workflowId: string, archiveWorkflow: boolean = true) => { + delete: async (workflowId: string, archiveWorkflow = true) => { warn(); await WorkflowResource.delete1({ client, @@ -702,9 +692,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { searchWorkflowsByTasks: async ( start?: number, - size: number = 100, + size = 100, sort?: string, - freeText: string = "*", + freeText = "*", query?: string ) => { warn(); @@ -760,10 +750,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - restart1: async ( - workflowId: string, - useLatestDefinitions: boolean = false - ) => { + restart1: async (workflowId: string, useLatestDefinitions = false) => { warn(); await WorkflowResource.restart({ client, @@ -776,11 +763,11 @@ export const addServicesBackwardCompatibility = (client: Client) => { search1: async ( queryId?: string, start?: number, - size: number = 100, + size = 100, sort?: string, - freeText: string = "*", + freeText = "*", query?: string, - skipCache: boolean = false + skipCache = false ) => { warn(); const { data } = await client.get({ @@ -799,9 +786,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { searchWorkflowsByTasksV2: async ( start?: number, - size: number = 100, + size = 100, sort?: string, - freeText: string = "*", + freeText = "*", query?: string ) => { warn(); @@ -971,7 +958,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - discover: async (name: string, create: boolean = false) => { + discover: async (name: string, create = false) => { warn(); const { data } = await ServiceRegistryResource.discover({ client, @@ -1028,7 +1015,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { workflowId: string, taskRefName: string, requestBody: any, - complete: boolean = false, + complete = false, iteration?: any[] ) => { warn(); @@ -1058,8 +1045,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { claimTask: async ( taskId: string, - overrideAssignment: boolean = false, - withTemplate: boolean = false + overrideAssignment = false, + withTemplate = false ) => { warn(); const { data } = await HumanTask.claimTask({ @@ -1074,8 +1061,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { assignAndClaim: async ( taskId: string, userId: string, - overrideAssignment: boolean = false, - withTemplate: boolean = false + overrideAssignment = false, + withTemplate = false ) => { warn(); const { data } = await HumanTask.assignAndClaim({ @@ -1119,7 +1106,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { updateTaskOutput: async ( taskId: string, requestBody: any, - complete: boolean = false + complete = false ) => { warn(); await HumanTask.updateTaskOutput({ @@ -1141,7 +1128,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - saveTemplate: async (requestBody: any, newVersion: boolean = false) => { + saveTemplate: async (requestBody: any, newVersion = false) => { warn(); const { data } = await UserForm.saveTemplate({ client, @@ -1152,7 +1139,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, - saveTemplates: async (requestBody: any[], newVersion: boolean = false) => { + saveTemplates: async (requestBody: any[], newVersion = false) => { warn(); const { data } = await UserForm.saveTemplates({ client, @@ -1264,9 +1251,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { search: async ( start?: number, - size: number = 100, + size = 100, sort?: string, - freeText: string = "*", + freeText = "*", query?: string ) => { warn(); @@ -1280,9 +1267,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { searchV22: async ( start?: number, - size: number = 100, + size = 100, sort?: string, - freeText: string = "*", + freeText = "*", query?: string ) => { warn(); @@ -1343,8 +1330,8 @@ export const addServicesBackwardCompatibility = (client: Client) => { tasktype: string, workerid?: string, domain?: string, - count: number = 1, - timeout: number = 100 + count = 1, + timeout = 100 ) => { warn(); const { data } = await TaskResource.batchPoll({ From 51b70a920f2c863780b8dbf88ec1f66fc5f351e0 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 17:51:22 +0300 Subject: [PATCH 09/19] disable linter for outdated functionality --- src/orkes/helpers/addServicesBackwardCompatibility.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index cea4bc74..cfb8715c 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -1,4 +1,4 @@ -// eslint-disable +/* eslint-disable */ import { SignalResponse } from "../../common"; import { Client } from "../../common/open-api/client/types.gen"; From 62ca288c446b6d18ec7e9b6494d002ad112f4361 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 17:55:51 +0300 Subject: [PATCH 10/19] add deprecation comment --- src/orkes/helpers/addServicesBackwardCompatibility.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index cfb8715c..8a123345 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -1,4 +1,6 @@ /* eslint-disable */ +// disable linter since related old functionality was not properly typed +// TODO: everything in this file is DEPRECATED and whole file should be removed after April 2026 import { SignalResponse } from "../../common"; import { Client } from "../../common/open-api/client/types.gen"; From fb825a4cf36f964542d313ed57b4463d2807019d Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 17:59:22 +0300 Subject: [PATCH 11/19] update warning message --- src/orkes/helpers/addServicesBackwardCompatibility.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addServicesBackwardCompatibility.ts index 8a123345..0097fb91 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addServicesBackwardCompatibility.ts @@ -21,7 +21,7 @@ import { const warn = () => { console.warn( - "DEPRECATED: Accessing methods directly on the client is deprecated and will be removed after April 2026" + "[Conductor SDK Deprecation Warning] Accessing resources directly on the client is deprecated and will be removed after April 2026" ); }; From 9b4a785a6b437a9e468dd2eaa4c4845efdaeadc0 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 18:35:52 +0300 Subject: [PATCH 12/19] update helper name, add more deprecation warnings --- src/orkes/OrkesConductorClient.ts | 9 +- ...s => addResourcesBackwardCompatibility.ts} | 466 +++++++++++++----- 2 files changed, 349 insertions(+), 126 deletions(-) rename src/orkes/helpers/{addServicesBackwardCompatibility.ts => addResourcesBackwardCompatibility.ts} (88%) diff --git a/src/orkes/OrkesConductorClient.ts b/src/orkes/OrkesConductorClient.ts index bcaa312f..31aa1dcc 100644 --- a/src/orkes/OrkesConductorClient.ts +++ b/src/orkes/OrkesConductorClient.ts @@ -6,7 +6,7 @@ import { } from "./helpers"; import type { OrkesApiConfig } from "./types"; import { createClient } from "../common/open-api/client"; -import { addServicesBackwardCompatibility } from "./helpers/addServicesBackwardCompatibility"; +import { addResourcesBackwardCompatibility } from "./helpers/addResourcesBackwardCompatibility"; /** * Takes a config with keyId and keySecret returns a promise with an instance of Client @@ -14,7 +14,7 @@ import { addServicesBackwardCompatibility } from "./helpers/addServicesBackwardC * @param config (optional) OrkesApiConfig with keyId and keySecret * @param customFetch (optional) custom fetch function * @param requestHandler DEPRECATED! (optional) ConductorHttpRequest handler, replaced with customFetch - * @returns + * @returns BackwardCompatibleClient with access to deprecated resource methods */ export const orkesConductorClient = async ( config?: OrkesApiConfig, @@ -42,7 +42,6 @@ export const orkesConductorClient = async ( await handleAuth(openApiClient, keyId, keySecret, refreshTokenInterval); } - addServicesBackwardCompatibility(openApiClient); // DEPRECATED, should be removed after April 2026 - - return openApiClient; + // DEPRECATED, should be replaced with return openApiClient after April 2026: + return addResourcesBackwardCompatibility(openApiClient); }; diff --git a/src/orkes/helpers/addServicesBackwardCompatibility.ts b/src/orkes/helpers/addResourcesBackwardCompatibility.ts similarity index 88% rename from src/orkes/helpers/addServicesBackwardCompatibility.ts rename to src/orkes/helpers/addResourcesBackwardCompatibility.ts index 0097fb91..bee05bdd 100644 --- a/src/orkes/helpers/addServicesBackwardCompatibility.ts +++ b/src/orkes/helpers/addResourcesBackwardCompatibility.ts @@ -25,8 +25,11 @@ const warn = () => { ); }; -export const addServicesBackwardCompatibility = (client: Client) => { - (client as any).eventResource = { +export const addResourcesBackwardCompatibility = (client: Client) => { + const eventResource = { + /** + * @deprecated + */ getQueueConfig: async (queueType: string, queueName: string) => { warn(); const { data } = await EventResource.getQueueConfig({ @@ -36,7 +39,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ putQueueConfig: async ( queueType: string, queueName: string, @@ -50,7 +55,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ deleteQueueConfig: async (queueType: string, queueName: string) => { warn(); await EventResource.deleteQueueConfig({ @@ -59,7 +66,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getEventHandlers: async () => { warn(); const { data } = await EventResource.getEventHandlers({ @@ -68,7 +77,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ updateEventHandler: async (body: any) => { warn(); await EventResource.updateEventHandler({ @@ -77,7 +88,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ addEventHandler: async (body: any) => { warn(); await EventResource.addEventHandler({ @@ -86,7 +99,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getQueueNames: async () => { warn(); const { data } = await EventResource.getQueueNames({ @@ -95,7 +110,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ removeEventHandlerStatus: async (name: string) => { warn(); await EventResource.removeEventHandlerStatus({ @@ -104,7 +121,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getEventHandlersForEvent: async (event: string, activeOnly = true) => { warn(); const { data } = await EventResource.getEventHandlersForEvent({ @@ -115,7 +134,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ deleteTagForEventHandler: async (name: string, body: any[]) => { warn(); await EventResource.deleteTagForEventHandler({ @@ -125,7 +146,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getTagsForEventHandler: async (name: string) => { warn(); const { data } = await EventResource.getTagsForEventHandler({ @@ -135,7 +158,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ putTagForEventHandler: async (name: string, body: any[]) => { warn(); await EventResource.putTagForEventHandler({ @@ -146,8 +171,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); }, }; - - (client as any).healthCheckResource = { + const healthCheckResource = { doCheck: async () => { warn(); const { data } = await HealthCheckResource.doCheck({ @@ -157,8 +181,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, }; - - (client as any).metadataResource = { + const metadataResource = { getTaskDef: async (tasktype: string, metadata = false) => { warn(); const { data } = await MetadataResource.getTaskDef({ @@ -169,7 +192,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ unregisterTaskDef: async (tasktype: string) => { warn(); await MetadataResource.unregisterTaskDef({ @@ -178,7 +203,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getAllWorkflows: async ( access = "READ", metadata = false, @@ -193,7 +220,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ update: async (requestBody: any[], overwrite = true) => { warn(); await MetadataResource.update({ @@ -203,7 +232,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ create: async (requestBody: any, overwrite = false) => { warn(); await MetadataResource.create({ @@ -213,7 +244,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getTaskDefs: async ( access = "READ", metadata = false, @@ -228,7 +261,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ updateTaskDef: async (requestBody: any) => { warn(); await MetadataResource.updateTaskDef({ @@ -237,7 +272,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ registerTaskDef: async (requestBody: any[]) => { warn(); await MetadataResource.registerTaskDef({ @@ -246,7 +283,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ unregisterWorkflowDef: async (name: string, version: number) => { warn(); await MetadataResource.unregisterWorkflowDef({ @@ -255,7 +294,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ get: async (name: string, version?: number, metadata = false) => { warn(); const { data } = await MetadataResource.get1({ @@ -267,8 +308,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, }; - - (client as any).schedulerResource = { + const schedulerResource = { getSchedule: async (name: string) => { warn(); const { data } = await SchedulerResource.getSchedule({ @@ -278,7 +318,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ deleteSchedule: async (name: string) => { warn(); await SchedulerResource.deleteSchedule({ @@ -287,7 +329,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getNextFewSchedules: async ( cronExpression: string, scheduleStartTime?: number, @@ -302,7 +346,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ pauseSchedule: async (name: string) => { warn(); await SchedulerResource.pauseSchedule({ @@ -311,7 +357,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ pauseAllSchedules: async () => { warn(); const { data } = await SchedulerResource.pauseAllSchedules({ @@ -320,7 +368,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ resumeSchedule: async (name: string) => { warn(); await SchedulerResource.resumeSchedule({ @@ -329,7 +379,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ requeueAllExecutionRecords: async () => { warn(); const { data } = await SchedulerResource.requeueAllExecutionRecords({ @@ -338,7 +390,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ resumeAllSchedules: async () => { warn(); const { data } = await SchedulerResource.resumeAllSchedules({ @@ -347,7 +401,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ getAllSchedules: async (workflowName?: string) => { warn(); const { data } = await SchedulerResource.getAllSchedules({ @@ -357,7 +413,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ saveSchedule: async (requestBody: any) => { warn(); await SchedulerResource.saveSchedule({ @@ -366,7 +424,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ searchV21: async ( start?: number, size = 100, @@ -382,7 +442,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ testTimeout: async () => { warn(); const { data } = await client.get({ @@ -399,7 +461,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; - (client as any).tokenResource = { + const tokenResource = { generateToken: async (requestBody: any) => { warn(); const { data } = await TokenResource.generateToken({ @@ -421,7 +483,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; - (client as any).workflowBulkResource = { + const workflowBulkResource = { retry: async (requestBody: any[]) => { warn(); const { data } = await WorkflowBulkResource.retry1({ @@ -431,7 +493,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ restart: async (requestBody: any[], useLatestDefinitions = false) => { warn(); const { data } = await WorkflowBulkResource.restart1({ @@ -442,7 +506,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ terminate: async (requestBody: any[], reason?: string) => { warn(); const { data } = await WorkflowBulkResource.terminate({ @@ -453,7 +519,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ resumeWorkflow: async (requestBody: any[]) => { warn(); const { data } = await WorkflowBulkResource.resumeWorkflow1({ @@ -463,7 +531,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ pauseWorkflow1: async (requestBody: any[]) => { warn(); const { data } = await WorkflowBulkResource.pauseWorkflow1({ @@ -475,7 +545,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; - (client as any).workflowResource = { + const workflowResource = { getRunningWorkflow: async ( name: string, version = 1, @@ -491,7 +561,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ executeWorkflow: async ( body: any, name: string, @@ -518,7 +590,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ startWorkflow: async (requestBody: any) => { warn(); const { data } = await WorkflowResource.startWorkflow({ @@ -528,7 +602,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ decide: async (workflowId: string) => { warn(); await WorkflowResource.decide({ @@ -537,7 +613,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ rerun: async (workflowId: string, requestBody: any) => { warn(); const { data } = await WorkflowResource.rerun({ @@ -548,7 +626,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ searchV21: async ( start?: number, size = 100, @@ -570,7 +650,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ pauseWorkflow: async (workflowId: string) => { warn(); await WorkflowResource.pauseWorkflow({ @@ -579,7 +661,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ skipTaskFromWorkflow: async ( workflowId: string, taskReferenceName: string, @@ -593,7 +677,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getWorkflows: async ( name: string, requestBody: any[], @@ -610,7 +696,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ getWorkflowStatusSummary: async ( workflowId: string, includeOutput = false, @@ -625,7 +713,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ getWorkflows1: async ( name: string, correlationId: string, @@ -641,7 +731,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ retry1: async (workflowId: string, resumeSubworkflowTasks = false) => { warn(); await WorkflowResource.retry({ @@ -651,7 +743,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getExecutionStatus: async (workflowId: string, includeTasks = true) => { warn(); const { data } = await WorkflowResource.getExecutionStatus({ @@ -662,7 +756,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ terminate1: async (workflowId: string, reason?: string) => { warn(); await WorkflowResource.terminate1({ @@ -672,7 +768,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ resumeWorkflow: async (workflowId: string) => { warn(); await WorkflowResource.resumeWorkflow({ @@ -681,7 +779,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ delete: async (workflowId: string, archiveWorkflow = true) => { warn(); await WorkflowResource.delete1({ @@ -691,7 +791,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ searchWorkflowsByTasks: async ( start?: number, size = 100, @@ -713,7 +815,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ getExternalStorageLocation: async ( path: string, operation: string, @@ -733,7 +837,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ startWorkflow1: async ( name: string, requestBody: any, @@ -751,7 +857,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ restart1: async (workflowId: string, useLatestDefinitions = false) => { warn(); await WorkflowResource.restart({ @@ -761,7 +869,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ search1: async ( queryId?: string, start?: number, @@ -785,7 +895,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ searchWorkflowsByTasksV2: async ( start?: number, size = 100, @@ -807,7 +919,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ resetWorkflow: async (workflowId: string) => { warn(); await WorkflowResource.resetWorkflow({ @@ -816,7 +930,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ testWorkflow: async (requestBody: any) => { warn(); const { data } = await WorkflowResource.testWorkflow({ @@ -828,7 +944,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; - (client as any).serviceRegistryResource = { + const serviceRegistryResource = { getRegisteredServices: async () => { warn(); const { data } = await ServiceRegistryResource.getRegisteredServices({ @@ -837,7 +953,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ removeService: async (name: string) => { warn(); await ServiceRegistryResource.removeService({ @@ -846,7 +964,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getService: async (name: string) => { warn(); const { data } = await ServiceRegistryResource.getService({ @@ -856,7 +976,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ openCircuitBreaker: async (name: string) => { warn(); const { data } = await ServiceRegistryResource.openCircuitBreaker({ @@ -866,7 +988,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ closeCircuitBreaker: async (name: string) => { warn(); const { data } = await ServiceRegistryResource.closeCircuitBreaker({ @@ -876,7 +1000,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ getCircuitBreakerStatus: async (name: string) => { warn(); const { data } = await ServiceRegistryResource.getCircuitBreakerStatus({ @@ -886,7 +1012,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ addOrUpdateService: async (serviceRegistry: any) => { warn(); await ServiceRegistryResource.addOrUpdateService({ @@ -895,7 +1023,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ addOrUpdateServiceMethod: async (registryName: string, method: any) => { warn(); await ServiceRegistryResource.addOrUpdateMethod({ @@ -905,7 +1035,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ removeMethod: async ( registryName: string, serviceName: string, @@ -920,7 +1052,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getProtoData: async (registryName: string, filename: string) => { warn(); const { data } = await ServiceRegistryResource.getProtoData({ @@ -930,7 +1064,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ setProtoData: async (registryName: string, filename: string, data: any) => { warn(); await ServiceRegistryResource.setProtoData({ @@ -940,7 +1076,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ deleteProto: async (registryName: string, filename: string) => { warn(); await ServiceRegistryResource.deleteProto({ @@ -949,7 +1087,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getAllProtos: async (registryName: string) => { warn(); const { data } = await ServiceRegistryResource.getAllProtos({ @@ -959,7 +1099,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ discover: async (name: string, create = false) => { warn(); const { data } = await ServiceRegistryResource.discover({ @@ -972,7 +1114,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; - (client as any).humanTaskResource = { + const humanTaskResource = { getConductorTaskById: async (taskId: string) => { warn(); const { data } = await HumanTaskResource.getConductorTaskById({ @@ -983,8 +1125,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data; }, }; - - (client as any).humanTask = { + const humanTask = { deleteTaskFromHumanTaskRecords: async (requestBody: any[]) => { warn(); await HumanTask.deleteTaskFromHumanTaskRecords({ @@ -993,7 +1134,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ deleteTaskFromHumanTaskRecords1: async (taskId: string) => { warn(); await HumanTask.deleteTaskFromHumanTaskRecords1({ @@ -1002,7 +1145,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ search: async (requestBody: any) => { warn(); const { data } = await HumanTask.search({ @@ -1012,7 +1157,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ updateTaskOutputByRef: async ( workflowId: string, taskRefName: string, @@ -1034,7 +1181,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ getTask1: async (taskId: string) => { warn(); const { data } = await HumanTask.getTask1({ @@ -1044,7 +1193,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ claimTask: async ( taskId: string, overrideAssignment = false, @@ -1059,7 +1210,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ assignAndClaim: async ( taskId: string, userId: string, @@ -1075,7 +1228,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ reassignTask: async (taskId: string, requestBody: any[]) => { warn(); await HumanTask.reassignTask({ @@ -1085,7 +1240,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ releaseTask: async (taskId: string) => { warn(); await HumanTask.releaseTask({ @@ -1094,7 +1251,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ skipTask: async (taskId: string, reason?: string) => { warn(); await HumanTask.skipTask({ @@ -1104,7 +1263,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ updateTaskOutput: async ( taskId: string, requestBody: any, @@ -1119,7 +1280,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getAllTemplates: async (name?: string, version?: number) => { warn(); const { data } = await UserForm.getAllTemplates({ @@ -1129,7 +1292,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ saveTemplate: async (requestBody: any, newVersion = false) => { warn(); const { data } = await UserForm.saveTemplate({ @@ -1140,7 +1305,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ saveTemplates: async (requestBody: any[], newVersion = false) => { warn(); const { data } = await UserForm.saveTemplates({ @@ -1151,7 +1318,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ deleteTemplateByName: async (name: string) => { warn(); await UserForm.deleteTemplateByName({ @@ -1160,7 +1329,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ deleteTemplatesByNameAndVersion: async (name: string, version: number) => { warn(); await HumanTask.deleteTemplatesByNameAndVersion({ @@ -1169,7 +1340,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getTemplateByNameAndVersion: async (name: string, version: number) => { warn(); const { data } = await UserForm.getTemplateByNameAndVersion({ @@ -1181,7 +1354,7 @@ export const addServicesBackwardCompatibility = (client: Client) => { }, }; - (client as any).taskResource = { + const taskResource = { poll: async (tasktype: string, workerid?: string, domain?: string) => { warn(); const { data } = await TaskResource.poll({ @@ -1192,7 +1365,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ allVerbose: async () => { warn(); const { data } = await TaskResource.allVerbose({ @@ -1201,7 +1376,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ updateTask: async ( workflowId: string, taskRefName: string, @@ -1221,7 +1398,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ getTask: async (taskId: string) => { warn(); const { data } = await TaskResource.getTask({ @@ -1231,7 +1410,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ all: async () => { warn(); const { data } = await TaskResource.all({ @@ -1240,7 +1421,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ requeuePendingTask: async (taskType: string) => { warn(); const { data } = await TaskResource.requeuePendingTask({ @@ -1250,7 +1433,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ search: async ( start?: number, size = 100, @@ -1266,7 +1451,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ searchV22: async ( start?: number, size = 100, @@ -1288,7 +1475,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ getPollData: async (taskType: string) => { warn(); const { data } = await TaskResource.getPollData({ @@ -1298,7 +1487,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ getTaskLogs: async (taskId: string) => { warn(); const { data } = await TaskResource.getTaskLogs({ @@ -1308,7 +1499,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ log: async (taskId: string, requestBody: string) => { warn(); await TaskResource.log({ @@ -1318,7 +1511,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { throwOnError: true, }); }, - + /** + * @deprecated + */ getAllPollData: async () => { warn(); const { data } = await TaskResource.getAllPollData({ @@ -1327,7 +1522,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ batchPoll: async ( tasktype: string, workerid?: string, @@ -1344,7 +1541,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ updateTask1: async (requestBody: any) => { warn(); const { data } = await TaskResource.updateTask({ @@ -1354,7 +1553,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ size1: async (taskType?: string[]) => { warn(); const { data } = await TaskResource.size({ @@ -1364,7 +1565,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ getExternalStorageLocation1: async ( path: string, operation: string, @@ -1384,7 +1587,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data as any; }, - + /** + * @deprecated + */ updateTaskSync: async ( workflowId: string, taskRefName: string, @@ -1402,7 +1607,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ signal: async ( workflowId: string, status: any, @@ -1419,7 +1626,9 @@ export const addServicesBackwardCompatibility = (client: Client) => { }); return data; }, - + /** + * @deprecated + */ signalAsync: async (workflowId: string, status: any, output: any) => { warn(); const { data } = await TaskResource.signalWorkflowTaskASync({ @@ -1431,4 +1640,19 @@ export const addServicesBackwardCompatibility = (client: Client) => { return data as SignalResponse; }, }; + + return { + ...client, + eventResource, + healthCheckResource, + metadataResource, + schedulerResource, + tokenResource, + workflowBulkResource, + workflowResource, + serviceRegistryResource, + humanTaskResource, + humanTask, + taskResource, + }; }; From f70c2c2b0688867a39b6f35b5816ad724bd5a6cb Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 18:54:19 +0300 Subject: [PATCH 13/19] add a comment --- src/orkes/helpers/addResourcesBackwardCompatibility.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/orkes/helpers/addResourcesBackwardCompatibility.ts b/src/orkes/helpers/addResourcesBackwardCompatibility.ts index bee05bdd..2410d717 100644 --- a/src/orkes/helpers/addResourcesBackwardCompatibility.ts +++ b/src/orkes/helpers/addResourcesBackwardCompatibility.ts @@ -25,6 +25,9 @@ const warn = () => { ); }; +/* everything this function does is add resources with related methods - + originally available in the old OpenAPI-generated client - + to the new client by mapping them to newly generated methods */ export const addResourcesBackwardCompatibility = (client: Client) => { const eventResource = { /** From cdf087e97d6cb45534677124a6242cc35755381d Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Tue, 28 Oct 2025 21:10:41 +0300 Subject: [PATCH 14/19] Update OrkesConductorClient.ts --- src/orkes/OrkesConductorClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/orkes/OrkesConductorClient.ts b/src/orkes/OrkesConductorClient.ts index 31aa1dcc..c2bd4937 100644 --- a/src/orkes/OrkesConductorClient.ts +++ b/src/orkes/OrkesConductorClient.ts @@ -14,7 +14,7 @@ import { addResourcesBackwardCompatibility } from "./helpers/addResourcesBackwar * @param config (optional) OrkesApiConfig with keyId and keySecret * @param customFetch (optional) custom fetch function * @param requestHandler DEPRECATED! (optional) ConductorHttpRequest handler, replaced with customFetch - * @returns BackwardCompatibleClient with access to deprecated resource methods + * @returns Client */ export const orkesConductorClient = async ( config?: OrkesApiConfig, From 65f7f116608c02aa460c80a84ff6136c57b11f25 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 29 Oct 2025 15:04:25 +0300 Subject: [PATCH 15/19] export declaration Client types --- src/common/index.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/common/index.ts b/src/common/index.ts index 3344f81a..417e6e5a 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -52,3 +52,16 @@ export type { ExtendedTaskDef, SignalResponse } from "./types"; // todo: remove after April 2026 (backward compatibility types) export * from "./deprecated-types"; + +/* Export types needed for client's return type in case if user + is building another app on top of sdk with declaration files: */ +export type { + Auth, + ClientOptions, + Config, + QuerySerializerOptions, + RequestOptions, + ResolvedRequestOptions, +} from "./open-api/client"; +export type { Middleware } from "./open-api/client/utils.gen"; +export type { StreamEvent } from "./open-api/core/serverSentEvents.gen"; From 7823f8553078eeec9b53e1309fcb781dd2314b3f Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 29 Oct 2025 15:39:42 +0300 Subject: [PATCH 16/19] add deprecation comment for types --- src/common/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/index.ts b/src/common/index.ts index 417e6e5a..929d947b 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -53,8 +53,11 @@ export type { ExtendedTaskDef, SignalResponse } from "./types"; // todo: remove after April 2026 (backward compatibility types) export * from "./deprecated-types"; -/* Export types needed for client's return type in case if user - is building another app on top of sdk with declaration files: */ +/** + * Export types needed for client's return type in case if user is building another lib on top of sdk with declaration files + * @deprecated + * to import all the types below manually while using SDK since these types could change in future without backward compatibility + */ export type { Auth, ClientOptions, From dfc2937d1b94e7b0404416cd27d23e203dd82998 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 29 Oct 2025 15:45:43 +0300 Subject: [PATCH 17/19] Update index.ts --- src/common/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/index.ts b/src/common/index.ts index 929d947b..16962714 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -57,6 +57,7 @@ export * from "./deprecated-types"; * Export types needed for client's return type in case if user is building another lib on top of sdk with declaration files * @deprecated * to import all the types below manually while using SDK since these types could change in future without backward compatibility + * TODO: remove after April 2026 */ export type { Auth, From 681ab3579b7fd7882bb59cdfc6af25b6a7eb9b7b Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 29 Oct 2025 15:47:52 +0300 Subject: [PATCH 18/19] Update waitForWorkflowStatus.ts --- integration-tests/utils/waitForWorkflowStatus.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/utils/waitForWorkflowStatus.ts b/integration-tests/utils/waitForWorkflowStatus.ts index d5ae7744..88671dcd 100644 --- a/integration-tests/utils/waitForWorkflowStatus.ts +++ b/integration-tests/utils/waitForWorkflowStatus.ts @@ -8,8 +8,8 @@ export const waitForWorkflowStatus = async ( workflowClient: WorkflowExecutor, workflowId: string, expectedStatus: string, - maxWaitTimeMs = 30000, - pollIntervalMs = 1000 + maxWaitTimeMs = 60000, + pollIntervalMs = 3000 ): Promise => { const startTime = Date.now(); From 89868bcab36ea36a0191b2f946501a5c3db10bf8 Mon Sep 17 00:00:00 2001 From: Dmitry Borisov Date: Wed, 29 Oct 2025 15:50:27 +0300 Subject: [PATCH 19/19] Update executor.test.ts --- integration-tests/common/executor.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/common/executor.test.ts b/integration-tests/common/executor.test.ts index bc295849..449e6ffa 100644 --- a/integration-tests/common/executor.test.ts +++ b/integration-tests/common/executor.test.ts @@ -11,7 +11,7 @@ import { MetadataClient } from "../../src/core"; describe("Executor", () => { const clientPromise = orkesConductorClient(); - jest.setTimeout(30000); + jest.setTimeout(60000); const name = `jsSdkTest-Workflow-${Date.now()}`; const version = 1; test("Should be able to register a workflow", async () => {