Documentation
¶
Index ¶
- Constants
- func BuildAppURL(ctx core.CommandContext, orgID, canvasID string) string
- func CommitCanvasStaging(ctx core.CommandContext, canvasID, commitMessage string) (*openapi_client.CanvasesCommitCanvasStagingResponse, error)
- func DescribeAppVersionByID(ctx core.CommandContext, appID string, versionID string) (openapi_client.CanvasesCanvasVersion, error)
- func DiscardCanvasStaging(ctx core.CommandContext, canvasID string) error
- func EnsureLiveVersionID(ctx core.CommandContext, appID string) (string, error)
- func FetchRepositoryFile(ctx core.CommandContext, canvasID, path, versionID string) ([]byte, error)
- func FindAppID(ctx core.CommandContext, client *openapi_client.APIClient, nameOrID string) (string, error)
- func GetCanvasStaging(ctx core.CommandContext, appID string) (openapi_client.CanvasesStagingSummary, error)
- func NormalizeRepositoryPath(path string) string
- func RepositoryPathFromLocalFile(localPath string) string
- func RequireCommitMessage(message string) (string, error)
- func ResolveAppNameOrIDArg(ctx core.CommandContext, arg string) (string, error)
- func ResolveLiveVersionID(ctx core.CommandContext, appID, versionID string) (string, error)
- func StageRepositoryFiles(ctx core.CommandContext, canvasID string, files []RepositoryFileStaging) error
- func StageRepositorySpecFile(ctx core.CommandContext, canvasID string, path string, content []byte) error
- type RepositoryFileStaging
Constants ¶
const ( CanvasYAMLRepositoryPath = "canvas.yaml" ConsoleYAMLRepositoryPath = "console.yaml" )
Variables ¶
This section is empty.
Functions ¶
func BuildAppURL ¶ added in v0.25.0
func BuildAppURL(ctx core.CommandContext, orgID, canvasID string) string
BuildCanvasURL composes the canonical web URL for an app. Returns "" when the context, base URL, organization id, or app id is missing so callers can omit the URL output without erroring.
orgID and canvasID should come from the API response (canvas metadata) rather than the local CLI context, so the URL stays correct even if the active context drifts.
func CommitCanvasStaging ¶ added in v0.28.0
func CommitCanvasStaging(ctx core.CommandContext, canvasID, commitMessage string) (*openapi_client.CanvasesCommitCanvasStagingResponse, error)
CommitCanvasStaging commits staged edits to main with the given message.
func DescribeAppVersionByID ¶
func DescribeAppVersionByID( ctx core.CommandContext, appID string, versionID string, ) (openapi_client.CanvasesCanvasVersion, error)
DescribeAppVersionByID loads a specific app version and errors when the response does not include one.
func DiscardCanvasStaging ¶ added in v0.28.0
func DiscardCanvasStaging(ctx core.CommandContext, canvasID string) error
DiscardCanvasStaging discards all staged edits for the current user.
func EnsureLiveVersionID ¶ added in v0.28.0
func EnsureLiveVersionID(ctx core.CommandContext, appID string) (string, error)
EnsureLiveVersionID returns the newest committed version id for an app.
func FetchRepositoryFile ¶ added in v0.25.1
func FetchRepositoryFile(ctx core.CommandContext, canvasID, path, versionID string) ([]byte, error)
func FindAppID ¶
func FindAppID(ctx core.CommandContext, client *openapi_client.APIClient, nameOrID string) (string, error)
FindAppID returns the app id for the given name or UUID. If `nameOrID` parses as a UUID, it is returned unchanged. Otherwise the CLI looks up apps by name and requires exactly one match.
func GetCanvasStaging ¶ added in v0.28.0
func GetCanvasStaging(ctx core.CommandContext, appID string) (openapi_client.CanvasesStagingSummary, error)
GetCanvasStaging loads the current user's staging summary for an app.
func NormalizeRepositoryPath ¶ added in v0.28.0
NormalizeRepositoryPath returns a repository-relative path.
func RepositoryPathFromLocalFile ¶ added in v0.28.0
RepositoryPathFromLocalFile maps a local file path to its repository path.
func RequireCommitMessage ¶ added in v0.28.0
RequireCommitMessage validates a commit message flag value.
func ResolveAppNameOrIDArg ¶
func ResolveAppNameOrIDArg(ctx core.CommandContext, arg string) (string, error)
ResolveAppNameOrIDArg returns the app id for `arg`, falling back to the active app configured for the user when `arg` is empty. It returns a friendly error when neither is available so callers can surface the same message across commands.
func ResolveLiveVersionID ¶ added in v0.28.0
func ResolveLiveVersionID(ctx core.CommandContext, appID, versionID string) (string, error)
ResolveLiveVersionID validates an optional explicit version id against the app history and returns the resolved live version id.
func StageRepositoryFiles ¶ added in v0.28.0
func StageRepositoryFiles(ctx core.CommandContext, canvasID string, files []RepositoryFileStaging) error
StageRepositoryFiles writes one or more repository files into per-user staging.
func StageRepositorySpecFile ¶ added in v0.28.0
func StageRepositorySpecFile( ctx core.CommandContext, canvasID string, path string, content []byte, ) error
StageRepositorySpecFile writes a repository spec file into per-user staging.