Initial API setup: GET and POST handlers and base permission checks.

This commit is contained in:
Jesse Malotaux 2025-03-23 15:30:08 +01:00
parent 535cf06237
commit 8b8a84aa67
15 changed files with 538 additions and 18 deletions

View file

@ -0,0 +1,25 @@
package structs
type Allowed struct {
Local []string
Remote []string
Auth []string
}
var Endpoints = Allowed{
Local: []string{
"/macro/record",
"/macro/list",
"/macro/delete",
"/macro/play",
"/device/list",
},
Remote: []string{
"/macro/list",
"/device/access",
"/device/auth",
},
Auth: []string{
"/macro/play",
},
}

View file

@ -0,0 +1,6 @@
package structs
type Settings struct {
Name string `json:"name"`
Type string `json:"type"`
}

View file

@ -0,0 +1,19 @@
package structs
type MacroRequest struct {
Macro string `json:"macro"`
}
type Step struct {
Type string `json:"type"`
Key string `json:"key"`
Code string `json:"code"`
Location int `json:"location"`
Direction string `json:"direction"`
Value int `json:"value"`
}
type NewMacro struct {
Name string `json:"name"`
Steps []Step `json:"steps"`
}