Skip to content

Commit 31248f0

Browse files
archandattaclaude
andcommitted
chore: bump kernel-go-sdk to v0.70.0 for telemetry events
The telemetry events command needs the Events/EventsAutoPaging surface added in v0.70.0. Adapt the command's category param to the generated []string type and fix the stale validation-error assertion. The bump also changes APIKeyService.Get to take a params arg, so update the api_keys command and its fake to pass APIKeyGetParams (empty preserves prior behavior). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent d18dca1 commit 31248f0

6 files changed

Lines changed: 9 additions & 13 deletions

File tree

cmd/api_keys.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
type APIKeysService interface {
1616
New(ctx context.Context, body kernel.APIKeyNewParams, opts ...option.RequestOption) (*kernel.CreatedAPIKey, error)
17-
Get(ctx context.Context, id string, opts ...option.RequestOption) (*kernel.APIKey, error)
17+
Get(ctx context.Context, id string, query kernel.APIKeyGetParams, opts ...option.RequestOption) (*kernel.APIKey, error)
1818
Update(ctx context.Context, id string, body kernel.APIKeyUpdateParams, opts ...option.RequestOption) (*kernel.APIKey, error)
1919
List(ctx context.Context, query kernel.APIKeyListParams, opts ...option.RequestOption) (*pagination.OffsetPagination[kernel.APIKey], error)
2020
Delete(ctx context.Context, id string, opts ...option.RequestOption) error
@@ -145,7 +145,7 @@ func (c APIKeysCmd) Get(ctx context.Context, in APIKeysGetInput) error {
145145
return err
146146
}
147147

148-
key, err := c.apiKeys.Get(ctx, in.ID)
148+
key, err := c.apiKeys.Get(ctx, in.ID, kernel.APIKeyGetParams{})
149149
if err != nil {
150150
return util.CleanedUpSdkError{Err: err}
151151
}

cmd/api_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (f *FakeAPIKeysService) New(ctx context.Context, body kernel.APIKeyNewParam
2929
return createdAPIKeyFromJSON(`{"id":"key_123","name":"default","key":"sk_test","masked_key":"sk_...test","created_at":"2026-05-27T12:00:00Z","created_by":{"id":"user_123","email":"dev@example.com","name":"Dev"},"expires_at":null,"project_id":null,"project_name":null}`), nil
3030
}
3131

32-
func (f *FakeAPIKeysService) Get(ctx context.Context, id string, opts ...option.RequestOption) (*kernel.APIKey, error) {
32+
func (f *FakeAPIKeysService) Get(ctx context.Context, id string, query kernel.APIKeyGetParams, opts ...option.RequestOption) (*kernel.APIKey, error) {
3333
if f.GetFunc != nil {
3434
return f.GetFunc(ctx, id, opts...)
3535
}

cmd/browsers_telemetry.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,7 @@ func (b BrowsersCmd) TelemetryEvents(ctx context.Context, in BrowsersTelemetryEv
270270
params.Until = kernel.Opt(in.Until)
271271
}
272272
if len(in.Categories) > 0 {
273-
cats := make([]kernel.BrowserTelemetryEventsParamsCategory, 0, len(in.Categories))
274-
for _, c := range in.Categories {
275-
cats = append(cats, kernel.BrowserTelemetryEventsParamsCategory(c))
276-
}
277-
params.Category = cats
273+
params.Category = in.Categories
278274
}
279275

280276
br, err := b.browsers.Get(ctx, in.Identifier, kernel.BrowserGetParams{})

cmd/browsers_telemetry_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func TestTelemetryEvents_UnknownCategoryErrors(t *testing.T) {
9898
err := b.TelemetryEvents(context.Background(), BrowsersTelemetryEventsInput{Identifier: "session123", Categories: []string{"netowrk"}})
9999

100100
assert.Error(t, err)
101-
assert.Contains(t, err.Error(), "invalid --category value")
101+
assert.Contains(t, err.Error(), "invalid --categories value")
102102
}
103103

104104
func TestTelemetryEvents_SinglePageTextAndParams(t *testing.T) {
@@ -130,7 +130,7 @@ func TestTelemetryEvents_SinglePageTextAndParams(t *testing.T) {
130130
assert.Equal(t, int64(5), gotQuery.Limit.Value)
131131
assert.Equal(t, "5m", gotQuery.Since.Value)
132132
assert.Equal(t, "2020-01-01T00:00:00Z", gotQuery.Until.Value)
133-
assert.Equal(t, []kernel.BrowserTelemetryEventsParamsCategory{"network"}, gotQuery.Category)
133+
assert.Equal(t, []string{"network"}, gotQuery.Category)
134134
out := outBuf.String()
135135
assert.Contains(t, out, "network_response")
136136
assert.Contains(t, out, "network_request")

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/charmbracelet/lipgloss/v2 v2.0.0-beta.1
1010
github.com/golang-jwt/jwt/v5 v5.2.2
1111
github.com/joho/godotenv v1.5.1
12-
github.com/kernel/kernel-go-sdk v0.66.0
12+
github.com/kernel/kernel-go-sdk v0.70.0
1313
github.com/klauspost/compress v1.18.5
1414
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
1515
github.com/pterm/pterm v0.12.80

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2
6464
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
6565
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
6666
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
67-
github.com/kernel/kernel-go-sdk v0.66.0 h1:pn+fSHHo4fJ4kYm8uOkF5J2rj6k1FC6NqlLzoxy2jy4=
68-
github.com/kernel/kernel-go-sdk v0.66.0/go.mod h1:EeZzSuHZVeHKxKCPUzxou2bovNGhXaz0RXrSqKNf1AQ=
67+
github.com/kernel/kernel-go-sdk v0.70.0 h1:tgg8suA8R9Y4ZLiby0jNc0KJ1KqHpqg+a4l0sJkZJVM=
68+
github.com/kernel/kernel-go-sdk v0.70.0/go.mod h1:EeZzSuHZVeHKxKCPUzxou2bovNGhXaz0RXrSqKNf1AQ=
6969
github.com/klauspost/compress v1.18.5 h1:/h1gH5Ce+VWNLSWqPzOVn6XBO+vJbCNGvjoaGBFW2IE=
7070
github.com/klauspost/compress v1.18.5/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
7171
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=

0 commit comments

Comments
 (0)