diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2601677..d0ab664 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.1.0" + ".": "1.2.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0ac1eb3..86253ea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 32 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-242450ea46eb8c3e843fd6c4bf87e73192b5f62f6da697cd091d13c6aa7a991b.yml -openapi_spec_hash: c1c561976de1abcacede71fd5ab9b3d9 -config_hash: 70e7e80b5e87f94981bee396c6cd41e8 +configured_endpoints: 37 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-cdff38301573d05fdad8416847402472ff6cb1ce75a9de9f99e8673ddec7c4a6.yml +openapi_spec_hash: 387fe6f53599abb0341764e00bcd0b26 +config_hash: 2bea1743c84d63bd61f8501a6ea63065 diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf7d1e..b6a693c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 1.2.0 (2026-07-30) + +Full Changelog: [v1.1.0...v1.2.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.1.0...v1.2.0) + +### Features + +* **api:** api update ([ccba916](https://github.com/context-dot-dev/context-dev-cli/commit/ccba91605a6095370892bec901f58a75f91a04c6)) +* **api:** api update ([b8de4ec](https://github.com/context-dot-dev/context-dev-cli/commit/b8de4ec1e8a39c97e3bbf04dd259c9fa3e8aa44f)) +* **api:** api update ([3c2c3c2](https://github.com/context-dot-dev/context-dev-cli/commit/3c2c3c2daf40ad8df4df6b9861ed88291b539f91)) +* **api:** api update ([0b487b1](https://github.com/context-dot-dev/context-dev-cli/commit/0b487b175434d6db1ce66501382164a55b68c557)) +* **api:** manual updates ([5b0ef3e](https://github.com/context-dot-dev/context-dev-cli/commit/5b0ef3ebae76534b4a1997d4e13311cc225bb555)) + + +### Chores + +* **internal:** codegen related update ([87780eb](https://github.com/context-dot-dev/context-dev-cli/commit/87780eb7d4bbb0df65fde3ecfbc74bfa191c04b7)) + ## 1.1.0 (2026-07-22) Full Changelog: [v1.0.0...v1.1.0](https://github.com/context-dot-dev/context-dev-cli/compare/v1.0.0...v1.1.0) diff --git a/go.mod b/go.mod index a000854..12f3f67 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/v2 v2.4.0 + github.com/context-dot-dev/context-go-sdk/v2 v2.5.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 e9ff7cd..2e31ee8 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/v2 v2.4.0 h1:mehuyGuUzgflR7rQpSlPaH7lNj2A8hdtf1+WG4U4h1I= -github.com/context-dot-dev/context-go-sdk/v2 v2.4.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8= +github.com/context-dot-dev/context-go-sdk/v2 v2.5.0 h1:FK79MDMznyABXAUjRGO44Xmvl6Bi0nz1HBSlwYyMU6U= +github.com/context-dot-dev/context-go-sdk/v2 v2.5.0/go.mod h1:CvRANWLP0FHj5XyUwzEVX79ujdwr/2Jy375UVzKNQm8= 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/batch.go b/pkg/cmd/batch.go new file mode 100644 index 0000000..d95a1ff --- /dev/null +++ b/pkg/cmd/batch.go @@ -0,0 +1,362 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "context" + "fmt" + + "github.com/context-dot-dev/context-dev-cli/internal/apiquery" + "github.com/context-dot-dev/context-dev-cli/internal/requestflag" + "github.com/context-dot-dev/context-go-sdk/v2" + "github.com/context-dot-dev/context-go-sdk/v2/option" + "github.com/tidwall/gjson" + "github.com/urfave/cli/v3" +) + +var batchRetrieve = cli.Command{ + Name: "retrieve", + Usage: "Check progress and get download links when the batch finishes. Also returns the\nrejected-URL list and webhook signing secret from submission, so nothing is lost\nif the submit response was dropped.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[string]{ + Name: "batch-id", + Usage: "ID of the batch to retrieve or cancel.", + Required: true, + PathParam: "batch_id", + }, + }, + Action: handleBatchRetrieve, + HideHelpCommand: true, +} + +var batchList = cli.Command{ + Name: "list", + Usage: "List your batches from newest to oldest. Filter by status or continue with a\ncursor.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[string]{ + Name: "cursor", + Usage: "Cursor from the previous page.", + QueryPath: "cursor", + }, + &requestflag.Flag[int64]{ + Name: "limit", + Usage: "Batches per page. Defaults to 25.", + QueryPath: "limit", + }, + &requestflag.Flag[string]{ + Name: "q", + Usage: "Free-text search term, matched against the batch id, crawl source (start URL or sitemap domain), and tags.", + QueryPath: "q", + }, + &requestflag.Flag[string]{ + Name: "search-type", + Usage: "`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.", + QueryPath: "search_type", + }, + &requestflag.Flag[string]{ + Name: "status", + Usage: "Filter by status.", + QueryPath: "status", + }, + &requestflag.Flag[string]{ + Name: "tags", + Usage: "Comma-separated list of tags to filter by (matches batches having any of them).", + QueryPath: "tags", + }, + }, + Action: handleBatchList, + HideHelpCommand: true, +} + +var batchCancel = cli.Command{ + Name: "cancel", + Usage: "Stop a batch from starting new pages. In-progress pages finish, and unused\ncredits are refunded.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[string]{ + Name: "batch-id", + Usage: "ID of the batch to retrieve or cancel.", + Required: true, + PathParam: "batch_id", + }, + }, + Action: handleBatchCancel, + HideHelpCommand: true, +} + +var batchGetResults = cli.Command{ + Name: "get-results", + Usage: "Page through the result records of a finished batch as JSON, in the same order\nas the downloadable result files. Use this instead of downloading and parsing\nthe NDJSON files yourself.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[string]{ + Name: "batch-id", + Usage: "ID of the batch to retrieve or cancel.", + Required: true, + PathParam: "batch_id", + }, + &requestflag.Flag[string]{ + Name: "cursor", + Usage: "next_cursor from the previous page.", + QueryPath: "cursor", + }, + &requestflag.Flag[int64]{ + Name: "limit", + Usage: "Records per page. Defaults to 25. A page can close early so its payload stays under ~8 MB; rely on next_cursor rather than counting records.", + QueryPath: "limit", + }, + }, + Action: handleBatchGetResults, + HideHelpCommand: true, +} + +var batchSubmit = requestflag.WithInnerFlags(cli.Command{ + Name: "submit", + Usage: "Retrieve and normalize a person profile from identifiers.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[map[string]any]{ + Name: "identifiers", + Usage: "Known identifiers for the person. At least one identifier is required.", + Required: true, + BodyPath: "identifiers", + }, + &requestflag.Flag[[]string]{ + Name: "tag", + Usage: "Optional tags for tracking usage. Up to 20 tags, each 1 to 50 characters.", + BodyPath: "tags", + }, + &requestflag.Flag[int64]{ + Name: "timeout-ms", + Usage: "Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).", + BodyPath: "timeoutMS", + }, + }, + Action: handleBatchSubmit, + HideHelpCommand: true, +}, map[string][]requestflag.HasOuterFlag{ + "identifiers": { + &requestflag.InnerFlag[string]{ + Name: "identifiers.linkedin-url", + Usage: "LinkedIn profile URL, e.g. https://www.linkedin.com/in/yahia-bakour/.", + InnerField: "linkedinUrl", + }, + }, +}) + +func handleBatchRetrieve(ctx context.Context, cmd *cli.Command) error { + client := contextdev.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + if !cmd.IsSet("batch-id") && len(unusedArgs) > 0 { + cmd.Set("batch-id", unusedArgs[0]) + unusedArgs = unusedArgs[1:] + } + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatBrackets, + apiquery.ArrayQueryFormatComma, + EmptyBody, + false, + ) + if err != nil { + return err + } + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Batch.Get(ctx, cmd.Value("batch-id").(string), options...) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "batch retrieve", + Transform: transform, + }) +} + +func handleBatchList(ctx context.Context, cmd *cli.Command) error { + client := contextdev.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatBrackets, + apiquery.ArrayQueryFormatComma, + EmptyBody, + false, + ) + if err != nil { + return err + } + + params := contextdev.BatchListParams{} + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Batch.List(ctx, params, options...) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "batch list", + Transform: transform, + }) +} + +func handleBatchCancel(ctx context.Context, cmd *cli.Command) error { + client := contextdev.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + if !cmd.IsSet("batch-id") && len(unusedArgs) > 0 { + cmd.Set("batch-id", unusedArgs[0]) + unusedArgs = unusedArgs[1:] + } + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatBrackets, + apiquery.ArrayQueryFormatComma, + EmptyBody, + false, + ) + if err != nil { + return err + } + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Batch.Cancel(ctx, cmd.Value("batch-id").(string), options...) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "batch cancel", + Transform: transform, + }) +} + +func handleBatchGetResults(ctx context.Context, cmd *cli.Command) error { + client := contextdev.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + if !cmd.IsSet("batch-id") && len(unusedArgs) > 0 { + cmd.Set("batch-id", unusedArgs[0]) + unusedArgs = unusedArgs[1:] + } + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatBrackets, + apiquery.ArrayQueryFormatComma, + EmptyBody, + false, + ) + if err != nil { + return err + } + + params := contextdev.BatchGetResultsParams{} + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Batch.GetResults( + ctx, + cmd.Value("batch-id").(string), + params, + options..., + ) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "batch get-results", + Transform: transform, + }) +} + +func handleBatchSubmit(ctx context.Context, cmd *cli.Command) error { + client := contextdev.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatBrackets, + apiquery.ArrayQueryFormatComma, + ApplicationJSON, + false, + ) + if err != nil { + return err + } + + params := contextdev.BatchSubmitParams{} + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Batch.Submit(ctx, params, options...) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "batch submit", + Transform: transform, + }) +} diff --git a/pkg/cmd/batch_test.go b/pkg/cmd/batch_test.go new file mode 100644 index 0000000..a14073e --- /dev/null +++ b/pkg/cmd/batch_test.go @@ -0,0 +1,112 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/context-dot-dev/context-dev-cli/internal/mocktest" + "github.com/context-dot-dev/context-dev-cli/internal/requestflag" +) + +func TestBatchRetrieve(t *testing.T) { + t.Skip("Mock server tests are disabled") + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "batch", "retrieve", + "--batch-id", "batch_9f2c8a", + ) + }) +} + +func TestBatchList(t *testing.T) { + t.Skip("Mock server tests are disabled") + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "batch", "list", + "--cursor", "cursor", + "--limit", "1", + "--q", "batch_1a2b", + "--search-type", "exact", + "--status", "queued", + "--tags", "docs,competitor", + ) + }) +} + +func TestBatchCancel(t *testing.T) { + t.Skip("Mock server tests are disabled") + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "batch", "cancel", + "--batch-id", "batch_9f2c8a", + ) + }) +} + +func TestBatchGetResults(t *testing.T) { + t.Skip("Mock server tests are disabled") + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "batch", "get-results", + "--batch-id", "batch_9f2c8a", + "--cursor", "cursor", + "--limit", "1", + ) + }) +} + +func TestBatchSubmit(t *testing.T) { + t.Skip("Mock server tests are disabled") + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "batch", "submit", + "--identifiers", "{linkedinUrl: https://www.linkedin.com/in/yahia-bakour/}", + "--tag", "production", + "--tag", "team-alpha", + "--timeout-ms", "1000", + ) + }) + + t.Run("inner flags", func(t *testing.T) { + // Check that inner flags have been set up correctly + requestflag.CheckInnerFlags(batchSubmit) + + // Alternative argument passing style using inner flags + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "batch", "submit", + "--identifiers.linkedin-url", "https://www.linkedin.com/in/yahia-bakour/", + "--tag", "production", + "--tag", "team-alpha", + "--timeout-ms", "1000", + ) + }) + + t.Run("piping data", func(t *testing.T) { + // Test piping YAML data over stdin + pipeData := []byte("" + + "identifiers:\n" + + " linkedinUrl: https://www.linkedin.com/in/yahia-bakour/\n" + + "tags:\n" + + " - production\n" + + " - team-alpha\n" + + "timeoutMS: 1000\n") + mocktest.TestRunMockTestWithPipeAndFlags( + t, pipeData, + "--api-key", "string", + "batch", "submit", + ) + }) +} diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index c17a6f6..a90d921 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -165,6 +165,18 @@ func init() { &monitorsRun, }, }, + { + Name: "batch", + Category: "API RESOURCE", + Suggest: true, + Commands: []*cli.Command{ + &batchRetrieve, + &batchList, + &batchCancel, + &batchGetResults, + &batchSubmit, + }, + }, { Name: "@manpages", Usage: "Generate documentation for 'man'", diff --git a/pkg/cmd/monitor.go b/pkg/cmd/monitor.go index 1842db3..fac0f1c 100644 --- a/pkg/cmd/monitor.go +++ b/pkg/cmd/monitor.go @@ -19,34 +19,32 @@ var monitorsCreate = requestflag.WithInnerFlags(cli.Command{ Usage: "Creates a monitor. The request body is a union of the supported target/change\ndetection combinations. The monitor runs immediately after creation to create\nits initial baseline.", Suggest: true, Flags: []cli.Flag{ - &requestflag.Flag[map[string]any]{ - Name: "change-detection", - Usage: "Discriminated union describing how changes are detected.", - Required: true, - BodyPath: "change_detection", - }, &requestflag.Flag[string]{ Name: "name", Required: true, BodyPath: "name", }, - &requestflag.Flag[map[string]any]{ - Name: "schedule", - Usage: "Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.", - Required: true, - BodyPath: "schedule", - }, &requestflag.Flag[map[string]any]{ Name: "target", Usage: "Discriminated union describing what the monitor watches.", Required: true, BodyPath: "target", }, + &requestflag.Flag[map[string]any]{ + Name: "change-detection", + Usage: "Discriminated union describing how changes are detected.", + BodyPath: "change_detection", + }, &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[map[string]any]{ + Name: "schedule", + Usage: "Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.", + BodyPath: "schedule", + }, &requestflag.Flag[[]string]{ Name: "tag", Usage: "User-defined tags for grouping and filtering monitors and their changes. Duplicates are removed.", diff --git a/pkg/cmd/monitor_test.go b/pkg/cmd/monitor_test.go index 40e2c3c..983650e 100644 --- a/pkg/cmd/monitor_test.go +++ b/pkg/cmd/monitor_test.go @@ -16,11 +16,11 @@ func TestMonitorsCreate(t *testing.T) { t, "--api-key", "string", "monitors", "create", - "--change-detection", "{type: exact}", "--name", "Acme pricing page", - "--schedule", "{frequency: 6, type: interval, unit: hours}", - "--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}", + "--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}", + "--change-detection", "{type: exact}", "--mode", "web", + "--schedule", "{frequency: 6, type: interval, unit: hours}", "--tag", "pricing", "--tag", "competitor", "--webhook", "{url: https://example.com/webhook, events: [change.detected, run.completed]}", @@ -36,13 +36,13 @@ func TestMonitorsCreate(t *testing.T) { t, "--api-key", "string", "monitors", "create", - "--change-detection", "{type: exact}", "--name", "Acme pricing page", + "--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}", + "--change-detection", "{type: exact}", + "--mode", "web", "--schedule.frequency", "6", "--schedule.type", "interval", "--schedule.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", @@ -53,18 +53,21 @@ func TestMonitorsCreate(t *testing.T) { t.Run("piping data", func(t *testing.T) { // Test piping YAML data over stdin pipeData := []byte("" + - "change_detection:\n" + - " type: exact\n" + "name: Acme pricing page\n" + - "schedule:\n" + - " frequency: 6\n" + - " type: interval\n" + - " unit: hours\n" + "target:\n" + " type: page\n" + " url: https://acme.com/pricing\n" + + " instructions: >-\n" + + " Report pricing or plan availability changes. Ignore counters, timestamps,\n" + + " testimonials, and navigation.\n" + " normalize_whitespace: true\n" + + "change_detection:\n" + + " type: exact\n" + "mode: web\n" + + "schedule:\n" + + " frequency: 6\n" + + " type: interval\n" + + " unit: hours\n" + "tags:\n" + " - pricing\n" + " - competitor\n" + @@ -107,7 +110,7 @@ func TestMonitorsUpdate(t *testing.T) { "--status", "active", "--tag", "pricing", "--tag", "competitor", - "--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}", + "--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}", "--webhook", "{url: https://example.com/webhook, events: [change.detected, run.completed]}", ) }) @@ -130,7 +133,7 @@ func TestMonitorsUpdate(t *testing.T) { "--status", "active", "--tag", "pricing", "--tag", "competitor", - "--target", "{type: page, url: https://acme.com/pricing, normalize_whitespace: true}", + "--target", "{type: page, url: https://acme.com/pricing, instructions: 'Report pricing or plan availability changes. Ignore counters, timestamps, testimonials, and navigation.', normalize_whitespace: true}", "--webhook.url", "https://example.com/webhook", "--webhook.events", "[change.detected, run.completed]", ) @@ -153,6 +156,9 @@ func TestMonitorsUpdate(t *testing.T) { "target:\n" + " type: page\n" + " url: https://acme.com/pricing\n" + + " instructions: >-\n" + + " Report pricing or plan availability changes. Ignore counters, timestamps,\n" + + " testimonials, and navigation.\n" + " normalize_whitespace: true\n" + "webhook:\n" + " url: https://example.com/webhook\n" + diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index a47345e..a9464c4 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "1.1.0" // x-release-please-version +const Version = "1.2.0" // x-release-please-version