Nov 8, 2021

Skript Files Routes

The Joint API skript files routes offer developers the capability to access, edit, or delete DEX8 skript files, which are essentially JavaScript files. This functionality enables developers to add new code, update existing scripts, or remove unnecessary files as needed.

GET /joint-api/skript-files/list?skript_id=&name_contains=&limit=&skip=&sort=

Provide a list of the skript files.

URL Query Parameters
  • skript_id :string - skript _id
  • name_contains :string - a string contained in the skript file name
  • limit :number - restrict the number of documents returned by a query
  • skip :number - skip a specified number of documents in a query result
  • sort :string - sort the query results based on one or more fields in ascending or descending order

POST /joint-api/skript-files/addnew

Route for creation of new skript file which is generally a JS file.

Body Parameters
  • skript_id :string - the _id of the skript to which a file belongs
  • name :string - file name
  • content :string - the file's code
Example
============
{
  "skript_id": "5df116babb572a5a79a50e9b",
  "name": "main.js",
  "content": "module.exports = (x, lib) => { console.log(ctx); };"
}

GET /joint-api/skript-files/:skriptFile_id

Get information for a specific skript file.

URL Parameters
  • skriptFile_id :string - the skript file _id

PUT /joint-api/skript-files/:skriptFile_id

Update an existing skript file.

Body Parameters
  • skript_id :string - the _id of the skript to which a file belongs
  • name :string - file name
  • content :string - the file's code

DELETE /joint-api/skript-files/:skriptFile_id

Delete the skript file.

URL Parameters
  • skriptFile_id :string - the skript file _id