From cc02426b606641864648cf6a533b2856becd1f60 Mon Sep 17 00:00:00 2001 From: Mees van der Wijk Date: Thu, 28 Aug 2025 00:25:06 +0200 Subject: [PATCH] Updated specs --- ModuleServerAPI.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/ModuleServerAPI.md b/ModuleServerAPI.md index 6d2c6de..f1d74a6 100644 --- a/ModuleServerAPI.md +++ b/ModuleServerAPI.md @@ -395,11 +395,11 @@ Read a file as JSON. api.readJSON(scope, filename, callback); ``` -| Argument | Type | Description | -| -------- | --------------------------------- | ------------------------------------------------------------------------ | -| scope | 'static' \| 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). | -| filename | string | The name of the file. | -| callback | ( json:any ):void | Function will be called with the JSON once it's loaded. | +| Argument | Type | Description | +| -------- | --------------------------------------------- | ------------------------------------------------------- | +| scope | 'static' \| 'module' \| 'channel' \| 'static' | The scope of the file. | +| filename | string | The name of the file. | +| callback | ( json:any ):void | Function will be called with the JSON once it's loaded. | ### writeJSON @@ -409,12 +409,12 @@ Write a file as JSON. api.writeJSON(scope, filename, json, callback?); ``` -| Argument | Type | Description | -| ------------------- | --------------------- | ------------------------------------------------------------------------ | -| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). | -| filename | string | The name of the file. | -| json | object | The JSON data to write. | -| (Optional) callback | function | Function will be called with the JSON was saved. | +| Argument | Type | Description | +| ------------------- | --------------------------------- | ------------------------------------------------ | +| scope | 'module' \| 'channel' \| 'static' | The scope of the file. | +| filename | string | The name of the file. | +| json | object | The JSON data to write. | +| (Optional) callback | function | Function will be called with the JSON was saved. | ### writeFile @@ -426,7 +426,7 @@ api.writeFile(scope, filename, data, options, callback?); | Argument | Type | Description | | ------------------- | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). | +| scope | 'module' \| 'channel' \| 'static' | The scope of the file. | | filename | string | The name of the file. | | data | string \| Buffer \| TypedArray \| DataView \| Object | The data to write. See [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). | | options | Object \| string | Writing options/mode to use. See [fs.writeFile](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback). | @@ -440,11 +440,11 @@ Check if a file exists. api.fileExists(scope, filename, callback); ``` -| Argument | Type | Description | -| -------- | --------------------------------- | ------------------------------------------------------------------------ | -| scope | 'static' \| 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). | -| filename | string | The name of the file. | -| callback | ( exists:boolean ):void | Function will be called when the file exists check has finished. | +| Argument | Type | Description | +| -------- | --------------------------------------------- | ---------------------------------------------------------------- | +| scope | 'static' \| 'module' \| 'channel' \| 'static' | The scope of the file. | +| filename | string | The name of the file. | +| callback | ( exists:boolean ):void | Function will be called when the file exists check has finished. | ### addHost @@ -454,10 +454,10 @@ Make a file accessable through the webserver. api.addHost(scope, filename); ``` -| Argument | Type | Description | -| -------- | --------------------- | ------------------------------------------------------------------------ | -| scope | 'module' \| 'channel' | The scope of the file, see [file scopes](./ModuleServerAPI#file-scopes). | -| filename | string | The name of the file. | +| Argument | Type | Description | +| -------- | --------------------------------- | ---------------------- | +| scope | 'module' \| 'channel' \| 'static' | The scope of the file. | +| filename | string | The name of the file. | \*_Returns_ { hostID:string, relativeUrl:string, downloadUrl:string } _The data of the hosted file._