electron-release-server icon indicating copy to clipboard operation
electron-release-server copied to clipboard

Add hidden routes in your documentation

Open locobastos opened this issue 5 months ago • 0 comments

Hello,

Could you please add in your documentation all hidden routes and how to use them inside a CI/CD pipelines? Here what I've found until now.

:warning: All of the following are examples as I'm using an other language and syntax.

Authentication:

  • Call https://electron-update.dev.ives.fr/api/auth/login with a JSON body: {"username":"my_admin_login","password":"my_very_secured_password"} => You'll get a Token as response.

Create a New Flavor:

  • Call https://electron-update.dev.ives.fr/api/flavor with your token in the cURL header ("Authorization: Bearer $TOKEN") and a JSON body: {"name":"MySoftware"}

Create New Version:

  • Call https://electron-update.dev.ives.fr/api/version with your token in the cURL header ("Authorization: Bearer $TOKEN") and a JSON body: {"id":"1.1.0_MySoftware","name":"1.1.0","notes":"","channel":"stable","flavor":"MySoftware","availability":"2050-12-31T25:59:59.000Z"}

Create New Asset:

  • Call https://electron-update.dev.ives.fr/api/asset with your token in the cURL header ("Authorization: Bearer $TOKEN") and a "multipart/form-data" and a defined "boundary" and this kind of body:
--${boundary}
Content-Disposition: form-data; name="token"

${TOKEN}
--${boundary}
Content-Disposition: form-data; name="version"

1.1.0_MySoftware
--${boundary}
Content-Disposition: form-data; name="platform"

osx_64
--${boundary}
Content-Disposition: form-data; name="file"; filename="MySoftware-1.1.0.zip"
Content-Type: application/x-zip-compressed


--${boundary}--

Currently, I'm stuck with the uploading file process and it would be great if all Admin API routes are documented.

Thank you!

locobastos avatar Jan 18 '24 09:01 locobastos