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
9 changes: 5 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
run:
go: '1.19'
deadline: 210s
go: '1.23'
timeout: 10m
skip-dirs:

issues:
exclude-dirs:
- mocks
- '.*_mock'
skip-files:
exclude-files:
- '.*_mock.go'
- ".*\\.pb\\.go$"

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME = stream-cli

GOLANGCI_VERSION = 1.55.2
GOLANGCI_VERSION = 1.62.2
GOLANGCI = .bin/golangci/$(GOLANGCI_VERSION)/golangci-lint
$(GOLANGCI):
@curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(dir $(GOLANGCI)) v$(GOLANGCI_VERSION)
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module github.com/GetStream/stream-cli

go 1.22
go 1.23

require (
github.com/AlecAivazis/survey/v2 v2.3.4
github.com/GetStream/stream-chat-go/v5 v5.8.1
github.com/GetStream/stream-chat-go/v8 v8.3.0
github.com/MakeNowJust/heredoc v1.0.0
github.com/cheynewallace/tabby v1.1.1
github.com/gizak/termui/v3 v3.1.0
Expand All @@ -18,7 +18,7 @@ require (
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/golang-jwt/jwt/v4 v4.4.1 // indirect
github.com/golang-jwt/jwt/v4 v4.5.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ github.com/AlecAivazis/survey/v2 v2.3.4 h1:pchTU9rsLUSvWEl2Aq9Pv3k0IE2fkqtGxazsk
github.com/AlecAivazis/survey/v2 v2.3.4/go.mod h1:hrV6Y/kQCLhIZXGcriDCUBtB3wnN7156gMXJ3+b23xM=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/GetStream/stream-chat-go/v5 v5.8.1 h1:nO3pfa4p4o6KEZOAXaaII3bhdrMrfT2zs6VduchuJws=
github.com/GetStream/stream-chat-go/v5 v5.8.1/go.mod h1:ET7NyUYplNy8+tyliin6Q3kKwbd/+FHQWMAW6zucisY=
github.com/GetStream/stream-chat-go/v8 v8.3.0 h1:mFtQZ0PkcCXMPjCDlnZcex3roOvE+UOaxBcNdq3o62s=
github.com/GetStream/stream-chat-go/v8 v8.3.0/go.mod h1:frj3A1yv9mjyWlGNwaZKnXcX9JYYTPWSDqzyOFeHPac=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Netflix/go-expect v0.0.0-20220104043353-73e0943537d2 h1:+vx7roKuyA63nhn5WAunQHLTznkw5W8b1Xc0dNjp83s=
Expand Down Expand Up @@ -79,9 +79,8 @@ github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmy
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ=
github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQgeo=
github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/chat/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"time"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -46,7 +46,7 @@ func getCmd() *cobra.Command {
return err
}

r, err := c.GetAppConfig(cmd.Context())
r, err := c.GetAppSettings(cmd.Context())
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cmd/chat/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"time"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -551,7 +551,7 @@ func hideCmd() *cobra.Command {
return err
}

cmd.Printf("Successfully hid channel for " + userID + "\n")
cmd.Printf("Successfully hid channel for %s\n", userID)
return nil
},
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/channel/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
"time"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/stretchr/testify/require"

"github.com/GetStream/stream-cli/test"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/channeltype/channeltype.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package channeltype
import (
"encoding/json"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/device/device.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package device

import (
stream_chat "github.com/GetStream/stream-chat-go/v5"
stream_chat "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down
13 changes: 10 additions & 3 deletions pkg/cmd/chat/imports/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"
"time"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -76,6 +76,12 @@ func uploadCmd() *cobra.Command {
mode = stream.InsertMode
}

var opts []stream.CreateImportOption
if cmd.Flags().Changed("merge-custom") {
mergeCustom, _ := cmd.Flags().GetBool("merge-custom")
opts = append(opts, stream.WithMergeCustom(mergeCustom))
}

createImportURLResp, err := c.CreateImportURL(cmd.Context(), filepath.Base(filename))
if err != nil {
return err
Expand All @@ -84,7 +90,7 @@ func uploadCmd() *cobra.Command {
if err := uploadToS3(cmd.Context(), filename, createImportURLResp.UploadURL); err != nil {
return err
}
createImportResp, err := c.CreateImport(cmd.Context(), createImportURLResp.Path, mode)
createImportResp, err := c.CreateImport(cmd.Context(), createImportURLResp.Path, mode, opts...)
if err != nil {
return err
}
Expand All @@ -94,7 +100,8 @@ func uploadCmd() *cobra.Command {
}

fl := cmd.Flags()
fl.StringP("mode", "m", "upsert", "[optional] Import mode. Canbe upsert or insert")
fl.StringP("mode", "m", "upsert", "[optional] Import mode. Can be upsert or insert")
fl.Bool("merge-custom", false, "[optional] Merge custom data during import")
fl.StringP("output-format", "o", "json", "[optional] Output format. Can be json or tree")
fl.Bool("lighter-validation-id", false, "[optional] allows to pass ! in channel ID")

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/imports/imports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/json"
"testing"

stream_chat "github.com/GetStream/stream-chat-go/v5"
stream_chat "github.com/GetStream/stream-chat-go/v8"
"github.com/stretchr/testify/require"

"github.com/GetStream/stream-cli/test"
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/message/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package message
import (
"strings"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package push
import (
"encoding/json"

stream_chat "github.com/GetStream/stream-chat-go/v5"
stream_chat "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/reaction/reaction.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package reaction

import (
stream_chat "github.com/GetStream/stream-chat-go/v5"
stream_chat "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down
10 changes: 6 additions & 4 deletions pkg/cmd/chat/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"time"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/MakeNowJust/heredoc"
"github.com/spf13/cobra"

Expand Down Expand Up @@ -359,9 +359,11 @@ func queryCmd() *cobra.Command {
return err
}

q := &stream.QueryOption{
Filter: m,
Limit: limit,
q := &stream.QueryUsersOptions{
QueryOption: stream.QueryOption{
Filter: m,
Limit: limit,
},
}
resp, err := c.QueryUsers(cmd.Context(), q)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/utils/async.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/chat/utils/fileupload.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"os"
"path/filepath"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"path/filepath"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"strings"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/spf13/pflag"
)

Expand Down
4 changes: 1 addition & 3 deletions test/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"math/rand"
"os"
"testing"
"time"

stream "github.com/GetStream/stream-chat-go/v5"
stream "github.com/GetStream/stream-chat-go/v8"
"github.com/spf13/cobra"
"github.com/spf13/viper"

Expand Down Expand Up @@ -91,7 +90,6 @@ func DeleteMessage(id string) {
}

func RandomString(n int) string {
rand.Seed(time.Now().UnixNano())
bytes := make([]byte, n)
for i := 0; i < n; i++ {
bytes[i] = byte(65 + rand.Intn(25)) // A=65 and Z = 65+25
Expand Down