From eef3dc54e0cee34bfac98d0ff0980566d908144a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 08:55:41 +0100 Subject: [PATCH] Update all non-major dependencies (#23) * Create simple CLI * Create goreleaser config * Set max editor width * Update all non-major dependencies --------- Co-authored-by: Aaron Kirkbride Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .gitignore | 1 + cli/.goreleaser.yaml | 39 +++++++++++ cli/README.md | 9 +++ cli/api/cfg.yaml | 6 ++ cli/api/collabify.go | 97 ++++++++++++++++++++++++++ cli/api/generate.go | 3 + cli/api/middleware.go | 53 +++++++++++++++ cli/api/router.go | 28 ++++++++ cli/collabify.go | 100 +++++++++++++++++++++++++++ cli/go.mod | 36 ++++++++++ cli/go.sum | 84 +++++++++++++++++++++++ cli/tools.go | 8 +++ cli/utils.go | 49 ++++++++++++++ pnpm-lock.yaml | 154 +++++++++++++++++++++--------------------- 14 files changed, 590 insertions(+), 77 deletions(-) create mode 100644 cli/.goreleaser.yaml create mode 100644 cli/README.md create mode 100644 cli/api/cfg.yaml create mode 100644 cli/api/collabify.go create mode 100644 cli/api/generate.go create mode 100644 cli/api/middleware.go create mode 100644 cli/api/router.go create mode 100644 cli/collabify.go create mode 100644 cli/go.mod create mode 100644 cli/go.sum create mode 100644 cli/tools.go create mode 100644 cli/utils.go diff --git a/.gitignore b/.gitignore index 4f07328..cda518d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ tsconfig.tsbuildinfo .DS_Store .env generated/ +*.gen.go diff --git a/cli/.goreleaser.yaml b/cli/.goreleaser.yaml new file mode 100644 index 0000000..90bb7dc --- /dev/null +++ b/cli/.goreleaser.yaml @@ -0,0 +1,39 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +# vim: set ts=2 sw=2 tw=0 fo=cnqoj + +version: 2 + +before: + hooks: + - go mod tidy + - go generate ./... + +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - windows + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/cli/README.md b/cli/README.md new file mode 100644 index 0000000..aa283c1 --- /dev/null +++ b/cli/README.md @@ -0,0 +1,9 @@ +# Collabify CLI + +## Usage + +`collabify ` + +# Future ideas + +- Create from a template: e.g. `collabify -t templates/kickoff.md 2024-01-01-project-kickoff.md` diff --git a/cli/api/cfg.yaml b/cli/api/cfg.yaml new file mode 100644 index 0000000..4e4da7f --- /dev/null +++ b/cli/api/cfg.yaml @@ -0,0 +1,6 @@ +package: api +output: collabify.gen.go +generate: + models: true + chi-server: true + embedded-spec: true diff --git a/cli/api/collabify.go b/cli/api/collabify.go new file mode 100644 index 0000000..df52358 --- /dev/null +++ b/cli/api/collabify.go @@ -0,0 +1,97 @@ +package api + +import ( + "encoding/json" + "fmt" + "io" + "log" + "net/http" + "os" +) + +type Collabify struct { + fileId string + filepath string +} + +// Ensure that we've conformed to the `ServerInterface` with a compile-time check +var _ ServerInterface = (*Collabify)(nil) + +func NewCollabify(fileId string, filepath string) *Collabify { + return &Collabify{ + fileId: fileId, + filepath: filepath, + } +} + +func (c Collabify) GetFile(w http.ResponseWriter, r *http.Request, fileId string) { + if fileId != c.fileId { + http.Error(w, "File ID not found", http.StatusNotFound) + return + } + + content, err := os.ReadFile(c.filepath) + if err != nil { + http.Error(w, "File not found", http.StatusNotFound) + return + } + + w.WriteHeader(http.StatusOK) + w.Header().Set("Content-Type", "text/markdown") + w.Write(content) +} + +func (c Collabify) UpdateFile(w http.ResponseWriter, r *http.Request, fileId string) { + if fileId != c.fileId { + http.Error(w, "Route not found", http.StatusNotFound) + return + } + + content, err := io.ReadAll(r.Body) + if err != nil { + http.Error(w, "Error reading request", http.StatusBadRequest) + return + } + defer r.Body.Close() + + err = os.WriteFile(c.filepath, content, 0644) + if err != nil { + http.Error(w, "Failed to write to file", http.StatusInternalServerError) + return + } + + log.Println("File updated") + + w.WriteHeader(http.StatusOK) +} + +type SessionData struct { + URL string `json:"url"` + JoinURL string `json:"joinUrl"` +} + +func (c Collabify) PostSession(w http.ResponseWriter, r *http.Request) { + var session SessionData + + if err := json.NewDecoder(r.Body).Decode(&session); err != nil { + http.Error(w, "Invalid input", http.StatusBadRequest) + return + } + + fmt.Printf("\n------------------------\n") + fmt.Printf("Your session URL: %s\n", session.URL) + fmt.Printf("Join URL to share: %s\n", session.JoinURL) + fmt.Printf("------------------------\n\n") + + w.WriteHeader(http.StatusOK) +} + +func (c Collabify) Stop(w http.ResponseWriter, r *http.Request) { + log.Println("Session ended via web") + + w.WriteHeader(http.StatusAccepted) + + go func() { + os.Exit(0) + }() +} diff --git a/cli/api/generate.go b/cli/api/generate.go new file mode 100644 index 0000000..b3c688b --- /dev/null +++ b/cli/api/generate.go @@ -0,0 +1,3 @@ +package api + +//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config cfg.yaml ../../schema/api.yaml diff --git a/cli/api/middleware.go b/cli/api/middleware.go new file mode 100644 index 0000000..411988e --- /dev/null +++ b/cli/api/middleware.go @@ -0,0 +1,53 @@ +package api + +import ( + "context" + "crypto/sha256" + "crypto/subtle" + "errors" + "fmt" + "net/http" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/getkin/kin-openapi/openapi3filter" + middleware "github.com/oapi-codegen/nethttp-middleware" + "github.com/rs/cors" +) + +func CorsMiddleware(allowedOrigins []string) func(next http.Handler) http.Handler { + return cors.New(cors.Options{ + AllowedOrigins: allowedOrigins, + AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, + AllowedHeaders: []string{"Accept", "Authorization", "Content-Type"}, + AllowCredentials: true, + }).Handler +} + +func OpenApiRequestValidatorMiddleware(swagger *openapi3.T, authToken string) func(next http.Handler) http.Handler { + return middleware.OapiRequestValidatorWithOptions(swagger, &middleware.Options{ + Options: openapi3filter.Options{ + AuthenticationFunc: authenticate(authToken), + }, + SilenceServersWarning: true, + }) +} + +func authenticate(authToken string) openapi3filter.AuthenticationFunc { + expectedAuthHeader := "Bearer " + authToken + expectedHash := sha256.Sum256([]byte(expectedAuthHeader)) + + return func(ctx context.Context, input *openapi3filter.AuthenticationInput) error { + if input.SecuritySchemeName != "bearerAuth" { + return fmt.Errorf("security scheme %s != 'bearerAuth'", input.SecuritySchemeName) + } + + providedAuthHeader := input.RequestValidationInput.Request.Header.Get("Authorization") + providedHash := sha256.Sum256([]byte(providedAuthHeader)) + + if subtle.ConstantTimeCompare(expectedHash[:], providedHash[:]) != 1 { + return errors.New("invalid token") + } + + return nil + } +} diff --git a/cli/api/router.go b/cli/api/router.go new file mode 100644 index 0000000..d4c0565 --- /dev/null +++ b/cli/api/router.go @@ -0,0 +1,28 @@ +package api + +import ( + "fmt" + "os" + + "github.com/go-chi/chi/v5" +) + +func CreateRouter(filename string, fileId string, authToken string, allowedOrigins []string) *chi.Mux { + swagger, err := GetSwagger() + if err != nil { + fmt.Println("Error loading swagger spec:", err) + os.Exit(1) + } + + r := chi.NewRouter() + + r.Use(CorsMiddleware(allowedOrigins)) + r.Use(OpenApiRequestValidatorMiddleware(swagger, authToken)) + + collabify := NewCollabify(fileId, filename) + r.Route("/v1", func(r chi.Router) { + r.Mount("/", HandlerFromMux(collabify, chi.NewMux())) + }) + + return r +} diff --git a/cli/collabify.go b/cli/collabify.go new file mode 100644 index 0000000..80de2b7 --- /dev/null +++ b/cli/collabify.go @@ -0,0 +1,100 @@ +package main + +import ( + "fmt" + "log" + "net" + "net/http" + "os" + "time" + + "collabify/api" + + "github.com/getkin/kin-openapi/openapi3filter" + "github.com/pkg/browser" + "github.com/urfave/cli/v2" +) + +const defaultAppUrl = "https://collabify.it" // Base URL for the app +const defaultListenHost = "localhost" // `localhost` is recommended for most use cases +const defaultListenPort = "0" // 0 uses the next available port + +func init() { + openapi3filter.RegisterBodyDecoder("text/markdown", openapi3filter.FileBodyDecoder) +} + +func main() { + appUrl := getEnv("COLLABIFY_APP_URL", defaultAppUrl) + listenHost := getEnv("COLLABIFY_LISTEN_HOST", defaultListenHost) + listenPort := getEnv("COLLABIFY_LISTEN_PORT", defaultListenPort) + allowedOrigins := []string{appUrl} + + app := &cli.App{ + Name: "collabify", + Usage: "serve a markdown file over HTTP", + Action: func(c *cli.Context) error { + filename := c.Args().Get(0) + if filename == "" { + return cli.Exit("You must provide a filename", 1) + } + if _, err := os.Stat(filename); err != nil { + return err + } + + // Generate a random fileId and authToken + fileId, err := generateRandomUrlSafeString(8) + if err != nil { + return err + } + authToken, err := generateRandomUrlSafeString(16) + if err != nil { + return err + } + + listener, err := net.Listen("tcp", ":"+listenPort) + if err != nil { + fmt.Println("Failed to listen:", err) + } + defer listener.Close() + + // This may be different from listenPort if listenPort + // was set to 0 (i.e. use the next available port) + port := listener.Addr().(*net.TCPAddr).Port + + r := api.CreateRouter(filename, fileId, authToken, allowedOrigins) + + // Start the HTTP server + serverStarted := make(chan error) + go func() { + err := http.Serve(listener, r) + if err != nil { + serverStarted <- err + return + } + }() + + select { + case err := <-serverStarted: + fmt.Println("Server failed to start:", err) + + case <-time.After(100 * time.Millisecond): + localUrl := fmt.Sprintf("http://%s:%d", listenHost, port) + newSessionUrl, err := buildNewSessionUrl(appUrl, localUrl, fileId, authToken) + if err != nil { + log.Fatal("Failed to build new URL:", err) + } + + fmt.Println("Opening", newSessionUrl) + browser.OpenURL(newSessionUrl) + } + + log.Fatal(http.Serve(listener, r)) + return nil + }, + } + + err := app.Run(os.Args) + if err != nil { + fmt.Println(err) + } +} diff --git a/cli/go.mod b/cli/go.mod new file mode 100644 index 0000000..fbc2807 --- /dev/null +++ b/cli/go.mod @@ -0,0 +1,36 @@ +module collabify + +go 1.22.4 + +require ( + github.com/getkin/kin-openapi v0.124.0 + github.com/go-chi/chi/v5 v5.0.12 + github.com/oapi-codegen/nethttp-middleware v1.0.2 + github.com/oapi-codegen/oapi-codegen/v2 v2.3.0 + github.com/oapi-codegen/runtime v1.1.1 + github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c + github.com/rs/cors v1.11.0 + github.com/urfave/cli/v2 v2.27.2 +) + +require ( + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/swag v0.22.8 // indirect + github.com/google/uuid v1.5.0 // indirect + github.com/gorilla/mux v1.8.1 // indirect + github.com/invopop/yaml v0.2.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/russross/blackfriday/v2 v2.1.0 // indirect + github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/sys v0.20.0 // indirect + golang.org/x/text v0.15.0 // indirect + golang.org/x/tools v0.21.0 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/cli/go.sum b/cli/go.sum new file mode 100644 index 0000000..630b65c --- /dev/null +++ b/cli/go.sum @@ -0,0 +1,84 @@ +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/getkin/kin-openapi v0.124.0 h1:VSFNMB9C9rTKBnQ/fpyDU8ytMTr4dWI9QovSKj9kz/M= +github.com/getkin/kin-openapi v0.124.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= +github.com/go-chi/chi/v5 v5.0.12 h1:9euLV5sTrTNTRUU9POmDUvfxyj6LAABLUcEWO+JJb4s= +github.com/go-chi/chi/v5 v5.0.12/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= +github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= +github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= +github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= +github.com/oapi-codegen/nethttp-middleware v1.0.2 h1:A5tfAcKJhWIbIPnlQH+l/DtfVE1i5TFgPlQAiW+l1vQ= +github.com/oapi-codegen/nethttp-middleware v1.0.2/go.mod h1:DfDalonSO+eRQ3RTb8kYoWZByCCPFRxm9WKq1UbY0E4= +github.com/oapi-codegen/oapi-codegen/v2 v2.3.0 h1:rICjNsHbPP1LttefanBPnwsSwl09SqhCO7Ee623qR84= +github.com/oapi-codegen/oapi-codegen/v2 v2.3.0/go.mod h1:4k+cJeSq5ntkwlcpQSxLxICCxQzCL772o30PxdibRt4= +github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= +github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= +github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= +github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= +github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI= +github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM= +github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 h1:+qGGcbkzsfDQNPPe9UDgpxAWQrhbbBXOYJFQDq/dtJw= +github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913/go.mod h1:4aEEwZQutDLsQv2Deui4iYQ6DWTxR14g6m8Wv88+Xqk= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/cli/tools.go b/cli/tools.go new file mode 100644 index 0000000..35e0f39 --- /dev/null +++ b/cli/tools.go @@ -0,0 +1,8 @@ +//go:build tools +// +build tools + +package main + +import ( + _ "github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen" +) diff --git a/cli/utils.go b/cli/utils.go new file mode 100644 index 0000000..4d6bc34 --- /dev/null +++ b/cli/utils.go @@ -0,0 +1,49 @@ +package main + +import ( + "crypto/rand" + "encoding/base64" + "net/url" + "os" +) + +func generateRandomBytes(n int) ([]byte, error) { + b := make([]byte, n) + _, err := rand.Read(b) + // Note that err == nil only if we read len(b) bytes. + if err != nil { + return nil, err + } + + return b, nil +} + +func generateRandomUrlSafeString(n int) (string, error) { + b, err := generateRandomBytes(n) + if err != nil { + return "", err + } + return base64.URLEncoding.EncodeToString(b), nil +} + +func buildNewSessionUrl(appUrl, localUrl, fileId, authToken string) (string, error) { + baseUrl, err := url.Parse(appUrl) + if err != nil { + return "", err + } + + params := url.Values{} + params.Add("baseUrl", localUrl) + params.Add("fileId", fileId) + params.Add("token", authToken) + params.Add("version", "v1") + + return baseUrl.String() + "/new#" + params.Encode(), nil +} + +func getEnv(key, fallback string) string { + if value, ok := os.LookupEnv(key); ok { + return value + } + return fallback +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 28beaaa..01cdaad 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: version: 1.16.0(eslint@8.57.0)(typescript@5.4.5) '@swc/core': specifier: ^1.4.2 - version: 1.5.29(@swc/helpers@0.5.5) + version: 1.6.1(@swc/helpers@0.5.5) '@types/node': specifier: ^20.11.24 version: 20.14.2 @@ -43,7 +43,7 @@ importers: version: 0.6.1(@ianvs/prettier-plugin-sort-imports@4.2.1(prettier@3.3.2))(prettier@3.3.2) ts-node: specifier: ^10.9.2 - version: 10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5) + version: 10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5) typescript: specifier: ^5.3.3 version: 5.4.5 @@ -142,19 +142,19 @@ importers: version: 2.3.0 ws: specifier: ^8.17.0 - version: 8.17.0 + version: 8.17.1 y-codemirror.next: specifier: ^0.3.4 - version: 0.3.4(@codemirror/state@6.4.1)(@codemirror/view@6.28.1)(yjs@13.6.16) + version: 0.3.4(@codemirror/state@6.4.1)(@codemirror/view@6.28.1)(yjs@13.6.17) y-indexeddb: specifier: ^9.0.12 - version: 9.0.12(yjs@13.6.16) + version: 9.0.12(yjs@13.6.17) y-webrtc: specifier: ^10.3.0 - version: 10.3.0(yjs@13.6.16) + version: 10.3.0(yjs@13.6.17) yjs: specifier: ^13.6.15 - version: 13.6.16 + version: 13.6.17 devDependencies: '@types/jsdom': specifier: ^21.1.7 @@ -176,10 +176,10 @@ importers: version: 7.0.0-rc.0(typescript@5.4.5) tailwindcss: specifier: ^3.4.1 - version: 3.4.4(ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)) + version: 3.4.4(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)) tailwindcss-animate: specifier: ^1.0.7 - version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5))) + version: 1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5))) vite: specifier: ^5.1.4 version: 5.3.1(@types/node@20.14.2) @@ -1184,68 +1184,68 @@ packages: '@sinclair/typebox@0.27.8': resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} - '@swc/core-darwin-arm64@1.5.29': - resolution: {integrity: sha512-6F/sSxpHaq3nzg2ADv9FHLi4Fu2A8w8vP8Ich8gIl16D2htStlwnaPmCLjRswO+cFkzgVqy/l01gzNGWd4DFqA==} + '@swc/core-darwin-arm64@1.6.1': + resolution: {integrity: sha512-u6GdwOXsOEdNAdSI6nWq6G2BQw5HiSNIZVcBaH1iSvBnxZvWbnIKyDiZKaYnDwTLHLzig2GuUjjE2NaCJPy4jg==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] - '@swc/core-darwin-x64@1.5.29': - resolution: {integrity: sha512-rF/rXkvUOTdTIfoYbmszbSUGsCyvqACqy1VeP3nXONS+LxFl4bRmRcUTRrblL7IE5RTMCKUuPbqbQSE2hK7bqg==} + '@swc/core-darwin-x64@1.6.1': + resolution: {integrity: sha512-/tXwQibkDNLVbAtr7PUQI0iQjoB708fjhDDDfJ6WILSBVZ3+qs/LHjJ7jHwumEYxVq1XA7Fv2Q7SE/ZSQoWHcQ==} engines: {node: '>=10'} cpu: [x64] os: [darwin] - '@swc/core-linux-arm-gnueabihf@1.5.29': - resolution: {integrity: sha512-2OAPL8iWBsmmwkjGXqvuUhbmmoLxS1xNXiMq87EsnCNMAKohGc7wJkdAOUL6J/YFpean/vwMWg64rJD4pycBeg==} + '@swc/core-linux-arm-gnueabihf@1.6.1': + resolution: {integrity: sha512-aDgipxhJTms8iH78emHVutFR2c16LNhO+NTRCdYi+X4PyIn58/DyYTH6VDZ0AeEcS5f132ZFldU5AEgExwihXA==} engines: {node: '>=10'} cpu: [arm] os: [linux] - '@swc/core-linux-arm64-gnu@1.5.29': - resolution: {integrity: sha512-eH/Q9+8O5qhSxMestZnhuS1xqQMr6M7SolZYxiXJqxArXYILLCF+nq2R9SxuMl0CfjHSpb6+hHPk/HXy54eIRA==} + '@swc/core-linux-arm64-gnu@1.6.1': + resolution: {integrity: sha512-XkJ+eO4zUKG5g458RyhmKPyBGxI0FwfWFgpfIj5eDybxYJ6s4HBT5MoxyBLorB5kMlZ0XoY/usUMobPVY3nL0g==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-arm64-musl@1.5.29': - resolution: {integrity: sha512-TERh2OICAJz+SdDIK9+0GyTUwF6r4xDlFmpoiHKHrrD/Hh3u+6Zue0d7jQ/he/i80GDn4tJQkHlZys+RZL5UZg==} + '@swc/core-linux-arm64-musl@1.6.1': + resolution: {integrity: sha512-dr6YbLBg/SsNxs1hDqJhxdcrS8dGMlOXJwXIrUvACiA8jAd6S5BxYCaqsCefLYXtaOmu0bbx1FB/evfodqB70Q==} engines: {node: '>=10'} cpu: [arm64] os: [linux] - '@swc/core-linux-x64-gnu@1.5.29': - resolution: {integrity: sha512-WMDPqU7Ji9dJpA+Llek2p9t7pcy7Bob8ggPUvgsIlv3R/eesF9DIzSbrgl6j3EAEPB9LFdSafsgf6kT/qnvqFg==} + '@swc/core-linux-x64-gnu@1.6.1': + resolution: {integrity: sha512-A0b/3V+yFy4LXh3O9umIE7LXPC7NBWdjl6AQYqymSMcMu0EOb1/iygA6s6uWhz9y3e172Hpb9b/CGsuD8Px/bg==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-linux-x64-musl@1.5.29': - resolution: {integrity: sha512-DO14glwpdKY4POSN0201OnGg1+ziaSVr6/RFzuSLggshwXeeyVORiHv3baj7NENhJhWhUy3NZlDsXLnRFkmhHQ==} + '@swc/core-linux-x64-musl@1.6.1': + resolution: {integrity: sha512-5dJjlzZXhC87nZZZWbpiDP8kBIO0ibis893F/rtPIQBI5poH+iJuA32EU3wN4/WFHeK4et8z6SGSVghPtWyk4g==} engines: {node: '>=10'} cpu: [x64] os: [linux] - '@swc/core-win32-arm64-msvc@1.5.29': - resolution: {integrity: sha512-V3Y1+a1zG1zpYXUMqPIHEMEOd+rHoVnIpO/KTyFwAmKVu8v+/xPEVx/AGoYE67x4vDAAvPQrKI3Aokilqa5yVg==} + '@swc/core-win32-arm64-msvc@1.6.1': + resolution: {integrity: sha512-HBi1ZlwvfcUibLtT3g/lP57FaDPC799AD6InolB2KSgkqyBbZJ9wAXM8/CcH67GLIP0tZ7FqblrJTzGXxetTJQ==} engines: {node: '>=10'} cpu: [arm64] os: [win32] - '@swc/core-win32-ia32-msvc@1.5.29': - resolution: {integrity: sha512-OrM6yfXw4wXhnVFosOJzarw0Fdz5Y0okgHfn9oFbTPJhoqxV5Rdmd6kXxWu2RiVKs6kGSJFZXHDeUq2w5rTIMg==} + '@swc/core-win32-ia32-msvc@1.6.1': + resolution: {integrity: sha512-AKqHohlWERclexar5y6ux4sQ8yaMejEXNxeKXm7xPhXrp13/1p4/I3E5bPVX/jMnvpm4HpcKSP0ee2WsqmhhPw==} engines: {node: '>=10'} cpu: [ia32] os: [win32] - '@swc/core-win32-x64-msvc@1.5.29': - resolution: {integrity: sha512-eD/gnxqKyZQQR0hR7TMkIlJ+nCF9dzYmVVNbYZWuA1Xy94aBPUsEk3Uw3oG7q6R3ErrEUPP0FNf2ztEnv+I+dw==} + '@swc/core-win32-x64-msvc@1.6.1': + resolution: {integrity: sha512-0dLdTLd+ONve8kgC5T6VQ2Y5G+OZ7y0ujjapnK66wpvCBM6BKYGdT/OKhZKZydrC5gUKaxFN6Y5oOt9JOFUrOQ==} engines: {node: '>=10'} cpu: [x64] os: [win32] - '@swc/core@1.5.29': - resolution: {integrity: sha512-nvTtHJI43DUSOAf3h9XsqYg8YXKc0/N4il9y4j0xAkO0ekgDNo+3+jbw6MInawjKJF9uulyr+f5bAutTsOKVlw==} + '@swc/core@1.6.1': + resolution: {integrity: sha512-Yz5uj5hNZpS5brLtBvKY0L4s2tBAbQ4TjmW8xF1EC3YLFxQRrUjMP49Zm1kp/KYyYvTkSaG48Ffj2YWLu9nChw==} engines: {node: '>=10'} peerDependencies: '@swc/helpers': '*' @@ -3643,8 +3643,8 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - ws@8.17.0: - resolution: {integrity: sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==} + ws@8.17.1: + resolution: {integrity: sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -3703,8 +3703,8 @@ packages: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} - yjs@13.6.16: - resolution: {integrity: sha512-uEq+n/dFIecBElEdeQea8nDnltScBfuhCSyAxDw4CosveP9Ag0eW6iZi2mdpW7EgxSFT7VXK2MJl3tKaLTmhAQ==} + yjs@13.6.17: + resolution: {integrity: sha512-ERnKXYZrZqgGO81Yqt3D69detaRUwaqhsQTZRKi9CDMgteDMund+KcLChfwpjQbva9YwfRgh7S914Pa6qPVVCA==} engines: {node: '>=16.0.0', npm: '>=8.0.0'} yn@3.1.1: @@ -4936,51 +4936,51 @@ snapshots: '@sinclair/typebox@0.27.8': {} - '@swc/core-darwin-arm64@1.5.29': + '@swc/core-darwin-arm64@1.6.1': optional: true - '@swc/core-darwin-x64@1.5.29': + '@swc/core-darwin-x64@1.6.1': optional: true - '@swc/core-linux-arm-gnueabihf@1.5.29': + '@swc/core-linux-arm-gnueabihf@1.6.1': optional: true - '@swc/core-linux-arm64-gnu@1.5.29': + '@swc/core-linux-arm64-gnu@1.6.1': optional: true - '@swc/core-linux-arm64-musl@1.5.29': + '@swc/core-linux-arm64-musl@1.6.1': optional: true - '@swc/core-linux-x64-gnu@1.5.29': + '@swc/core-linux-x64-gnu@1.6.1': optional: true - '@swc/core-linux-x64-musl@1.5.29': + '@swc/core-linux-x64-musl@1.6.1': optional: true - '@swc/core-win32-arm64-msvc@1.5.29': + '@swc/core-win32-arm64-msvc@1.6.1': optional: true - '@swc/core-win32-ia32-msvc@1.5.29': + '@swc/core-win32-ia32-msvc@1.6.1': optional: true - '@swc/core-win32-x64-msvc@1.5.29': + '@swc/core-win32-x64-msvc@1.6.1': optional: true - '@swc/core@1.5.29(@swc/helpers@0.5.5)': + '@swc/core@1.6.1(@swc/helpers@0.5.5)': dependencies: '@swc/counter': 0.1.3 '@swc/types': 0.1.8 optionalDependencies: - '@swc/core-darwin-arm64': 1.5.29 - '@swc/core-darwin-x64': 1.5.29 - '@swc/core-linux-arm-gnueabihf': 1.5.29 - '@swc/core-linux-arm64-gnu': 1.5.29 - '@swc/core-linux-arm64-musl': 1.5.29 - '@swc/core-linux-x64-gnu': 1.5.29 - '@swc/core-linux-x64-musl': 1.5.29 - '@swc/core-win32-arm64-msvc': 1.5.29 - '@swc/core-win32-ia32-msvc': 1.5.29 - '@swc/core-win32-x64-msvc': 1.5.29 + '@swc/core-darwin-arm64': 1.6.1 + '@swc/core-darwin-x64': 1.6.1 + '@swc/core-linux-arm-gnueabihf': 1.6.1 + '@swc/core-linux-arm64-gnu': 1.6.1 + '@swc/core-linux-arm64-musl': 1.6.1 + '@swc/core-linux-x64-gnu': 1.6.1 + '@swc/core-linux-x64-musl': 1.6.1 + '@swc/core-win32-arm64-msvc': 1.6.1 + '@swc/core-win32-ia32-msvc': 1.6.1 + '@swc/core-win32-x64-msvc': 1.6.1 '@swc/helpers': 0.5.5 '@swc/counter@0.1.3': {} @@ -6462,7 +6462,7 @@ snapshots: whatwg-encoding: 3.1.1 whatwg-mimetype: 4.0.0 whatwg-url: 14.0.0 - ws: 8.17.0 + ws: 8.17.1 xml-name-validator: 5.0.0 transitivePeerDependencies: - bufferutil @@ -6835,13 +6835,13 @@ snapshots: camelcase-css: 2.0.1 postcss: 8.4.38 - postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)): + postcss-load-config@4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)): dependencies: lilconfig: 3.1.1 yaml: 2.4.3 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5) + ts-node: 10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5) postcss-nested@6.0.1(postcss@8.4.38): dependencies: @@ -7268,11 +7268,11 @@ snapshots: dependencies: '@babel/runtime': 7.24.5 - tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5))): + tailwindcss-animate@1.0.7(tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5))): dependencies: - tailwindcss: 3.4.4(ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)) + tailwindcss: 3.4.4(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)) - tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)): + tailwindcss@3.4.4(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -7291,7 +7291,7 @@ snapshots: postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) - postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)) + postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5)) postcss-nested: 6.0.1(postcss@8.4.38) postcss-selector-parser: 6.1.0 resolve: 1.22.8 @@ -7342,7 +7342,7 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@swc/core@1.5.29(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5): + ts-node@10.9.2(@swc/core@1.6.1(@swc/helpers@0.5.5))(@types/node@20.14.2)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -7360,7 +7360,7 @@ snapshots: v8-compile-cache-lib: 3.0.1 yn: 3.1.1 optionalDependencies: - '@swc/core': 1.5.29(@swc/helpers@0.5.5) + '@swc/core': 1.6.1(@swc/helpers@0.5.5) tsconfig-paths@3.15.0: dependencies: @@ -7631,37 +7631,37 @@ snapshots: wrappy@1.0.2: {} - ws@8.17.0: {} + ws@8.17.1: {} xml-name-validator@5.0.0: {} xmlchars@2.2.0: {} - y-codemirror.next@0.3.4(@codemirror/state@6.4.1)(@codemirror/view@6.28.1)(yjs@13.6.16): + y-codemirror.next@0.3.4(@codemirror/state@6.4.1)(@codemirror/view@6.28.1)(yjs@13.6.17): dependencies: '@codemirror/state': 6.4.1 '@codemirror/view': 6.28.1 lib0: 0.2.94 - yjs: 13.6.16 + yjs: 13.6.17 - y-indexeddb@9.0.12(yjs@13.6.16): + y-indexeddb@9.0.12(yjs@13.6.17): dependencies: lib0: 0.2.94 - yjs: 13.6.16 + yjs: 13.6.17 - y-protocols@1.0.6(yjs@13.6.16): + y-protocols@1.0.6(yjs@13.6.17): dependencies: lib0: 0.2.94 - yjs: 13.6.16 + yjs: 13.6.17 - y-webrtc@10.3.0(yjs@13.6.16): + y-webrtc@10.3.0(yjs@13.6.17): dependencies: lib0: 0.2.94 simple-peer: 9.11.1 - y-protocols: 1.0.6(yjs@13.6.16) - yjs: 13.6.16 + y-protocols: 1.0.6(yjs@13.6.17) + yjs: 13.6.17 optionalDependencies: - ws: 8.17.0 + ws: 8.17.1 transitivePeerDependencies: - bufferutil - supports-color @@ -7675,7 +7675,7 @@ snapshots: yargs-parser@21.1.1: {} - yjs@13.6.16: + yjs@13.6.17: dependencies: lib0: 0.2.94