Documentation
¶
Overview ¶
Package ui provides a web-based user interface for the Nylas CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct {
ID string `json:"id"`
Name string `json:"name"`
Environment string `json:"environment"`
}
Application represents a Nylas application.
type Command ¶
type Command struct {
Key string `json:"key"`
Title string `json:"title"`
Cmd string `json:"cmd"`
Desc string `json:"desc"`
ParamName string `json:"paramName,omitempty"`
Placeholder string `json:"placeholder,omitempty"`
}
Command represents a CLI command with metadata.
type Commands ¶
type Commands struct {
Auth []Command `json:"auth"`
Email []Command `json:"email"`
Calendar []Command `json:"calendar"`
Contacts []Command `json:"contacts"`
Inbound []Command `json:"inbound"`
Scheduler []Command `json:"scheduler"`
Timezone []Command `json:"timezone"`
Webhook []Command `json:"webhook"`
OTP []Command `json:"otp"`
Admin []Command `json:"admin"`
Notetaker []Command `json:"notetaker"`
}
Commands holds categorized commands.
func GetDefaultCommands ¶
func GetDefaultCommands() Commands
GetDefaultCommands returns the default command definitions.
type ConfigStatusResponse ¶
type ExecRequest ¶
type ExecRequest struct {
Command string `json:"command"`
}
ExecRequest represents a command execution request.
type ExecResponse ¶
type ExecResponse struct {
Output string `json:"output,omitempty"`
Error string `json:"error,omitempty"`
}
ExecResponse represents a command execution response.
type Grant ¶
type Grant struct {
ID string `json:"id"`
Email string `json:"email"`
Provider string `json:"provider"`
}
Grant represents an authenticated account.
type GrantsResponse ¶
type GrantsResponse struct {
Grants []Grant `json:"grants"`
DefaultGrant string `json:"default_grant"`
}
GrantsResponse represents the grants list API response.
type PageData ¶
type PageData struct {
Configured bool
DemoMode bool
ClientID string
Region string
HasAPIKey bool
DefaultGrant string
DefaultGrantEmail string
Grants []Grant
Commands Commands
}
PageData contains all data needed to render the page.
func (PageData) CommandsJSON ¶
CommandsJSON returns commands as JSON for JavaScript.
func (PageData) GrantsJSON ¶
GrantsJSON returns grants as JSON for JavaScript.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the web UI server.
func NewDemoServer ¶
NewDemoServer creates a UI server in demo mode with sample data.
type SetDefaultGrantRequest ¶
type SetDefaultGrantRequest struct {
GrantID string `json:"grant_id"`
}
SetDefaultGrantRequest represents the request to set default grant.
type SetDefaultGrantResponse ¶
type SetDefaultGrantResponse struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Error string `json:"error,omitempty"`
}
SetDefaultGrantResponse represents the response for setting default grant.
type SetupRequest ¶
SetupRequest represents the setup API request.
type SetupResponse ¶
type SetupResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
ClientID string `json:"client_id,omitempty"`
Applications []Application `json:"applications,omitempty"`
Grants []Grant `json:"grants,omitempty"`
Error string `json:"error,omitempty"`
}
SetupResponse represents the setup API response.