Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,6 @@ hookdeck connection enable # Enable a connection
hookdeck connection disable # Disable a connection
hookdeck connection pause # Pause a connection
hookdeck connection unpause # Unpause a connection
hookdeck connection archive # Archive a connection
hookdeck connection unarchive # Unarchive a connection
```

### Manage active project
Expand Down Expand Up @@ -724,9 +722,8 @@ $ hookdeck connection list --destination dest_xyz789
# Filter by name pattern
$ hookdeck connection list --name "production-*"

# Include disabled or paused connections
# Include disabled connections
$ hookdeck connection list --disabled
$ hookdeck connection list --paused

# Output as JSON
$ hookdeck connection list --output json
Expand Down Expand Up @@ -763,18 +760,11 @@ $ hookdeck connection pause conn_123abc

# Resume a paused connection
$ hookdeck connection unpause conn_123abc

# Archive a connection (hide from main lists)
$ hookdeck connection archive conn_123abc

# Restore an archived connection
$ hookdeck connection unarchive conn_123abc
```

**State differences:**
- **Disabled**: Connection stops receiving events entirely
- **Paused**: Connection queues events but doesn't forward them (useful during maintenance)
- **Archived**: Connection is hidden from main lists but can be restored

#### Delete a connection

Expand Down
72 changes: 29 additions & 43 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ All commands support these global options:
--help, -h Show help information
```

### 🚧 Planned Global Options
### 🔄 Partially Implemented Options
```bash
--output json Output in JSON format (available on: connection create/list/get/upsert)
Default: human-readable format
```

### � Planned Global Options
```bash
--project string Project ID to use (overrides profile)
--format string Output format: table, json, yaml (default "table")
--output string Additional output formats: table, yaml (currently only json supported)
```

## Authentication
Expand Down Expand Up @@ -293,7 +299,7 @@ The Hookdeck CLI provides comprehensive connection management capabilities. The
| Project Management | 🔄 **Partial** | `project list`, `project use` |
| Local Development | ✅ **Current** | `listen` |
| CI/CD | ✅ **Current** | `ci` |
| Connection Management | ✅ **Current** | `connection create`, `connection list`, `connection get`, `connection upsert`, `connection delete`, `connection enable`, `connection disable`, `connection pause`, `connection unpause`, `connection archive`, `connection unarchive` |
| Connection Management | ✅ **Current** | `connection create`, `connection list`, `connection get`, `connection upsert`, `connection delete`, `connection enable`, `connection disable`, `connection pause`, `connection unpause` |
| Shell Completion | ✅ **Current** | `completion` (bash, zsh) |
| Source Management | 🚧 **Planned** | *(Not implemented)* |
| Destination Management | 🚧 **Planned** | *(Not implemented)* |
Expand Down Expand Up @@ -450,7 +456,7 @@ hookdeck project delete proj_123 --force
<source-id> # Required positional argument for source ID
--force # Force delete without confirmation (boolean flag)

# Source enable/disable/archive/unarchive command parameters
# Source enable/disable command parameters
<source-id> # Required positional argument for source ID
```

Expand Down Expand Up @@ -662,12 +668,6 @@ hookdeck source enable <source-id>

# Disable source
hookdeck source disable <source-id>

# Archive source
hookdeck source archive <source-id>

# Unarchive source
hookdeck source unarchive <source-id>
```

## Destinations
Expand Down Expand Up @@ -729,7 +729,7 @@ hookdeck source unarchive <source-id>
<destination-id> # Required positional argument for destination ID
--force # Force delete without confirmation (boolean flag)

# Destination enable/disable/archive/unarchive command parameters
# Destination enable/disable command parameters
<destination-id> # Required positional argument for destination ID
```

Expand Down Expand Up @@ -863,12 +863,6 @@ hookdeck destination enable <destination-id>

# Disable destination
hookdeck destination disable <destination-id>

# Archive destination
hookdeck destination archive <destination-id>

# Unarchive destination
hookdeck destination unarchive <destination-id>
```

## Connections
Expand All @@ -883,7 +877,6 @@ hookdeck destination unarchive <destination-id>
- `connection delete` - Delete connections with confirmation
- `connection enable/disable` - Control connection state
- `connection pause/unpause` - Pause/resume event processing
- `connection archive/unarchive` - Archive inactive connections

**Implementation Status:**
- ✅ Full CRUD operations
Expand All @@ -902,36 +895,34 @@ hookdeck destination unarchive <destination-id>
# List all connections
hookdeck connection list

# Filter by source
hookdeck connection list --source src_abc123
# Filter by source ID
hookdeck connection list --source-id src_abc123

# Filter by destination
hookdeck connection list --destination dest_xyz789
# Filter by destination ID
hookdeck connection list --destination-id dest_xyz789

# Filter by name pattern
hookdeck connection list --name "production-*"
# Filter by connection name
hookdeck connection list --name "production-connection"

# Include disabled connections
hookdeck connection list --disabled

# Include paused connections
hookdeck connection list --paused
# Combine filters
hookdeck connection list --source-id src_abc123 --disabled

# Include archived connections
hookdeck connection list --archived
# Limit results
hookdeck connection list --limit 50

# Combine filters
hookdeck connection list --source src_abc123 --disabled
# Output as JSON
hookdeck connection list --output json
```

