Skip to content

FileBody ​

Type, in @jr2/orchestrator/src/http-effect.ts. The signature of an export, or a type that it names, names this type. The Authoring surface page lists each export. This type is not an export of @jr2/orchestrator, so a workflow module does not import it by name.

ts
type FileBody<S extends z.ZodType | undefined = undefined> = {
  readonly file: {
    readonly path: FromInput<S, string>;
    readonly slot?: string;
    readonly segments?: FromInput<S, readonly string[]>;
    readonly contentType?: string;
  };
};

file(path, { slot?, segments?, contentType? }): a Worktree file as an http body.

Fields

  • file: object

    • path: FromInput<S, string>

      The file, relative to the Repo Slot's Worktree, or to /work in a Workspace with no Repo Slot.

    • slot (optional): string

      The Repo Slot whose Worktree holds it. Write it only when the Workspace has more than one.

    • segments (optional): FromInput<S, readonly string[]>

      Path segments that jr2 adds to the end of the url, as path of request does for a json or text body.

    • contentType (optional): string

      The content type of the body. Write it or a content-type header, not both. With neither, it is application/octet-stream.

The docs of Kit version 0.5.1. Each page is also at its .md URL.