Documentation
¶
Index ¶
- func BuildCanvasURL(ctx core.CommandContext, orgID, canvasID string) string
- func ChangeManagementEnabled(ctx core.CommandContext, appID string) (bool, error)
- func DescribeAppVersionByID(ctx core.CommandContext, appID string, versionID string) (openapi_client.CanvasesCanvasVersion, error)
- func EnsureCurrentUserDraftVersionID(ctx core.CommandContext, appID string) (string, error)
- func FindAppID(ctx core.CommandContext, client *openapi_client.APIClient, nameOrID string) (string, error)
- func FindCurrentUserDraftVersionID(ctx core.CommandContext, appID string) (string, error)
- func FindOwnedDraftVersionID(ctx core.CommandContext, appID string, userID string) (string, error)
- func ResolveAppNameOrIDArg(ctx core.CommandContext, arg string) (string, error)
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 ¶
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.