Tools

codemode-gatewaysourcetypescript
Path: codemode-gateway/src/cf/tools.tsRelative: src/cf/tools.tsSubproject: codemode-gatewayCategory: codemode-gateway
Lines: 187Bytes: 6,099Imports: 4Exports: 7

Content Preview

  1. import type { CfEnvelope, CfError, D1Database, Env, KvNamespace } from "../types";
  2. import { CloudflareApiError } from "../types";
  3. import { asObject, asString, optArray, reqString } from "../parse";
  4. import { CF_ACCOUNT_ID, cfFetch, cfRequest } from "./client";
  5. /**
  6. * Hand-built implementations for the `cf` namespace (Cloudflare REST API).
  7. *
  8. * Each function is `(args, env) => Promise<R>` and executes host-side; the
  9. * registry wraps it with arg parsing. `docs_search` was investigated and
  10. * DRO