diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4208b5c..1b77f50 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.6.0" + ".": "0.7.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2f86aeb..0115b3b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 36 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-8667763c416101820f5086c97d542bf13bb3bb12b57f5f604da671d9dcea0599.yml -openapi_spec_hash: e33db883d584bc8573897391f3edb105 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-66a3bf68b47ba61c9b61406d36f614a079ff752b8964a8df8062e485391d5598.yml +openapi_spec_hash: b17d6cfe3710dd0605078f3907a1a419 config_hash: 7ec4851ee8d93177947e95df5ae897b5 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f2322e..e39b816 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.7.0 (2026-06-30) + +Full Changelog: [v0.6.0...v0.7.0](https://github.com/context-dot-dev/context-dev-cli/compare/v0.6.0...v0.7.0) + +### Features + +* **api:** api update ([6b8d1cc](https://github.com/context-dot-dev/context-dev-cli/commit/6b8d1cc9593681bdee01369a730094ebca3d6fc4)) +* **api:** api update ([1722d54](https://github.com/context-dot-dev/context-dev-cli/commit/1722d543bb09c25729bf6af74de4642c77b3b078)) + ## 0.6.0 (2026-06-29) Full Changelog: [v0.5.0...v0.6.0](https://github.com/context-dot-dev/context-dev-cli/compare/v0.5.0...v0.6.0) diff --git a/go.mod b/go.mod index 2c82bc4..a986fba 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/charmbracelet/bubbletea v1.3.6 github.com/charmbracelet/lipgloss v1.1.0 github.com/charmbracelet/x/term v0.2.1 - github.com/context-dot-dev/context-go-sdk v1.3.0 + github.com/context-dot-dev/context-go-sdk v1.4.0 github.com/goccy/go-yaml v1.18.0 github.com/itchyny/json2yaml v0.1.4 github.com/muesli/reflow v0.3.0 diff --git a/go.sum b/go.sum index e806734..4ca6f33 100644 --- a/go.sum +++ b/go.sum @@ -18,8 +18,8 @@ github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91 h1:payR github.com/charmbracelet/x/exp/golden v0.0.0-20241011142426-46044092ad91/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/term v0.2.1 h1:AQeHeLZ1OqSXhrAWpYUtZyX1T3zVxfpZuEQMIQaGIAQ= github.com/charmbracelet/x/term v0.2.1/go.mod h1:oQ4enTYFV7QN4m0i9mzHrViD7TQKvNEEkHUMCmsxdUg= -github.com/context-dot-dev/context-go-sdk v1.3.0 h1:OyRxjHshWXnF8At15QOLpYJ5913Ytt7az7PviGVxbJA= -github.com/context-dot-dev/context-go-sdk v1.3.0/go.mod h1:YwbwUXSpQRB5LdVmgyIyZhIgKyulaeQmVWxylI4KE54= +github.com/context-dot-dev/context-go-sdk v1.4.0 h1:UiQeIP5oCFIRpgklVo+tlZahUh9AsqVi3vek2kLYqSE= +github.com/context-dot-dev/context-go-sdk v1.4.0/go.mod h1:YwbwUXSpQRB5LdVmgyIyZhIgKyulaeQmVWxylI4KE54= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/pkg/cmd/monitor.go b/pkg/cmd/monitor.go index a66a8ee..8754aff 100644 --- a/pkg/cmd/monitor.go +++ b/pkg/cmd/monitor.go @@ -21,7 +21,7 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{ Flags: []cli.Flag{ &requestflag.Flag[map[string]any]{ Name: "change-detection", - Usage: "Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.", + Usage: "Discriminated union describing how changes are detected.", Required: true, BodyPath: "change_detection", }, @@ -38,9 +38,15 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{ }, &requestflag.Flag[map[string]any]{ Name: "target", + Usage: "Discriminated union describing what the monitor watches.", Required: true, BodyPath: "target", }, + &requestflag.Flag[string]{ + Name: "mode", + Usage: "Top-level monitor category. Always `web` today; the concrete behavior is described by `target` and `change_detection`.", + BodyPath: "mode", + }, &requestflag.Flag[[]string]{ Name: "tag", Usage: "User-defined tags for grouping and filtering monitors and their changes.", @@ -54,13 +60,6 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{ Action: handleMonitorsCreate, HideHelpCommand: true, }, map[string][]requestflag.HasOuterFlag{ - "change-detection": { - &requestflag.InnerFlag[string]{ - Name: "change-detection.type", - Usage: `Allowed values: "exact".`, - InnerField: "type", - }, - }, "schedule": { &requestflag.InnerFlag[int64]{ Name: "schedule.frequency", @@ -78,22 +77,6 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{ InnerField: "unit", }, }, - "target": { - &requestflag.InnerFlag[string]{ - Name: "target.type", - Usage: `Allowed values: "page".`, - InnerField: "type", - }, - &requestflag.InnerFlag[string]{ - Name: "target.url", - InnerField: "url", - }, - &requestflag.InnerFlag[bool]{ - Name: "target.normalize-whitespace", - Usage: "Normalize whitespace before comparing or analyzing text.", - InnerField: "normalize_whitespace", - }, - }, "webhook": { &requestflag.InnerFlag[string]{ Name: "webhook.url", @@ -204,7 +187,7 @@ var monitorsUpdate = requestflag.WithInnerFlags(cli.Command{ var monitorsList = cli.Command{ Name: "list", - Usage: "List monitors", + Usage: "Lists monitors for the authenticated organization. Supports free-text search\n(`q` over `search_by` fields, `prefix` or `exact` via `search_type`) plus\nstatus/type/tag filters. Results are paginated via the opaque `cursor`.", Suggest: true, Flags: []cli.Flag{ &requestflag.Flag[string]{ @@ -221,6 +204,22 @@ var monitorsList = cli.Command{ Default: 25, QueryPath: "limit", }, + &requestflag.Flag[string]{ + Name: "q", + Usage: "Free-text search term, matched against the fields named in `search_by`.", + QueryPath: "q", + }, + &requestflag.Flag[[]string]{ + Name: "search-by", + Usage: "Comma-separated fields to search with `q`. Defaults to all of them. Note `query` only exists on semantic monitors.", + QueryPath: "search_by", + }, + &requestflag.Flag[string]{ + Name: "search-type", + Usage: "`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.", + Default: "prefix", + QueryPath: "search_type", + }, &requestflag.Flag[string]{ Name: "status", Usage: `Allowed values: "active", "paused", "failed".`, @@ -231,6 +230,11 @@ var monitorsList = cli.Command{ Usage: "Filter to items that have this tag.", QueryPath: "tag", }, + &requestflag.Flag[[]string]{ + Name: "tag", + Usage: "Comma-separated list of tags to filter by (matches monitors having any of them).", + QueryPath: "tags", + }, &requestflag.Flag[string]{ Name: "target-type", Usage: `Allowed values: "page", "sitemap", "extract".`, diff --git a/pkg/cmd/monitor_test.go b/pkg/cmd/monitor_test.go index 6c2dd0d..5745c6a 100644 --- a/pkg/cmd/monitor_test.go +++ b/pkg/cmd/monitor_test.go @@ -17,9 +17,10 @@ func TestMonitorsCreate(t *testing.T) { "--api-key", "string", "monitors", "create", "--change-detection", "{type: exact}", - "--name", "Acme pricing monitor", + "--name", "Acme pricing page", "--schedule", "{frequency: 6, type: interval, unit: hours}", "--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}", + "--mode", "web", "--tag", "pricing", "--tag", "competitor", "--webhook", "{url: https://example.com/webhook}", @@ -35,14 +36,13 @@ func TestMonitorsCreate(t *testing.T) { t, "--api-key", "string", "monitors", "create", - "--change-detection.type", "exact", - "--name", "Acme pricing monitor", + "--change-detection", "{type: exact}", + "--name", "Acme pricing page", "--schedule.frequency", "6", "--schedule.type", "interval", "--schedule.unit", "hours", - "--target.type", "page", - "--target.url", "https://acme.com/pricing", - "--target.normalize-whitespace=true", + "--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}", + "--mode", "web", "--tag", "pricing", "--tag", "competitor", "--webhook.url", "https://example.com/webhook", @@ -54,7 +54,7 @@ func TestMonitorsCreate(t *testing.T) { pipeData := []byte("" + "change_detection:\n" + " type: exact\n" + - "name: Acme pricing monitor\n" + + "name: Acme pricing page\n" + "schedule:\n" + " frequency: 6\n" + " type: interval\n" + @@ -63,6 +63,7 @@ func TestMonitorsCreate(t *testing.T) { " type: page\n" + " url: https://acme.com/pricing\n" + " normalize_whitespace: true\n" + + "mode: web\n" + "tags:\n" + " - pricing\n" + " - competitor\n" + @@ -169,8 +170,12 @@ func TestMonitorsList(t *testing.T) { "--change-detection-type", "exact", "--cursor", "cursor", "--limit", "1", + "--q", "q", + "--search-by", "name", + "--search-type", "exact", "--status", "active", "--tag", "tag", + "--tag", "string", "--target-type", "page", ) }) diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index c1f2884..f37c8ca 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "0.6.0" // x-release-please-version +const Version = "0.7.0" // x-release-please-version