diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/config/config.go | 8 | ||||
| -rw-r--r-- | internal/models/widget.go | 24 |
2 files changed, 32 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index 1738e54..67658b4 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -40,12 +40,16 @@ type Config struct { WebAuthnRPID string // Relying Party ID (domain, e.g., "doot.terst.org") WebAuthnOrigin string // Expected origin (e.g., "https://doot.terst.org") + // Widget API + WidgetToken string // Static bearer token for /api/widget (WIDGET_TOKEN env var) + // Claudomator ClaudomatorURL string // URL of Claudomator service // Service gateway — additional upstream services proxied through doot's auth layer PlaygroundURL string // URL of playground demo service (optional) ScoutURL string // URL of scout listing feed service (optional) + HawaiiURL string // URL of Hawaii county data dashboard (optional) } // Load reads configuration from environment variables @@ -83,12 +87,16 @@ func Load() (*Config, error) { WebAuthnRPID: os.Getenv("WEBAUTHN_RP_ID"), WebAuthnOrigin: os.Getenv("WEBAUTHN_ORIGIN"), + // Widget API + WidgetToken: os.Getenv("WIDGET_TOKEN"), + // Claudomator ClaudomatorURL: getEnvWithDefault("CLAUDOMATOR_URL", "http://127.0.0.1:8484"), // Service gateway PlaygroundURL: os.Getenv("PLAYGROUND_URL"), ScoutURL: os.Getenv("SCOUT_URL"), + HawaiiURL: os.Getenv("HAWAII_URL"), } // Validate required fields diff --git a/internal/models/widget.go b/internal/models/widget.go new file mode 100644 index 0000000..94deec7 --- /dev/null +++ b/internal/models/widget.go @@ -0,0 +1,24 @@ +package models + +import "time" + +// WidgetItem is a single item in the widget API response. +// Source values: "todoist", "trello", "plantoeat", "calendar", "gtasks" +// Type values: "task", "event" +type WidgetItem struct { + ID string `json:"id"` + Title string `json:"title"` + Source string `json:"source"` + Type string `json:"type"` + Start *time.Time `json:"start,omitempty"` // nil = no specific time (floating task) + End *time.Time `json:"end,omitempty"` + IsAllDay bool `json:"is_all_day"` + URL string `json:"url,omitempty"` + Completable bool `json:"completable"` // true = todoist task (checkbox shown) +} + +// WidgetResponse is the full /api/widget response body. +type WidgetResponse struct { + Now time.Time `json:"now"` + Items []WidgetItem `json:"items"` +} |
