Skip to content

workspaces.write_file

Writes a file of a workspace unless it changed since it was read (DMN-090).

/** `workspaces.write_file` params (DMN-090). */
export type WriteFileParams = {
/** The new text of the file (UTF-8). */
content: string;
/**
* The `hash` of the file the text was based on: a file that no longer has it is `conflict`. Absent: the file
* must not exist yet.
*/
expectedHash?: string | null;
/** As in `workspaces.read_file`. */
path: string;
workspaceId: string;
};
/** The result of `workspaces.write_file` (DMN-090). */
export type FileWritten = {
/** Hex SHA-1 of the written bytes. */
hash: string;
/** Relative to the workspace folder. */
path: string;
size: number;
};