Interface TasksAPI

interface TasksAPI {
    clearCache: () => void;
    createTask: (
        query: { migrateFrom?: string },
        body: Task,
        options?: ApiCallOptions,
    ) => Promise<CreateTaskHttpResponse>;
    deleteTask: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteTaskHttpResponse>;
    getLastTaskRun: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<GetLastTaskRunHttpResponse>;
    getTask: (
        id: string,
        options?: ApiCallOptions,
    ) => Promise<GetTaskHttpResponse>;
    getTaskRunLog: (
        id: string,
        runId: string,
        options?: ApiCallOptions,
    ) => Promise<GetTaskRunLogHttpResponse>;
    getTaskRuns: (
        id: string,
        query: {
            limit?: number;
            page?: string;
            sort?:
                | "+status"
                | "-status"
                | "+startedAt"
                | "-startedAt"
                | "+endedAt"
                | "-endedAt"
                | "+taskId"
                | "-taskId"
                | "+actionId"
                | "-actionId";
        },
        options?: ApiCallOptions,
    ) => Promise<GetTaskRunsHttpResponse>;
    getTasks: (
        query: {
            limit?: number;
            page?: string;
            resourceId: string;
            sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
        },
        options?: ApiCallOptions,
    ) => Promise<GetTasksHttpResponse>;
    getTasksResourceRuns: (
        id: string,
        query: {
            limit?: number;
            page?: string;
            sort?:
                | "+status"
                | "-status"
                | "+startedAt"
                | "-startedAt"
                | "+endedAt"
                | "-endedAt"
                | "+taskId"
                | "-taskId"
                | "+actionId"
                | "-actionId";
        },
        options?: ApiCallOptions,
    ) => Promise<GetTasksResourceRunsHttpResponse>;
    startTask: (
        id: string,
        query: { source?: string },
        options?: ApiCallOptions,
    ) => Promise<StartTaskHttpResponse>;
    updateTask: (
        id: string,
        body: Task,
        options?: ApiCallOptions,
    ) => Promise<UpdateTaskHttpResponse>;
}
Index

Properties

clearCache: () => void

Clears the cache for tasks api requests.

Type declaration

    • (): void
    • Clears the cache for tasks api requests.

      Returns void

createTask: (
    query: { migrateFrom?: string },
    body: Task,
    options?: ApiCallOptions,
) => Promise<CreateTaskHttpResponse>

Creates a new task.

Type declaration

    • (
          query: { migrateFrom?: string },
          body: Task,
          options?: ApiCallOptions,
      ): Promise<CreateTaskHttpResponse>
    • Creates a new task.

      Parameters

      • query: { migrateFrom?: string }

        an object with query parameters

        • OptionalmigrateFrom?: string

          ID of the reload-task to migrate from the old system (optional).

      • body: Task

        an object with the body content

      • Optionaloptions: ApiCallOptions

      Returns Promise<CreateTaskHttpResponse>

      CreateTaskHttpError

an object with query parameters

an object with the body content

CreateTaskHttpError

deleteTask: (
    id: string,
    options?: ApiCallOptions,
) => Promise<DeleteTaskHttpResponse>

Deletes a specific task.

Type declaration

The task's unique identifier.

DeleteTaskHttpError

getLastTaskRun: (
    id: string,
    options?: ApiCallOptions,
) => Promise<GetLastTaskRunHttpResponse>

Returns the last run of a specific task.

Type declaration

The task's unique identifier.

GetLastTaskRunHttpError

getTask: (id: string, options?: ApiCallOptions) => Promise<GetTaskHttpResponse>

Retrieves details for a specific task.

Type declaration

The task's unique identifier.

GetTaskHttpError

getTaskRunLog: (
    id: string,
    runId: string,
    options?: ApiCallOptions,
) => Promise<GetTaskRunLogHttpResponse>

Get specific run log of a task.

Type declaration

The task's unique identifier.

The run's unique identifier.

GetTaskRunLogHttpError

getTaskRuns: (
    id: string,
    query: {
        limit?: number;
        page?: string;
        sort?:
            | "+status"
            | "-status"
            | "+startedAt"
            | "-startedAt"
            | "+endedAt"
            | "-endedAt"
            | "+taskId"
            | "-taskId"
            | "+actionId"
            | "-actionId";
    },
    options?: ApiCallOptions,
) => Promise<GetTaskRunsHttpResponse>

Returns runs for the specified task.

Type declaration

    • (
          id: string,
          query: {
              limit?: number;
              page?: string;
              sort?:
                  | "+status"
                  | "-status"
                  | "+startedAt"
                  | "-startedAt"
                  | "+endedAt"
                  | "-endedAt"
                  | "+taskId"
                  | "-taskId"
                  | "+actionId"
                  | "-actionId";
          },
          options?: ApiCallOptions,
      ): Promise<GetTaskRunsHttpResponse>
    • Returns runs for the specified task.

      Parameters

      • id: string

        The task's unique identifier.

      • query: {
            limit?: number;
            page?: string;
            sort?:
                | "+status"
                | "-status"
                | "+startedAt"
                | "-startedAt"
                | "+endedAt"
                | "-endedAt"
                | "+taskId"
                | "-taskId"
                | "+actionId"
                | "-actionId";
        }

        an object with query parameters

        • Optionallimit?: number

          The maximum number of task runs to return for a request.

        • Optionalpage?: string

          The page cursor.

        • Optionalsort?:
              | "+status"
              | "-status"
              | "+startedAt"
              | "-startedAt"
              | "+endedAt"
              | "-endedAt"
              | "+taskId"
              | "-taskId"
              | "+actionId"
              | "-actionId"

          The property of a resource to sort on (default sort is -startedAt). A property must be prefixed by + or - to indicate ascending or descending sort order respectively.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetTaskRunsHttpResponse>

      GetTaskRunsHttpError

