@@ -177,11 +177,13 @@ export class Fs extends APIResource {
177177 writeFile (
178178 id : string ,
179179 contents : string | ArrayBuffer | ArrayBufferView | Blob | DataView ,
180+ params : FWriteFileParams ,
180181 options ?: RequestOptions ,
181182 ) : APIPromise < void > {
182- const { path, mode } = params ;
183+ const { path : path_ , mode } = params ;
183184 return this . _client . put ( path `/browsers/${ id } /fs/write_file` , {
184185 body : contents ,
186+ query : { path : path_ , mode } ,
185187 ...options ,
186188 headers : buildHeaders ( [
187189 { 'Content-Type' : 'application/octet-stream' , Accept : '*/*' } ,
@@ -343,6 +345,18 @@ export interface FSetFilePermissionsParams {
343345 owner ?: string ;
344346}
345347
348+ export interface FWriteFileParams {
349+ /**
350+ * Query param: Destination absolute file path.
351+ */
352+ path : string ;
353+
354+ /**
355+ * Query param: Optional file mode (octal string, e.g. 644). Defaults to 644.
356+ */
357+ mode ?: string ;
358+ }
359+
346360Fs . Watch = Watch ;
347361
348362export declare namespace Fs {
@@ -357,6 +371,7 @@ export declare namespace Fs {
357371 type FMoveParams as FMoveParams ,
358372 type FReadFileParams as FReadFileParams ,
359373 type FSetFilePermissionsParams as FSetFilePermissionsParams ,
374+ type FWriteFileParams as FWriteFileParams ,
360375 } ;
361376
362377 export {
0 commit comments