MCPcopy Create free account
hub / github.com/compozy/agh / buildTaskBridgeNotificationSubscriptionListQuery

Function buildTaskBridgeNotificationSubscriptionListQuery

internal/cli/task.go:940–967  ·  view source on GitHub ↗
(
	bridgeInstanceID string,
	scopeRaw string,
	workspaceID string,
	last int,
)

Source from the content-addressed store, hash-verified

938}
939
940func buildTaskBridgeNotificationSubscriptionListQuery(
941 bridgeInstanceID string,
942 scopeRaw string,
943 workspaceID string,
944 last int,
945) (TaskBridgeNotificationSubscriptionQuery, error) {
946 if last < 0 {
947 return TaskBridgeNotificationSubscriptionQuery{}, errors.New(
948 "cli: --last must be zero or positive",
949 )
950 }
951 query := TaskBridgeNotificationSubscriptionQuery{
952 BridgeInstanceID: strings.TrimSpace(bridgeInstanceID),
953 WorkspaceID: strings.TrimSpace(workspaceID),
954 Limit: last,
955 }
956 if trimmed := strings.TrimSpace(scopeRaw); trimmed != "" {
957 scope := bridgepkg.Scope(trimmed).Normalize()
958 if err := scope.Validate(); err != nil {
959 return TaskBridgeNotificationSubscriptionQuery{}, fmt.Errorf(
960 "cli: invalid notification scope: %w",
961 err,
962 )
963 }
964 query.Scope = scope
965 }
966 return query, nil
967}
968
969func newTaskReviewCommand(deps commandDeps) *cobra.Command {
970 cmd := &cobra.Command{

Callers 1

Calls 3

ScopeMethod · 0.80
ValidateMethod · 0.65
NormalizeMethod · 0.45

Tested by

no test coverage detected