The task's unique identifier.

an object with query parameters

GetTaskRunsHttpError

getTasks: (
    query: {
        limit?: number;
        page?: string;
        resourceId: string;
        sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
    },
    options?: ApiCallOptions,
) => Promise<GetTasksHttpResponse>

Retrieves a list of the tasks that the requesting user has access to.

Type declaration

    • (
          query: {
              limit?: number;
              page?: string;
              resourceId: string;
              sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
          },
          options?: ApiCallOptions,
      ): Promise<GetTasksHttpResponse>
    • Retrieves a list of the tasks that the requesting user has access to.

      Parameters

      • query: {
            limit?: number;
            page?: string;
            resourceId: string;
            sort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt";
        }

        an object with query parameters

        • Optionallimit?: number

          The maximum number of resources to return for a request.

        • Optionalpage?: string

          The page cursor.

        • resourceId: string

          Required. Filter tasks by its target resource ID. If not provided, request will fail with 400 (Bad Request).

        • Optionalsort?: "+createdAt" | "-createdAt" | "+updatedAt" | "-updatedAt"

          The property of a resource to sort on (default sort is -updatedAt). A property must be prefixed by + or - to indicate ascending or descending sort order respectively.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetTasksHttpResponse>

      GetTasksHttpError

an object with query parameters

GetTasksHttpError

getTasksResourceRuns: (
    id: string,
    query: {
        limit?: number;
        page?: string;
        sort?:
            | "+status"
            | "-status"
            | "+startedAt"
            | "-startedAt"
            | "+endedAt"
            | "-endedAt"
            | "+taskId"
            | "-taskId"
            | "+actionId"
            | "-actionId";
    },
    options?: ApiCallOptions,
) => Promise<GetTasksResourceRunsHttpResponse>

Returns a list of task runs for a specified resourceId.

Type declaration

    • (
          id: string,
          query: {
              limit?: number;
              page?: string;
              sort?:
                  | "+status"
                  | "-status"
                  | "+startedAt"
                  | "-startedAt"
                  | "+endedAt"
                  | "-endedAt"
                  | "+taskId"
                  | "-taskId"
                  | "+actionId"
                  | "-actionId";
          },
          options?: ApiCallOptions,
      ): Promise<GetTasksResourceRunsHttpResponse>
    • Returns a list of task runs for a specified resourceId.

      Parameters

      • id: string

        Filter tasks by its target resource ID

      • query: {
            limit?: number;
            page?: string;
            sort?:
                | "+status"
                | "-status"
                | "+startedAt"
                | "-startedAt"
                | "+endedAt"
                | "-endedAt"
                | "+taskId"
                | "-taskId"
                | "+actionId"
                | "-actionId";
        }

        an object with query parameters

        • Optionallimit?: number

          The maximum number of task runs to return for a request.

        • Optionalpage?: string

          The page cursor.

        • Optionalsort?:
              | "+status"
              | "-status"
              | "+startedAt"
              | "-startedAt"
              | "+endedAt"
              | "-endedAt"
              | "+taskId"
              | "-taskId"
              | "+actionId"
              | "-actionId"

          The property of a resource to sort on (default sort is -startedAt). A property must be prefixed by + or - to indicate ascending or descending sort order respectively.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetTasksResourceRunsHttpResponse>

      GetTasksResourceRunsHttpError

Filter tasks by its target resource ID

an object with query parameters

GetTasksResourceRunsHttpError

startTask: (
    id: string,
    query: { source?: string },
    options?: ApiCallOptions,
) => Promise<StartTaskHttpResponse>

Starts the specified task.

Type declaration

    • (
          id: string,
          query: { source?: string },
          options?: ApiCallOptions,
      ): Promise<StartTaskHttpResponse>
    • Starts the specified task.

      Parameters

      • id: string

        The task's unique identifier.

      • query: { source?: string }

        an object with query parameters

        • Optionalsource?: string

          Indicates the origin of the trigger. If not provided, defaults to 'manual'. For event-triggered tasks, this can be the name of the triggering task.

      • Optionaloptions: ApiCallOptions

      Returns Promise<StartTaskHttpResponse>

      StartTaskHttpError

The task's unique identifier.

an object with query parameters

StartTaskHttpError

updateTask: (
    id: string,
    body: Task,
    options?: ApiCallOptions,
) => Promise<UpdateTaskHttpResponse>

Updates a specific task. If the task is owned by another user, ownership will be transferred to the requesting user.

Type declaration

    • (
          id: string,
          body: Task,
          options?: ApiCallOptions,
      ): Promise<UpdateTaskHttpResponse>
    • Updates a specific task. If the task is owned by another user, ownership will be transferred to the requesting user.

      Parameters

      • id: string

        The task's unique identifier.

      • body: Task

        an object with the body content

      • Optionaloptions: ApiCallOptions

      Returns Promise<UpdateTaskHttpResponse>

      UpdateTaskHttpError

The task's unique identifier.

an object with the body content

UpdateTaskHttpError