-
Notifications
You must be signed in to change notification settings - Fork 4
III.3.e. Superuser only content
- Add a file or directory
- Edit file content
- Rename a file or directory
- Delete a file or directory
- Regenerate the cache
- Rerender posts
- Rebuild post search index
- Reload boards, config and/or templates
/action/superuserAddFile
Adds a file or directory to the application's root directory or subdirectory. Returns an empty object.
Note: Your access level must be SUPERUSER.
The required fields are:
-
dirThe directory to add a new entity to. -
fileNameThe name of the file or directory.
The optional fields are:
-
isDirIf specified and the value is"true"(astring), a directory is created. Otherwise, a file is created.
File content may be specified. You need to attach a file to do this. File form field name is not sufficient (typically it is file).
Example:
/action/superuserAddFile { dir=./boards&fileName=test.js }
{}
On any error, an error object is returned.
/action/superuserAddFile { dir=./config.json&fileName=test.js }
{
"title": "Error",
"errorMessage": "Error",
"errorDescription": "Not a directory"
}
/action/superuserEditFile
Edits file content. Returns an empty object.
Note: Your access level must be SUPERUSER.
The required fields are:
-
fileNameThe name of the file to edit. -
contentThe new file content (astring).
Example:
/action/superuserEditFile { fileName=./boards/test.js&content={} }
{}
On any error, an error object is returned.
/action/superuserEditFile { fileName=./boards&content={} }
{
"title": "Error",
"errorMessage": "Error",
"errorDescription": "Not a file"
}
/action/superuserRenameFile
Renames a file or a directory. Returns an empty object.
Note: Your access level must be SUPERUSER.
The required fields are:
-
oldFileNameThe name of the file or directory. -
fileNameThe new name of the file or directory.
Example:
/action/superuserRenameFile { oldFileName=./boards/test.js&fileName=production.js }
{}
On any error, an error object is returned.
/action/superuserDeleteFile
Deletes a file or a directory. Returns an empty object.
Note: Your access level must be SUPERUSER.
The required fields are:
-
fileNameThe name of the file or directory to delete.
Example:
/action/superuserDeleteFile { fileName=./boards/test.js }
{}
On any error, an error object is returned.
/action/superuserRegenerateCache
Regenerates the cache. Connection with the server is lost, manual page reload is required.
Note: Your access level must be SUPERUSER.
Optional fields:
-
regenerateArchiveIf the value is"true", archived threads are regenerated, too.
Example:
/action/superuserRegenerateCache {}
{}
On any error, an error object is returned.
/action/superuserRerenderPosts
Rerenders the posts on the specified boards or on all boards if no board is specified. Connection with the server is lost, manual page reload is required.
Note: Your access level must be SUPERUSER.
Boards are specified using board_BOARD fields. The BOARD part of the field name must match it's value.
Example:
/action/superuserRerenderPosts { board_b=b&board_d=d }
{}
On any error, an error object is returned.
/action/superuserRebuildSearchIndex
Regenerates the cach. An empty object is returned.
Note: Your access level must be SUPERUSER.
No field is required.
Example:
/action/superuserRebuildSearchIndex {}
{}
On any error, an error object is returned.
/action/superuserReload
Reloads boards, configuration, and/or templates. Connection with the server is lost, manual page reload is required.
Note: Your access level must be SUPERUSER.
The optional fields are:
-
boardsIf specified and the value is"true"(astring), boards are reloaded. -
configIf specified and the value is"true"(astring), configuration are reloaded. -
templatesIf specified and the value is"true"(astring), templates are reloaded.
Any combination of the above fields is allowed.
Example:
/action/superuserReload { boards=true&config=true&templates=true }
{}
On any error, an error object is returned.