From 97170a3a8fb7ff8617304ba9d9cad65ff14c06de Mon Sep 17 00:00:00 2001 From: David Porter Date: Tue, 5 May 2026 12:51:22 +1000 Subject: [PATCH] AP-8332 # remove getAdhocTasksForFormsApp and getAdhocTasksGroupInstanceTasks --- CHANGELOG.md | 1 - src/apps/scheduled-tasks-service.ts | 66 ++--------------------------- 2 files changed, 3 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd1769bb..b6e00435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - support adhoc tasks -- `getAdhocTasksForFormsApp` and `getAdhocTaskGroupInstanceTasks` to `scheduledTasksService` ## [10.1.1] - 2026-04-23 diff --git a/src/apps/scheduled-tasks-service.ts b/src/apps/scheduled-tasks-service.ts index 4385e516..ef9efcce 100644 --- a/src/apps/scheduled-tasks-service.ts +++ b/src/apps/scheduled-tasks-service.ts @@ -25,6 +25,7 @@ export type AdhocTaskResponse = Pick async function getTasks< T extends { taskResponses: TaskResponse[] + availableAdhocTasks: AdhocTaskResponse[] | undefined }, >(url: string, abortSignal?: AbortSignal) { try { @@ -92,38 +93,12 @@ export async function getTasksForFormsApp({ abortSignal?: AbortSignal }): Promise<{ taskResponses: TaskResponse[] + availableAdhocTasks: AdhocTaskResponse[] | undefined }> { const url = `${tenants.current.apiOrigin}/forms-apps/${formsAppId}/scheduled-tasks?date=${date}` return await getTasks(url, abortSignal) } -/** - * Obtain all of the related adhoc Tasks for a specific Forms App - * - * #### Example - * - * ```js - * const formsAppId = 1 - * const tasks = await getAdhocTasksForFormsApp({ formsAppId }) - * ``` - * - * @param formsAppId - * @param abortSignal - * @returns - */ -export async function getAdhocTasksForFormsApp({ - formsAppId, - abortSignal, -}: { - formsAppId: number - abortSignal?: AbortSignal -}) { - const url = `${tenants.current.apiOrigin}/forms-apps/${formsAppId}/adhoc-tasks` - return (await getTasks(url, abortSignal)) as { - taskResponses: AdhocTaskResponse[] - } -} - /** * Obtain all of the tasks related to a Task Group Instances in a specific Forms * App @@ -160,47 +135,12 @@ export async function getTaskGroupInstanceTasks({ const url = `${tenants.current.apiOrigin}/forms-apps/${formsAppId}/scheduled-task-group-instances/${taskGroupInstanceId}?date=${date}` return await getTasks<{ taskResponses: TaskResponse[] + availableAdhocTasks: AdhocTaskResponse[] | undefined taskGroup: ScheduledTasksTypes.TaskGroup taskGroupInstance: ScheduledTasksTypes.TaskGroupInstance }>(url, abortSignal) } -/** - * Obtain all of the adhoc tasks related to a Task Group Instances in a specific - * Forms App - * - * #### Example - * - * ```js - * const formsAppId = 1 - * const taskGroupInstanceId = 'abc123' - * const tasks = await getAdhocTaskGroupInstanceTasks({ - * formsAppId, - * taskGroupInstanceId, - * }) - * ``` - * - * @param formsAppId - * @param taskGroupInstanceId - * @param abortSignal - * @returns - */ -export async function getAdhocTaskGroupInstanceTasks({ - taskGroupInstanceId, - formsAppId, - abortSignal, -}: { - taskGroupInstanceId: string - date: string - formsAppId: number - abortSignal?: AbortSignal -}) { - const url = `${tenants.current.apiOrigin}/forms-apps/${formsAppId}/scheduled-task-group-instances/${taskGroupInstanceId}/adhoc-tasks` - return (await getTasks(url, abortSignal)) as { - taskResponses: AdhocTaskResponse[] - } -} - /** * Obtain all of the Task Group instances for a specific Forms App *