cli

package
v0.0.0-...-17a9677 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Dir         string
	In          io.Reader
	Out         io.Writer
	Err         io.Writer
	Interactive bool

	HTTP        *http.Client
	OpenBrowser func(string) error
	// contains filtered or unexported fields
}

func New

func New(in io.Reader, out, stderr io.Writer) (*App, error)

func (*App) Execute

func (a *App) Execute(ctx context.Context, args []string, version string) error

type Capabilities

type Capabilities struct {
	Version           int   `json:"version"`
	Sites             bool  `json:"sites"`
	Files             bool  `json:"files"`
	Database          bool  `json:"database"`
	Realtime          bool  `json:"realtime"`
	Identity          bool  `json:"identity,omitempty"`
	AccessControl     bool  `json:"accessControl,omitempty"`
	PermissionVersion int   `json:"permissionVersion,omitempty"`
	Publishing        bool  `json:"publishing,omitempty"`
	Artifacts         bool  `json:"artifacts,omitempty"`
	Actions           bool  `json:"actions,omitempty"`
	MaxUploadBytes    int64 `json:"maxUploadBytes"`
}

func (*Capabilities) UnmarshalJSON

func (c *Capabilities) UnmarshalJSON(data []byte) error

UnmarshalJSON requires the original capabilities and tolerates new ones, so platform upgrades do not break installed CLIs.

type Connection

type Connection struct {
	Version       int             `json:"version"`
	Name          string          `json:"name"`
	Server        string          `json:"server"`
	SiteBaseURL   string          `json:"siteBaseURL"`
	CLIReleaseURL string          `json:"cliReleaseURL,omitempty"`
	Resource      string          `json:"resource,omitempty"`
	ClientID      string          `json:"clientId,omitempty"`
	TenantID      string          `json:"tenantId,omitempty"`
	Auth          *hex.AuthConfig `json:"auth,omitempty"`
	Capabilities  *Capabilities   `json:"capabilities"`
	// LegacyPublishing is the storage destination older platforms advertised
	// and older CLIs saved in profiles. Publishing now goes through the API,
	// so it is accepted and ignored.
	LegacyPublishing json.RawMessage `json:"publishing,omitempty"`
}

type ExitError

type ExitError struct {
	Code int
}

func (*ExitError) Error

func (e *ExitError) Error() string

type Project

type Project struct {
	Workspace    *workspacePin `json:"workspace,omitempty"`
	Name         string        `json:"name"`
	Title        string        `json:"title,omitempty"`
	Description  string        `json:"description,omitempty"`
	Author       string        `json:"author,omitempty"`
	Discoverable *bool         `json:"discoverable,omitempty"`
	Directory    string        `json:"directory,omitempty"`
	Platform     string        `json:"platform,omitempty"`
	Server       string        `json:"server,omitempty"`
	SiteBaseURL  string        `json:"siteBaseURL,omitempty"`
	Resource     string        `json:"resource,omitempty"`
	// Access is the site's access policy, applied by the platform when the
	// site is published. The platform validates it.
	Access json.RawMessage `json:"access,omitempty"`
	// Actions are operations the app exposes to the CLI and agents, performed
	// by the platform on the app's documents. The platform validates them.
	Actions json.RawMessage `json:"actions,omitempty"`
	// Automations are metadata for scheduled or on-demand JavaScript scripts run
	// as the site; more can live one per file in automations/*.json.
	Automations json.RawMessage `json:"automations,omitempty"`

	// ClientID and TenantID come from the platform profile and select the
	// CLI's own browser sign-in.
	ClientID     string          `json:"-"`
	TenantID     string          `json:"-"`
	Auth         *hex.AuthConfig `json:"-"`
	Capabilities *Capabilities   `json:"-"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址