talwat / pap

A swiss army knife for minecraft servers.
MIT License
42 stars 2 forks source link

API plugin download type #10

Open talwat opened 1 year ago

talwat commented 1 year ago

For each plugin, perhaps there could be an api plugin type which fetches a url defined by the plugin and get's the download url from that. For example:

{
  "downloads": [
    {
      "type": "api",
      "goto": {
         "api_url": "https://api.example.com/plugin/get/myplugin"
         "id": ".plugin.info.id" // Gets json data from the api_url
         "goto": {
           "api_url": "https://api.example.com/plugin/get/files/{id}"
           "url": ".files[0].download_url" // Whenever the url property is defined, pap will use it as the download url
         }
       },
      "filename": "plugin.jar"
    }
  ]
}

Any other ways to implement this are welcome, especially parsing the data from the api, I'm not sure about a format to use.

talwat commented 1 year ago

Doing this primarily to further reduce the plugins without the latest version.