Skip to content
This repository was archived by the owner on Aug 6, 2022. It is now read-only.

III.3.e. Superuser only content

Andrey Bogdanov edited this page Apr 10, 2016 · 6 revisions

Contents

Requests

Add a file or directory
/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:

  • dir The directory to add a new entity to.
  • fileName The name of the file or directory.

The optional fields are:

  • isDir If specified and the value is "true" (a string), 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"
}
Edit file content
/action/superuserEditFile

Edits file content. Returns an empty object.

Note: Your access level must be SUPERUSER.

The required fields are:

  • fileName The name of the file to edit.
  • content The new file content (a string).

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"
}
Rename a file or directory
/action/superuserRenameFile

Renames a file or a directory. Returns an empty object.

Note: Your access level must be SUPERUSER.

The required fields are:

  • oldFileName The name of the file or directory.
  • fileName The 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.

Delete a file or directory
/action/superuserDeleteFile

Deletes a file or a directory. Returns an empty object.

Note: Your access level must be SUPERUSER.

The required fields are:

  • fileName The name of the file or directory to delete.

Example:

/action/superuserDeleteFile { fileName=./boards/test.js }

{}

On any error, an error object is returned.

Regenerate the cache
/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:

  • regenerateArchive If the value is "true", archived threads are regenerated, too.

Example:

/action/superuserRegenerateCache {}

{}

On any error, an error object is returned.

Rerender posts
/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.

Rebuild post search index
/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.

Reload boards, config and/or templates
/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:

  • boards If specified and the value is "true" (a string), boards are reloaded.
  • config If specified and the value is "true" (a string), configuration are reloaded.
  • templates If specified and the value is "true" (a string), 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.

Clone this wiki locally