common

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCanvasURL

func BuildCanvasURL(ctx core.CommandContext, orgID, canvasID string) string

BuildCanvasURL composes the canonical web URL for a canvas. Returns "" when the context, base URL, organization id, or canvas 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 ChangeManagementEnabled

func ChangeManagementEnabled(ctx core.CommandContext, appID string) (bool, error)

ChangeManagementEnabled reports whether change management is enabled on the app identified by `appID`.

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 EnsureCurrentUserDraftVersionID

func EnsureCurrentUserDraftVersionID(ctx core.CommandContext, appID string) (string, error)

EnsureCurrentUserDraftVersionID returns the id of the current user's draft version, creating one if it does not yet exist.

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 FindCurrentUserDraftVersionID

func FindCurrentUserDraftVersionID(ctx core.CommandContext, appID string) (string, error)

FindCurrentUserDraftVersionID returns the id of the first non-published app version visible to the current user, or an empty string if none exists. It does not create a draft.

func FindOwnedDraftVersionID

func FindOwnedDraftVersionID(ctx core.CommandContext, appID string, userID string) (string, error)

FindOwnedDraftVersionID walks the version history (paginated) and returns the id of the latest non-published version whose owner matches `userID`, or an empty string when none is found.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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