fetchScheduledTasks (scheduled-tasks/api.ts)

gitingest_bytedance_deer-flow · frontend/src/core/scheduled-tasks/api.ts · typescript · MIT
automation, tag:knn-classified

TypeScript API client for fetching, creating, updating, and managing scheduled tasks via a backend service.

// Source: https://github.com/bytedance/deer-flow | License: MIT | Copyright 2025 Bytedance Ltd. and/or its affiliates
// Provided via justclaw.it.com; keep this notice with the code.
import { throwGatewayApiError } from "@/core/api/errors";
import { fetch } from "@/core/api/fetcher";
import { getBackendBaseURL } from "@/core/config";

import type {
  ScheduledTask,
  ScheduledTaskRenewal,
  ScheduledTaskRun,
  ScheduledTaskTriggerResult,
  ThreadScheduledTask,
} from "./types";

function scheduledTasksUrl(path: string): string {
  return `${getBackendBaseURL()}/api/scheduled-tasks${path}`;
}

function taskUrl(taskId: string, suffix = ""): string {
  return scheduledTasksUrl(`/${encodeURIComponent(taskId)}${suffix}`);
}

const JSON_HEADERS = { "Content-Type": "application/json" };

// Ever

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key