Skip to main content

addFile

client.file.addFile(data: AddFileRequest): Promise<unknown>

Creates a new file in the workspace.

Adds a file with the specified name and content. If the file already exists, behavior depends on the server configuration.

Parameters

ParameterTypeRequiredDescription
dataAddFileRequestYesRequest specifying the file path and content to create

Returns

Promise<unknown> — A promise that resolves when the file has been created

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.file.addFile(/* AddFileRequest */);
console.log(result);