**Available Flags:**
- `--source <id-or-name>` - Filter by source ID or name
- `--destination <id-or-name>` - Filter by destination ID or name
- `--name <pattern>` - Filter by connection name
- `--full-name <pattern>` - Filter by full connection name (source > connection > destination)
- `--disabled` - Show only disabled connections
- `--paused` - Show only paused connections
- `--archived` - Show only archived connections
- `--name <string>` - Filter by connection name
- `--source-id <string>` - Filter by source ID
- `--destination-id <string>` - Filter by destination ID
- `--disabled` - Include disabled connections
- `--limit <int>` - Limit number of results (default: 100)
- `--output json` - Output in JSON format

### Get Connection
Expand Down Expand Up @@ -1236,16 +1227,11 @@ hookdeck connection enable conn_abc123
# Pause/Unpause (queue events without forwarding)
hookdeck connection pause conn_abc123
hookdeck connection unpause conn_abc123

# Archive/Unarchive (for inactive connections)
hookdeck connection archive conn_abc123
hookdeck connection unarchive conn_abc123
```

**State Differences:**
- **Disabled**: Connection stops receiving events entirely
- **Paused**: Connection queues events but doesn't forward them
- **Archived**: Connection is hidden from main lists but can be restored

### Implementation Notes

Expand All @@ -1254,7 +1240,7 @@ hookdeck connection unarchive conn_abc123
- Inline resource creation with authentication
- All 5 rule types (retry, filter, transform, delay, deduplicate)
- Rate limiting configuration
- Lifecycle management (enable, disable, pause, unpause, archive, unarchive)
- Lifecycle management (enable, disable, pause, unpause)
- Idempotent upsert with dry-run support
- 21 acceptance tests, all passing

Expand Down
2 changes: 0 additions & 2 deletions pkg/cmd/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ https://github.com/hookdeck/hookdeck-cli/issues`,
cc.cmd.AddCommand(newConnectionDisableCmd().cmd)
cc.cmd.AddCommand(newConnectionPauseCmd().cmd)
cc.cmd.AddCommand(newConnectionUnpauseCmd().cmd)
cc.cmd.AddCommand(newConnectionArchiveCmd().cmd)
cc.cmd.AddCommand(newConnectionUnarchiveCmd().cmd)

return cc
}
48 changes: 0 additions & 48 deletions pkg/cmd/connection_archive.go

This file was deleted.

25 changes: 15 additions & 10 deletions pkg/cmd/connection_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ type connectionListCmd struct {
sourceID string
destinationID string
disabled bool
paused bool
limit int
output string
}
Expand Down Expand Up @@ -50,9 +49,6 @@ Examples:
# Include disabled connections
hookdeck connection list --disabled

# Include paused connections
hookdeck connection list --paused

# Limit results
hookdeck connection list --limit 10`,
RunE: cc.runConnectionListCmd,
Expand All @@ -62,7 +58,6 @@ Examples:
cc.cmd.Flags().StringVar(&cc.sourceID, "source-id", "", "Filter by source ID")
cc.cmd.Flags().StringVar(&cc.destinationID, "destination-id", "", "Filter by destination ID")
cc.cmd.Flags().BoolVar(&cc.disabled, "disabled", false, "Include disabled connections")
cc.cmd.Flags().BoolVar(&cc.paused, "paused", false, "Include paused connections")
cc.cmd.Flags().IntVar(&cc.limit, "limit", 100, "Limit number of results")
cc.cmd.Flags().StringVar(&cc.output, "output", "", "Output format (json)")

Expand Down Expand Up @@ -91,14 +86,24 @@ func (cc *connectionListCmd) runConnectionListCmd(cmd *cobra.Command, args []str
params["destination_id"] = cc.destinationID
}

if !cc.disabled {
// API behavior (tested in test-scripts/test-disabled-behavior.sh):
// - NO parameter: Returns ALL connections (both active and disabled)
// - disabled=false: Returns ONLY active connections (excludes disabled)
// - disabled=true: Returns ALL connections (both active and disabled)
//
// CLI behavior (from test expectations):
// - --disabled flag present: Include ALL connections (both active and disabled)
// - --disabled flag absent: Include only active connections
//
// Therefore:
// - When --disabled flag is PRESENT: Send disabled=true (to get all)
// - When --disabled flag is ABSENT: Send disabled=false (to exclude disabled)
if cc.disabled {
params["disabled"] = "true"
} else {
params["disabled"] = "false"
}

if !cc.paused {
params["paused"] = "false"
}

params["limit"] = strconv.Itoa(cc.limit)

// List connections
Expand Down
48 changes: 0 additions & 48 deletions pkg/cmd/connection_unarchive.go

This file was deleted.

Loading