diff --git a/api/Makefile b/api/Makefile index ad81808..dc5ab22 100644 --- a/api/Makefile +++ b/api/Makefile @@ -1,3 +1,7 @@ +generate: + rm graph/schema.graphqls + for f in graph/schema/*.gql; do cat $f; echo; done > graph/schema.graphqls + start: docker container start test-db go run cmd/citadel/main.go diff --git a/api/cmd/citadel/main.go b/api/cmd/citadel/main.go index fe9fc67..ff9db8b 100644 --- a/api/cmd/citadel/main.go +++ b/api/cmd/citadel/main.go @@ -3,20 +3,50 @@ package main import ( "fmt" _ "github.com/lib/pq" + "io/ioutil" "net/http" "time" + "github.com/BurntSushi/toml" "github.com/jmoiron/sqlx" - "github.com/jordanknott/project-citadel/api/router" + "github.com/jordanknott/project-citadel/api/internal/route" log "github.com/sirupsen/logrus" ) +type Database struct { + Host string + Name string + User string + Password string +} +type AppConfig struct { + Database Database +} + func main() { + dat, err := ioutil.ReadFile("conf/app.toml") + if err != nil { + panic(err) + } + + var appConfig AppConfig + _, err = toml.Decode(string(dat), &appConfig) + if err != nil { + panic(err) + } + Formatter := new(log.TextFormatter) Formatter.TimestampFormat = "02-01-2006 15:04:05" Formatter.FullTimestamp = true log.SetFormatter(Formatter) - db, err := sqlx.Connect("postgres", "user=postgres password=test host=0.0.0.0 dbname=citadel sslmode=disable") + log.SetLevel(log.InfoLevel) + connection := fmt.Sprintf("user=%s password=%s host=%s dbname=%s sslmode=disable", + appConfig.Database.User, + appConfig.Database.Password, + appConfig.Database.Host, + appConfig.Database.Name, + ) + db, err := sqlx.Connect("postgres", connection) if err != nil { log.Panic(err) } @@ -27,6 +57,6 @@ func main() { defer db.Close() fmt.Println("starting graphql server on http://localhost:3333") fmt.Println("starting graphql playground on http://localhost:3333/__graphql") - r, _ := router.NewRouter(db) + r, _ := route.NewRouter(db) http.ListenAndServe(":3333", r) } diff --git a/api/cmd/citadelctl/main.go b/api/cmd/citadelctl/main.go index be5cbf5..5f1e3b1 100644 --- a/api/cmd/citadelctl/main.go +++ b/api/cmd/citadelctl/main.go @@ -1,20 +1,43 @@ package main import ( - // "context" - // "fmt" - // "io/ioutil" - + "bytes" + "context" + "fmt" + "github.com/BurntSushi/toml" + "github.com/jmoiron/sqlx" "github.com/jordan-wright/email" + "github.com/jordanknott/project-citadel/api/pg" + "github.com/jordanknott/project-citadel/api/router" _ "github.com/lib/pq" + "golang.org/x/crypto/bcrypt" + "io/ioutil" "net/smtp" - // "github.com/jmoiron/sqlx" - // "github.com/jordanknott/project-citadel/api/pg" - // "github.com/BurntSushi/toml" - // "github.com/jordanknott/project-citadel/api/router" - // "time" + "text/template" + "time" + + "github.com/golang-migrate/migrate/v4" + "github.com/golang-migrate/migrate/v4/database/postgres" + _ "github.com/golang-migrate/migrate/v4/source/file" ) +type Database struct { + Host string + Name string + User string + Password string +} +type AppConfig struct { + Database Database +} + +type UserRegistration struct { + Username string + Year string + AppName string + AppURL string +} + type color struct { Name string Color string @@ -25,39 +48,136 @@ type colors struct { Color []color } -func main() { +func SendEmail() { + emailTmpl, err := ioutil.ReadFile("templates/mail/user/registered.tmpl") + if err != nil { + panic(err) + } + + user := UserRegistration{Username: "jordanthedev", AppName: "Citadel", AppURL: "http://localhost:3000/", Year: "2020"} + tmpl, err := template.New("registered").Parse(string(emailTmpl)) + if err != nil { + panic(err) + } + var tpl bytes.Buffer + if err := tmpl.Execute(&tpl, &user); err != nil { + panic(err) + } + + result := tpl.String() e := email.NewEmail() e.From = "Jordan Knott " e.To = []string{"jordan@jordanthedev.com"} e.Subject = "Jordan Knott (@jordanthedev) invited you to join the team \"Paradox\" on Citadel" e.Text = []byte("Text Body is, of course, supported!") - e.HTML = []byte("

Fancy HTML is supported, too!

") + e.HTML = []byte(result) e.Send("localhost:1025", smtp.PlainAuth("", "test@gmail.com", "password123", "localhost")) - // dur := time.Hour * 24 * 7 * 30 - // token, err := router.NewAccessTokenCustomExpiration("21345076-6423-4a00-a6bd-cd9f830e2764", dur) - // if err != nil { - // panic(err) - // } - // fmt.Println(token) - - // fmt.Println("seeding database...") - - // dat, err := ioutil.ReadFile("data/colors.toml") - // if err != nil { - // panic(err) - // } - - // var labelColors colors - // _, err = toml.Decode(string(dat), &labelColors) - // if err != nil { - // panic(err) - // } - // db, err := sqlx.Connect("postgres", "user=postgres password=test host=0.0.0.0 dbname=citadel sslmode=disable") - // repository := pg.NewRepository(db) - // for _, color := range labelColors.Color { - // fmt.Printf("%v\n", color) - // repository.CreateLabelColor(context.Background(), pg.CreateLabelColorParams{color.Name, color.Color, float64(color.Position)}) - // } - +} + +func Seed() { + dur := time.Hour * 24 * 7 * 30 + token, err := router.NewAccessTokenCustomExpiration("21345076-6423-4a00-a6bd-cd9f830e2764", dur) + if err != nil { + panic(err) + } + fmt.Println(token) + + fmt.Println("seeding database...") + + dat, err := ioutil.ReadFile("data/dark_colors.toml") + if err != nil { + panic(err) + } + + var labelColors colors + _, err = toml.Decode(string(dat), &labelColors) + if err != nil { + panic(err) + } + db, err := sqlx.Connect("postgres", "user=postgres password=test host=0.0.0.0 dbname=citadel sslmode=disable") + repository := pg.NewRepository(db) + for _, color := range labelColors.Color { + fmt.Printf("%v\n", color) + repository.CreateLabelColor(context.Background(), pg.CreateLabelColorParams{color.Name, color.Color, float64(color.Position)}) + } +} +func Migrate() { + dat, err := ioutil.ReadFile("conf/app.toml") + if err != nil { + panic(err) + } + + var appConfig AppConfig + _, err = toml.Decode(string(dat), &appConfig) + if err != nil { + panic(err) + } + connection := fmt.Sprintf("user=%s password=%s host=%s dbname=%s sslmode=disable", + appConfig.Database.User, + appConfig.Database.Password, + appConfig.Database.Host, + appConfig.Database.Name, + ) + fmt.Println(connection) + db, err := sqlx.Connect("postgres", connection) + if err != nil { + panic(err) + } + defer db.Close() + driver, err := postgres.WithInstance(db.DB, &postgres.Config{}) + if err != nil { + panic(err) + } + m, err := migrate.NewWithDatabaseInstance( + "file://migrations", + "postgres", driver) + if err != nil { + panic(err) + } + err = m.Up() + if err != nil { + panic(err) + } +} +func main() { + dat, err := ioutil.ReadFile("conf/app.toml") + if err != nil { + panic(err) + } + + var appConfig AppConfig + _, err = toml.Decode(string(dat), &appConfig) + if err != nil { + panic(err) + } + connection := fmt.Sprintf("user=%s password=%s host=%s dbname=%s sslmode=disable", + appConfig.Database.User, + appConfig.Database.Password, + appConfig.Database.Host, + appConfig.Database.Name, + ) + fmt.Println(connection) + db, err := sqlx.Connect("postgres", connection) + if err != nil { + panic(err) + + } + createdAt := time.Now().UTC() + hashedPwd, err := bcrypt.GenerateFromPassword([]byte("test"), 14) + repo := pg.NewRepository(db) + if err != nil { + panic(err) + } + _, err = repo.CreateUserAccount(context.Background(), pg.CreateUserAccountParams{ + Username: "jordan", + Initials: "JK", + Email: "jordan@jordanthedev.com", + PasswordHash: string(hashedPwd), + CreatedAt: createdAt, + RoleCode: "admin", + }) + if err != nil { + panic(err) + } } diff --git a/api/cmd/send/main.go b/api/cmd/send/main.go new file mode 100644 index 0000000..470f539 --- /dev/null +++ b/api/cmd/send/main.go @@ -0,0 +1,56 @@ +package main + +import ( + "fmt" + + "github.com/RichardKnop/machinery/v1" + "github.com/RichardKnop/machinery/v1/config" + "github.com/RichardKnop/machinery/v1/tasks" +) + +func Add(args ...int64) (int64, error) { + sum := int64(0) + for _, arg := range args { + sum += arg + } + return sum, nil +} + +func main() { + var cnf = &config.Config{ + Broker: "amqp://guest:guest@localhost:5672/", + DefaultQueue: "machinery_tasks", + ResultBackend: "memcache://localhost:11211", + AMQP: &config.AMQPConfig{ + Exchange: "machinery_exchange", + ExchangeType: "direct", + BindingKey: "machinery_task", + }, + } + + fmt.Println("starting server") + server, err := machinery.NewServer(cnf) + if err != nil { + // do something with the error + } + + addTask0 := tasks.Signature{ + Name: "userRegistration", + Args: []tasks.Arg{ + { + Type: "string", + Value: "21345076-6423-4a00-a6bd-cd9f830e2764", + }, + }, + } + + asyncResult, err := server.SendTask(&addTask0) + if err != nil { + fmt.Errorf("Could not send task: %s", err.Error()) + } + fmt.Println(asyncResult.GetState()) + + // results, err := asyncResult.Get(time.Duration(time.Millisecond * 5)) + // fmt.Printf("split([\"foo\"]) = %v\n", tasks.HumanReadableResults(results)) + +} diff --git a/api/cmd/worker/main.go b/api/cmd/worker/main.go new file mode 100644 index 0000000..034faa9 --- /dev/null +++ b/api/cmd/worker/main.go @@ -0,0 +1,66 @@ +package main + +import ( + "context" + "fmt" + + "github.com/RichardKnop/machinery/v1" + "github.com/RichardKnop/machinery/v1/config" + "github.com/google/uuid" + "github.com/jmoiron/sqlx" + "github.com/jordanknott/project-citadel/api/pg" + _ "github.com/lib/pq" +) + +type MachineTasks struct { + Repository pg.Repository +} + +func (m *MachineTasks) UserRegistration(userID string) (bool, error) { + ctx := context.Background() + uid, err := uuid.Parse(userID) + if err != nil { + return false, err + } + user, err := m.Repository.GetUserAccountByID(ctx, uid) + if err != nil { + return false, err + } + if user.Username == "jordan" { + return true, nil + } + return false, nil +} + +func main() { + var cnf = &config.Config{ + Broker: "amqp://guest:guest@localhost:5672/", + DefaultQueue: "machinery_tasks", + ResultBackend: "memcache://localhost:11211", + AMQP: &config.AMQPConfig{ + Exchange: "machinery_exchange", + ExchangeType: "direct", + BindingKey: "machinery_task", + }, + } + + fmt.Println("starting server") + server, err := machinery.NewServer(cnf) + if err != nil { + // do something with the error + } + + db, err := sqlx.Connect("postgres", "user=postgres password=test host=0.0.0.0 dbname=citadel sslmode=disable") + repo := pg.NewRepository(db) + tasks := MachineTasks{repo} + server.RegisterTasks(map[string]interface{}{ + "userRegistration": tasks.UserRegistration, + }) + + worker := server.NewWorker("citadel_worker", 10) + fmt.Println("launching worker") + err = worker.Launch() + if err != nil { + // do something with the error + } +} diff --git a/api/conf/app.toml b/api/conf/app.toml new file mode 100644 index 0000000..ffee241 --- /dev/null +++ b/api/conf/app.toml @@ -0,0 +1,5 @@ +[database] +host = '0.0.0.0' +name = 'citadel' +user = 'postgres' +password = 'test' diff --git a/api/data/dark_colors.toml b/api/data/dark_colors.toml new file mode 100644 index 0000000..d619f87 --- /dev/null +++ b/api/data/dark_colors.toml @@ -0,0 +1,74 @@ +[[color]] +name = "red" +color = '#e8384f' +position = 1 + +[[color]] +name = "orange" +color = '#fd612c' +position = 2 + +[[color]] +name = "yellow_orange" +color = '#fd9a00' +position = 3 + +[[color]] +name = "yellow" +color = '#eec300' +position = 4 + +[[color]] +name = "yellow_green" +color = '#a4cf30' +position = 5 + +[[color]] +name = "green" +color = '#62d26f' +position = 6 + +[[color]] +name = "blue_green" +color = '#37c5ab' +position = 7 + +[[color]] +name = "aqua" +color = '#20aaea' +position = 8 + +[[color]] +name = "blue" +color = '#4186e0' +position = 9 + +[[color]] +name = "indigo" +color = '#7a6ff0' +position = 10 + +[[color]] +name = "purple" +color = '#aa62e3' +position = 11 + +[[color]] +name = "magenta" +color = '#e362e3' +position = 12 + +[[color]] +name = "hot_pink" +color = '#ea4e9d' +position = 13 + +[[color]] +name = "pink" +color = '#fc91ad' +position = 14 + +[[color]] +name = "cool_gray" +color = '#8da3a6' +position = 15 diff --git a/api/data/dark_colors.yml b/api/data/dark_colors.yml new file mode 100644 index 0000000..22c1da9 --- /dev/null +++ b/api/data/dark_colors.yml @@ -0,0 +1,16 @@ +colors: + red: '#e8384f' + orange: '#fd612c' + yellow_orange: '#fd9a00' + yellow: '#eec300' + yellow_green: '#a4cf30' + green: '#62d26f' + blue_green: '#37c5ab' + aqua: '#20aaea' + blue: '#4186e0' + indigo: '#7a6ff0' + purple: '#aa62e3' + magenta: '#e362e3' + hot_pink: '#ea4e9d' + pink: '#fc91ad' + cool_gray: '#8da3a6' diff --git a/api/docker-compose.yml b/api/docker-compose.yml index ff5f467..c06087c 100644 --- a/api/docker-compose.yml +++ b/api/docker-compose.yml @@ -6,3 +6,14 @@ services: ports: - 1025:1025 - 8025:8025 + broker: + image: rabbitmq:3-management + restart: always + ports: + - 8060:15672 + - 5672:5672 + result_store: + image: memcached:1.6-alpine + restart: always + ports: + - 11211:11211 diff --git a/api/go.mod b/api/go.mod index 3fa59eb..d6a63c6 100644 --- a/api/go.mod +++ b/api/go.mod @@ -5,25 +5,28 @@ go 1.13 require ( github.com/99designs/gqlgen v0.11.3 github.com/BurntSushi/toml v0.3.1 + github.com/RichardKnop/machinery v1.8.6 github.com/boyter/scc v2.12.0+incompatible // indirect github.com/dbaggerman/cuba v0.3.2 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/go-chi/chi v3.3.2+incompatible github.com/go-chi/cors v1.0.0 + github.com/golang-migrate/migrate/v4 v4.11.0 github.com/google/martian v2.1.0+incompatible github.com/google/uuid v1.1.1 github.com/jmoiron/sqlx v1.2.0 github.com/jordan-wright/email v0.0.0-20200602115436-fd8a7622303e - github.com/lib/pq v1.0.0 + github.com/lib/pq v1.3.0 + github.com/magefile/mage v1.9.0 github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect github.com/monochromegane/go-gitignore v0.0.0-20200525100937-58356a36e03f // indirect github.com/pelletier/go-toml v1.8.0 - github.com/pkg/errors v0.8.1 + github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.4.2 github.com/spf13/cobra v1.0.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/urfave/cli v1.20.0 // indirect + github.com/streadway/amqp v1.0.0 github.com/vektah/gqlparser/v2 v2.0.1 - golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 + golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 golang.org/x/text v0.3.3 // indirect ) diff --git a/api/go.sum b/api/go.sum index 00aaa14..a560ec6 100644 --- a/api/go.sum +++ b/api/go.sum @@ -1,70 +1,217 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0 h1:MZQCQQaRwOrAcuKjiHWHrgKykt4fZyuwF2dtiG3fGW8= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0 h1:Lpy6hKgdcl7a3WGSfJIFmxmcdjSpP6OmBEfcOv1Y680= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/spanner v1.2.0/go.mod h1:LfwGAsK42Yz8IeLsd/oagGFBqTXt3xVWtm8/KD2vrEI= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/99designs/gqlgen v0.11.1 h1:QoSL8/AAJ2T3UOeQbdnBR32JcG4pO08+P/g5jdbFkUg= github.com/99designs/gqlgen v0.11.1/go.mod h1:vjFOyBZ7NwDl+GdSD4PFn7BQn5Fy7ohJwXn7Vk8zz+c= github.com/99designs/gqlgen v0.11.3 h1:oFSxl1DFS9X///uHV3y6CEfpcXWrDUxVblR4Xib2bs4= github.com/99designs/gqlgen v0.11.3/go.mod h1:RgX5GRRdDWNkh4pBrdzNpNPFVsdoUFY2+adM6nb1N+4= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= 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/ClickHouse/clickhouse-go v1.3.12/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= +github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= +github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/RichardKnop/logging v0.0.0-20190827224416-1a693bdd4fae h1:DcFpTQBYQ9Ct2d6sC7ol0/ynxc2pO1cpGUM+f4t5adg= +github.com/RichardKnop/logging v0.0.0-20190827224416-1a693bdd4fae/go.mod h1:rJJ84PyA/Wlmw1hO+xTzV2wsSUon6J5ktg0g8BF2PuU= +github.com/RichardKnop/machinery v1.8.6 h1:IPdPeO/yVE32isMJME2hiCgJgNibCVLjhshyjrQIDFY= +github.com/RichardKnop/machinery v1.8.6/go.mod h1:W87mnh7t91WdrwGbdnAjvDzqD/bqBV+0+GF276gv/bU= +github.com/RichardKnop/redsync v1.2.0 h1:gK35hR3zZkQigHKm8wOGb9MpJ9BsrW6MzxezwjTcHP0= +github.com/RichardKnop/redsync v1.2.0/go.mod h1:9b8nBGAX3bE2uCfJGSnsDvF23mKyHTZzmvmj5FH3Tp0= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/agnivade/levenshtein v1.0.3 h1:M5ZnqLOoZR8ygVq0FfkXsNOKzMCk0xRiow0R5+5VkQ0= github.com/agnivade/levenshtein v1.0.3/go.mod h1:4SFRZbbXWLF4MU1T9Qg0pGgH3Pjs+t6ie5efyrwRJXs= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/aws/aws-sdk-go v1.17.7/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.29.15 h1:0ms/213murpsujhsnxnNKNeVouW60aJqSd992Ks3mxs= +github.com/aws/aws-sdk-go v1.29.15/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= +github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boyter/scc v2.12.0+incompatible h1:Sxhi1Ry3gdreoaF0xEITQSdjR+pJT0cXHXhlDw5FHT0= github.com/boyter/scc v2.12.0+incompatible/go.mod h1:VB5w4e0dahmIiKnpZ7LRh/sjauoY0BmCWjIzZcShNY0= +github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b h1:L/QXpzIa3pOvUGt1D1lA5KjYhPBAN/3iWdP7xeFS9F0= +github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= +github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= +github.com/cockroachdb/cockroach-go v0.0.0-20190925194419-606b3d062051/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= +github.com/containerd/containerd v1.3.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= +github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSYgptZMwQh2aRr3LuazLJIa+Pg3Kc1ylSYVY= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/cznic/mathutil v0.0.0-20180504122225-ca4c9f2c1369/go.mod h1:e6NPNENfs9mPDVNRekM7lKScauxd5kXTr1Mfyig6TDM= 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/dbaggerman/cuba v0.3.2 h1:6ZbQX3FNvkocR222YyoAIZ8wi4avrb7JcJkPvVI2AS4= github.com/dbaggerman/cuba v0.3.2/go.mod h1:t9Oo05XRZGcjaVqsA/gFeNAOm7DYZYNhI17unI5FlwY= +github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dgryski/trifles v0.0.0-20190318185328-a8d75aae118c/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= +github.com/dhui/dktest v0.3.2/go.mod h1:l1/ib23a/CmxAe7yixtrYPc8Iy90Zy2udyaHINM5p58= +github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= +github.com/docker/docker v1.4.2-0.20200213202729-31a86c4ab209/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsouza/fake-gcs-server v1.17.0/go.mod h1:D1rTE4YCyHFNa99oyJJ5HyclvN/0uQR+pM/VdlL83bw= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-chi/chi v3.3.2+incompatible h1:uQNcQN3NsV1j4ANsPh42P4ew4t6rnRbJb8frvpp31qQ= github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-chi/cors v1.0.0 h1:e6x8k7uWbUwYs+aXDoiUzeQFT6l0cygBYyNhD7/1Tg0= github.com/go-chi/cors v1.0.0/go.mod h1:K2Yje0VW/SJzxiyMYu6iPQYa7hMjQX2i/F491VChg1I= +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/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U= +github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= github.com/go-sql-driver/mysql v1.4.0 h1:7LxgVwFb2hIQtMm87NdgAVfXjnt4OePseqT1tKx+opk= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= +github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= +github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= +github.com/gobuffalo/envy v1.6.15/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/flect v0.1.0/go.mod h1:d2ehjJqGOH/Kjqcoz+F7jHTBbmDb38yXA598Hb50EGs= +github.com/gobuffalo/flect v0.1.1/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/flect v0.1.3/go.mod h1:8JCgGVbRjJhVgD6399mQr4fx5rRfGKVzFjbj6RE/9UI= +github.com/gobuffalo/genny v0.0.0-20190329151137-27723ad26ef9/go.mod h1:rWs4Z12d1Zbf19rlsn0nurr75KqhYp52EAGGxTbBhNk= +github.com/gobuffalo/genny v0.0.0-20190403191548-3ca520ef0d9e/go.mod h1:80lIj3kVJWwOrXWWMRzzdhW3DsrdjILVil/SFKBzF28= +github.com/gobuffalo/genny v0.1.0/go.mod h1:XidbUqzak3lHdS//TPu2OgiFB+51Ur5f7CSnXZ/JDvo= +github.com/gobuffalo/genny v0.1.1/go.mod h1:5TExbEyY48pfunL4QSXxlDOmdsD44RRq4mVZ0Ex28Xk= +github.com/gobuffalo/gitgen v0.0.0-20190315122116-cc086187d211/go.mod h1:vEHJk/E9DmhejeLeNt7UVvlSGv3ziL+djtTr3yyzcOw= +github.com/gobuffalo/gogen v0.0.0-20190315121717-8f38393713f5/go.mod h1:V9QVDIxsgKNZs6L2IYiGR8datgMhB577vzTDqypH360= +github.com/gobuffalo/gogen v0.1.0/go.mod h1:8NTelM5qd8RZ15VjQTFkAW6qOMx5wBbW4dSCS3BY8gg= +github.com/gobuffalo/gogen v0.1.1/go.mod h1:y8iBtmHmGc4qa3urIyo1shvOD8JftTtfcKi+71xfDNE= +github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= +github.com/gobuffalo/logger v0.0.0-20190315122211-86e12af44bc2/go.mod h1:QdxcLw541hSGtBnhUc4gaNIXRjiDppFGaDqzbrBd3v8= +github.com/gobuffalo/mapi v1.0.1/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/mapi v1.0.2/go.mod h1:4VAGh89y6rVOvm5A8fKFxYG+wIW6LO1FMTG9hnKStFc= +github.com/gobuffalo/packd v0.0.0-20190315124812-a385830c7fc0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packd v0.1.0/go.mod h1:M2Juc+hhDXf/PnmBANFCqx4DM3wRbgDvnVWeG2RIxq4= +github.com/gobuffalo/packr/v2 v2.0.9/go.mod h1:emmyGweYTm6Kdper+iywB6YK5YzuKchGtJQZ0Odn4pQ= +github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= +github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= +github.com/gocql/gocql v0.0.0-20190301043612-f6df8288f9b4/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0= github.com/gogo/protobuf v1.0.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang-migrate/migrate v3.5.4+incompatible h1:R7OzwvCJTCgwapPCiX6DyBiu2czIUMDCB118gFTKTUA= +github.com/golang-migrate/migrate/v4 v4.11.0 h1:uqtd0ysK5WyBQ/T1K2uDIooJV0o2Obt6uPwP062DupQ= +github.com/golang-migrate/migrate/v4 v4.11.0/go.mod h1:nqbpDbckcYjsCD5I8q5+NI9Tkk7SVcmaF40Ax1eAWhg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +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= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0= +github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/context v0.0.0-20160226214623-1ea25387ff6f/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.6.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= @@ -72,39 +219,102 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackc/chunkreader v1.0.0/go.mod h1:RT6O25fNZIuasFJRyZ4R/Y2BbhasbmZXF9QQ7T3kePo= +github.com/jackc/chunkreader/v2 v2.0.0/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/chunkreader/v2 v2.0.1/go.mod h1:odVSm741yZoC3dpHEUXIqA9tQRhFrgOHwnPIn9lDKlk= +github.com/jackc/pgconn v0.0.0-20190420214824-7e0022ef6ba3/go.mod h1:jkELnwuX+w9qN5YIfX0fl88Ehu4XC3keFuOJJk9pcnA= +github.com/jackc/pgconn v0.0.0-20190824142844-760dd75542eb/go.mod h1:lLjNuW/+OfW9/pnVKPazfWOgNfH2aPem8YQ7ilXGvJE= +github.com/jackc/pgconn v0.0.0-20190831204454-2fabfa3c18b7/go.mod h1:ZJKsE/KZfsUgOEh9hBm+xYTstcNHg7UPMVJqRfQxq4s= +github.com/jackc/pgconn v1.3.2/go.mod h1:LvCquS3HbBKwgl7KbX9KyqEIumJAbm1UMcTvGaIf3bM= +github.com/jackc/pgio v1.0.0/go.mod h1:oP+2QK2wFfUWgr+gxjoBH9KGBb31Eio69xUb0w5bYf8= +github.com/jackc/pgmock v0.0.0-20190831213851-13a1b77aafa2/go.mod h1:fGZlG77KXmcq05nJLRkk0+p82V8B8Dw8KN2/V9c/OAE= +github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= +github.com/jackc/pgproto3 v1.1.0/go.mod h1:eR5FA3leWg7p9aeAqi37XOTgTIbkABlvcPB3E5rlc78= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190420180111-c116219b62db/go.mod h1:bhq50y+xrl9n5mRYyCBFKkpRVTLYJVWeCc+mEAI3yXA= +github.com/jackc/pgproto3/v2 v2.0.0-alpha1.0.20190609003834-432c2951c711/go.mod h1:uH0AWtUmuShn0bcesswc4aBTWGvw0cAxIJp+6OB//Wg= +github.com/jackc/pgproto3/v2 v2.0.0-rc3/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.0-rc3.0.20190831210041-4c03ce451f29/go.mod h1:ryONWYqW6dqSg1Lw6vXNMXoBJhpzvWKnT95C46ckYeM= +github.com/jackc/pgproto3/v2 v2.0.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= +github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= +github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= +github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y= +github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM= +github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc= +github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jordan-wright/email v0.0.0-20200602115436-fd8a7622303e h1:OGunVjqY7y4U4laftpEHv+mvZBlr7UGimJXKEGQtg48= github.com/jordan-wright/email v0.0.0-20200602115436-fd8a7622303e/go.mod h1:Fy2gCFfZhay8jplf/Csj6cyH/oshQTkLQYZbKkcV+SY= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= +github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= +github.com/karrick/godirwalk v1.10.3/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= +github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= +github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.9.5/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= +github.com/klauspost/compress v1.10.2 h1:Znfn6hXZAHaLPNnlqUYRrBSReFHYybslgv4PTiyz6P0= +github.com/klauspost/compress v1.10.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.1.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU= +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +github.com/magefile/mage v1.9.0 h1:t3AU2wNwehMCW97vuqQLtw6puppWXHO+O2MHo5a50XE= +github.com/magefile/mage v1.9.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= +github.com/markbates/pkger v0.15.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= +github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007 h1:reVOUXwnhsYv/8UqjvhrMOu5CNT9UapHFLbQ2JcXsmg= github.com/matryer/moq v0.0.0-20200106131100-75d0ddfc0007/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= +github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= +github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 h1:lYpkrQH5ajf0OXOcUbGjvZxxijuBwbbmlSxLiuofa+g= github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1/go.mod h1:pD8RvIylQ358TN4wwqatJ8rNavkEINozVn9DtGI3dfQ= @@ -115,44 +325,81 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/monochromegane/go-gitignore v0.0.0-20200525100937-58356a36e03f h1:0HN0GKijN4mr9SmYoW/Ni3ozuNeHiSxo2s7drhv7obY= github.com/monochromegane/go-gitignore v0.0.0-20200525100937-58356a36e03f/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= +github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nakagami/firebirdsql v0.0.0-20190310045651-3c02a58cfed8/go.mod h1:86wM1zFnC6/uDBfZGNwB65O+pR2OFi5q/YQaEUid1qA= +github.com/neo4j-drivers/gobolt v1.7.4/go.mod h1:O9AUbip4Dgre+CD3p40dnMD4a4r52QBIfblg5k7CTbE= +github.com/neo4j/neo4j-go-driver v1.7.4/go.mod h1:aPO0vVr+WnhEJne+FgFjfsjzAnssPFLucHgGZ76Zb/U= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0 h1:pWlfV3Bxv7k65HYwkikxat0+s3pV4bsqf19k25Ur8rU= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.3.0/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= 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/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= +github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= +github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= +github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= +github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371/go.mod h1:ZY1cvUeJuFPAdZ/B6v7RHavJWZn2YPVFQ1OSXhCGOkg= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/vfsgen v0.0.0-20180121065927-ffb13db8def0/go.mod h1:TrYk7fJVaAttu97ZZKrO9UbRa8izdowaMIZcxYMbVaw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -161,90 +408,319 @@ github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= +github.com/streadway/amqp v0.0.0-20200108173154-1c71cc93ed71/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v1.0.0 h1:kuuDrUJFZL1QYL9hUNuCxNObNzB0bV/ZG5jV3RWAQgo= +github.com/streadway/amqp v1.0.0/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= +github.com/tidwall/pretty v0.0.0-20180105212114-65a9db5fad51/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= +github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.1.1 h1:Qt8FeAtxE/vfdrLmR3rxR6JRE0RoVmbXu8+6kZtYU4k= github.com/urfave/cli/v2 v2.1.1/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e h1:+w0Zm/9gaWpEAyDlU1eKOuk5twTjAjuevXqcJJw8hrg= github.com/vektah/dataloaden v0.2.1-0.20190515034641-a19b9a6e7c9e/go.mod h1:/HUdMve7rvxZma+2ZELQeNh88+003LL7Pf/CZ089j8U= github.com/vektah/gqlparser/v2 v2.0.1 h1:xgl5abVnsd4hkN9rk65OJID9bfcLSMuTaTcZj777q1o= github.com/vektah/gqlparser/v2 v2.0.1/go.mod h1:SyUiHgLATUR8BiYURfTirrTcGpcE+4XkV2se04Px1Ms= +github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c h1:u40Z8hqBAAQyv+vATcGgV0YCnDjqSL7/q/JyPhhJSPk= +github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= +github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= +github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= +github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= +gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.mongodb.org/mongo-driver v1.1.0/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.mongodb.org/mongo-driver v1.3.0 h1:ew6uUIeJOo+qdUUv7LxFCUhtWmVv7ZV/Xuy4FAUsw2E= +go.mongodb.org/mongo-driver v1.3.0/go.mod h1:MSWZXKOynuguX+JSvwP8i+58jYCXxbia8HS3gZBapIE= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200213203834-85f925bdd4d0/go.mod h1:IX6Eufr4L0ErOUlzqX/aFlHqsiKZRbV42Kb69e9VsTE= +golang.org/x/exp v0.0.0-20200228211341-fcea875c7e85/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181108082009-03003ca0c849/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190425163242-31fd60d6bfdc/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190515012406-7d7faa4812bd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190531172133-b3315ee88b7d/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190823170909-c4a336ef6a2f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589 h1:rjUrONFu4kLchcZTfp3/96bR8bW8dIa8uz3cR5n0cgM= golang.org/x/tools v0.0.0-20200114235610-7ae403b6b589/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200128002243-345141a36859/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200213224642-88e652f7a869/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200303165918-5bcca83a7881/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0 h1:GwFK8+l5/gdsOYKz5p6M4UK+QT8OvmHWZPJCnf+5DjA= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200128133413-58ce757ed39b/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200303153909-beee998c1893 h1:OTjq5CN+5TpMIvzqxSFCjbBX3jNKjX0XOPi4SdBxQU8= +google.golang.org/genproto v0.0.0-20200303153909-beee998c1893/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= +gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +modernc.org/b v1.0.0/go.mod h1:uZWcZfRj1BpYzfN9JTerzlNUnnPsV9O2ZA8JsRcubNg= +modernc.org/db v1.0.0/go.mod h1:kYD/cO29L/29RM0hXYl4i3+Q5VojL31kTUVpVJDw0s8= +modernc.org/file v1.0.0/go.mod h1:uqEokAEn1u6e+J45e54dsEA/pw4o7zLrA2GwyntZzjw= +modernc.org/fileutil v1.0.0/go.mod h1:JHsWpkrk/CnVV1H/eGlFf85BEpfkrp56ro8nojIq9Q8= +modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= +modernc.org/internal v1.0.0/go.mod h1:VUD/+JAkhCpvkUitlEOnhpVxCgsBI90oTzSCRcqQVSM= +modernc.org/lldb v1.0.0/go.mod h1:jcRvJGWfCGodDZz8BPwiKMJxGJngQ/5DrRapkQnLob8= +modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= +modernc.org/ql v1.0.0/go.mod h1:xGVyrLIatPcO2C1JvI/Co8c0sr6y91HKFNy4pt9JXEY= +modernc.org/sortutil v1.1.0/go.mod h1:ZyL98OQHJgH9IEfN71VsamvJgrtRX9Dj2gX+vH86L1k= +modernc.org/strutil v1.1.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= +modernc.org/zappy v1.0.0/go.mod h1:hHe+oGahLVII/aTTyWK/b53VDHMAGCBYYeZ9sn83HC4= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sourcegraph.com/sourcegraph/appdash v0.0.0-20180110180208-2cc67fd64755/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= sourcegraph.com/sourcegraph/appdash-data v0.0.0-20151005221446-73f23eafcf67/go.mod h1:L5q+DGLGOQFpo1snNEkLOJT2d1YTW66rWNzatr3He1k= diff --git a/api/gqlgen.yml b/api/gqlgen.yml index 99b4dac..161b14a 100644 --- a/api/gqlgen.yml +++ b/api/gqlgen.yml @@ -1,10 +1,10 @@ # Where are all the schema files located? globs are supported eg src/**/*.graphqls schema: - - graph/*.graphqls + - internal/graph/schema.graphqls # Where should the generated server code go? exec: - filename: graph/generated.go + filename: internal/graph/generated.go package: graph # Uncomment to enable federation @@ -14,7 +14,7 @@ exec: # Where should any generated models go? model: - filename: graph/models_gen.go + filename: internal/graph/models_gen.go package: graph # Where should the resolver implementations go? @@ -29,7 +29,7 @@ omit_slice_element_pointers: true # gqlgen will search for any type names in the schema in these go packages # if they match it will use them, otherwise it will generate them. autobind: - - "github.com/jordanknott/project-citadel/api/pg" + - "github.com/jordanknott/project-citadel/api/internal/db" # This section declares type mapping between the GraphQL and go type systems # @@ -38,10 +38,10 @@ autobind: # your liking models: ID: - model: github.com/jordanknott/project-citadel/api/graph.UUID + model: github.com/jordanknott/project-citadel/api/internal/graph.UUID Int: model: - github.com/99designs/gqlgen/graphql.Int UUID: - model: github.com/jordanknott/project-citadel/api/graph.UUID + model: github.com/jordanknott/project-citadel/api/internal/graph.UUID diff --git a/api/router/tokens.go b/api/internal/auth/auth.go similarity index 83% rename from api/router/tokens.go rename to api/internal/auth/auth.go index cff30f6..591d0c6 100644 --- a/api/router/tokens.go +++ b/api/internal/auth/auth.go @@ -1,4 +1,4 @@ -package router +package auth import ( "time" @@ -7,6 +7,30 @@ import ( log "github.com/sirupsen/logrus" ) +var jwtKey = []byte("citadel_test_key") + +type AccessTokenClaims struct { + UserID string `json:"userId"` + jwt.StandardClaims +} + +type RefreshTokenClaims struct { + UserID string `json:"userId"` + jwt.StandardClaims +} + +type ErrExpiredToken struct{} + +func (r *ErrExpiredToken) Error() string { + return "token is expired" +} + +type ErrMalformedToken struct{} + +func (r *ErrMalformedToken) Error() string { + return "token is malformed" +} + func NewAccessToken(userID string) (string, error) { accessExpirationTime := time.Now().Add(5 * time.Second) accessClaims := &AccessTokenClaims{ @@ -51,7 +75,7 @@ func ValidateAccessToken(accessTokenString string) (AccessTokenClaims, error) { log.WithFields(log.Fields{ "token": accessTokenString, "timeToExpire": time.Unix(accessClaims.ExpiresAt, 0), - }).Info("token is valid") + }).Debug("token is valid") return *accessClaims, nil } diff --git a/api/pg/db.go b/api/internal/db/db.go similarity index 98% rename from api/pg/db.go rename to api/internal/db/db.go index 969baf7..c3c034a 100644 --- a/api/pg/db.go +++ b/api/internal/db/db.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. -package pg +package db import ( "context" diff --git a/api/pg/label_color.sql.go b/api/internal/db/label_color.sql.go similarity index 99% rename from api/pg/label_color.sql.go rename to api/internal/db/label_color.sql.go index 5986c7a..2b1e2f7 100644 --- a/api/pg/label_color.sql.go +++ b/api/internal/db/label_color.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: label_color.sql -package pg +package db import ( "context" diff --git a/api/pg/models.go b/api/internal/db/models.go similarity index 88% rename from api/pg/models.go rename to api/internal/db/models.go index 2f18099..9b08449 100644 --- a/api/pg/models.go +++ b/api/internal/db/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. -package pg +package db import ( "database/sql" @@ -38,6 +38,14 @@ type ProjectLabel struct { Name sql.NullString `json:"name"` } +type ProjectMember struct { + ProjectMemberID uuid.UUID `json:"project_member_id"` + ProjectID uuid.UUID `json:"project_id"` + UserID uuid.UUID `json:"user_id"` + AddedAt time.Time `json:"added_at"` + RoleCode string `json:"role_code"` +} + type RefreshToken struct { TokenID uuid.UUID `json:"token_id"` UserID uuid.UUID `json:"user_id"` @@ -45,6 +53,11 @@ type RefreshToken struct { ExpiresAt time.Time `json:"expires_at"` } +type Role struct { + Code string `json:"code"` + Name string `json:"name"` +} + type Task struct { TaskID uuid.UUID `json:"task_id"` TaskGroupID uuid.UUID `json:"task_group_id"` @@ -101,6 +114,7 @@ type Team struct { CreatedAt time.Time `json:"created_at"` Name string `json:"name"` OrganizationID uuid.UUID `json:"organization_id"` + Owner uuid.UUID `json:"owner"` } type TeamMember struct { @@ -108,6 +122,7 @@ type TeamMember struct { TeamID uuid.UUID `json:"team_id"` UserID uuid.UUID `json:"user_id"` Addeddate time.Time `json:"addeddate"` + RoleCode string `json:"role_code"` } type UserAccount struct { @@ -120,4 +135,5 @@ type UserAccount struct { FullName string `json:"full_name"` Initials string `json:"initials"` ProfileAvatarUrl sql.NullString `json:"profile_avatar_url"` + RoleCode string `json:"role_code"` } diff --git a/api/pg/organization.sql.go b/api/internal/db/organization.sql.go similarity index 99% rename from api/pg/organization.sql.go rename to api/internal/db/organization.sql.go index fdc8a0e..1a87c72 100644 --- a/api/pg/organization.sql.go +++ b/api/internal/db/organization.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: organization.sql -package pg +package db import ( "context" diff --git a/api/internal/db/project.sql.go b/api/internal/db/project.sql.go new file mode 100644 index 0000000..774a0e9 --- /dev/null +++ b/api/internal/db/project.sql.go @@ -0,0 +1,294 @@ +// Code generated by sqlc. DO NOT EDIT. +// source: project.sql + +package db + +import ( + "context" + "time" + + "github.com/google/uuid" +) + +const createProject = `-- name: CreateProject :one +INSERT INTO project(owner, team_id, created_at, name) VALUES ($1, $2, $3, $4) RETURNING project_id, team_id, created_at, name, owner +` + +type CreateProjectParams struct { + Owner uuid.UUID `json:"owner"` + TeamID uuid.UUID `json:"team_id"` + CreatedAt time.Time `json:"created_at"` + Name string `json:"name"` +} + +func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error) { + row := q.db.QueryRowContext(ctx, createProject, + arg.Owner, + arg.TeamID, + arg.CreatedAt, + arg.Name, + ) + var i Project + err := row.Scan( + &i.ProjectID, + &i.TeamID, + &i.CreatedAt, + &i.Name, + &i.Owner, + ) + return i, err +} + +const createProjectMember = `-- name: CreateProjectMember :one +INSERT INTO project_member (project_id, user_id, role_code, added_at) VALUES ($1, $2, $3, $4) + RETURNING project_member_id, project_id, user_id, added_at, role_code +` + +type CreateProjectMemberParams struct { + ProjectID uuid.UUID `json:"project_id"` + UserID uuid.UUID `json:"user_id"` + RoleCode string `json:"role_code"` + AddedAt time.Time `json:"added_at"` +} + +func (q *Queries) CreateProjectMember(ctx context.Context, arg CreateProjectMemberParams) (ProjectMember, error) { + row := q.db.QueryRowContext(ctx, createProjectMember, + arg.ProjectID, + arg.UserID, + arg.RoleCode, + arg.AddedAt, + ) + var i ProjectMember + err := row.Scan( + &i.ProjectMemberID, + &i.ProjectID, + &i.UserID, + &i.AddedAt, + &i.RoleCode, + ) + return i, err +} + +const deleteProjectByID = `-- name: DeleteProjectByID :exec +DELETE FROM project WHERE project_id = $1 +` + +func (q *Queries) DeleteProjectByID(ctx context.Context, projectID uuid.UUID) error { + _, err := q.db.ExecContext(ctx, deleteProjectByID, projectID) + return err +} + +const deleteProjectMember = `-- name: DeleteProjectMember :exec +DELETE FROM project_member WHERE user_id = $1 AND project_id = $2 +` + +type DeleteProjectMemberParams struct { + UserID uuid.UUID `json:"user_id"` + ProjectID uuid.UUID `json:"project_id"` +} + +func (q *Queries) DeleteProjectMember(ctx context.Context, arg DeleteProjectMemberParams) error { + _, err := q.db.ExecContext(ctx, deleteProjectMember, arg.UserID, arg.ProjectID) + return err +} + +const getAllProjects = `-- name: GetAllProjects :many +SELECT project_id, team_id, created_at, name, owner FROM project +` + +func (q *Queries) GetAllProjects(ctx context.Context) ([]Project, error) { + rows, err := q.db.QueryContext(ctx, getAllProjects) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Project + for rows.Next() { + var i Project + if err := rows.Scan( + &i.ProjectID, + &i.TeamID, + &i.CreatedAt, + &i.Name, + &i.Owner, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getAllProjectsForTeam = `-- name: GetAllProjectsForTeam :many +SELECT project_id, team_id, created_at, name, owner FROM project WHERE team_id = $1 +` + +func (q *Queries) GetAllProjectsForTeam(ctx context.Context, teamID uuid.UUID) ([]Project, error) { + rows, err := q.db.QueryContext(ctx, getAllProjectsForTeam, teamID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []Project + for rows.Next() { + var i Project + if err := rows.Scan( + &i.ProjectID, + &i.TeamID, + &i.CreatedAt, + &i.Name, + &i.Owner, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getProjectByID = `-- name: GetProjectByID :one +SELECT project_id, team_id, created_at, name, owner FROM project WHERE project_id = $1 +` + +func (q *Queries) GetProjectByID(ctx context.Context, projectID uuid.UUID) (Project, error) { + row := q.db.QueryRowContext(ctx, getProjectByID, projectID) + var i Project + err := row.Scan( + &i.ProjectID, + &i.TeamID, + &i.CreatedAt, + &i.Name, + &i.Owner, + ) + return i, err +} + +const getProjectMembersForProjectID = `-- name: GetProjectMembersForProjectID :many +SELECT project_member_id, project_id, user_id, added_at, role_code FROM project_member WHERE project_id = $1 +` + +func (q *Queries) GetProjectMembersForProjectID(ctx context.Context, projectID uuid.UUID) ([]ProjectMember, error) { + rows, err := q.db.QueryContext(ctx, getProjectMembersForProjectID, projectID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []ProjectMember + for rows.Next() { + var i ProjectMember + if err := rows.Scan( + &i.ProjectMemberID, + &i.ProjectID, + &i.UserID, + &i.AddedAt, + &i.RoleCode, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const getRoleForProjectMemberByUserID = `-- name: GetRoleForProjectMemberByUserID :one +SELECT code, role.name FROM project_member INNER JOIN role ON role.code = project_member.role_code +WHERE user_id = $1 AND project_id = $2 +` + +type GetRoleForProjectMemberByUserIDParams struct { + UserID uuid.UUID `json:"user_id"` + ProjectID uuid.UUID `json:"project_id"` +} + +func (q *Queries) GetRoleForProjectMemberByUserID(ctx context.Context, arg GetRoleForProjectMemberByUserIDParams) (Role, error) { + row := q.db.QueryRowContext(ctx, getRoleForProjectMemberByUserID, arg.UserID, arg.ProjectID) + var i Role + err := row.Scan(&i.Code, &i.Name) + return i, err +} + +const setProjectOwner = `-- name: SetProjectOwner :one +UPDATE project SET owner = $2 WHERE project_id = $1 RETURNING project_id, team_id, created_at, name, owner +` + +type SetProjectOwnerParams struct { + ProjectID uuid.UUID `json:"project_id"` + Owner uuid.UUID `json:"owner"` +} + +func (q *Queries) SetProjectOwner(ctx context.Context, arg SetProjectOwnerParams) (Project, error) { + row := q.db.QueryRowContext(ctx, setProjectOwner, arg.ProjectID, arg.Owner) + var i Project + err := row.Scan( + &i.ProjectID, + &i.TeamID, + &i.CreatedAt, + &i.Name, + &i.Owner, + ) + return i, err +} + +const updateProjectMemberRole = `-- name: UpdateProjectMemberRole :one +UPDATE project_member SET role_code = $3 WHERE project_id = $1 AND user_id = $2 + RETURNING project_member_id, project_id, user_id, added_at, role_code +` + +type UpdateProjectMemberRoleParams struct { + ProjectID uuid.UUID `json:"project_id"` + UserID uuid.UUID `json:"user_id"` + RoleCode string `json:"role_code"` +} + +func (q *Queries) UpdateProjectMemberRole(ctx context.Context, arg UpdateProjectMemberRoleParams) (ProjectMember, error) { + row := q.db.QueryRowContext(ctx, updateProjectMemberRole, arg.ProjectID, arg.UserID, arg.RoleCode) + var i ProjectMember + err := row.Scan( + &i.ProjectMemberID, + &i.ProjectID, + &i.UserID, + &i.AddedAt, + &i.RoleCode, + ) + return i, err +} + +const updateProjectNameByID = `-- name: UpdateProjectNameByID :one +UPDATE project SET name = $2 WHERE project_id = $1 RETURNING project_id, team_id, created_at, name, owner +` + +type UpdateProjectNameByIDParams struct { + ProjectID uuid.UUID `json:"project_id"` + Name string `json:"name"` +} + +func (q *Queries) UpdateProjectNameByID(ctx context.Context, arg UpdateProjectNameByIDParams) (Project, error) { + row := q.db.QueryRowContext(ctx, updateProjectNameByID, arg.ProjectID, arg.Name) + var i Project + err := row.Scan( + &i.ProjectID, + &i.TeamID, + &i.CreatedAt, + &i.Name, + &i.Owner, + ) + return i, err +} diff --git a/api/pg/project_label.sql.go b/api/internal/db/project_label.sql.go similarity index 99% rename from api/pg/project_label.sql.go rename to api/internal/db/project_label.sql.go index 8d5e5fb..6fec2ec 100644 --- a/api/pg/project_label.sql.go +++ b/api/internal/db/project_label.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: project_label.sql -package pg +package db import ( "context" diff --git a/api/pg/querier.go b/api/internal/db/querier.go similarity index 84% rename from api/pg/querier.go rename to api/internal/db/querier.go index 059c562..15ecfb6 100644 --- a/api/pg/querier.go +++ b/api/internal/db/querier.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. -package pg +package db import ( "context" @@ -13,6 +13,7 @@ type Querier interface { CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Organization, error) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error) CreateProjectLabel(ctx context.Context, arg CreateProjectLabelParams) (ProjectLabel, error) + CreateProjectMember(ctx context.Context, arg CreateProjectMemberParams) (ProjectMember, error) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (RefreshToken, error) CreateTask(ctx context.Context, arg CreateTaskParams) (Task, error) CreateTaskAssigned(ctx context.Context, arg CreateTaskAssignedParams) (TaskAssigned, error) @@ -26,6 +27,7 @@ type Querier interface { DeleteExpiredTokens(ctx context.Context) error DeleteProjectByID(ctx context.Context, projectID uuid.UUID) error DeleteProjectLabelByID(ctx context.Context, projectLabelID uuid.UUID) error + DeleteProjectMember(ctx context.Context, arg DeleteProjectMemberParams) error DeleteRefreshTokenByID(ctx context.Context, tokenID uuid.UUID) error DeleteRefreshTokenByUserID(ctx context.Context, userID uuid.UUID) error DeleteTaskAssignedByID(ctx context.Context, arg DeleteTaskAssignedByIDParams) (TaskAssigned, error) @@ -37,7 +39,7 @@ type Querier interface { DeleteTaskLabelForTaskByProjectLabelID(ctx context.Context, arg DeleteTaskLabelForTaskByProjectLabelIDParams) error DeleteTasksByTaskGroupID(ctx context.Context, taskGroupID uuid.UUID) (int64, error) DeleteTeamByID(ctx context.Context, teamID uuid.UUID) error - DeleteTeamMemberByUserID(ctx context.Context, userID uuid.UUID) error + DeleteTeamMember(ctx context.Context, arg DeleteTeamMemberParams) error DeleteUserAccountByID(ctx context.Context, userID uuid.UUID) error GetAllOrganizations(ctx context.Context) ([]Organization, error) GetAllProjects(ctx context.Context) ([]Project, error) @@ -50,9 +52,14 @@ type Querier interface { GetLabelColorByID(ctx context.Context, labelColorID uuid.UUID) (LabelColor, error) GetLabelColors(ctx context.Context) ([]LabelColor, error) GetProjectByID(ctx context.Context, projectID uuid.UUID) (Project, error) + GetProjectIDForTask(ctx context.Context, taskID uuid.UUID) (uuid.UUID, error) GetProjectLabelByID(ctx context.Context, projectLabelID uuid.UUID) (ProjectLabel, error) GetProjectLabelsForProject(ctx context.Context, projectID uuid.UUID) ([]ProjectLabel, error) + GetProjectMembersForProjectID(ctx context.Context, projectID uuid.UUID) ([]ProjectMember, error) GetRefreshTokenByID(ctx context.Context, tokenID uuid.UUID) (RefreshToken, error) + GetRoleForProjectMemberByUserID(ctx context.Context, arg GetRoleForProjectMemberByUserIDParams) (Role, error) + GetRoleForTeamMember(ctx context.Context, arg GetRoleForTeamMemberParams) (Role, error) + GetRoleForUserID(ctx context.Context, userID uuid.UUID) (GetRoleForUserIDRow, error) GetTaskByID(ctx context.Context, taskID uuid.UUID) (Task, error) GetTaskChecklistByID(ctx context.Context, taskChecklistID uuid.UUID) (TaskChecklist, error) GetTaskChecklistItemByID(ctx context.Context, taskChecklistItemID uuid.UUID) (TaskChecklistItem, error) @@ -65,16 +72,20 @@ type Querier interface { GetTaskLabelsForTaskID(ctx context.Context, taskID uuid.UUID) ([]TaskLabel, error) GetTasksForTaskGroupID(ctx context.Context, taskGroupID uuid.UUID) ([]Task, error) GetTeamByID(ctx context.Context, teamID uuid.UUID) (Team, error) + GetTeamMemberByID(ctx context.Context, arg GetTeamMemberByIDParams) (TeamMember, error) GetTeamMembersForTeamID(ctx context.Context, teamID uuid.UUID) ([]TeamMember, error) GetTeamsForOrganization(ctx context.Context, organizationID uuid.UUID) ([]Team, error) GetUserAccountByID(ctx context.Context, userID uuid.UUID) (UserAccount, error) GetUserAccountByUsername(ctx context.Context, username string) (UserAccount, error) + SetProjectOwner(ctx context.Context, arg SetProjectOwnerParams) (Project, error) SetTaskChecklistItemComplete(ctx context.Context, arg SetTaskChecklistItemCompleteParams) (TaskChecklistItem, error) SetTaskComplete(ctx context.Context, arg SetTaskCompleteParams) (Task, error) SetTaskGroupName(ctx context.Context, arg SetTaskGroupNameParams) (TaskGroup, error) + SetTeamOwner(ctx context.Context, arg SetTeamOwnerParams) (Team, error) UpdateProjectLabel(ctx context.Context, arg UpdateProjectLabelParams) (ProjectLabel, error) UpdateProjectLabelColor(ctx context.Context, arg UpdateProjectLabelColorParams) (ProjectLabel, error) UpdateProjectLabelName(ctx context.Context, arg UpdateProjectLabelNameParams) (ProjectLabel, error) + UpdateProjectMemberRole(ctx context.Context, arg UpdateProjectMemberRoleParams) (ProjectMember, error) UpdateProjectNameByID(ctx context.Context, arg UpdateProjectNameByIDParams) (Project, error) UpdateTaskChecklistItemName(ctx context.Context, arg UpdateTaskChecklistItemNameParams) (TaskChecklistItem, error) UpdateTaskChecklistName(ctx context.Context, arg UpdateTaskChecklistNameParams) (TaskChecklist, error) @@ -83,6 +94,7 @@ type Querier interface { UpdateTaskGroupLocation(ctx context.Context, arg UpdateTaskGroupLocationParams) (TaskGroup, error) UpdateTaskLocation(ctx context.Context, arg UpdateTaskLocationParams) (Task, error) UpdateTaskName(ctx context.Context, arg UpdateTaskNameParams) (Task, error) + UpdateTeamMemberRole(ctx context.Context, arg UpdateTeamMemberRoleParams) (TeamMember, error) UpdateUserAccountProfileAvatarURL(ctx context.Context, arg UpdateUserAccountProfileAvatarURLParams) (UserAccount, error) } diff --git a/api/query/label_color.sql b/api/internal/db/query/label_color.sql similarity index 100% rename from api/query/label_color.sql rename to api/internal/db/query/label_color.sql diff --git a/api/query/organization.sql b/api/internal/db/query/organization.sql similarity index 100% rename from api/query/organization.sql rename to api/internal/db/query/organization.sql diff --git a/api/internal/db/query/project.sql b/api/internal/db/query/project.sql new file mode 100644 index 0000000..2d14f76 --- /dev/null +++ b/api/internal/db/query/project.sql @@ -0,0 +1,41 @@ +-- name: GetAllProjects :many +SELECT * FROM project; + +-- name: GetAllProjectsForTeam :many +SELECT * FROM project WHERE team_id = $1; + +-- name: GetProjectByID :one +SELECT * FROM project WHERE project_id = $1; + +-- name: CreateProject :one +INSERT INTO project(owner, team_id, created_at, name) VALUES ($1, $2, $3, $4) RETURNING *; + +-- name: SetProjectOwner :one +UPDATE project SET owner = $2 WHERE project_id = $1 RETURNING *; + +-- name: UpdateProjectNameByID :one +UPDATE project SET name = $2 WHERE project_id = $1 RETURNING *; + +-- name: DeleteProjectByID :exec +DELETE FROM project WHERE project_id = $1; + +-- name: GetProjectMembersForProjectID :many +SELECT * FROM project_member WHERE project_id = $1; + +-- name: GetRoleForProjectMemberByUserID :one +SELECT code, role.name FROM project_member INNER JOIN role ON role.code = project_member.role_code +WHERE user_id = $1 AND project_id = $2; + +-- name: CreateProjectMember :one +INSERT INTO project_member (project_id, user_id, role_code, added_at) VALUES ($1, $2, $3, $4) + RETURNING *; + +-- name: DeleteProjectMember :exec +DELETE FROM project_member WHERE user_id = $1 AND project_id = $2; + +-- name: UpdateProjectMemberRole :one +UPDATE project_member SET role_code = $3 WHERE project_id = $1 AND user_id = $2 + RETURNING *; + + + diff --git a/api/query/project_label.sql b/api/internal/db/query/project_label.sql similarity index 100% rename from api/query/project_label.sql rename to api/internal/db/query/project_label.sql diff --git a/api/query/task.sql b/api/internal/db/query/task.sql similarity index 86% rename from api/query/task.sql rename to api/internal/db/query/task.sql index d32b743..228ffcd 100644 --- a/api/query/task.sql +++ b/api/internal/db/query/task.sql @@ -31,3 +31,8 @@ UPDATE task SET due_date = $2 WHERE task_id = $1 RETURNING *; -- name: SetTaskComplete :one UPDATE task SET complete = $2 WHERE task_id = $1 RETURNING *; + +-- name: GetProjectIDForTask :one +SELECT project_id FROM task + INNER JOIN task_group ON task_group.task_group_id = task.task_group_id + WHERE task_id = $1; diff --git a/api/query/task_assigned.sql b/api/internal/db/query/task_assigned.sql similarity index 100% rename from api/query/task_assigned.sql rename to api/internal/db/query/task_assigned.sql diff --git a/api/query/task_checklist.sql b/api/internal/db/query/task_checklist.sql similarity index 100% rename from api/query/task_checklist.sql rename to api/internal/db/query/task_checklist.sql diff --git a/api/query/task_group.sql b/api/internal/db/query/task_group.sql similarity index 100% rename from api/query/task_group.sql rename to api/internal/db/query/task_group.sql diff --git a/api/query/task_label.sql b/api/internal/db/query/task_label.sql similarity index 100% rename from api/query/task_label.sql rename to api/internal/db/query/task_label.sql diff --git a/api/query/team.sql b/api/internal/db/query/team.sql similarity index 61% rename from api/query/team.sql rename to api/internal/db/query/team.sql index f2f6e8f..7ff17fe 100644 --- a/api/query/team.sql +++ b/api/internal/db/query/team.sql @@ -5,10 +5,13 @@ SELECT * FROM team; SELECT * FROM team WHERE team_id = $1; -- name: CreateTeam :one -INSERT INTO team (organization_id, created_at, name) VALUES ($1, $2, $3) RETURNING *; +INSERT INTO team (organization_id, created_at, name, owner) VALUES ($1, $2, $3, $4) RETURNING *; -- name: DeleteTeamByID :exec DELETE FROM team WHERE team_id = $1; -- name: GetTeamsForOrganization :many SELECT * FROM team WHERE organization_id = $1; + +-- name: SetTeamOwner :one +UPDATE team SET owner = $2 WHERE team_id = $1 RETURNING *; diff --git a/api/internal/db/query/team_member.sql b/api/internal/db/query/team_member.sql new file mode 100644 index 0000000..793146e --- /dev/null +++ b/api/internal/db/query/team_member.sql @@ -0,0 +1,21 @@ +-- name: CreateTeamMember :one +INSERT INTO team_member (team_id, user_id, addedDate, role_code) VALUES ($1, $2, $3, $4) + RETURNING *; + +-- name: GetTeamMembersForTeamID :many +SELECT * FROM team_member WHERE team_id = $1; + +-- name: DeleteTeamMember :exec +DELETE FROM team_member WHERE user_id = $1 AND team_id = $2; + +-- name: GetRoleForTeamMember :one +SELECT code, role.name FROM team_member + INNER JOIN role ON role.code = team_member.role_code + WHERE user_id = $1 AND team_id = $2; + +-- name: UpdateTeamMemberRole :one +UPDATE team_member SET role_code = $3 WHERE user_id = $2 AND team_id = $1 + RETURNING *; + +-- name: GetTeamMemberByID :one +SELECT * FROM team_member WHERE team_id = $1 AND user_id = $2; diff --git a/api/query/token.sql b/api/internal/db/query/token.sql similarity index 100% rename from api/query/token.sql rename to api/internal/db/query/token.sql diff --git a/api/query/user_accounts.sql b/api/internal/db/query/user_accounts.sql similarity index 68% rename from api/query/user_accounts.sql rename to api/internal/db/query/user_accounts.sql index a3af29d..cc00373 100644 --- a/api/query/user_accounts.sql +++ b/api/internal/db/query/user_accounts.sql @@ -8,8 +8,8 @@ SELECT * FROM user_account; SELECT * FROM user_account WHERE username = $1; -- name: CreateUserAccount :one -INSERT INTO user_account(full_name, initials, email, username, created_at, password_hash) - VALUES ($1, $2, $3, $4, $5, $6) RETURNING *; +INSERT INTO user_account(full_name, initials, email, username, created_at, password_hash, role_code) + VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING *; -- name: UpdateUserAccountProfileAvatarURL :one UPDATE user_account SET profile_avatar_url = $2 WHERE user_id = $1 @@ -17,3 +17,8 @@ UPDATE user_account SET profile_avatar_url = $2 WHERE user_id = $1 -- name: DeleteUserAccountByID :exec DELETE FROM user_account WHERE user_id = $1; + +-- name: GetRoleForUserID :one +SELECT username, role.code, role.name FROM user_account + INNER JOIN role ON role.code = user_account.role_code +WHERE user_id = $1; diff --git a/api/internal/db/repository.go b/api/internal/db/repository.go new file mode 100644 index 0000000..d3e2d91 --- /dev/null +++ b/api/internal/db/repository.go @@ -0,0 +1,18 @@ +package db + +import ( + "github.com/jmoiron/sqlx" +) + +type Repository struct { + *Queries + db *sqlx.DB +} + +// NewRepository returns an implementation of the Repository interface. +func NewRepository(db *sqlx.DB) *Repository { + return &Repository{ + Queries: New(db.DB), + db: db, + } +} diff --git a/api/pg/task.sql.go b/api/internal/db/task.sql.go similarity index 94% rename from api/pg/task.sql.go rename to api/internal/db/task.sql.go index 33c6d73..0f7caec 100644 --- a/api/pg/task.sql.go +++ b/api/internal/db/task.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: task.sql -package pg +package db import ( "context" @@ -101,6 +101,19 @@ func (q *Queries) GetAllTasks(ctx context.Context) ([]Task, error) { return items, nil } +const getProjectIDForTask = `-- name: GetProjectIDForTask :one +SELECT project_id FROM task + INNER JOIN task_group ON task_group.task_group_id = task.task_group_id + WHERE task_id = $1 +` + +func (q *Queries) GetProjectIDForTask(ctx context.Context, taskID uuid.UUID) (uuid.UUID, error) { + row := q.db.QueryRowContext(ctx, getProjectIDForTask, taskID) + var project_id uuid.UUID + err := row.Scan(&project_id) + return project_id, err +} + const getTaskByID = `-- name: GetTaskByID :one SELECT task_id, task_group_id, created_at, name, position, description, due_date, complete FROM task WHERE task_id = $1 ` diff --git a/api/pg/task_assigned.sql.go b/api/internal/db/task_assigned.sql.go similarity index 99% rename from api/pg/task_assigned.sql.go rename to api/internal/db/task_assigned.sql.go index 73f0df9..cf3cc79 100644 --- a/api/pg/task_assigned.sql.go +++ b/api/internal/db/task_assigned.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: task_assigned.sql -package pg +package db import ( "context" diff --git a/api/pg/task_checklist.sql.go b/api/internal/db/task_checklist.sql.go similarity index 99% rename from api/pg/task_checklist.sql.go rename to api/internal/db/task_checklist.sql.go index 9cc1734..4cbb859 100644 --- a/api/pg/task_checklist.sql.go +++ b/api/internal/db/task_checklist.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: task_checklist.sql -package pg +package db import ( "context" diff --git a/api/pg/task_group.sql.go b/api/internal/db/task_group.sql.go similarity index 99% rename from api/pg/task_group.sql.go rename to api/internal/db/task_group.sql.go index e0cb17b..cf22e19 100644 --- a/api/pg/task_group.sql.go +++ b/api/internal/db/task_group.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: task_group.sql -package pg +package db import ( "context" diff --git a/api/pg/task_label.sql.go b/api/internal/db/task_label.sql.go similarity index 99% rename from api/pg/task_label.sql.go rename to api/internal/db/task_label.sql.go index dfc7106..cc2b851 100644 --- a/api/pg/task_label.sql.go +++ b/api/internal/db/task_label.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: task_label.sql -package pg +package db import ( "context" diff --git a/api/pg/team.sql.go b/api/internal/db/team.sql.go similarity index 66% rename from api/pg/team.sql.go rename to api/internal/db/team.sql.go index 9d22118..8ae9455 100644 --- a/api/pg/team.sql.go +++ b/api/internal/db/team.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: team.sql -package pg +package db import ( "context" @@ -11,23 +11,30 @@ import ( ) const createTeam = `-- name: CreateTeam :one -INSERT INTO team (organization_id, created_at, name) VALUES ($1, $2, $3) RETURNING team_id, created_at, name, organization_id +INSERT INTO team (organization_id, created_at, name, owner) VALUES ($1, $2, $3, $4) RETURNING team_id, created_at, name, organization_id, owner ` type CreateTeamParams struct { OrganizationID uuid.UUID `json:"organization_id"` CreatedAt time.Time `json:"created_at"` Name string `json:"name"` + Owner uuid.UUID `json:"owner"` } func (q *Queries) CreateTeam(ctx context.Context, arg CreateTeamParams) (Team, error) { - row := q.db.QueryRowContext(ctx, createTeam, arg.OrganizationID, arg.CreatedAt, arg.Name) + row := q.db.QueryRowContext(ctx, createTeam, + arg.OrganizationID, + arg.CreatedAt, + arg.Name, + arg.Owner, + ) var i Team err := row.Scan( &i.TeamID, &i.CreatedAt, &i.Name, &i.OrganizationID, + &i.Owner, ) return i, err } @@ -42,7 +49,7 @@ func (q *Queries) DeleteTeamByID(ctx context.Context, teamID uuid.UUID) error { } const getAllTeams = `-- name: GetAllTeams :many -SELECT team_id, created_at, name, organization_id FROM team +SELECT team_id, created_at, name, organization_id, owner FROM team ` func (q *Queries) GetAllTeams(ctx context.Context) ([]Team, error) { @@ -59,6 +66,7 @@ func (q *Queries) GetAllTeams(ctx context.Context) ([]Team, error) { &i.CreatedAt, &i.Name, &i.OrganizationID, + &i.Owner, ); err != nil { return nil, err } @@ -74,7 +82,7 @@ func (q *Queries) GetAllTeams(ctx context.Context) ([]Team, error) { } const getTeamByID = `-- name: GetTeamByID :one -SELECT team_id, created_at, name, organization_id FROM team WHERE team_id = $1 +SELECT team_id, created_at, name, organization_id, owner FROM team WHERE team_id = $1 ` func (q *Queries) GetTeamByID(ctx context.Context, teamID uuid.UUID) (Team, error) { @@ -85,12 +93,13 @@ func (q *Queries) GetTeamByID(ctx context.Context, teamID uuid.UUID) (Team, erro &i.CreatedAt, &i.Name, &i.OrganizationID, + &i.Owner, ) return i, err } const getTeamsForOrganization = `-- name: GetTeamsForOrganization :many -SELECT team_id, created_at, name, organization_id FROM team WHERE organization_id = $1 +SELECT team_id, created_at, name, organization_id, owner FROM team WHERE organization_id = $1 ` func (q *Queries) GetTeamsForOrganization(ctx context.Context, organizationID uuid.UUID) ([]Team, error) { @@ -107,6 +116,7 @@ func (q *Queries) GetTeamsForOrganization(ctx context.Context, organizationID uu &i.CreatedAt, &i.Name, &i.OrganizationID, + &i.Owner, ); err != nil { return nil, err } @@ -120,3 +130,25 @@ func (q *Queries) GetTeamsForOrganization(ctx context.Context, organizationID uu } return items, nil } + +const setTeamOwner = `-- name: SetTeamOwner :one +UPDATE team SET owner = $2 WHERE team_id = $1 RETURNING team_id, created_at, name, organization_id, owner +` + +type SetTeamOwnerParams struct { + TeamID uuid.UUID `json:"team_id"` + Owner uuid.UUID `json:"owner"` +} + +func (q *Queries) SetTeamOwner(ctx context.Context, arg SetTeamOwnerParams) (Team, error) { + row := q.db.QueryRowContext(ctx, setTeamOwner, arg.TeamID, arg.Owner) + var i Team + err := row.Scan( + &i.TeamID, + &i.CreatedAt, + &i.Name, + &i.OrganizationID, + &i.Owner, + ) + return i, err +} diff --git a/api/internal/db/team_member.sql.go b/api/internal/db/team_member.sql.go new file mode 100644 index 0000000..c5b8c50 --- /dev/null +++ b/api/internal/db/team_member.sql.go @@ -0,0 +1,152 @@ +// Code generated by sqlc. DO NOT EDIT. +// source: team_member.sql + +package db + +import ( + "context" + "time" + + "github.com/google/uuid" +) + +const createTeamMember = `-- name: CreateTeamMember :one +INSERT INTO team_member (team_id, user_id, addedDate, role_code) VALUES ($1, $2, $3, $4) + RETURNING team_member_id, team_id, user_id, addeddate, role_code +` + +type CreateTeamMemberParams struct { + TeamID uuid.UUID `json:"team_id"` + UserID uuid.UUID `json:"user_id"` + Addeddate time.Time `json:"addeddate"` + RoleCode string `json:"role_code"` +} + +func (q *Queries) CreateTeamMember(ctx context.Context, arg CreateTeamMemberParams) (TeamMember, error) { + row := q.db.QueryRowContext(ctx, createTeamMember, + arg.TeamID, + arg.UserID, + arg.Addeddate, + arg.RoleCode, + ) + var i TeamMember + err := row.Scan( + &i.TeamMemberID, + &i.TeamID, + &i.UserID, + &i.Addeddate, + &i.RoleCode, + ) + return i, err +} + +const deleteTeamMember = `-- name: DeleteTeamMember :exec +DELETE FROM team_member WHERE user_id = $1 AND team_id = $2 +` + +type DeleteTeamMemberParams struct { + UserID uuid.UUID `json:"user_id"` + TeamID uuid.UUID `json:"team_id"` +} + +func (q *Queries) DeleteTeamMember(ctx context.Context, arg DeleteTeamMemberParams) error { + _, err := q.db.ExecContext(ctx, deleteTeamMember, arg.UserID, arg.TeamID) + return err +} + +const getRoleForTeamMember = `-- name: GetRoleForTeamMember :one +SELECT code, role.name FROM team_member + INNER JOIN role ON role.code = team_member.role_code + WHERE user_id = $1 AND team_id = $2 +` + +type GetRoleForTeamMemberParams struct { + UserID uuid.UUID `json:"user_id"` + TeamID uuid.UUID `json:"team_id"` +} + +func (q *Queries) GetRoleForTeamMember(ctx context.Context, arg GetRoleForTeamMemberParams) (Role, error) { + row := q.db.QueryRowContext(ctx, getRoleForTeamMember, arg.UserID, arg.TeamID) + var i Role + err := row.Scan(&i.Code, &i.Name) + return i, err +} + +const getTeamMemberByID = `-- name: GetTeamMemberByID :one +SELECT team_member_id, team_id, user_id, addeddate, role_code FROM team_member WHERE team_id = $1 AND user_id = $2 +` + +type GetTeamMemberByIDParams struct { + TeamID uuid.UUID `json:"team_id"` + UserID uuid.UUID `json:"user_id"` +} + +func (q *Queries) GetTeamMemberByID(ctx context.Context, arg GetTeamMemberByIDParams) (TeamMember, error) { + row := q.db.QueryRowContext(ctx, getTeamMemberByID, arg.TeamID, arg.UserID) + var i TeamMember + err := row.Scan( + &i.TeamMemberID, + &i.TeamID, + &i.UserID, + &i.Addeddate, + &i.RoleCode, + ) + return i, err +} + +const getTeamMembersForTeamID = `-- name: GetTeamMembersForTeamID :many +SELECT team_member_id, team_id, user_id, addeddate, role_code FROM team_member WHERE team_id = $1 +` + +func (q *Queries) GetTeamMembersForTeamID(ctx context.Context, teamID uuid.UUID) ([]TeamMember, error) { + rows, err := q.db.QueryContext(ctx, getTeamMembersForTeamID, teamID) + if err != nil { + return nil, err + } + defer rows.Close() + var items []TeamMember + for rows.Next() { + var i TeamMember + if err := rows.Scan( + &i.TeamMemberID, + &i.TeamID, + &i.UserID, + &i.Addeddate, + &i.RoleCode, + ); err != nil { + return nil, err + } + items = append(items, i) + } + if err := rows.Close(); err != nil { + return nil, err + } + if err := rows.Err(); err != nil { + return nil, err + } + return items, nil +} + +const updateTeamMemberRole = `-- name: UpdateTeamMemberRole :one +UPDATE team_member SET role_code = $3 WHERE user_id = $2 AND team_id = $1 + RETURNING team_member_id, team_id, user_id, addeddate, role_code +` + +type UpdateTeamMemberRoleParams struct { + TeamID uuid.UUID `json:"team_id"` + UserID uuid.UUID `json:"user_id"` + RoleCode string `json:"role_code"` +} + +func (q *Queries) UpdateTeamMemberRole(ctx context.Context, arg UpdateTeamMemberRoleParams) (TeamMember, error) { + row := q.db.QueryRowContext(ctx, updateTeamMemberRole, arg.TeamID, arg.UserID, arg.RoleCode) + var i TeamMember + err := row.Scan( + &i.TeamMemberID, + &i.TeamID, + &i.UserID, + &i.Addeddate, + &i.RoleCode, + ) + return i, err +} diff --git a/api/pg/token.sql.go b/api/internal/db/token.sql.go similarity index 99% rename from api/pg/token.sql.go rename to api/internal/db/token.sql.go index 351ee5a..6fb4f3c 100644 --- a/api/pg/token.sql.go +++ b/api/internal/db/token.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: token.sql -package pg +package db import ( "context" diff --git a/api/pg/user_accounts.sql.go b/api/internal/db/user_accounts.sql.go similarity index 75% rename from api/pg/user_accounts.sql.go rename to api/internal/db/user_accounts.sql.go index 89490ed..acec84b 100644 --- a/api/pg/user_accounts.sql.go +++ b/api/internal/db/user_accounts.sql.go @@ -1,7 +1,7 @@ // Code generated by sqlc. DO NOT EDIT. // source: user_accounts.sql -package pg +package db import ( "context" @@ -12,8 +12,8 @@ import ( ) const createUserAccount = `-- name: CreateUserAccount :one -INSERT INTO user_account(full_name, initials, email, username, created_at, password_hash) - VALUES ($1, $2, $3, $4, $5, $6) RETURNING user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url +INSERT INTO user_account(full_name, initials, email, username, created_at, password_hash, role_code) + VALUES ($1, $2, $3, $4, $5, $6, $7) RETURNING user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url, role_code ` type CreateUserAccountParams struct { @@ -23,6 +23,7 @@ type CreateUserAccountParams struct { Username string `json:"username"` CreatedAt time.Time `json:"created_at"` PasswordHash string `json:"password_hash"` + RoleCode string `json:"role_code"` } func (q *Queries) CreateUserAccount(ctx context.Context, arg CreateUserAccountParams) (UserAccount, error) { @@ -33,6 +34,7 @@ func (q *Queries) CreateUserAccount(ctx context.Context, arg CreateUserAccountPa arg.Username, arg.CreatedAt, arg.PasswordHash, + arg.RoleCode, ) var i UserAccount err := row.Scan( @@ -45,6 +47,7 @@ func (q *Queries) CreateUserAccount(ctx context.Context, arg CreateUserAccountPa &i.FullName, &i.Initials, &i.ProfileAvatarUrl, + &i.RoleCode, ) return i, err } @@ -59,7 +62,7 @@ func (q *Queries) DeleteUserAccountByID(ctx context.Context, userID uuid.UUID) e } const getAllUserAccounts = `-- name: GetAllUserAccounts :many -SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url FROM user_account +SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url, role_code FROM user_account ` func (q *Queries) GetAllUserAccounts(ctx context.Context) ([]UserAccount, error) { @@ -81,6 +84,7 @@ func (q *Queries) GetAllUserAccounts(ctx context.Context) ([]UserAccount, error) &i.FullName, &i.Initials, &i.ProfileAvatarUrl, + &i.RoleCode, ); err != nil { return nil, err } @@ -95,8 +99,27 @@ func (q *Queries) GetAllUserAccounts(ctx context.Context) ([]UserAccount, error) return items, nil } +const getRoleForUserID = `-- name: GetRoleForUserID :one +SELECT username, role.code, role.name FROM user_account + INNER JOIN role ON role.code = user_account.role_code +WHERE user_id = $1 +` + +type GetRoleForUserIDRow struct { + Username string `json:"username"` + Code string `json:"code"` + Name string `json:"name"` +} + +func (q *Queries) GetRoleForUserID(ctx context.Context, userID uuid.UUID) (GetRoleForUserIDRow, error) { + row := q.db.QueryRowContext(ctx, getRoleForUserID, userID) + var i GetRoleForUserIDRow + err := row.Scan(&i.Username, &i.Code, &i.Name) + return i, err +} + const getUserAccountByID = `-- name: GetUserAccountByID :one -SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url FROM user_account WHERE user_id = $1 +SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url, role_code FROM user_account WHERE user_id = $1 ` func (q *Queries) GetUserAccountByID(ctx context.Context, userID uuid.UUID) (UserAccount, error) { @@ -112,12 +135,13 @@ func (q *Queries) GetUserAccountByID(ctx context.Context, userID uuid.UUID) (Use &i.FullName, &i.Initials, &i.ProfileAvatarUrl, + &i.RoleCode, ) return i, err } const getUserAccountByUsername = `-- name: GetUserAccountByUsername :one -SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url FROM user_account WHERE username = $1 +SELECT user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url, role_code FROM user_account WHERE username = $1 ` func (q *Queries) GetUserAccountByUsername(ctx context.Context, username string) (UserAccount, error) { @@ -133,13 +157,14 @@ func (q *Queries) GetUserAccountByUsername(ctx context.Context, username string) &i.FullName, &i.Initials, &i.ProfileAvatarUrl, + &i.RoleCode, ) return i, err } const updateUserAccountProfileAvatarURL = `-- name: UpdateUserAccountProfileAvatarURL :one UPDATE user_account SET profile_avatar_url = $2 WHERE user_id = $1 - RETURNING user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url + RETURNING user_id, created_at, email, username, password_hash, profile_bg_color, full_name, initials, profile_avatar_url, role_code ` type UpdateUserAccountProfileAvatarURLParams struct { @@ -160,6 +185,7 @@ func (q *Queries) UpdateUserAccountProfileAvatarURL(ctx context.Context, arg Upd &i.FullName, &i.Initials, &i.ProfileAvatarUrl, + &i.RoleCode, ) return i, err } diff --git a/api/graph/generated.go b/api/internal/graph/generated.go similarity index 76% rename from api/graph/generated.go rename to api/internal/graph/generated.go index 4da3d2c..80b886c 100644 --- a/api/graph/generated.go +++ b/api/internal/graph/generated.go @@ -14,7 +14,7 @@ import ( "github.com/99designs/gqlgen/graphql" "github.com/99designs/gqlgen/graphql/introspection" "github.com/google/uuid" - "github.com/jordanknott/project-citadel/api/pg" + "github.com/jordanknott/project-citadel/api/internal/db" gqlparser "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" ) @@ -62,11 +62,22 @@ type ComplexityRoot struct { Total func(childComplexity int) int } + CreateProjectMemberPayload struct { + Member func(childComplexity int) int + Ok func(childComplexity int) int + } + CreateTeamMemberPayload struct { Team func(childComplexity int) int TeamMember func(childComplexity int) int } + DeleteProjectMemberPayload struct { + Member func(childComplexity int) int + Ok func(childComplexity int) int + ProjectID func(childComplexity int) int + } + DeleteProjectPayload struct { Ok func(childComplexity int) int Project func(childComplexity int) int @@ -92,6 +103,11 @@ type ComplexityRoot struct { TaskID func(childComplexity int) int } + DeleteTeamMemberPayload struct { + TeamID func(childComplexity int) int + UserID func(childComplexity int) int + } + DeleteTeamPayload struct { Ok func(childComplexity int) int Projects func(childComplexity int) int @@ -110,12 +126,21 @@ type ComplexityRoot struct { Position func(childComplexity int) int } + Member struct { + FullName func(childComplexity int) int + ID func(childComplexity int) int + ProfileIcon func(childComplexity int) int + Role func(childComplexity int) int + Username func(childComplexity int) int + } + Mutation struct { AddTaskLabel func(childComplexity int, input *AddTaskLabelInput) int AssignTask func(childComplexity int, input *AssignTaskInput) int ClearProfileAvatar func(childComplexity int) int CreateProject func(childComplexity int, input NewProject) int CreateProjectLabel func(childComplexity int, input NewProjectLabel) int + CreateProjectMember func(childComplexity int, input CreateProjectMember) int CreateRefreshToken func(childComplexity int, input NewRefreshToken) int CreateTask func(childComplexity int, input NewTask) int CreateTaskChecklist func(childComplexity int, input CreateTaskChecklist) int @@ -126,21 +151,26 @@ type ComplexityRoot struct { CreateUserAccount func(childComplexity int, input NewUserAccount) int DeleteProject func(childComplexity int, input DeleteProject) int DeleteProjectLabel func(childComplexity int, input DeleteProjectLabel) int + DeleteProjectMember func(childComplexity int, input DeleteProjectMember) int DeleteTask func(childComplexity int, input DeleteTaskInput) int DeleteTaskChecklist func(childComplexity int, input DeleteTaskChecklist) int DeleteTaskChecklistItem func(childComplexity int, input DeleteTaskChecklistItem) int DeleteTaskGroup func(childComplexity int, input DeleteTaskGroupInput) int DeleteTeam func(childComplexity int, input DeleteTeam) int + DeleteTeamMember func(childComplexity int, input DeleteTeamMember) int DeleteUserAccount func(childComplexity int, input DeleteUserAccount) int LogoutUser func(childComplexity int, input LogoutUser) int RemoveTaskLabel func(childComplexity int, input *RemoveTaskLabelInput) int + SetProjectOwner func(childComplexity int, input SetProjectOwner) int SetTaskChecklistItemComplete func(childComplexity int, input SetTaskChecklistItemComplete) int SetTaskComplete func(childComplexity int, input SetTaskComplete) int + SetTeamOwner func(childComplexity int, input SetTeamOwner) int ToggleTaskLabel func(childComplexity int, input ToggleTaskLabelInput) int UnassignTask func(childComplexity int, input *UnassignTaskInput) int UpdateProjectLabel func(childComplexity int, input UpdateProjectLabel) int UpdateProjectLabelColor func(childComplexity int, input UpdateProjectLabelColor) int UpdateProjectLabelName func(childComplexity int, input UpdateProjectLabelName) int + UpdateProjectMemberRole func(childComplexity int, input UpdateProjectMemberRole) int UpdateProjectName func(childComplexity int, input *UpdateProjectName) int UpdateTaskChecklistItemName func(childComplexity int, input UpdateTaskChecklistItemName) int UpdateTaskChecklistName func(childComplexity int, input UpdateTaskChecklistName) int @@ -150,6 +180,7 @@ type ComplexityRoot struct { UpdateTaskGroupName func(childComplexity int, input UpdateTaskGroupName) int UpdateTaskLocation func(childComplexity int, input NewTaskLocation) int UpdateTaskName func(childComplexity int, input UpdateTaskName) int + UpdateTeamMemberRole func(childComplexity int, input UpdateTeamMemberRole) int } Organization struct { @@ -181,12 +212,6 @@ type ComplexityRoot struct { Name func(childComplexity int) int } - ProjectMember struct { - FullName func(childComplexity int) int - ID func(childComplexity int) int - ProfileIcon func(childComplexity int) int - } - Query struct { FindProject func(childComplexity int, input FindProject) int FindTask func(childComplexity int, input FindTask) int @@ -208,6 +233,23 @@ type ComplexityRoot struct { UserID func(childComplexity int) int } + Role struct { + Code func(childComplexity int) int + Name func(childComplexity int) int + } + + SetProjectOwnerPayload struct { + NewOwner func(childComplexity int) int + Ok func(childComplexity int) int + PrevOwner func(childComplexity int) int + } + + SetTeamOwnerPayload struct { + NewOwner func(childComplexity int) int + Ok func(childComplexity int) int + PrevOwner func(childComplexity int) int + } + Task struct { Assigned func(childComplexity int) int Badges func(childComplexity int) int @@ -270,11 +312,21 @@ type ComplexityRoot struct { Task func(childComplexity int) int } + UpdateProjectMemberRolePayload struct { + Member func(childComplexity int) int + Ok func(childComplexity int) int + } + UpdateTaskLocationPayload struct { PreviousTaskGroupID func(childComplexity int) int Task func(childComplexity int) int } + UpdateTeamMemberRolePayload struct { + Member func(childComplexity int) int + Ok func(childComplexity int) int + } + UserAccount struct { CreatedAt func(childComplexity int) int Email func(childComplexity int) int @@ -282,129 +334,139 @@ type ComplexityRoot struct { ID func(childComplexity int) int Initials func(childComplexity int) int ProfileIcon func(childComplexity int) int + Role func(childComplexity int) int Username func(childComplexity int) int } } type LabelColorResolver interface { - ID(ctx context.Context, obj *pg.LabelColor) (uuid.UUID, error) + ID(ctx context.Context, obj *db.LabelColor) (uuid.UUID, error) } type MutationResolver interface { - CreateRefreshToken(ctx context.Context, input NewRefreshToken) (*pg.RefreshToken, error) - CreateUserAccount(ctx context.Context, input NewUserAccount) (*pg.UserAccount, error) - DeleteUserAccount(ctx context.Context, input DeleteUserAccount) (*DeleteUserAccountPayload, error) - DeleteTeam(ctx context.Context, input DeleteTeam) (*DeleteTeamPayload, error) - CreateTeam(ctx context.Context, input NewTeam) (*pg.Team, error) - ClearProfileAvatar(ctx context.Context) (*pg.UserAccount, error) - CreateTeamMember(ctx context.Context, input CreateTeamMember) (*CreateTeamMemberPayload, error) - CreateProject(ctx context.Context, input NewProject) (*pg.Project, error) + CreateProject(ctx context.Context, input NewProject) (*db.Project, error) DeleteProject(ctx context.Context, input DeleteProject) (*DeleteProjectPayload, error) - UpdateProjectName(ctx context.Context, input *UpdateProjectName) (*pg.Project, error) - CreateProjectLabel(ctx context.Context, input NewProjectLabel) (*pg.ProjectLabel, error) - DeleteProjectLabel(ctx context.Context, input DeleteProjectLabel) (*pg.ProjectLabel, error) - UpdateProjectLabel(ctx context.Context, input UpdateProjectLabel) (*pg.ProjectLabel, error) - UpdateProjectLabelName(ctx context.Context, input UpdateProjectLabelName) (*pg.ProjectLabel, error) - UpdateProjectLabelColor(ctx context.Context, input UpdateProjectLabelColor) (*pg.ProjectLabel, error) - CreateTaskGroup(ctx context.Context, input NewTaskGroup) (*pg.TaskGroup, error) - UpdateTaskGroupLocation(ctx context.Context, input NewTaskGroupLocation) (*pg.TaskGroup, error) - UpdateTaskGroupName(ctx context.Context, input UpdateTaskGroupName) (*pg.TaskGroup, error) - DeleteTaskGroup(ctx context.Context, input DeleteTaskGroupInput) (*DeleteTaskGroupPayload, error) - AddTaskLabel(ctx context.Context, input *AddTaskLabelInput) (*pg.Task, error) - RemoveTaskLabel(ctx context.Context, input *RemoveTaskLabelInput) (*pg.Task, error) - ToggleTaskLabel(ctx context.Context, input ToggleTaskLabelInput) (*ToggleTaskLabelPayload, error) - CreateTaskChecklist(ctx context.Context, input CreateTaskChecklist) (*pg.TaskChecklist, error) - DeleteTaskChecklist(ctx context.Context, input DeleteTaskChecklist) (*DeleteTaskChecklistPayload, error) - UpdateTaskChecklistName(ctx context.Context, input UpdateTaskChecklistName) (*pg.TaskChecklist, error) - CreateTaskChecklistItem(ctx context.Context, input CreateTaskChecklistItem) (*pg.TaskChecklistItem, error) - UpdateTaskChecklistItemName(ctx context.Context, input UpdateTaskChecklistItemName) (*pg.TaskChecklistItem, error) - SetTaskChecklistItemComplete(ctx context.Context, input SetTaskChecklistItemComplete) (*pg.TaskChecklistItem, error) - DeleteTaskChecklistItem(ctx context.Context, input DeleteTaskChecklistItem) (*DeleteTaskChecklistItemPayload, error) - CreateTask(ctx context.Context, input NewTask) (*pg.Task, error) - UpdateTaskDescription(ctx context.Context, input UpdateTaskDescriptionInput) (*pg.Task, error) - UpdateTaskLocation(ctx context.Context, input NewTaskLocation) (*UpdateTaskLocationPayload, error) - UpdateTaskName(ctx context.Context, input UpdateTaskName) (*pg.Task, error) - SetTaskComplete(ctx context.Context, input SetTaskComplete) (*pg.Task, error) - UpdateTaskDueDate(ctx context.Context, input UpdateTaskDueDate) (*pg.Task, error) + UpdateProjectName(ctx context.Context, input *UpdateProjectName) (*db.Project, error) + CreateProjectLabel(ctx context.Context, input NewProjectLabel) (*db.ProjectLabel, error) + DeleteProjectLabel(ctx context.Context, input DeleteProjectLabel) (*db.ProjectLabel, error) + UpdateProjectLabel(ctx context.Context, input UpdateProjectLabel) (*db.ProjectLabel, error) + UpdateProjectLabelName(ctx context.Context, input UpdateProjectLabelName) (*db.ProjectLabel, error) + UpdateProjectLabelColor(ctx context.Context, input UpdateProjectLabelColor) (*db.ProjectLabel, error) + CreateProjectMember(ctx context.Context, input CreateProjectMember) (*CreateProjectMemberPayload, error) + DeleteProjectMember(ctx context.Context, input DeleteProjectMember) (*DeleteProjectMemberPayload, error) + UpdateProjectMemberRole(ctx context.Context, input UpdateProjectMemberRole) (*UpdateProjectMemberRolePayload, error) + SetProjectOwner(ctx context.Context, input SetProjectOwner) (*SetProjectOwnerPayload, error) + CreateTask(ctx context.Context, input NewTask) (*db.Task, error) DeleteTask(ctx context.Context, input DeleteTaskInput) (*DeleteTaskPayload, error) - AssignTask(ctx context.Context, input *AssignTaskInput) (*pg.Task, error) - UnassignTask(ctx context.Context, input *UnassignTaskInput) (*pg.Task, error) + UpdateTaskDescription(ctx context.Context, input UpdateTaskDescriptionInput) (*db.Task, error) + UpdateTaskLocation(ctx context.Context, input NewTaskLocation) (*UpdateTaskLocationPayload, error) + UpdateTaskName(ctx context.Context, input UpdateTaskName) (*db.Task, error) + SetTaskComplete(ctx context.Context, input SetTaskComplete) (*db.Task, error) + UpdateTaskDueDate(ctx context.Context, input UpdateTaskDueDate) (*db.Task, error) + AssignTask(ctx context.Context, input *AssignTaskInput) (*db.Task, error) + UnassignTask(ctx context.Context, input *UnassignTaskInput) (*db.Task, error) + CreateTaskChecklist(ctx context.Context, input CreateTaskChecklist) (*db.TaskChecklist, error) + DeleteTaskChecklist(ctx context.Context, input DeleteTaskChecklist) (*DeleteTaskChecklistPayload, error) + UpdateTaskChecklistName(ctx context.Context, input UpdateTaskChecklistName) (*db.TaskChecklist, error) + CreateTaskChecklistItem(ctx context.Context, input CreateTaskChecklistItem) (*db.TaskChecklistItem, error) + UpdateTaskChecklistItemName(ctx context.Context, input UpdateTaskChecklistItemName) (*db.TaskChecklistItem, error) + SetTaskChecklistItemComplete(ctx context.Context, input SetTaskChecklistItemComplete) (*db.TaskChecklistItem, error) + DeleteTaskChecklistItem(ctx context.Context, input DeleteTaskChecklistItem) (*DeleteTaskChecklistItemPayload, error) + CreateTaskGroup(ctx context.Context, input NewTaskGroup) (*db.TaskGroup, error) + UpdateTaskGroupLocation(ctx context.Context, input NewTaskGroupLocation) (*db.TaskGroup, error) + UpdateTaskGroupName(ctx context.Context, input UpdateTaskGroupName) (*db.TaskGroup, error) + DeleteTaskGroup(ctx context.Context, input DeleteTaskGroupInput) (*DeleteTaskGroupPayload, error) + AddTaskLabel(ctx context.Context, input *AddTaskLabelInput) (*db.Task, error) + RemoveTaskLabel(ctx context.Context, input *RemoveTaskLabelInput) (*db.Task, error) + ToggleTaskLabel(ctx context.Context, input ToggleTaskLabelInput) (*ToggleTaskLabelPayload, error) + DeleteTeam(ctx context.Context, input DeleteTeam) (*DeleteTeamPayload, error) + CreateTeam(ctx context.Context, input NewTeam) (*db.Team, error) + SetTeamOwner(ctx context.Context, input SetTeamOwner) (*SetTeamOwnerPayload, error) + CreateTeamMember(ctx context.Context, input CreateTeamMember) (*CreateTeamMemberPayload, error) + UpdateTeamMemberRole(ctx context.Context, input UpdateTeamMemberRole) (*UpdateTeamMemberRolePayload, error) + DeleteTeamMember(ctx context.Context, input DeleteTeamMember) (*DeleteTeamMemberPayload, error) + CreateRefreshToken(ctx context.Context, input NewRefreshToken) (*db.RefreshToken, error) + CreateUserAccount(ctx context.Context, input NewUserAccount) (*db.UserAccount, error) + DeleteUserAccount(ctx context.Context, input DeleteUserAccount) (*DeleteUserAccountPayload, error) LogoutUser(ctx context.Context, input LogoutUser) (bool, error) + ClearProfileAvatar(ctx context.Context) (*db.UserAccount, error) } type OrganizationResolver interface { - ID(ctx context.Context, obj *pg.Organization) (uuid.UUID, error) + ID(ctx context.Context, obj *db.Organization) (uuid.UUID, error) } type ProjectResolver interface { - ID(ctx context.Context, obj *pg.Project) (uuid.UUID, error) + ID(ctx context.Context, obj *db.Project) (uuid.UUID, error) - Team(ctx context.Context, obj *pg.Project) (*pg.Team, error) - Owner(ctx context.Context, obj *pg.Project) (*ProjectMember, error) - TaskGroups(ctx context.Context, obj *pg.Project) ([]pg.TaskGroup, error) - Members(ctx context.Context, obj *pg.Project) ([]ProjectMember, error) - Labels(ctx context.Context, obj *pg.Project) ([]pg.ProjectLabel, error) + Team(ctx context.Context, obj *db.Project) (*db.Team, error) + Owner(ctx context.Context, obj *db.Project) (*Member, error) + TaskGroups(ctx context.Context, obj *db.Project) ([]db.TaskGroup, error) + Members(ctx context.Context, obj *db.Project) ([]Member, error) + Labels(ctx context.Context, obj *db.Project) ([]db.ProjectLabel, error) } type ProjectLabelResolver interface { - ID(ctx context.Context, obj *pg.ProjectLabel) (uuid.UUID, error) + ID(ctx context.Context, obj *db.ProjectLabel) (uuid.UUID, error) - LabelColor(ctx context.Context, obj *pg.ProjectLabel) (*pg.LabelColor, error) - Name(ctx context.Context, obj *pg.ProjectLabel) (*string, error) + LabelColor(ctx context.Context, obj *db.ProjectLabel) (*db.LabelColor, error) + Name(ctx context.Context, obj *db.ProjectLabel) (*string, error) } type QueryResolver interface { - Organizations(ctx context.Context) ([]pg.Organization, error) - Users(ctx context.Context) ([]pg.UserAccount, error) - FindUser(ctx context.Context, input FindUser) (*pg.UserAccount, error) - FindProject(ctx context.Context, input FindProject) (*pg.Project, error) - FindTask(ctx context.Context, input FindTask) (*pg.Task, error) - Projects(ctx context.Context, input *ProjectsFilter) ([]pg.Project, error) - FindTeam(ctx context.Context, input FindTeam) (*pg.Team, error) - Teams(ctx context.Context) ([]pg.Team, error) - LabelColors(ctx context.Context) ([]pg.LabelColor, error) - TaskGroups(ctx context.Context) ([]pg.TaskGroup, error) - Me(ctx context.Context) (*pg.UserAccount, error) + Organizations(ctx context.Context) ([]db.Organization, error) + Users(ctx context.Context) ([]db.UserAccount, error) + FindUser(ctx context.Context, input FindUser) (*db.UserAccount, error) + FindProject(ctx context.Context, input FindProject) (*db.Project, error) + FindTask(ctx context.Context, input FindTask) (*db.Task, error) + Projects(ctx context.Context, input *ProjectsFilter) ([]db.Project, error) + FindTeam(ctx context.Context, input FindTeam) (*db.Team, error) + Teams(ctx context.Context) ([]db.Team, error) + LabelColors(ctx context.Context) ([]db.LabelColor, error) + TaskGroups(ctx context.Context) ([]db.TaskGroup, error) + Me(ctx context.Context) (*db.UserAccount, error) } type RefreshTokenResolver interface { - ID(ctx context.Context, obj *pg.RefreshToken) (uuid.UUID, error) + ID(ctx context.Context, obj *db.RefreshToken) (uuid.UUID, error) } type TaskResolver interface { - ID(ctx context.Context, obj *pg.Task) (uuid.UUID, error) - TaskGroup(ctx context.Context, obj *pg.Task) (*pg.TaskGroup, error) + ID(ctx context.Context, obj *db.Task) (uuid.UUID, error) + TaskGroup(ctx context.Context, obj *db.Task) (*db.TaskGroup, error) - Description(ctx context.Context, obj *pg.Task) (*string, error) - DueDate(ctx context.Context, obj *pg.Task) (*time.Time, error) + Description(ctx context.Context, obj *db.Task) (*string, error) + DueDate(ctx context.Context, obj *db.Task) (*time.Time, error) - Assigned(ctx context.Context, obj *pg.Task) ([]ProjectMember, error) - Labels(ctx context.Context, obj *pg.Task) ([]pg.TaskLabel, error) - Checklists(ctx context.Context, obj *pg.Task) ([]pg.TaskChecklist, error) - Badges(ctx context.Context, obj *pg.Task) (*TaskBadges, error) + Assigned(ctx context.Context, obj *db.Task) ([]Member, error) + Labels(ctx context.Context, obj *db.Task) ([]db.TaskLabel, error) + Checklists(ctx context.Context, obj *db.Task) ([]db.TaskChecklist, error) + Badges(ctx context.Context, obj *db.Task) (*TaskBadges, error) } type TaskChecklistResolver interface { - ID(ctx context.Context, obj *pg.TaskChecklist) (uuid.UUID, error) + ID(ctx context.Context, obj *db.TaskChecklist) (uuid.UUID, error) - Items(ctx context.Context, obj *pg.TaskChecklist) ([]pg.TaskChecklistItem, error) + Items(ctx context.Context, obj *db.TaskChecklist) ([]db.TaskChecklistItem, error) } type TaskChecklistItemResolver interface { - ID(ctx context.Context, obj *pg.TaskChecklistItem) (uuid.UUID, error) + ID(ctx context.Context, obj *db.TaskChecklistItem) (uuid.UUID, error) - DueDate(ctx context.Context, obj *pg.TaskChecklistItem) (*time.Time, error) + DueDate(ctx context.Context, obj *db.TaskChecklistItem) (*time.Time, error) } type TaskGroupResolver interface { - ID(ctx context.Context, obj *pg.TaskGroup) (uuid.UUID, error) - ProjectID(ctx context.Context, obj *pg.TaskGroup) (string, error) + ID(ctx context.Context, obj *db.TaskGroup) (uuid.UUID, error) + ProjectID(ctx context.Context, obj *db.TaskGroup) (string, error) - Tasks(ctx context.Context, obj *pg.TaskGroup) ([]pg.Task, error) + Tasks(ctx context.Context, obj *db.TaskGroup) ([]db.Task, error) } type TaskLabelResolver interface { - ID(ctx context.Context, obj *pg.TaskLabel) (uuid.UUID, error) - ProjectLabel(ctx context.Context, obj *pg.TaskLabel) (*pg.ProjectLabel, error) + ID(ctx context.Context, obj *db.TaskLabel) (uuid.UUID, error) + ProjectLabel(ctx context.Context, obj *db.TaskLabel) (*db.ProjectLabel, error) } type TeamResolver interface { - ID(ctx context.Context, obj *pg.Team) (uuid.UUID, error) + ID(ctx context.Context, obj *db.Team) (uuid.UUID, error) - Members(ctx context.Context, obj *pg.Team) ([]ProjectMember, error) + Members(ctx context.Context, obj *db.Team) ([]Member, error) } type UserAccountResolver interface { - ID(ctx context.Context, obj *pg.UserAccount) (uuid.UUID, error) + ID(ctx context.Context, obj *db.UserAccount) (uuid.UUID, error) - ProfileIcon(ctx context.Context, obj *pg.UserAccount) (*ProfileIcon, error) + Role(ctx context.Context, obj *db.UserAccount) (*db.Role, error) + + ProfileIcon(ctx context.Context, obj *db.UserAccount) (*ProfileIcon, error) } type executableSchema struct { @@ -436,6 +498,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ChecklistBadge.Total(childComplexity), true + case "CreateProjectMemberPayload.member": + if e.complexity.CreateProjectMemberPayload.Member == nil { + break + } + + return e.complexity.CreateProjectMemberPayload.Member(childComplexity), true + + case "CreateProjectMemberPayload.ok": + if e.complexity.CreateProjectMemberPayload.Ok == nil { + break + } + + return e.complexity.CreateProjectMemberPayload.Ok(childComplexity), true + case "CreateTeamMemberPayload.team": if e.complexity.CreateTeamMemberPayload.Team == nil { break @@ -450,6 +526,27 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.CreateTeamMemberPayload.TeamMember(childComplexity), true + case "DeleteProjectMemberPayload.member": + if e.complexity.DeleteProjectMemberPayload.Member == nil { + break + } + + return e.complexity.DeleteProjectMemberPayload.Member(childComplexity), true + + case "DeleteProjectMemberPayload.ok": + if e.complexity.DeleteProjectMemberPayload.Ok == nil { + break + } + + return e.complexity.DeleteProjectMemberPayload.Ok(childComplexity), true + + case "DeleteProjectMemberPayload.projectID": + if e.complexity.DeleteProjectMemberPayload.ProjectID == nil { + break + } + + return e.complexity.DeleteProjectMemberPayload.ProjectID(childComplexity), true + case "DeleteProjectPayload.ok": if e.complexity.DeleteProjectPayload.Ok == nil { break @@ -520,6 +617,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.DeleteTaskPayload.TaskID(childComplexity), true + case "DeleteTeamMemberPayload.teamID": + if e.complexity.DeleteTeamMemberPayload.TeamID == nil { + break + } + + return e.complexity.DeleteTeamMemberPayload.TeamID(childComplexity), true + + case "DeleteTeamMemberPayload.userID": + if e.complexity.DeleteTeamMemberPayload.UserID == nil { + break + } + + return e.complexity.DeleteTeamMemberPayload.UserID(childComplexity), true + case "DeleteTeamPayload.ok": if e.complexity.DeleteTeamPayload.Ok == nil { break @@ -583,6 +694,41 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.LabelColor.Position(childComplexity), true + case "Member.fullName": + if e.complexity.Member.FullName == nil { + break + } + + return e.complexity.Member.FullName(childComplexity), true + + case "Member.id": + if e.complexity.Member.ID == nil { + break + } + + return e.complexity.Member.ID(childComplexity), true + + case "Member.profileIcon": + if e.complexity.Member.ProfileIcon == nil { + break + } + + return e.complexity.Member.ProfileIcon(childComplexity), true + + case "Member.role": + if e.complexity.Member.Role == nil { + break + } + + return e.complexity.Member.Role(childComplexity), true + + case "Member.username": + if e.complexity.Member.Username == nil { + break + } + + return e.complexity.Member.Username(childComplexity), true + case "Mutation.addTaskLabel": if e.complexity.Mutation.AddTaskLabel == nil { break @@ -638,6 +784,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.CreateProjectLabel(childComplexity, args["input"].(NewProjectLabel)), true + case "Mutation.createProjectMember": + if e.complexity.Mutation.CreateProjectMember == nil { + break + } + + args, err := ec.field_Mutation_createProjectMember_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.CreateProjectMember(childComplexity, args["input"].(CreateProjectMember)), true + case "Mutation.createRefreshToken": if e.complexity.Mutation.CreateRefreshToken == nil { break @@ -758,6 +916,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.DeleteProjectLabel(childComplexity, args["input"].(DeleteProjectLabel)), true + case "Mutation.deleteProjectMember": + if e.complexity.Mutation.DeleteProjectMember == nil { + break + } + + args, err := ec.field_Mutation_deleteProjectMember_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteProjectMember(childComplexity, args["input"].(DeleteProjectMember)), true + case "Mutation.deleteTask": if e.complexity.Mutation.DeleteTask == nil { break @@ -818,6 +988,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.DeleteTeam(childComplexity, args["input"].(DeleteTeam)), true + case "Mutation.deleteTeamMember": + if e.complexity.Mutation.DeleteTeamMember == nil { + break + } + + args, err := ec.field_Mutation_deleteTeamMember_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.DeleteTeamMember(childComplexity, args["input"].(DeleteTeamMember)), true + case "Mutation.deleteUserAccount": if e.complexity.Mutation.DeleteUserAccount == nil { break @@ -854,6 +1036,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.RemoveTaskLabel(childComplexity, args["input"].(*RemoveTaskLabelInput)), true + case "Mutation.setProjectOwner": + if e.complexity.Mutation.SetProjectOwner == nil { + break + } + + args, err := ec.field_Mutation_setProjectOwner_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.SetProjectOwner(childComplexity, args["input"].(SetProjectOwner)), true + case "Mutation.setTaskChecklistItemComplete": if e.complexity.Mutation.SetTaskChecklistItemComplete == nil { break @@ -878,6 +1072,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.SetTaskComplete(childComplexity, args["input"].(SetTaskComplete)), true + case "Mutation.setTeamOwner": + if e.complexity.Mutation.SetTeamOwner == nil { + break + } + + args, err := ec.field_Mutation_setTeamOwner_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.SetTeamOwner(childComplexity, args["input"].(SetTeamOwner)), true + case "Mutation.toggleTaskLabel": if e.complexity.Mutation.ToggleTaskLabel == nil { break @@ -938,6 +1144,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.UpdateProjectLabelName(childComplexity, args["input"].(UpdateProjectLabelName)), true + case "Mutation.updateProjectMemberRole": + if e.complexity.Mutation.UpdateProjectMemberRole == nil { + break + } + + args, err := ec.field_Mutation_updateProjectMemberRole_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateProjectMemberRole(childComplexity, args["input"].(UpdateProjectMemberRole)), true + case "Mutation.updateProjectName": if e.complexity.Mutation.UpdateProjectName == nil { break @@ -1046,6 +1264,18 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.Mutation.UpdateTaskName(childComplexity, args["input"].(UpdateTaskName)), true + case "Mutation.updateTeamMemberRole": + if e.complexity.Mutation.UpdateTeamMemberRole == nil { + break + } + + args, err := ec.field_Mutation_updateTeamMemberRole_args(context.TODO(), rawArgs) + if err != nil { + return 0, false + } + + return e.complexity.Mutation.UpdateTeamMemberRole(childComplexity, args["input"].(UpdateTeamMemberRole)), true + case "Organization.id": if e.complexity.Organization.ID == nil { break @@ -1165,27 +1395,6 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ProjectLabel.Name(childComplexity), true - case "ProjectMember.fullName": - if e.complexity.ProjectMember.FullName == nil { - break - } - - return e.complexity.ProjectMember.FullName(childComplexity), true - - case "ProjectMember.id": - if e.complexity.ProjectMember.ID == nil { - break - } - - return e.complexity.ProjectMember.ID(childComplexity), true - - case "ProjectMember.profileIcon": - if e.complexity.ProjectMember.ProfileIcon == nil { - break - } - - return e.complexity.ProjectMember.ProfileIcon(childComplexity), true - case "Query.findProject": if e.complexity.Query.FindProject == nil { break @@ -1316,6 +1525,62 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.RefreshToken.UserID(childComplexity), true + case "Role.code": + if e.complexity.Role.Code == nil { + break + } + + return e.complexity.Role.Code(childComplexity), true + + case "Role.name": + if e.complexity.Role.Name == nil { + break + } + + return e.complexity.Role.Name(childComplexity), true + + case "SetProjectOwnerPayload.newOwner": + if e.complexity.SetProjectOwnerPayload.NewOwner == nil { + break + } + + return e.complexity.SetProjectOwnerPayload.NewOwner(childComplexity), true + + case "SetProjectOwnerPayload.ok": + if e.complexity.SetProjectOwnerPayload.Ok == nil { + break + } + + return e.complexity.SetProjectOwnerPayload.Ok(childComplexity), true + + case "SetProjectOwnerPayload.prevOwner": + if e.complexity.SetProjectOwnerPayload.PrevOwner == nil { + break + } + + return e.complexity.SetProjectOwnerPayload.PrevOwner(childComplexity), true + + case "SetTeamOwnerPayload.newOwner": + if e.complexity.SetTeamOwnerPayload.NewOwner == nil { + break + } + + return e.complexity.SetTeamOwnerPayload.NewOwner(childComplexity), true + + case "SetTeamOwnerPayload.ok": + if e.complexity.SetTeamOwnerPayload.Ok == nil { + break + } + + return e.complexity.SetTeamOwnerPayload.Ok(childComplexity), true + + case "SetTeamOwnerPayload.prevOwner": + if e.complexity.SetTeamOwnerPayload.PrevOwner == nil { + break + } + + return e.complexity.SetTeamOwnerPayload.PrevOwner(childComplexity), true + case "Task.assigned": if e.complexity.Task.Assigned == nil { break @@ -1582,6 +1847,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.ToggleTaskLabelPayload.Task(childComplexity), true + case "UpdateProjectMemberRolePayload.member": + if e.complexity.UpdateProjectMemberRolePayload.Member == nil { + break + } + + return e.complexity.UpdateProjectMemberRolePayload.Member(childComplexity), true + + case "UpdateProjectMemberRolePayload.ok": + if e.complexity.UpdateProjectMemberRolePayload.Ok == nil { + break + } + + return e.complexity.UpdateProjectMemberRolePayload.Ok(childComplexity), true + case "UpdateTaskLocationPayload.previousTaskGroupID": if e.complexity.UpdateTaskLocationPayload.PreviousTaskGroupID == nil { break @@ -1596,6 +1875,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.UpdateTaskLocationPayload.Task(childComplexity), true + case "UpdateTeamMemberRolePayload.member": + if e.complexity.UpdateTeamMemberRolePayload.Member == nil { + break + } + + return e.complexity.UpdateTeamMemberRolePayload.Member(childComplexity), true + + case "UpdateTeamMemberRolePayload.ok": + if e.complexity.UpdateTeamMemberRolePayload.Ok == nil { + break + } + + return e.complexity.UpdateTeamMemberRolePayload.Ok(childComplexity), true + case "UserAccount.createdAt": if e.complexity.UserAccount.CreatedAt == nil { break @@ -1638,6 +1931,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.UserAccount.ProfileIcon(childComplexity), true + case "UserAccount.role": + if e.complexity.UserAccount.Role == nil { + break + } + + return e.complexity.UserAccount.Role(childComplexity), true + case "UserAccount.username": if e.complexity.UserAccount.Username == nil { break @@ -1709,10 +2009,17 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er } var sources = []*ast.Source{ - &ast.Source{Name: "graph/schema.graphqls", Input: `scalar Time + &ast.Source{Name: "internal/graph/schema.graphqls", Input: `scalar Time scalar UUID scalar Upload +enum RoleCode { + owner + admin + member + observer +} + type ProjectLabel { id: ID! createdDate: Time! @@ -1739,9 +2046,11 @@ type ProfileIcon { bgColor: String } -type ProjectMember { +type Member { id: ID! + role: Role! fullName: String! + username: String! profileIcon: ProfileIcon! } @@ -1752,12 +2061,18 @@ type RefreshToken { createdAt: Time! } +type Role { + code: String! + name: String! +} + type UserAccount { id: ID! email: String! createdAt: Time! fullName: String! initials: String! + role: Role! username: String! profileIcon: ProfileIcon! } @@ -1766,7 +2081,7 @@ type Team { id: ID! createdAt: Time! name: String! - members: [ProjectMember!]! + members: [Member!]! } type Project { @@ -1774,9 +2089,9 @@ type Project { createdAt: Time! name: String! team: Team! - owner: ProjectMember! + owner: Member! taskGroups: [TaskGroup!]! - members: [ProjectMember!]! + members: [Member!]! labels: [ProjectLabel!]! } @@ -1807,127 +2122,17 @@ type Task { description: String dueDate: Time complete: Boolean! - assigned: [ProjectMember!]! + assigned: [Member!]! labels: [TaskLabel!]! checklists: [TaskChecklist!]! badges: TaskBadges! } -input ProjectsFilter { - teamID: UUID -} - -input FindUser { - userId: String! -} - -input FindProject { - projectId: String! -} - -input FindTask { - taskID: UUID! -} - type Organization { id: ID! name: String! } -input FindTeam { - teamID: UUID! -} - -type Query { - organizations: [Organization!]! - users: [UserAccount!]! - findUser(input: FindUser!): UserAccount! - findProject(input: FindProject!): Project! - findTask(input: FindTask!): Task! - projects(input: ProjectsFilter): [Project!]! - findTeam(input: FindTeam!): Team! - teams: [Team!]! - labelColors: [LabelColor!]! - taskGroups: [TaskGroup!]! - me: UserAccount! -} - -input NewRefreshToken { - userId: String! -} - -input NewUserAccount { - username: String! - email: String! - fullName: String! - initials: String! - password: String! -} - -input NewTeam { - name: String! - organizationID: UUID! -} - -input NewProject { - userID: UUID! - teamID: UUID! - name: String! -} - -input NewTaskGroup { - projectID: String! - name: String! - position: Float! -} - -input LogoutUser { - userID: String! -} -input NewTask { - taskGroupID: String! - name: String! - position: Float! -} -input NewTaskLocation { - taskID: UUID! - taskGroupID: UUID! - position: Float! -} - -input DeleteTaskInput { - taskID: String! -} - -type DeleteTaskPayload { - taskID: String! -} - -input UpdateTaskName { - taskID: String! - name: String! -} - -input NewTaskGroupLocation { - taskGroupID: UUID! - position: Float! -} - -input DeleteTaskGroupInput { - taskGroupID: UUID! -} - -type DeleteTaskGroupPayload { - ok: Boolean! - affectedRows: Int! - taskGroup: TaskGroup! -} - -type DeleteTaskChecklistItemPayload { - ok: Boolean! - taskChecklistItem: TaskChecklistItem! -} - type TaskChecklistItem { id: ID! name: String! @@ -1944,27 +2149,75 @@ type TaskChecklist { items: [TaskChecklistItem!]! } -input AssignTaskInput { +type Query { + organizations: [Organization!]! + users: [UserAccount!]! + findUser(input: FindUser!): UserAccount! + findProject(input: FindProject!): Project! + findTask(input: FindTask!): Task! + projects(input: ProjectsFilter): [Project!]! + findTeam(input: FindTeam!): Team! + teams: [Team!]! + labelColors: [LabelColor!]! + taskGroups: [TaskGroup!]! + me: UserAccount! +} + +type Mutation + +input ProjectsFilter { + teamID: UUID +} + +input FindUser { + userId: String! +} + +input FindProject { + projectId: String! +} + +input FindTask { taskID: UUID! +} + +input FindTeam { + teamID: UUID! +} + +extend type Mutation { + createProject(input: NewProject!): Project! + deleteProject(input: DeleteProject!): DeleteProjectPayload! + updateProjectName(input: UpdateProjectName): Project! +} + +input NewProject { userID: UUID! + teamID: UUID! + name: String! } -input UnassignTaskInput { - taskID: UUID! - userID: UUID! -} -input UpdateTaskDescriptionInput { - taskID: UUID! - description: String! +input UpdateProjectName { + projectID: UUID! + name: String! } -input AddTaskLabelInput { - taskID: UUID! - projectLabelID: UUID! +input DeleteProject { + projectID: UUID! } -input RemoveTaskLabelInput { - taskLabelID: UUID! +type DeleteProjectPayload { + ok: Boolean! + project: Project! +} + + +extend type Mutation { + createProjectLabel(input: NewProjectLabel!): ProjectLabel! + deleteProjectLabel(input: DeleteProjectLabel!): ProjectLabel! + updateProjectLabel(input: UpdateProjectLabel!): ProjectLabel! + updateProjectLabelName(input: UpdateProjectLabelName!): ProjectLabel! + updateProjectLabelColor(input: UpdateProjectLabelColor!): ProjectLabel! } input NewProjectLabel { @@ -1993,19 +2246,88 @@ input UpdateProjectLabelColor { labelColorID: UUID! } -input ToggleTaskLabelInput { - taskID: UUID! - projectLabelID: UUID! +extend type Mutation { + createProjectMember(input: CreateProjectMember!): CreateProjectMemberPayload! + deleteProjectMember(input: DeleteProjectMember!): DeleteProjectMemberPayload! + updateProjectMemberRole(input: UpdateProjectMemberRole!): UpdateProjectMemberRolePayload! + setProjectOwner(input: SetProjectOwner!): SetProjectOwnerPayload! } -type ToggleTaskLabelPayload { - active: Boolean! - task: Task! -} - -input UpdateProjectName { +input CreateProjectMember { projectID: UUID! + userID: UUID! +} + +type CreateProjectMemberPayload { + ok: Boolean! + member: Member! +} + +input DeleteProjectMember { + projectID: UUID! + userID: UUID! +} + +type DeleteProjectMemberPayload { + ok: Boolean! + member: Member! + projectID: UUID! +} + +input UpdateProjectMemberRole { + projectID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateProjectMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetProjectOwner { + projectID: UUID! + ownerID: UUID! +} +type SetProjectOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} + +extend type Mutation { + createTask(input: NewTask!): Task! + deleteTask(input: DeleteTaskInput!): DeleteTaskPayload! + + updateTaskDescription(input: UpdateTaskDescriptionInput!): Task! + updateTaskLocation(input: NewTaskLocation!): UpdateTaskLocationPayload! + updateTaskName(input: UpdateTaskName!): Task! + setTaskComplete(input: SetTaskComplete!): Task! + updateTaskDueDate(input: UpdateTaskDueDate!): Task! + + assignTask(input: AssignTaskInput): Task! + unassignTask(input: UnassignTaskInput): Task! +} + +input NewTask { + taskGroupID: String! name: String! + position: Float! +} + +input AssignTaskInput { + taskID: UUID! + userID: UUID! +} + +input UnassignTaskInput { + taskID: UUID! + userID: UUID! +} + +input UpdateTaskDescriptionInput { + taskID: UUID! + description: String! } type UpdateTaskLocationPayload { @@ -2013,11 +2335,6 @@ type UpdateTaskLocationPayload { task: Task! } -input UpdateTaskGroupName { - taskGroupID: UUID! - name: String! -} - input UpdateTaskDueDate { taskID: UUID! dueDate: Time @@ -2028,12 +2345,46 @@ input SetTaskComplete { complete: Boolean! } +input NewTaskLocation { + taskID: UUID! + taskGroupID: UUID! + position: Float! +} + +input DeleteTaskInput { + taskID: String! +} + +type DeleteTaskPayload { + taskID: String! +} + +input UpdateTaskName { + taskID: String! + name: String! +} + +extend type Mutation { + createTaskChecklist(input: CreateTaskChecklist!): TaskChecklist! + deleteTaskChecklist(input: DeleteTaskChecklist!): DeleteTaskChecklistPayload! + updateTaskChecklistName(input: UpdateTaskChecklistName!): TaskChecklist! + createTaskChecklistItem(input: CreateTaskChecklistItem!): TaskChecklistItem! + updateTaskChecklistItemName(input: UpdateTaskChecklistItemName!): TaskChecklistItem! + setTaskChecklistItemComplete(input: SetTaskChecklistItemComplete!): TaskChecklistItem! + deleteTaskChecklistItem(input: DeleteTaskChecklistItem!): DeleteTaskChecklistItemPayload! +} + input CreateTaskChecklist { taskID: UUID! name: String! position: Float! } +type DeleteTaskChecklistItemPayload { + ok: Boolean! + taskChecklistItem: TaskChecklistItem! +} + input CreateTaskChecklistItem { taskChecklistID: UUID! name: String! @@ -2044,6 +2395,7 @@ input SetTaskChecklistItemComplete { taskChecklistItemID: UUID! complete: Boolean! } + input DeleteTaskChecklistItem { taskChecklistItemID: UUID! } @@ -2053,44 +2405,6 @@ input UpdateTaskChecklistItemName { name: String! } -input CreateTeamMember { - userID: UUID! - teamID: UUID! -} - -type CreateTeamMemberPayload { - team: Team! - teamMember: ProjectMember! -} - -input DeleteProject { - projectID: UUID! -} - -type DeleteProjectPayload { - ok: Boolean! - project: Project! -} - -input DeleteTeam { - teamID: UUID! -} - -type DeleteTeamPayload { - ok: Boolean! - team: Team! - projects: [Project!]! -} - -input DeleteUserAccount { - userID: UUID! -} - -type DeleteUserAccountPayload { - ok: Boolean! - userAccount: UserAccount! -} - input UpdateTaskChecklistName { taskChecklistID: UUID! name: String! @@ -2102,57 +2416,166 @@ type DeleteTaskChecklistPayload { ok: Boolean! taskChecklist: TaskChecklist! } -type Mutation { - createRefreshToken(input: NewRefreshToken!): RefreshToken! - - createUserAccount(input: NewUserAccount!): UserAccount! - deleteUserAccount(input: DeleteUserAccount!): DeleteUserAccountPayload! - - deleteTeam(input: DeleteTeam!): DeleteTeamPayload! - createTeam(input: NewTeam!): Team! - clearProfileAvatar: UserAccount! - - createTeamMember(input: CreateTeamMember!): CreateTeamMemberPayload! - - createProject(input: NewProject!): Project! - deleteProject(input: DeleteProject!): DeleteProjectPayload! - updateProjectName(input: UpdateProjectName): Project! - - createProjectLabel(input: NewProjectLabel!): ProjectLabel! - deleteProjectLabel(input: DeleteProjectLabel!): ProjectLabel! - updateProjectLabel(input: UpdateProjectLabel!): ProjectLabel! - updateProjectLabelName(input: UpdateProjectLabelName!): ProjectLabel! - updateProjectLabelColor(input: UpdateProjectLabelColor!): ProjectLabel! +extend type Mutation { createTaskGroup(input: NewTaskGroup!): TaskGroup! updateTaskGroupLocation(input: NewTaskGroupLocation!): TaskGroup! updateTaskGroupName(input: UpdateTaskGroupName!): TaskGroup! deleteTaskGroup(input: DeleteTaskGroupInput!): DeleteTaskGroupPayload! +} +input NewTaskGroupLocation { + taskGroupID: UUID! + position: Float! +} + +input UpdateTaskGroupName { + taskGroupID: UUID! + name: String! +} + +input DeleteTaskGroupInput { + taskGroupID: UUID! +} + +type DeleteTaskGroupPayload { + ok: Boolean! + affectedRows: Int! + taskGroup: TaskGroup! +} + +input NewTaskGroup { + projectID: String! + name: String! + position: Float! +} + +input AddTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +input RemoveTaskLabelInput { + taskLabelID: UUID! +} +input ToggleTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +type ToggleTaskLabelPayload { + active: Boolean! + task: Task! +} +extend type Mutation { addTaskLabel(input: AddTaskLabelInput): Task! removeTaskLabel(input: RemoveTaskLabelInput): Task! toggleTaskLabel(input: ToggleTaskLabelInput!): ToggleTaskLabelPayload! - - createTaskChecklist(input: CreateTaskChecklist!): TaskChecklist! - deleteTaskChecklist(input: DeleteTaskChecklist!): DeleteTaskChecklistPayload! - updateTaskChecklistName(input: UpdateTaskChecklistName!): TaskChecklist! - createTaskChecklistItem(input: CreateTaskChecklistItem!): TaskChecklistItem! - updateTaskChecklistItemName(input: UpdateTaskChecklistItemName!): TaskChecklistItem! - setTaskChecklistItemComplete(input: SetTaskChecklistItemComplete!): TaskChecklistItem! - deleteTaskChecklistItem(input: DeleteTaskChecklistItem!): DeleteTaskChecklistItemPayload! - - createTask(input: NewTask!): Task! - updateTaskDescription(input: UpdateTaskDescriptionInput!): Task! - updateTaskLocation(input: NewTaskLocation!): UpdateTaskLocationPayload! - updateTaskName(input: UpdateTaskName!): Task! - setTaskComplete(input: SetTaskComplete!): Task! - updateTaskDueDate(input: UpdateTaskDueDate!): Task! - deleteTask(input: DeleteTaskInput!): DeleteTaskPayload! - assignTask(input: AssignTaskInput): Task! - unassignTask(input: UnassignTaskInput): Task! - - logoutUser(input: LogoutUser!): Boolean! } + +extend type Mutation { + deleteTeam(input: DeleteTeam!): DeleteTeamPayload! + createTeam(input: NewTeam!): Team! +} + +input NewTeam { + name: String! + organizationID: UUID! +} + +input DeleteTeam { + teamID: UUID! +} + +type DeleteTeamPayload { + ok: Boolean! + team: Team! + projects: [Project!]! +} + +extend type Mutation { + setTeamOwner(input: SetTeamOwner!): SetTeamOwnerPayload! + createTeamMember(input: CreateTeamMember!): CreateTeamMemberPayload! + updateTeamMemberRole(input: UpdateTeamMemberRole!): UpdateTeamMemberRolePayload! + deleteTeamMember(input: DeleteTeamMember!): DeleteTeamMemberPayload! +} + +input DeleteTeamMember { + teamID: UUID! + userID: UUID! +} + +type DeleteTeamMemberPayload { + teamID: UUID! + userID: UUID! +} + +input CreateTeamMember { + userID: UUID! + teamID: UUID! +} + +type CreateTeamMemberPayload { + team: Team! + teamMember: Member! +} + +input UpdateTeamMemberRole { + teamID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateTeamMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetTeamOwner { + teamID: UUID! + userID: UUID! +} + +type SetTeamOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} + +extend type Mutation { + createRefreshToken(input: NewRefreshToken!): RefreshToken! + createUserAccount(input: NewUserAccount!): UserAccount! + deleteUserAccount(input: DeleteUserAccount!): DeleteUserAccountPayload! + logoutUser(input: LogoutUser!): Boolean! + clearProfileAvatar: UserAccount! +} + +input NewRefreshToken { + userId: String! +} + +input NewUserAccount { + username: String! + email: String! + fullName: String! + initials: String! + password: String! + roleCode: String! +} + +input LogoutUser { + userID: String! +} + +input DeleteUserAccount { + userID: UUID! +} + +type DeleteUserAccountPayload { + ok: Boolean! + userAccount: UserAccount! +} + `, BuiltIn: false}, } var parsedSchema = gqlparser.MustLoadSchema(sources...) @@ -2166,7 +2589,7 @@ func (ec *executionContext) field_Mutation_addTaskLabel_args(ctx context.Context args := map[string]interface{}{} var arg0 *AddTaskLabelInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalOAddTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAddTaskLabelInput(ctx, tmp) + arg0, err = ec.unmarshalOAddTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAddTaskLabelInput(ctx, tmp) if err != nil { return nil, err } @@ -2180,7 +2603,7 @@ func (ec *executionContext) field_Mutation_assignTask_args(ctx context.Context, args := map[string]interface{}{} var arg0 *AssignTaskInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalOAssignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAssignTaskInput(ctx, tmp) + arg0, err = ec.unmarshalOAssignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAssignTaskInput(ctx, tmp) if err != nil { return nil, err } @@ -2194,7 +2617,21 @@ func (ec *executionContext) field_Mutation_createProjectLabel_args(ctx context.C args := map[string]interface{}{} var arg0 NewProjectLabel if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewProjectLabel(ctx, tmp) + arg0, err = ec.unmarshalNNewProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewProjectLabel(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_createProjectMember_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 CreateProjectMember + if tmp, ok := rawArgs["input"]; ok { + arg0, err = ec.unmarshalNCreateProjectMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateProjectMember(ctx, tmp) if err != nil { return nil, err } @@ -2208,7 +2645,7 @@ func (ec *executionContext) field_Mutation_createProject_args(ctx context.Contex args := map[string]interface{}{} var arg0 NewProject if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewProject(ctx, tmp) + arg0, err = ec.unmarshalNNewProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewProject(ctx, tmp) if err != nil { return nil, err } @@ -2222,7 +2659,7 @@ func (ec *executionContext) field_Mutation_createRefreshToken_args(ctx context.C args := map[string]interface{}{} var arg0 NewRefreshToken if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewRefreshToken2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewRefreshToken(ctx, tmp) + arg0, err = ec.unmarshalNNewRefreshToken2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewRefreshToken(ctx, tmp) if err != nil { return nil, err } @@ -2236,7 +2673,7 @@ func (ec *executionContext) field_Mutation_createTaskChecklistItem_args(ctx cont args := map[string]interface{}{} var arg0 CreateTaskChecklistItem if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNCreateTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTaskChecklistItem(ctx, tmp) + arg0, err = ec.unmarshalNCreateTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTaskChecklistItem(ctx, tmp) if err != nil { return nil, err } @@ -2250,7 +2687,7 @@ func (ec *executionContext) field_Mutation_createTaskChecklist_args(ctx context. args := map[string]interface{}{} var arg0 CreateTaskChecklist if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNCreateTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTaskChecklist(ctx, tmp) + arg0, err = ec.unmarshalNCreateTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTaskChecklist(ctx, tmp) if err != nil { return nil, err } @@ -2264,7 +2701,7 @@ func (ec *executionContext) field_Mutation_createTaskGroup_args(ctx context.Cont args := map[string]interface{}{} var arg0 NewTaskGroup if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTaskGroup(ctx, tmp) + arg0, err = ec.unmarshalNNewTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTaskGroup(ctx, tmp) if err != nil { return nil, err } @@ -2278,7 +2715,7 @@ func (ec *executionContext) field_Mutation_createTask_args(ctx context.Context, args := map[string]interface{}{} var arg0 NewTask if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTask(ctx, tmp) + arg0, err = ec.unmarshalNNewTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTask(ctx, tmp) if err != nil { return nil, err } @@ -2292,7 +2729,7 @@ func (ec *executionContext) field_Mutation_createTeamMember_args(ctx context.Con args := map[string]interface{}{} var arg0 CreateTeamMember if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNCreateTeamMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTeamMember(ctx, tmp) + arg0, err = ec.unmarshalNCreateTeamMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTeamMember(ctx, tmp) if err != nil { return nil, err } @@ -2306,7 +2743,7 @@ func (ec *executionContext) field_Mutation_createTeam_args(ctx context.Context, args := map[string]interface{}{} var arg0 NewTeam if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTeam(ctx, tmp) + arg0, err = ec.unmarshalNNewTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTeam(ctx, tmp) if err != nil { return nil, err } @@ -2320,7 +2757,7 @@ func (ec *executionContext) field_Mutation_createUserAccount_args(ctx context.Co args := map[string]interface{}{} var arg0 NewUserAccount if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewUserAccount(ctx, tmp) + arg0, err = ec.unmarshalNNewUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewUserAccount(ctx, tmp) if err != nil { return nil, err } @@ -2334,7 +2771,21 @@ func (ec *executionContext) field_Mutation_deleteProjectLabel_args(ctx context.C args := map[string]interface{}{} var arg0 DeleteProjectLabel if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteProjectLabel(ctx, tmp) + arg0, err = ec.unmarshalNDeleteProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectLabel(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteProjectMember_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 DeleteProjectMember + if tmp, ok := rawArgs["input"]; ok { + arg0, err = ec.unmarshalNDeleteProjectMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectMember(ctx, tmp) if err != nil { return nil, err } @@ -2348,7 +2799,7 @@ func (ec *executionContext) field_Mutation_deleteProject_args(ctx context.Contex args := map[string]interface{}{} var arg0 DeleteProject if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteProject(ctx, tmp) + arg0, err = ec.unmarshalNDeleteProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProject(ctx, tmp) if err != nil { return nil, err } @@ -2362,7 +2813,7 @@ func (ec *executionContext) field_Mutation_deleteTaskChecklistItem_args(ctx cont args := map[string]interface{}{} var arg0 DeleteTaskChecklistItem if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistItem(ctx, tmp) + arg0, err = ec.unmarshalNDeleteTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistItem(ctx, tmp) if err != nil { return nil, err } @@ -2376,7 +2827,7 @@ func (ec *executionContext) field_Mutation_deleteTaskChecklist_args(ctx context. args := map[string]interface{}{} var arg0 DeleteTaskChecklist if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklist(ctx, tmp) + arg0, err = ec.unmarshalNDeleteTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklist(ctx, tmp) if err != nil { return nil, err } @@ -2390,7 +2841,7 @@ func (ec *executionContext) field_Mutation_deleteTaskGroup_args(ctx context.Cont args := map[string]interface{}{} var arg0 DeleteTaskGroupInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteTaskGroupInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskGroupInput(ctx, tmp) + arg0, err = ec.unmarshalNDeleteTaskGroupInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskGroupInput(ctx, tmp) if err != nil { return nil, err } @@ -2404,7 +2855,21 @@ func (ec *executionContext) field_Mutation_deleteTask_args(ctx context.Context, args := map[string]interface{}{} var arg0 DeleteTaskInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskInput(ctx, tmp) + arg0, err = ec.unmarshalNDeleteTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_deleteTeamMember_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 DeleteTeamMember + if tmp, ok := rawArgs["input"]; ok { + arg0, err = ec.unmarshalNDeleteTeamMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamMember(ctx, tmp) if err != nil { return nil, err } @@ -2418,7 +2883,7 @@ func (ec *executionContext) field_Mutation_deleteTeam_args(ctx context.Context, args := map[string]interface{}{} var arg0 DeleteTeam if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTeam(ctx, tmp) + arg0, err = ec.unmarshalNDeleteTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeam(ctx, tmp) if err != nil { return nil, err } @@ -2432,7 +2897,7 @@ func (ec *executionContext) field_Mutation_deleteUserAccount_args(ctx context.Co args := map[string]interface{}{} var arg0 DeleteUserAccount if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNDeleteUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteUserAccount(ctx, tmp) + arg0, err = ec.unmarshalNDeleteUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteUserAccount(ctx, tmp) if err != nil { return nil, err } @@ -2446,7 +2911,7 @@ func (ec *executionContext) field_Mutation_logoutUser_args(ctx context.Context, args := map[string]interface{}{} var arg0 LogoutUser if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNLogoutUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐLogoutUser(ctx, tmp) + arg0, err = ec.unmarshalNLogoutUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐLogoutUser(ctx, tmp) if err != nil { return nil, err } @@ -2460,7 +2925,21 @@ func (ec *executionContext) field_Mutation_removeTaskLabel_args(ctx context.Cont args := map[string]interface{}{} var arg0 *RemoveTaskLabelInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalORemoveTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐRemoveTaskLabelInput(ctx, tmp) + arg0, err = ec.unmarshalORemoveTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRemoveTaskLabelInput(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_setProjectOwner_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 SetProjectOwner + if tmp, ok := rawArgs["input"]; ok { + arg0, err = ec.unmarshalNSetProjectOwner2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetProjectOwner(ctx, tmp) if err != nil { return nil, err } @@ -2474,7 +2953,7 @@ func (ec *executionContext) field_Mutation_setTaskChecklistItemComplete_args(ctx args := map[string]interface{}{} var arg0 SetTaskChecklistItemComplete if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNSetTaskChecklistItemComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐSetTaskChecklistItemComplete(ctx, tmp) + arg0, err = ec.unmarshalNSetTaskChecklistItemComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTaskChecklistItemComplete(ctx, tmp) if err != nil { return nil, err } @@ -2488,7 +2967,21 @@ func (ec *executionContext) field_Mutation_setTaskComplete_args(ctx context.Cont args := map[string]interface{}{} var arg0 SetTaskComplete if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNSetTaskComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐSetTaskComplete(ctx, tmp) + arg0, err = ec.unmarshalNSetTaskComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTaskComplete(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_setTeamOwner_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 SetTeamOwner + if tmp, ok := rawArgs["input"]; ok { + arg0, err = ec.unmarshalNSetTeamOwner2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTeamOwner(ctx, tmp) if err != nil { return nil, err } @@ -2502,7 +2995,7 @@ func (ec *executionContext) field_Mutation_toggleTaskLabel_args(ctx context.Cont args := map[string]interface{}{} var arg0 ToggleTaskLabelInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNToggleTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐToggleTaskLabelInput(ctx, tmp) + arg0, err = ec.unmarshalNToggleTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐToggleTaskLabelInput(ctx, tmp) if err != nil { return nil, err } @@ -2516,7 +3009,7 @@ func (ec *executionContext) field_Mutation_unassignTask_args(ctx context.Context args := map[string]interface{}{} var arg0 *UnassignTaskInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalOUnassignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUnassignTaskInput(ctx, tmp) + arg0, err = ec.unmarshalOUnassignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUnassignTaskInput(ctx, tmp) if err != nil { return nil, err } @@ -2530,7 +3023,7 @@ func (ec *executionContext) field_Mutation_updateProjectLabelColor_args(ctx cont args := map[string]interface{}{} var arg0 UpdateProjectLabelColor if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateProjectLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectLabelColor(ctx, tmp) + arg0, err = ec.unmarshalNUpdateProjectLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectLabelColor(ctx, tmp) if err != nil { return nil, err } @@ -2544,7 +3037,7 @@ func (ec *executionContext) field_Mutation_updateProjectLabelName_args(ctx conte args := map[string]interface{}{} var arg0 UpdateProjectLabelName if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateProjectLabelName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectLabelName(ctx, tmp) + arg0, err = ec.unmarshalNUpdateProjectLabelName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectLabelName(ctx, tmp) if err != nil { return nil, err } @@ -2558,7 +3051,21 @@ func (ec *executionContext) field_Mutation_updateProjectLabel_args(ctx context.C args := map[string]interface{}{} var arg0 UpdateProjectLabel if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectLabel(ctx, tmp) + arg0, err = ec.unmarshalNUpdateProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectLabel(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateProjectMemberRole_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 UpdateProjectMemberRole + if tmp, ok := rawArgs["input"]; ok { + arg0, err = ec.unmarshalNUpdateProjectMemberRole2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectMemberRole(ctx, tmp) if err != nil { return nil, err } @@ -2572,7 +3079,7 @@ func (ec *executionContext) field_Mutation_updateProjectName_args(ctx context.Co args := map[string]interface{}{} var arg0 *UpdateProjectName if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalOUpdateProjectName2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectName(ctx, tmp) + arg0, err = ec.unmarshalOUpdateProjectName2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectName(ctx, tmp) if err != nil { return nil, err } @@ -2586,7 +3093,7 @@ func (ec *executionContext) field_Mutation_updateTaskChecklistItemName_args(ctx args := map[string]interface{}{} var arg0 UpdateTaskChecklistItemName if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateTaskChecklistItemName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskChecklistItemName(ctx, tmp) + arg0, err = ec.unmarshalNUpdateTaskChecklistItemName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskChecklistItemName(ctx, tmp) if err != nil { return nil, err } @@ -2600,7 +3107,7 @@ func (ec *executionContext) field_Mutation_updateTaskChecklistName_args(ctx cont args := map[string]interface{}{} var arg0 UpdateTaskChecklistName if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateTaskChecklistName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskChecklistName(ctx, tmp) + arg0, err = ec.unmarshalNUpdateTaskChecklistName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskChecklistName(ctx, tmp) if err != nil { return nil, err } @@ -2614,7 +3121,7 @@ func (ec *executionContext) field_Mutation_updateTaskDescription_args(ctx contex args := map[string]interface{}{} var arg0 UpdateTaskDescriptionInput if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateTaskDescriptionInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskDescriptionInput(ctx, tmp) + arg0, err = ec.unmarshalNUpdateTaskDescriptionInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskDescriptionInput(ctx, tmp) if err != nil { return nil, err } @@ -2628,7 +3135,7 @@ func (ec *executionContext) field_Mutation_updateTaskDueDate_args(ctx context.Co args := map[string]interface{}{} var arg0 UpdateTaskDueDate if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateTaskDueDate2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskDueDate(ctx, tmp) + arg0, err = ec.unmarshalNUpdateTaskDueDate2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskDueDate(ctx, tmp) if err != nil { return nil, err } @@ -2642,7 +3149,7 @@ func (ec *executionContext) field_Mutation_updateTaskGroupLocation_args(ctx cont args := map[string]interface{}{} var arg0 NewTaskGroupLocation if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewTaskGroupLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTaskGroupLocation(ctx, tmp) + arg0, err = ec.unmarshalNNewTaskGroupLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTaskGroupLocation(ctx, tmp) if err != nil { return nil, err } @@ -2656,7 +3163,7 @@ func (ec *executionContext) field_Mutation_updateTaskGroupName_args(ctx context. args := map[string]interface{}{} var arg0 UpdateTaskGroupName if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateTaskGroupName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskGroupName(ctx, tmp) + arg0, err = ec.unmarshalNUpdateTaskGroupName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskGroupName(ctx, tmp) if err != nil { return nil, err } @@ -2670,7 +3177,7 @@ func (ec *executionContext) field_Mutation_updateTaskLocation_args(ctx context.C args := map[string]interface{}{} var arg0 NewTaskLocation if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNNewTaskLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTaskLocation(ctx, tmp) + arg0, err = ec.unmarshalNNewTaskLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTaskLocation(ctx, tmp) if err != nil { return nil, err } @@ -2684,7 +3191,21 @@ func (ec *executionContext) field_Mutation_updateTaskName_args(ctx context.Conte args := map[string]interface{}{} var arg0 UpdateTaskName if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNUpdateTaskName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskName(ctx, tmp) + arg0, err = ec.unmarshalNUpdateTaskName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskName(ctx, tmp) + if err != nil { + return nil, err + } + } + args["input"] = arg0 + return args, nil +} + +func (ec *executionContext) field_Mutation_updateTeamMemberRole_args(ctx context.Context, rawArgs map[string]interface{}) (map[string]interface{}, error) { + var err error + args := map[string]interface{}{} + var arg0 UpdateTeamMemberRole + if tmp, ok := rawArgs["input"]; ok { + arg0, err = ec.unmarshalNUpdateTeamMemberRole2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTeamMemberRole(ctx, tmp) if err != nil { return nil, err } @@ -2712,7 +3233,7 @@ func (ec *executionContext) field_Query_findProject_args(ctx context.Context, ra args := map[string]interface{}{} var arg0 FindProject if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNFindProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindProject(ctx, tmp) + arg0, err = ec.unmarshalNFindProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindProject(ctx, tmp) if err != nil { return nil, err } @@ -2726,7 +3247,7 @@ func (ec *executionContext) field_Query_findTask_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 FindTask if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNFindTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindTask(ctx, tmp) + arg0, err = ec.unmarshalNFindTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindTask(ctx, tmp) if err != nil { return nil, err } @@ -2740,7 +3261,7 @@ func (ec *executionContext) field_Query_findTeam_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 FindTeam if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNFindTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindTeam(ctx, tmp) + arg0, err = ec.unmarshalNFindTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindTeam(ctx, tmp) if err != nil { return nil, err } @@ -2754,7 +3275,7 @@ func (ec *executionContext) field_Query_findUser_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 FindUser if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalNFindUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindUser(ctx, tmp) + arg0, err = ec.unmarshalNFindUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindUser(ctx, tmp) if err != nil { return nil, err } @@ -2768,7 +3289,7 @@ func (ec *executionContext) field_Query_projects_args(ctx context.Context, rawAr args := map[string]interface{}{} var arg0 *ProjectsFilter if tmp, ok := rawArgs["input"]; ok { - arg0, err = ec.unmarshalOProjectsFilter2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectsFilter(ctx, tmp) + arg0, err = ec.unmarshalOProjectsFilter2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProjectsFilter(ctx, tmp) if err != nil { return nil, err } @@ -2881,6 +3402,74 @@ func (ec *executionContext) _ChecklistBadge_total(ctx context.Context, field gra return ec.marshalNInt2int(ctx, field.Selections, res) } +func (ec *executionContext) _CreateProjectMemberPayload_ok(ctx context.Context, field graphql.CollectedField, obj *CreateProjectMemberPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "CreateProjectMemberPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ok, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _CreateProjectMemberPayload_member(ctx context.Context, field graphql.CollectedField, obj *CreateProjectMemberPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "CreateProjectMemberPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Member, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + func (ec *executionContext) _CreateTeamMemberPayload_team(ctx context.Context, field graphql.CollectedField, obj *CreateTeamMemberPayload) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -2910,9 +3499,9 @@ func (ec *executionContext) _CreateTeamMemberPayload_team(ctx context.Context, f } return graphql.Null } - res := resTmp.(*pg.Team) + res := resTmp.(*db.Team) fc.Result = res - return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx, field.Selections, res) + return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx, field.Selections, res) } func (ec *executionContext) _CreateTeamMemberPayload_teamMember(ctx context.Context, field graphql.CollectedField, obj *CreateTeamMemberPayload) (ret graphql.Marshaler) { @@ -2944,9 +3533,111 @@ func (ec *executionContext) _CreateTeamMemberPayload_teamMember(ctx context.Cont } return graphql.Null } - res := resTmp.(*ProjectMember) + res := resTmp.(*Member) fc.Result = res - return ec.marshalNProjectMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMember(ctx, field.Selections, res) + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + +func (ec *executionContext) _DeleteProjectMemberPayload_ok(ctx context.Context, field graphql.CollectedField, obj *DeleteProjectMemberPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "DeleteProjectMemberPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ok, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _DeleteProjectMemberPayload_member(ctx context.Context, field graphql.CollectedField, obj *DeleteProjectMemberPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "DeleteProjectMemberPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Member, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + +func (ec *executionContext) _DeleteProjectMemberPayload_projectID(ctx context.Context, field graphql.CollectedField, obj *DeleteProjectMemberPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "DeleteProjectMemberPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.ProjectID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } func (ec *executionContext) _DeleteProjectPayload_ok(ctx context.Context, field graphql.CollectedField, obj *DeleteProjectPayload) (ret graphql.Marshaler) { @@ -3012,9 +3703,9 @@ func (ec *executionContext) _DeleteProjectPayload_project(ctx context.Context, f } return graphql.Null } - res := resTmp.(*pg.Project) + res := resTmp.(*db.Project) fc.Result = res - return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProject(ctx, field.Selections, res) + return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProject(ctx, field.Selections, res) } func (ec *executionContext) _DeleteTaskChecklistItemPayload_ok(ctx context.Context, field graphql.CollectedField, obj *DeleteTaskChecklistItemPayload) (ret graphql.Marshaler) { @@ -3080,9 +3771,9 @@ func (ec *executionContext) _DeleteTaskChecklistItemPayload_taskChecklistItem(ct } return graphql.Null } - res := resTmp.(*pg.TaskChecklistItem) + res := resTmp.(*db.TaskChecklistItem) fc.Result = res - return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItem(ctx, field.Selections, res) + return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItem(ctx, field.Selections, res) } func (ec *executionContext) _DeleteTaskChecklistPayload_ok(ctx context.Context, field graphql.CollectedField, obj *DeleteTaskChecklistPayload) (ret graphql.Marshaler) { @@ -3148,9 +3839,9 @@ func (ec *executionContext) _DeleteTaskChecklistPayload_taskChecklist(ctx contex } return graphql.Null } - res := resTmp.(*pg.TaskChecklist) + res := resTmp.(*db.TaskChecklist) fc.Result = res - return ec.marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklist(ctx, field.Selections, res) + return ec.marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklist(ctx, field.Selections, res) } func (ec *executionContext) _DeleteTaskGroupPayload_ok(ctx context.Context, field graphql.CollectedField, obj *DeleteTaskGroupPayload) (ret graphql.Marshaler) { @@ -3250,9 +3941,9 @@ func (ec *executionContext) _DeleteTaskGroupPayload_taskGroup(ctx context.Contex } return graphql.Null } - res := resTmp.(*pg.TaskGroup) + res := resTmp.(*db.TaskGroup) fc.Result = res - return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx, field.Selections, res) + return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx, field.Selections, res) } func (ec *executionContext) _DeleteTaskPayload_taskID(ctx context.Context, field graphql.CollectedField, obj *DeleteTaskPayload) (ret graphql.Marshaler) { @@ -3289,6 +3980,74 @@ func (ec *executionContext) _DeleteTaskPayload_taskID(ctx context.Context, field return ec.marshalNString2string(ctx, field.Selections, res) } +func (ec *executionContext) _DeleteTeamMemberPayload_teamID(ctx context.Context, field graphql.CollectedField, obj *DeleteTeamMemberPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "DeleteTeamMemberPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.TeamID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + +func (ec *executionContext) _DeleteTeamMemberPayload_userID(ctx context.Context, field graphql.CollectedField, obj *DeleteTeamMemberPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "DeleteTeamMemberPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.UserID, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(uuid.UUID) + fc.Result = res + return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) +} + func (ec *executionContext) _DeleteTeamPayload_ok(ctx context.Context, field graphql.CollectedField, obj *DeleteTeamPayload) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -3352,9 +4111,9 @@ func (ec *executionContext) _DeleteTeamPayload_team(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*pg.Team) + res := resTmp.(*db.Team) fc.Result = res - return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx, field.Selections, res) + return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx, field.Selections, res) } func (ec *executionContext) _DeleteTeamPayload_projects(ctx context.Context, field graphql.CollectedField, obj *DeleteTeamPayload) (ret graphql.Marshaler) { @@ -3386,9 +4145,9 @@ func (ec *executionContext) _DeleteTeamPayload_projects(ctx context.Context, fie } return graphql.Null } - res := resTmp.([]pg.Project) + res := resTmp.([]db.Project) fc.Result = res - return ec.marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectᚄ(ctx, field.Selections, res) + return ec.marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectᚄ(ctx, field.Selections, res) } func (ec *executionContext) _DeleteUserAccountPayload_ok(ctx context.Context, field graphql.CollectedField, obj *DeleteUserAccountPayload) (ret graphql.Marshaler) { @@ -3454,12 +4213,12 @@ func (ec *executionContext) _DeleteUserAccountPayload_userAccount(ctx context.Co } return graphql.Null } - res := resTmp.(*pg.UserAccount) + res := resTmp.(*db.UserAccount) fc.Result = res - return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx, field.Selections, res) + return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx, field.Selections, res) } -func (ec *executionContext) _LabelColor_id(ctx context.Context, field graphql.CollectedField, obj *pg.LabelColor) (ret graphql.Marshaler) { +func (ec *executionContext) _LabelColor_id(ctx context.Context, field graphql.CollectedField, obj *db.LabelColor) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3493,7 +4252,7 @@ func (ec *executionContext) _LabelColor_id(ctx context.Context, field graphql.Co return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _LabelColor_name(ctx context.Context, field graphql.CollectedField, obj *pg.LabelColor) (ret graphql.Marshaler) { +func (ec *executionContext) _LabelColor_name(ctx context.Context, field graphql.CollectedField, obj *db.LabelColor) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3527,7 +4286,7 @@ func (ec *executionContext) _LabelColor_name(ctx context.Context, field graphql. return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _LabelColor_position(ctx context.Context, field graphql.CollectedField, obj *pg.LabelColor) (ret graphql.Marshaler) { +func (ec *executionContext) _LabelColor_position(ctx context.Context, field graphql.CollectedField, obj *db.LabelColor) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3561,7 +4320,7 @@ func (ec *executionContext) _LabelColor_position(ctx context.Context, field grap return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _LabelColor_colorHex(ctx context.Context, field graphql.CollectedField, obj *pg.LabelColor) (ret graphql.Marshaler) { +func (ec *executionContext) _LabelColor_colorHex(ctx context.Context, field graphql.CollectedField, obj *db.LabelColor) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3595,7 +4354,7 @@ func (ec *executionContext) _LabelColor_colorHex(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_createRefreshToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Member_id(ctx context.Context, field graphql.CollectedField, obj *Member) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3603,23 +4362,16 @@ func (ec *executionContext) _Mutation_createRefreshToken(ctx context.Context, fi } }() fc := &graphql.FieldContext{ - Object: "Mutation", + Object: "Member", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, } ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_createRefreshToken_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateRefreshToken(rctx, args["input"].(NewRefreshToken)) + return obj.ID, nil }) if err != nil { ec.Error(ctx, err) @@ -3631,12 +4383,12 @@ func (ec *executionContext) _Mutation_createRefreshToken(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*pg.RefreshToken) + res := resTmp.(uuid.UUID) fc.Result = res - return ec.marshalNRefreshToken2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐRefreshToken(ctx, field.Selections, res) + return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_createUserAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Member_role(ctx context.Context, field graphql.CollectedField, obj *Member) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3644,23 +4396,16 @@ func (ec *executionContext) _Mutation_createUserAccount(ctx context.Context, fie } }() fc := &graphql.FieldContext{ - Object: "Mutation", + Object: "Member", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, } ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_createUserAccount_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateUserAccount(rctx, args["input"].(NewUserAccount)) + return obj.Role, nil }) if err != nil { ec.Error(ctx, err) @@ -3672,12 +4417,12 @@ func (ec *executionContext) _Mutation_createUserAccount(ctx context.Context, fie } return graphql.Null } - res := resTmp.(*pg.UserAccount) + res := resTmp.(*db.Role) fc.Result = res - return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx, field.Selections, res) + return ec.marshalNRole2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐRole(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_deleteUserAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Member_fullName(ctx context.Context, field graphql.CollectedField, obj *Member) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3685,23 +4430,16 @@ func (ec *executionContext) _Mutation_deleteUserAccount(ctx context.Context, fie } }() fc := &graphql.FieldContext{ - Object: "Mutation", + Object: "Member", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, } ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_deleteUserAccount_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteUserAccount(rctx, args["input"].(DeleteUserAccount)) + return obj.FullName, nil }) if err != nil { ec.Error(ctx, err) @@ -3713,12 +4451,12 @@ func (ec *executionContext) _Mutation_deleteUserAccount(ctx context.Context, fie } return graphql.Null } - res := resTmp.(*DeleteUserAccountPayload) + res := resTmp.(string) fc.Result = res - return ec.marshalNDeleteUserAccountPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteUserAccountPayload(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_deleteTeam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Member_username(ctx context.Context, field graphql.CollectedField, obj *Member) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3726,23 +4464,16 @@ func (ec *executionContext) _Mutation_deleteTeam(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "Mutation", + Object: "Member", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, } ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_deleteTeam_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteTeam(rctx, args["input"].(DeleteTeam)) + return obj.Username, nil }) if err != nil { ec.Error(ctx, err) @@ -3754,12 +4485,12 @@ func (ec *executionContext) _Mutation_deleteTeam(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*DeleteTeamPayload) + res := resTmp.(string) fc.Result = res - return ec.marshalNDeleteTeamPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTeamPayload(ctx, field.Selections, res) + return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_createTeam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Member_profileIcon(ctx context.Context, field graphql.CollectedField, obj *Member) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -3767,23 +4498,16 @@ func (ec *executionContext) _Mutation_createTeam(ctx context.Context, field grap } }() fc := &graphql.FieldContext{ - Object: "Mutation", + Object: "Member", Field: field, Args: nil, - IsMethod: true, + IsMethod: false, } ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_createTeam_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTeam(rctx, args["input"].(NewTeam)) + return obj.ProfileIcon, nil }) if err != nil { ec.Error(ctx, err) @@ -3795,84 +4519,9 @@ func (ec *executionContext) _Mutation_createTeam(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*pg.Team) + res := resTmp.(*ProfileIcon) fc.Result = res - return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_clearProfileAvatar(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ClearProfileAvatar(rctx) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.UserAccount) - fc.Result = res - return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_createTeamMember(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_createTeamMember_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTeamMember(rctx, args["input"].(CreateTeamMember)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*CreateTeamMemberPayload) - fc.Result = res - return ec.marshalNCreateTeamMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTeamMemberPayload(ctx, field.Selections, res) + return ec.marshalNProfileIcon2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProfileIcon(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_createProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -3911,9 +4560,9 @@ func (ec *executionContext) _Mutation_createProject(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*pg.Project) + res := resTmp.(*db.Project) fc.Result = res - return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProject(ctx, field.Selections, res) + return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProject(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_deleteProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -3954,7 +4603,7 @@ func (ec *executionContext) _Mutation_deleteProject(ctx context.Context, field g } res := resTmp.(*DeleteProjectPayload) fc.Result = res - return ec.marshalNDeleteProjectPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteProjectPayload(ctx, field.Selections, res) + return ec.marshalNDeleteProjectPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectPayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_updateProjectName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -3993,9 +4642,9 @@ func (ec *executionContext) _Mutation_updateProjectName(ctx context.Context, fie } return graphql.Null } - res := resTmp.(*pg.Project) + res := resTmp.(*db.Project) fc.Result = res - return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProject(ctx, field.Selections, res) + return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProject(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_createProjectLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -4034,9 +4683,9 @@ func (ec *executionContext) _Mutation_createProjectLabel(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*pg.ProjectLabel) + res := resTmp.(*db.ProjectLabel) fc.Result = res - return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx, field.Selections, res) + return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_deleteProjectLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -4075,9 +4724,9 @@ func (ec *executionContext) _Mutation_deleteProjectLabel(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*pg.ProjectLabel) + res := resTmp.(*db.ProjectLabel) fc.Result = res - return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx, field.Selections, res) + return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_updateProjectLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -4116,9 +4765,9 @@ func (ec *executionContext) _Mutation_updateProjectLabel(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*pg.ProjectLabel) + res := resTmp.(*db.ProjectLabel) fc.Result = res - return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx, field.Selections, res) + return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_updateProjectLabelName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -4157,9 +4806,9 @@ func (ec *executionContext) _Mutation_updateProjectLabelName(ctx context.Context } return graphql.Null } - res := resTmp.(*pg.ProjectLabel) + res := resTmp.(*db.ProjectLabel) fc.Result = res - return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx, field.Selections, res) + return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_updateProjectLabelColor(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -4198,12 +4847,12 @@ func (ec *executionContext) _Mutation_updateProjectLabelColor(ctx context.Contex } return graphql.Null } - res := resTmp.(*pg.ProjectLabel) + res := resTmp.(*db.ProjectLabel) fc.Result = res - return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx, field.Selections, res) + return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_createTaskGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_createProjectMember(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4219,7 +4868,7 @@ func (ec *executionContext) _Mutation_createTaskGroup(ctx context.Context, field ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_createTaskGroup_args(ctx, rawArgs) + args, err := ec.field_Mutation_createProjectMember_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null @@ -4227,7 +4876,7 @@ func (ec *executionContext) _Mutation_createTaskGroup(ctx context.Context, field fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTaskGroup(rctx, args["input"].(NewTaskGroup)) + return ec.resolvers.Mutation().CreateProjectMember(rctx, args["input"].(CreateProjectMember)) }) if err != nil { ec.Error(ctx, err) @@ -4239,12 +4888,12 @@ func (ec *executionContext) _Mutation_createTaskGroup(ctx context.Context, field } return graphql.Null } - res := resTmp.(*pg.TaskGroup) + res := resTmp.(*CreateProjectMemberPayload) fc.Result = res - return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx, field.Selections, res) + return ec.marshalNCreateProjectMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateProjectMemberPayload(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_updateTaskGroupLocation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_deleteProjectMember(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4260,7 +4909,7 @@ func (ec *executionContext) _Mutation_updateTaskGroupLocation(ctx context.Contex ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskGroupLocation_args(ctx, rawArgs) + args, err := ec.field_Mutation_deleteProjectMember_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null @@ -4268,7 +4917,7 @@ func (ec *executionContext) _Mutation_updateTaskGroupLocation(ctx context.Contex fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskGroupLocation(rctx, args["input"].(NewTaskGroupLocation)) + return ec.resolvers.Mutation().DeleteProjectMember(rctx, args["input"].(DeleteProjectMember)) }) if err != nil { ec.Error(ctx, err) @@ -4280,12 +4929,12 @@ func (ec *executionContext) _Mutation_updateTaskGroupLocation(ctx context.Contex } return graphql.Null } - res := resTmp.(*pg.TaskGroup) + res := resTmp.(*DeleteProjectMemberPayload) fc.Result = res - return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx, field.Selections, res) + return ec.marshalNDeleteProjectMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectMemberPayload(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_updateTaskGroupName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_updateProjectMemberRole(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4301,7 +4950,7 @@ func (ec *executionContext) _Mutation_updateTaskGroupName(ctx context.Context, f ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskGroupName_args(ctx, rawArgs) + args, err := ec.field_Mutation_updateProjectMemberRole_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null @@ -4309,7 +4958,7 @@ func (ec *executionContext) _Mutation_updateTaskGroupName(ctx context.Context, f fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskGroupName(rctx, args["input"].(UpdateTaskGroupName)) + return ec.resolvers.Mutation().UpdateProjectMemberRole(rctx, args["input"].(UpdateProjectMemberRole)) }) if err != nil { ec.Error(ctx, err) @@ -4321,12 +4970,12 @@ func (ec *executionContext) _Mutation_updateTaskGroupName(ctx context.Context, f } return graphql.Null } - res := resTmp.(*pg.TaskGroup) + res := resTmp.(*UpdateProjectMemberRolePayload) fc.Result = res - return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx, field.Selections, res) + return ec.marshalNUpdateProjectMemberRolePayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectMemberRolePayload(ctx, field.Selections, res) } -func (ec *executionContext) _Mutation_deleteTaskGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_setProjectOwner(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -4342,7 +4991,7 @@ func (ec *executionContext) _Mutation_deleteTaskGroup(ctx context.Context, field ctx = graphql.WithFieldContext(ctx, fc) rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_deleteTaskGroup_args(ctx, rawArgs) + args, err := ec.field_Mutation_setProjectOwner_args(ctx, rawArgs) if err != nil { ec.Error(ctx, err) return graphql.Null @@ -4350,7 +4999,7 @@ func (ec *executionContext) _Mutation_deleteTaskGroup(ctx context.Context, field fc.Args = args resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteTaskGroup(rctx, args["input"].(DeleteTaskGroupInput)) + return ec.resolvers.Mutation().SetProjectOwner(rctx, args["input"].(SetProjectOwner)) }) if err != nil { ec.Error(ctx, err) @@ -4362,419 +5011,9 @@ func (ec *executionContext) _Mutation_deleteTaskGroup(ctx context.Context, field } return graphql.Null } - res := resTmp.(*DeleteTaskGroupPayload) + res := resTmp.(*SetProjectOwnerPayload) fc.Result = res - return ec.marshalNDeleteTaskGroupPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskGroupPayload(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_addTaskLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_addTaskLabel_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().AddTaskLabel(rctx, args["input"].(*AddTaskLabelInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.Task) - fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_removeTaskLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_removeTaskLabel_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().RemoveTaskLabel(rctx, args["input"].(*RemoveTaskLabelInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.Task) - fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_toggleTaskLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_toggleTaskLabel_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().ToggleTaskLabel(rctx, args["input"].(ToggleTaskLabelInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*ToggleTaskLabelPayload) - fc.Result = res - return ec.marshalNToggleTaskLabelPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐToggleTaskLabelPayload(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_createTaskChecklist(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_createTaskChecklist_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTaskChecklist(rctx, args["input"].(CreateTaskChecklist)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.TaskChecklist) - fc.Result = res - return ec.marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklist(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_deleteTaskChecklist(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_deleteTaskChecklist_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteTaskChecklist(rctx, args["input"].(DeleteTaskChecklist)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*DeleteTaskChecklistPayload) - fc.Result = res - return ec.marshalNDeleteTaskChecklistPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistPayload(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_updateTaskChecklistName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskChecklistName_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskChecklistName(rctx, args["input"].(UpdateTaskChecklistName)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.TaskChecklist) - fc.Result = res - return ec.marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklist(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_createTaskChecklistItem(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_createTaskChecklistItem_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().CreateTaskChecklistItem(rctx, args["input"].(CreateTaskChecklistItem)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.TaskChecklistItem) - fc.Result = res - return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItem(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_updateTaskChecklistItemName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskChecklistItemName_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskChecklistItemName(rctx, args["input"].(UpdateTaskChecklistItemName)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.TaskChecklistItem) - fc.Result = res - return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItem(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_setTaskChecklistItemComplete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_setTaskChecklistItemComplete_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().SetTaskChecklistItemComplete(rctx, args["input"].(SetTaskChecklistItemComplete)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.TaskChecklistItem) - fc.Result = res - return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItem(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_deleteTaskChecklistItem(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_deleteTaskChecklistItem_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().DeleteTaskChecklistItem(rctx, args["input"].(DeleteTaskChecklistItem)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*DeleteTaskChecklistItemPayload) - fc.Result = res - return ec.marshalNDeleteTaskChecklistItemPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistItemPayload(ctx, field.Selections, res) + return ec.marshalNSetProjectOwnerPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetProjectOwnerPayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_createTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -4813,214 +5052,9 @@ func (ec *executionContext) _Mutation_createTask(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*pg.Task) + res := resTmp.(*db.Task) fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_updateTaskDescription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskDescription_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskDescription(rctx, args["input"].(UpdateTaskDescriptionInput)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.Task) - fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_updateTaskLocation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskLocation_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskLocation(rctx, args["input"].(NewTaskLocation)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*UpdateTaskLocationPayload) - fc.Result = res - return ec.marshalNUpdateTaskLocationPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskLocationPayload(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_updateTaskName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskName_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskName(rctx, args["input"].(UpdateTaskName)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.Task) - fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_setTaskComplete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_setTaskComplete_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().SetTaskComplete(rctx, args["input"].(SetTaskComplete)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.Task) - fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) -} - -func (ec *executionContext) _Mutation_updateTaskDueDate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "Mutation", - Field: field, - Args: nil, - IsMethod: true, - } - - ctx = graphql.WithFieldContext(ctx, fc) - rawArgs := field.ArgumentMap(ec.Variables) - args, err := ec.field_Mutation_updateTaskDueDate_args(ctx, rawArgs) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - fc.Args = args - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return ec.resolvers.Mutation().UpdateTaskDueDate(rctx, args["input"].(UpdateTaskDueDate)) - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*pg.Task) - fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_deleteTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -5061,7 +5095,212 @@ func (ec *executionContext) _Mutation_deleteTask(ctx context.Context, field grap } res := resTmp.(*DeleteTaskPayload) fc.Result = res - return ec.marshalNDeleteTaskPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskPayload(ctx, field.Selections, res) + return ec.marshalNDeleteTaskPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskDescription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskDescription_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskDescription(rctx, args["input"].(UpdateTaskDescriptionInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Task) + fc.Result = res + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskLocation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskLocation_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskLocation(rctx, args["input"].(NewTaskLocation)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*UpdateTaskLocationPayload) + fc.Result = res + return ec.marshalNUpdateTaskLocationPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskLocationPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskName_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskName(rctx, args["input"].(UpdateTaskName)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Task) + fc.Result = res + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_setTaskComplete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_setTaskComplete_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().SetTaskComplete(rctx, args["input"].(SetTaskComplete)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Task) + fc.Result = res + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskDueDate(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskDueDate_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskDueDate(rctx, args["input"].(UpdateTaskDueDate)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Task) + fc.Result = res + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_assignTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -5100,9 +5339,9 @@ func (ec *executionContext) _Mutation_assignTask(ctx context.Context, field grap } return graphql.Null } - res := resTmp.(*pg.Task) + res := resTmp.(*db.Task) fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_unassignTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -5141,9 +5380,952 @@ func (ec *executionContext) _Mutation_unassignTask(ctx context.Context, field gr } return graphql.Null } - res := resTmp.(*pg.Task) + res := resTmp.(*db.Task) fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_createTaskChecklist(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_createTaskChecklist_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateTaskChecklist(rctx, args["input"].(CreateTaskChecklist)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskChecklist) + fc.Result = res + return ec.marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklist(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_deleteTaskChecklist(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_deleteTaskChecklist_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteTaskChecklist(rctx, args["input"].(DeleteTaskChecklist)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*DeleteTaskChecklistPayload) + fc.Result = res + return ec.marshalNDeleteTaskChecklistPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskChecklistName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskChecklistName_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskChecklistName(rctx, args["input"].(UpdateTaskChecklistName)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskChecklist) + fc.Result = res + return ec.marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklist(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_createTaskChecklistItem(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_createTaskChecklistItem_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateTaskChecklistItem(rctx, args["input"].(CreateTaskChecklistItem)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskChecklistItem) + fc.Result = res + return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItem(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskChecklistItemName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskChecklistItemName_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskChecklistItemName(rctx, args["input"].(UpdateTaskChecklistItemName)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskChecklistItem) + fc.Result = res + return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItem(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_setTaskChecklistItemComplete(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_setTaskChecklistItemComplete_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().SetTaskChecklistItemComplete(rctx, args["input"].(SetTaskChecklistItemComplete)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskChecklistItem) + fc.Result = res + return ec.marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItem(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_deleteTaskChecklistItem(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_deleteTaskChecklistItem_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteTaskChecklistItem(rctx, args["input"].(DeleteTaskChecklistItem)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*DeleteTaskChecklistItemPayload) + fc.Result = res + return ec.marshalNDeleteTaskChecklistItemPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistItemPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_createTaskGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_createTaskGroup_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateTaskGroup(rctx, args["input"].(NewTaskGroup)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskGroup) + fc.Result = res + return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskGroupLocation(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskGroupLocation_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskGroupLocation(rctx, args["input"].(NewTaskGroupLocation)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskGroup) + fc.Result = res + return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTaskGroupName(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTaskGroupName_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTaskGroupName(rctx, args["input"].(UpdateTaskGroupName)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.TaskGroup) + fc.Result = res + return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_deleteTaskGroup(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_deleteTaskGroup_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteTaskGroup(rctx, args["input"].(DeleteTaskGroupInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*DeleteTaskGroupPayload) + fc.Result = res + return ec.marshalNDeleteTaskGroupPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskGroupPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_addTaskLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_addTaskLabel_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().AddTaskLabel(rctx, args["input"].(*AddTaskLabelInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Task) + fc.Result = res + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_removeTaskLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_removeTaskLabel_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().RemoveTaskLabel(rctx, args["input"].(*RemoveTaskLabelInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Task) + fc.Result = res + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_toggleTaskLabel(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_toggleTaskLabel_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ToggleTaskLabel(rctx, args["input"].(ToggleTaskLabelInput)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*ToggleTaskLabelPayload) + fc.Result = res + return ec.marshalNToggleTaskLabelPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐToggleTaskLabelPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_deleteTeam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_deleteTeam_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteTeam(rctx, args["input"].(DeleteTeam)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*DeleteTeamPayload) + fc.Result = res + return ec.marshalNDeleteTeamPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_createTeam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_createTeam_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateTeam(rctx, args["input"].(NewTeam)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Team) + fc.Result = res + return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_setTeamOwner(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_setTeamOwner_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().SetTeamOwner(rctx, args["input"].(SetTeamOwner)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*SetTeamOwnerPayload) + fc.Result = res + return ec.marshalNSetTeamOwnerPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTeamOwnerPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_createTeamMember(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_createTeamMember_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateTeamMember(rctx, args["input"].(CreateTeamMember)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*CreateTeamMemberPayload) + fc.Result = res + return ec.marshalNCreateTeamMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTeamMemberPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_updateTeamMemberRole(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_updateTeamMemberRole_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().UpdateTeamMemberRole(rctx, args["input"].(UpdateTeamMemberRole)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*UpdateTeamMemberRolePayload) + fc.Result = res + return ec.marshalNUpdateTeamMemberRolePayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTeamMemberRolePayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_deleteTeamMember(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_deleteTeamMember_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteTeamMember(rctx, args["input"].(DeleteTeamMember)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*DeleteTeamMemberPayload) + fc.Result = res + return ec.marshalNDeleteTeamMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamMemberPayload(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_createRefreshToken(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_createRefreshToken_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateRefreshToken(rctx, args["input"].(NewRefreshToken)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.RefreshToken) + fc.Result = res + return ec.marshalNRefreshToken2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐRefreshToken(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_createUserAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_createUserAccount_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().CreateUserAccount(rctx, args["input"].(NewUserAccount)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.UserAccount) + fc.Result = res + return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx, field.Selections, res) +} + +func (ec *executionContext) _Mutation_deleteUserAccount(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + rawArgs := field.ArgumentMap(ec.Variables) + args, err := ec.field_Mutation_deleteUserAccount_args(ctx, rawArgs) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + fc.Args = args + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().DeleteUserAccount(rctx, args["input"].(DeleteUserAccount)) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*DeleteUserAccountPayload) + fc.Result = res + return ec.marshalNDeleteUserAccountPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteUserAccountPayload(ctx, field.Selections, res) } func (ec *executionContext) _Mutation_logoutUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -5187,7 +6369,41 @@ func (ec *executionContext) _Mutation_logoutUser(ctx context.Context, field grap return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *pg.Organization) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_clearProfileAvatar(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Mutation", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.Mutation().ClearProfileAvatar(rctx) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.UserAccount) + fc.Result = res + return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx, field.Selections, res) +} + +func (ec *executionContext) _Organization_id(ctx context.Context, field graphql.CollectedField, obj *db.Organization) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5221,7 +6437,7 @@ func (ec *executionContext) _Organization_id(ctx context.Context, field graphql. return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *pg.Organization) (ret graphql.Marshaler) { +func (ec *executionContext) _Organization_name(ctx context.Context, field graphql.CollectedField, obj *db.Organization) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5348,7 +6564,7 @@ func (ec *executionContext) _ProfileIcon_bgColor(ctx context.Context, field grap return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_id(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5382,7 +6598,7 @@ func (ec *executionContext) _Project_id(ctx context.Context, field graphql.Colle return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _Project_createdAt(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_createdAt(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5416,7 +6632,7 @@ func (ec *executionContext) _Project_createdAt(ctx context.Context, field graphq return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Project_name(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_name(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5450,7 +6666,7 @@ func (ec *executionContext) _Project_name(ctx context.Context, field graphql.Col return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Project_team(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_team(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5479,12 +6695,12 @@ func (ec *executionContext) _Project_team(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.(*pg.Team) + res := resTmp.(*db.Team) fc.Result = res - return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx, field.Selections, res) + return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx, field.Selections, res) } -func (ec *executionContext) _Project_owner(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_owner(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5513,12 +6729,12 @@ func (ec *executionContext) _Project_owner(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.(*ProjectMember) + res := resTmp.(*Member) fc.Result = res - return ec.marshalNProjectMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMember(ctx, field.Selections, res) + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) } -func (ec *executionContext) _Project_taskGroups(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_taskGroups(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5547,12 +6763,12 @@ func (ec *executionContext) _Project_taskGroups(ctx context.Context, field graph } return graphql.Null } - res := resTmp.([]pg.TaskGroup) + res := resTmp.([]db.TaskGroup) fc.Result = res - return ec.marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroupᚄ(ctx, field.Selections, res) + return ec.marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroupᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Project_members(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_members(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5581,12 +6797,12 @@ func (ec *executionContext) _Project_members(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.([]ProjectMember) + res := resTmp.([]Member) fc.Result = res - return ec.marshalNProjectMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMemberᚄ(ctx, field.Selections, res) + return ec.marshalNMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMemberᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Project_labels(ctx context.Context, field graphql.CollectedField, obj *pg.Project) (ret graphql.Marshaler) { +func (ec *executionContext) _Project_labels(ctx context.Context, field graphql.CollectedField, obj *db.Project) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5615,12 +6831,12 @@ func (ec *executionContext) _Project_labels(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]pg.ProjectLabel) + res := resTmp.([]db.ProjectLabel) fc.Result = res - return ec.marshalNProjectLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabelᚄ(ctx, field.Selections, res) + return ec.marshalNProjectLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabelᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _ProjectLabel_id(ctx context.Context, field graphql.CollectedField, obj *pg.ProjectLabel) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectLabel_id(ctx context.Context, field graphql.CollectedField, obj *db.ProjectLabel) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5654,7 +6870,7 @@ func (ec *executionContext) _ProjectLabel_id(ctx context.Context, field graphql. return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _ProjectLabel_createdDate(ctx context.Context, field graphql.CollectedField, obj *pg.ProjectLabel) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectLabel_createdDate(ctx context.Context, field graphql.CollectedField, obj *db.ProjectLabel) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5688,7 +6904,7 @@ func (ec *executionContext) _ProjectLabel_createdDate(ctx context.Context, field return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _ProjectLabel_labelColor(ctx context.Context, field graphql.CollectedField, obj *pg.ProjectLabel) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectLabel_labelColor(ctx context.Context, field graphql.CollectedField, obj *db.ProjectLabel) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5717,12 +6933,12 @@ func (ec *executionContext) _ProjectLabel_labelColor(ctx context.Context, field } return graphql.Null } - res := resTmp.(*pg.LabelColor) + res := resTmp.(*db.LabelColor) fc.Result = res - return ec.marshalNLabelColor2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐLabelColor(ctx, field.Selections, res) + return ec.marshalNLabelColor2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐLabelColor(ctx, field.Selections, res) } -func (ec *executionContext) _ProjectLabel_name(ctx context.Context, field graphql.CollectedField, obj *pg.ProjectLabel) (ret graphql.Marshaler) { +func (ec *executionContext) _ProjectLabel_name(ctx context.Context, field graphql.CollectedField, obj *db.ProjectLabel) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -5753,108 +6969,6 @@ func (ec *executionContext) _ProjectLabel_name(ctx context.Context, field graphq return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _ProjectMember_id(ctx context.Context, field graphql.CollectedField, obj *ProjectMember) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "ProjectMember", - Field: field, - Args: nil, - IsMethod: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ID, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(uuid.UUID) - fc.Result = res - return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) -} - -func (ec *executionContext) _ProjectMember_fullName(ctx context.Context, field graphql.CollectedField, obj *ProjectMember) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "ProjectMember", - Field: field, - Args: nil, - IsMethod: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.FullName, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(string) - fc.Result = res - return ec.marshalNString2string(ctx, field.Selections, res) -} - -func (ec *executionContext) _ProjectMember_profileIcon(ctx context.Context, field graphql.CollectedField, obj *ProjectMember) (ret graphql.Marshaler) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = graphql.Null - } - }() - fc := &graphql.FieldContext{ - Object: "ProjectMember", - Field: field, - Args: nil, - IsMethod: false, - } - - ctx = graphql.WithFieldContext(ctx, fc) - resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { - ctx = rctx // use context from middleware stack in children - return obj.ProfileIcon, nil - }) - if err != nil { - ec.Error(ctx, err) - return graphql.Null - } - if resTmp == nil { - if !graphql.HasFieldError(ctx, fc) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - res := resTmp.(*ProfileIcon) - fc.Result = res - return ec.marshalNProfileIcon2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProfileIcon(ctx, field.Selections, res) -} - func (ec *executionContext) _Query_organizations(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { @@ -5884,9 +6998,9 @@ func (ec *executionContext) _Query_organizations(ctx context.Context, field grap } return graphql.Null } - res := resTmp.([]pg.Organization) + res := resTmp.([]db.Organization) fc.Result = res - return ec.marshalNOrganization2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐOrganizationᚄ(ctx, field.Selections, res) + return ec.marshalNOrganization2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐOrganizationᚄ(ctx, field.Selections, res) } func (ec *executionContext) _Query_users(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -5918,9 +7032,9 @@ func (ec *executionContext) _Query_users(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]pg.UserAccount) + res := resTmp.([]db.UserAccount) fc.Result = res - return ec.marshalNUserAccount2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccountᚄ(ctx, field.Selections, res) + return ec.marshalNUserAccount2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccountᚄ(ctx, field.Selections, res) } func (ec *executionContext) _Query_findUser(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -5959,9 +7073,9 @@ func (ec *executionContext) _Query_findUser(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(*pg.UserAccount) + res := resTmp.(*db.UserAccount) fc.Result = res - return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx, field.Selections, res) + return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx, field.Selections, res) } func (ec *executionContext) _Query_findProject(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6000,9 +7114,9 @@ func (ec *executionContext) _Query_findProject(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.(*pg.Project) + res := resTmp.(*db.Project) fc.Result = res - return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProject(ctx, field.Selections, res) + return ec.marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProject(ctx, field.Selections, res) } func (ec *executionContext) _Query_findTask(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6041,9 +7155,9 @@ func (ec *executionContext) _Query_findTask(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(*pg.Task) + res := resTmp.(*db.Task) fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) } func (ec *executionContext) _Query_projects(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6082,9 +7196,9 @@ func (ec *executionContext) _Query_projects(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.([]pg.Project) + res := resTmp.([]db.Project) fc.Result = res - return ec.marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectᚄ(ctx, field.Selections, res) + return ec.marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectᚄ(ctx, field.Selections, res) } func (ec *executionContext) _Query_findTeam(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6123,9 +7237,9 @@ func (ec *executionContext) _Query_findTeam(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(*pg.Team) + res := resTmp.(*db.Team) fc.Result = res - return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx, field.Selections, res) + return ec.marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx, field.Selections, res) } func (ec *executionContext) _Query_teams(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6157,9 +7271,9 @@ func (ec *executionContext) _Query_teams(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]pg.Team) + res := resTmp.([]db.Team) fc.Result = res - return ec.marshalNTeam2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeamᚄ(ctx, field.Selections, res) + return ec.marshalNTeam2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeamᚄ(ctx, field.Selections, res) } func (ec *executionContext) _Query_labelColors(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6191,9 +7305,9 @@ func (ec *executionContext) _Query_labelColors(ctx context.Context, field graphq } return graphql.Null } - res := resTmp.([]pg.LabelColor) + res := resTmp.([]db.LabelColor) fc.Result = res - return ec.marshalNLabelColor2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐLabelColorᚄ(ctx, field.Selections, res) + return ec.marshalNLabelColor2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐLabelColorᚄ(ctx, field.Selections, res) } func (ec *executionContext) _Query_taskGroups(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6225,9 +7339,9 @@ func (ec *executionContext) _Query_taskGroups(ctx context.Context, field graphql } return graphql.Null } - res := resTmp.([]pg.TaskGroup) + res := resTmp.([]db.TaskGroup) fc.Result = res - return ec.marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroupᚄ(ctx, field.Selections, res) + return ec.marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroupᚄ(ctx, field.Selections, res) } func (ec *executionContext) _Query_me(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6259,9 +7373,9 @@ func (ec *executionContext) _Query_me(ctx context.Context, field graphql.Collect } return graphql.Null } - res := resTmp.(*pg.UserAccount) + res := resTmp.(*db.UserAccount) fc.Result = res - return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx, field.Selections, res) + return ec.marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx, field.Selections, res) } func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { @@ -6333,7 +7447,7 @@ func (ec *executionContext) _Query___schema(ctx context.Context, field graphql.C return ec.marshalO__Schema2ᚖgithubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐSchema(ctx, field.Selections, res) } -func (ec *executionContext) _RefreshToken_id(ctx context.Context, field graphql.CollectedField, obj *pg.RefreshToken) (ret graphql.Marshaler) { +func (ec *executionContext) _RefreshToken_id(ctx context.Context, field graphql.CollectedField, obj *db.RefreshToken) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6367,7 +7481,7 @@ func (ec *executionContext) _RefreshToken_id(ctx context.Context, field graphql. return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _RefreshToken_userId(ctx context.Context, field graphql.CollectedField, obj *pg.RefreshToken) (ret graphql.Marshaler) { +func (ec *executionContext) _RefreshToken_userId(ctx context.Context, field graphql.CollectedField, obj *db.RefreshToken) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6401,7 +7515,7 @@ func (ec *executionContext) _RefreshToken_userId(ctx context.Context, field grap return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _RefreshToken_expiresAt(ctx context.Context, field graphql.CollectedField, obj *pg.RefreshToken) (ret graphql.Marshaler) { +func (ec *executionContext) _RefreshToken_expiresAt(ctx context.Context, field graphql.CollectedField, obj *db.RefreshToken) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6435,7 +7549,7 @@ func (ec *executionContext) _RefreshToken_expiresAt(ctx context.Context, field g return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _RefreshToken_createdAt(ctx context.Context, field graphql.CollectedField, obj *pg.RefreshToken) (ret graphql.Marshaler) { +func (ec *executionContext) _RefreshToken_createdAt(ctx context.Context, field graphql.CollectedField, obj *db.RefreshToken) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6469,7 +7583,279 @@ func (ec *executionContext) _RefreshToken_createdAt(ctx context.Context, field g return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Task_id(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Role_code(ctx context.Context, field graphql.CollectedField, obj *db.Role) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Role", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Code, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _Role_name(ctx context.Context, field graphql.CollectedField, obj *db.Role) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "Role", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Name, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(string) + fc.Result = res + return ec.marshalNString2string(ctx, field.Selections, res) +} + +func (ec *executionContext) _SetProjectOwnerPayload_ok(ctx context.Context, field graphql.CollectedField, obj *SetProjectOwnerPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "SetProjectOwnerPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ok, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _SetProjectOwnerPayload_prevOwner(ctx context.Context, field graphql.CollectedField, obj *SetProjectOwnerPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "SetProjectOwnerPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PrevOwner, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + +func (ec *executionContext) _SetProjectOwnerPayload_newOwner(ctx context.Context, field graphql.CollectedField, obj *SetProjectOwnerPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "SetProjectOwnerPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NewOwner, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + +func (ec *executionContext) _SetTeamOwnerPayload_ok(ctx context.Context, field graphql.CollectedField, obj *SetTeamOwnerPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "SetTeamOwnerPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ok, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _SetTeamOwnerPayload_prevOwner(ctx context.Context, field graphql.CollectedField, obj *SetTeamOwnerPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "SetTeamOwnerPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.PrevOwner, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + +func (ec *executionContext) _SetTeamOwnerPayload_newOwner(ctx context.Context, field graphql.CollectedField, obj *SetTeamOwnerPayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "SetTeamOwnerPayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.NewOwner, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + +func (ec *executionContext) _Task_id(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6503,7 +7889,7 @@ func (ec *executionContext) _Task_id(ctx context.Context, field graphql.Collecte return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _Task_taskGroup(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_taskGroup(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6532,12 +7918,12 @@ func (ec *executionContext) _Task_taskGroup(ctx context.Context, field graphql.C } return graphql.Null } - res := resTmp.(*pg.TaskGroup) + res := resTmp.(*db.TaskGroup) fc.Result = res - return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx, field.Selections, res) + return ec.marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx, field.Selections, res) } -func (ec *executionContext) _Task_createdAt(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_createdAt(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6571,7 +7957,7 @@ func (ec *executionContext) _Task_createdAt(ctx context.Context, field graphql.C return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Task_name(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_name(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6605,7 +7991,7 @@ func (ec *executionContext) _Task_name(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Task_position(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_position(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6639,7 +8025,7 @@ func (ec *executionContext) _Task_position(ctx context.Context, field graphql.Co return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _Task_description(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_description(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6670,7 +8056,7 @@ func (ec *executionContext) _Task_description(ctx context.Context, field graphql return ec.marshalOString2ᚖstring(ctx, field.Selections, res) } -func (ec *executionContext) _Task_dueDate(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_dueDate(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6701,7 +8087,7 @@ func (ec *executionContext) _Task_dueDate(ctx context.Context, field graphql.Col return ec.marshalOTime2ᚖtimeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Task_complete(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_complete(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6735,7 +8121,7 @@ func (ec *executionContext) _Task_complete(ctx context.Context, field graphql.Co return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _Task_assigned(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_assigned(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6764,12 +8150,12 @@ func (ec *executionContext) _Task_assigned(ctx context.Context, field graphql.Co } return graphql.Null } - res := resTmp.([]ProjectMember) + res := resTmp.([]Member) fc.Result = res - return ec.marshalNProjectMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMemberᚄ(ctx, field.Selections, res) + return ec.marshalNMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMemberᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Task_labels(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_labels(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6798,12 +8184,12 @@ func (ec *executionContext) _Task_labels(ctx context.Context, field graphql.Coll } return graphql.Null } - res := resTmp.([]pg.TaskLabel) + res := resTmp.([]db.TaskLabel) fc.Result = res - return ec.marshalNTaskLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskLabelᚄ(ctx, field.Selections, res) + return ec.marshalNTaskLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskLabelᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Task_checklists(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_checklists(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6832,12 +8218,12 @@ func (ec *executionContext) _Task_checklists(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.([]pg.TaskChecklist) + res := resTmp.([]db.TaskChecklist) fc.Result = res - return ec.marshalNTaskChecklist2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistᚄ(ctx, field.Selections, res) + return ec.marshalNTaskChecklist2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _Task_badges(ctx context.Context, field graphql.CollectedField, obj *pg.Task) (ret graphql.Marshaler) { +func (ec *executionContext) _Task_badges(ctx context.Context, field graphql.CollectedField, obj *db.Task) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6868,7 +8254,7 @@ func (ec *executionContext) _Task_badges(ctx context.Context, field graphql.Coll } res := resTmp.(*TaskBadges) fc.Result = res - return ec.marshalNTaskBadges2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐTaskBadges(ctx, field.Selections, res) + return ec.marshalNTaskBadges2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐTaskBadges(ctx, field.Selections, res) } func (ec *executionContext) _TaskBadges_checklist(ctx context.Context, field graphql.CollectedField, obj *TaskBadges) (ret graphql.Marshaler) { @@ -6899,10 +8285,10 @@ func (ec *executionContext) _TaskBadges_checklist(ctx context.Context, field gra } res := resTmp.(*ChecklistBadge) fc.Result = res - return ec.marshalOChecklistBadge2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐChecklistBadge(ctx, field.Selections, res) + return ec.marshalOChecklistBadge2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐChecklistBadge(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklist_id(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklist) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklist_id(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklist) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6936,7 +8322,7 @@ func (ec *executionContext) _TaskChecklist_id(ctx context.Context, field graphql return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklist_name(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklist) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklist_name(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklist) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -6970,7 +8356,7 @@ func (ec *executionContext) _TaskChecklist_name(ctx context.Context, field graph return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklist_position(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklist) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklist_position(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklist) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7004,7 +8390,7 @@ func (ec *executionContext) _TaskChecklist_position(ctx context.Context, field g return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklist_items(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklist) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklist_items(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklist) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7033,12 +8419,12 @@ func (ec *executionContext) _TaskChecklist_items(ctx context.Context, field grap } return graphql.Null } - res := resTmp.([]pg.TaskChecklistItem) + res := resTmp.([]db.TaskChecklistItem) fc.Result = res - return ec.marshalNTaskChecklistItem2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItemᚄ(ctx, field.Selections, res) + return ec.marshalNTaskChecklistItem2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItemᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklistItem_id(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklistItem) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklistItem_id(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklistItem) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7072,7 +8458,7 @@ func (ec *executionContext) _TaskChecklistItem_id(ctx context.Context, field gra return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklistItem_name(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklistItem) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklistItem_name(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklistItem) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7106,7 +8492,7 @@ func (ec *executionContext) _TaskChecklistItem_name(ctx context.Context, field g return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklistItem_taskChecklistID(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklistItem) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklistItem_taskChecklistID(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklistItem) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7140,7 +8526,7 @@ func (ec *executionContext) _TaskChecklistItem_taskChecklistID(ctx context.Conte return ec.marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklistItem_complete(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklistItem) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklistItem_complete(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklistItem) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7174,7 +8560,7 @@ func (ec *executionContext) _TaskChecklistItem_complete(ctx context.Context, fie return ec.marshalNBoolean2bool(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklistItem_position(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklistItem) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklistItem_position(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklistItem) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7208,7 +8594,7 @@ func (ec *executionContext) _TaskChecklistItem_position(ctx context.Context, fie return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _TaskChecklistItem_dueDate(ctx context.Context, field graphql.CollectedField, obj *pg.TaskChecklistItem) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskChecklistItem_dueDate(ctx context.Context, field graphql.CollectedField, obj *db.TaskChecklistItem) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7242,7 +8628,7 @@ func (ec *executionContext) _TaskChecklistItem_dueDate(ctx context.Context, fiel return ec.marshalNTime2ᚖtimeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _TaskGroup_id(ctx context.Context, field graphql.CollectedField, obj *pg.TaskGroup) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskGroup_id(ctx context.Context, field graphql.CollectedField, obj *db.TaskGroup) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7276,7 +8662,7 @@ func (ec *executionContext) _TaskGroup_id(ctx context.Context, field graphql.Col return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _TaskGroup_projectID(ctx context.Context, field graphql.CollectedField, obj *pg.TaskGroup) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskGroup_projectID(ctx context.Context, field graphql.CollectedField, obj *db.TaskGroup) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7310,7 +8696,7 @@ func (ec *executionContext) _TaskGroup_projectID(ctx context.Context, field grap return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _TaskGroup_createdAt(ctx context.Context, field graphql.CollectedField, obj *pg.TaskGroup) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskGroup_createdAt(ctx context.Context, field graphql.CollectedField, obj *db.TaskGroup) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7344,7 +8730,7 @@ func (ec *executionContext) _TaskGroup_createdAt(ctx context.Context, field grap return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _TaskGroup_name(ctx context.Context, field graphql.CollectedField, obj *pg.TaskGroup) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskGroup_name(ctx context.Context, field graphql.CollectedField, obj *db.TaskGroup) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7378,7 +8764,7 @@ func (ec *executionContext) _TaskGroup_name(ctx context.Context, field graphql.C return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _TaskGroup_position(ctx context.Context, field graphql.CollectedField, obj *pg.TaskGroup) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskGroup_position(ctx context.Context, field graphql.CollectedField, obj *db.TaskGroup) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7412,7 +8798,7 @@ func (ec *executionContext) _TaskGroup_position(ctx context.Context, field graph return ec.marshalNFloat2float64(ctx, field.Selections, res) } -func (ec *executionContext) _TaskGroup_tasks(ctx context.Context, field graphql.CollectedField, obj *pg.TaskGroup) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskGroup_tasks(ctx context.Context, field graphql.CollectedField, obj *db.TaskGroup) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7441,12 +8827,12 @@ func (ec *executionContext) _TaskGroup_tasks(ctx context.Context, field graphql. } return graphql.Null } - res := resTmp.([]pg.Task) + res := resTmp.([]db.Task) fc.Result = res - return ec.marshalNTask2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskᚄ(ctx, field.Selections, res) + return ec.marshalNTask2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskᚄ(ctx, field.Selections, res) } -func (ec *executionContext) _TaskLabel_id(ctx context.Context, field graphql.CollectedField, obj *pg.TaskLabel) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskLabel_id(ctx context.Context, field graphql.CollectedField, obj *db.TaskLabel) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7480,7 +8866,7 @@ func (ec *executionContext) _TaskLabel_id(ctx context.Context, field graphql.Col return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _TaskLabel_projectLabel(ctx context.Context, field graphql.CollectedField, obj *pg.TaskLabel) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskLabel_projectLabel(ctx context.Context, field graphql.CollectedField, obj *db.TaskLabel) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7509,12 +8895,12 @@ func (ec *executionContext) _TaskLabel_projectLabel(ctx context.Context, field g } return graphql.Null } - res := resTmp.(*pg.ProjectLabel) + res := resTmp.(*db.ProjectLabel) fc.Result = res - return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx, field.Selections, res) + return ec.marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx, field.Selections, res) } -func (ec *executionContext) _TaskLabel_assignedDate(ctx context.Context, field graphql.CollectedField, obj *pg.TaskLabel) (ret graphql.Marshaler) { +func (ec *executionContext) _TaskLabel_assignedDate(ctx context.Context, field graphql.CollectedField, obj *db.TaskLabel) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7548,7 +8934,7 @@ func (ec *executionContext) _TaskLabel_assignedDate(ctx context.Context, field g return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Team_id(ctx context.Context, field graphql.CollectedField, obj *pg.Team) (ret graphql.Marshaler) { +func (ec *executionContext) _Team_id(ctx context.Context, field graphql.CollectedField, obj *db.Team) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7582,7 +8968,7 @@ func (ec *executionContext) _Team_id(ctx context.Context, field graphql.Collecte return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _Team_createdAt(ctx context.Context, field graphql.CollectedField, obj *pg.Team) (ret graphql.Marshaler) { +func (ec *executionContext) _Team_createdAt(ctx context.Context, field graphql.CollectedField, obj *db.Team) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7616,7 +9002,7 @@ func (ec *executionContext) _Team_createdAt(ctx context.Context, field graphql.C return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _Team_name(ctx context.Context, field graphql.CollectedField, obj *pg.Team) (ret graphql.Marshaler) { +func (ec *executionContext) _Team_name(ctx context.Context, field graphql.CollectedField, obj *db.Team) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7650,7 +9036,7 @@ func (ec *executionContext) _Team_name(ctx context.Context, field graphql.Collec return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _Team_members(ctx context.Context, field graphql.CollectedField, obj *pg.Team) (ret graphql.Marshaler) { +func (ec *executionContext) _Team_members(ctx context.Context, field graphql.CollectedField, obj *db.Team) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7679,9 +9065,9 @@ func (ec *executionContext) _Team_members(ctx context.Context, field graphql.Col } return graphql.Null } - res := resTmp.([]ProjectMember) + res := resTmp.([]Member) fc.Result = res - return ec.marshalNProjectMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMemberᚄ(ctx, field.Selections, res) + return ec.marshalNMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMemberᚄ(ctx, field.Selections, res) } func (ec *executionContext) _ToggleTaskLabelPayload_active(ctx context.Context, field graphql.CollectedField, obj *ToggleTaskLabelPayload) (ret graphql.Marshaler) { @@ -7747,9 +9133,77 @@ func (ec *executionContext) _ToggleTaskLabelPayload_task(ctx context.Context, fi } return graphql.Null } - res := resTmp.(*pg.Task) + res := resTmp.(*db.Task) fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) +} + +func (ec *executionContext) _UpdateProjectMemberRolePayload_ok(ctx context.Context, field graphql.CollectedField, obj *UpdateProjectMemberRolePayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "UpdateProjectMemberRolePayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ok, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _UpdateProjectMemberRolePayload_member(ctx context.Context, field graphql.CollectedField, obj *UpdateProjectMemberRolePayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "UpdateProjectMemberRolePayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Member, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) } func (ec *executionContext) _UpdateTaskLocationPayload_previousTaskGroupID(ctx context.Context, field graphql.CollectedField, obj *UpdateTaskLocationPayload) (ret graphql.Marshaler) { @@ -7815,12 +9269,80 @@ func (ec *executionContext) _UpdateTaskLocationPayload_task(ctx context.Context, } return graphql.Null } - res := resTmp.(*pg.Task) + res := resTmp.(*db.Task) fc.Result = res - return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, field.Selections, res) + return ec.marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, field.Selections, res) } -func (ec *executionContext) _UserAccount_id(ctx context.Context, field graphql.CollectedField, obj *pg.UserAccount) (ret graphql.Marshaler) { +func (ec *executionContext) _UpdateTeamMemberRolePayload_ok(ctx context.Context, field graphql.CollectedField, obj *UpdateTeamMemberRolePayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "UpdateTeamMemberRolePayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Ok, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(bool) + fc.Result = res + return ec.marshalNBoolean2bool(ctx, field.Selections, res) +} + +func (ec *executionContext) _UpdateTeamMemberRolePayload_member(ctx context.Context, field graphql.CollectedField, obj *UpdateTeamMemberRolePayload) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "UpdateTeamMemberRolePayload", + Field: field, + Args: nil, + IsMethod: false, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Member, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*Member) + fc.Result = res + return ec.marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, field.Selections, res) +} + +func (ec *executionContext) _UserAccount_id(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7854,7 +9376,7 @@ func (ec *executionContext) _UserAccount_id(ctx context.Context, field graphql.C return ec.marshalNID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, field.Selections, res) } -func (ec *executionContext) _UserAccount_email(ctx context.Context, field graphql.CollectedField, obj *pg.UserAccount) (ret graphql.Marshaler) { +func (ec *executionContext) _UserAccount_email(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7888,7 +9410,7 @@ func (ec *executionContext) _UserAccount_email(ctx context.Context, field graphq return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _UserAccount_createdAt(ctx context.Context, field graphql.CollectedField, obj *pg.UserAccount) (ret graphql.Marshaler) { +func (ec *executionContext) _UserAccount_createdAt(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7922,7 +9444,7 @@ func (ec *executionContext) _UserAccount_createdAt(ctx context.Context, field gr return ec.marshalNTime2timeᚐTime(ctx, field.Selections, res) } -func (ec *executionContext) _UserAccount_fullName(ctx context.Context, field graphql.CollectedField, obj *pg.UserAccount) (ret graphql.Marshaler) { +func (ec *executionContext) _UserAccount_fullName(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7956,7 +9478,7 @@ func (ec *executionContext) _UserAccount_fullName(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _UserAccount_initials(ctx context.Context, field graphql.CollectedField, obj *pg.UserAccount) (ret graphql.Marshaler) { +func (ec *executionContext) _UserAccount_initials(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -7990,7 +9512,41 @@ func (ec *executionContext) _UserAccount_initials(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _UserAccount_username(ctx context.Context, field graphql.CollectedField, obj *pg.UserAccount) (ret graphql.Marshaler) { +func (ec *executionContext) _UserAccount_role(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + fc := &graphql.FieldContext{ + Object: "UserAccount", + Field: field, + Args: nil, + IsMethod: true, + } + + ctx = graphql.WithFieldContext(ctx, fc) + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return ec.resolvers.UserAccount().Role(rctx, obj) + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + if !graphql.HasFieldError(ctx, fc) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + res := resTmp.(*db.Role) + fc.Result = res + return ec.marshalNRole2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐRole(ctx, field.Selections, res) +} + +func (ec *executionContext) _UserAccount_username(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8024,7 +9580,7 @@ func (ec *executionContext) _UserAccount_username(ctx context.Context, field gra return ec.marshalNString2string(ctx, field.Selections, res) } -func (ec *executionContext) _UserAccount_profileIcon(ctx context.Context, field graphql.CollectedField, obj *pg.UserAccount) (ret graphql.Marshaler) { +func (ec *executionContext) _UserAccount_profileIcon(ctx context.Context, field graphql.CollectedField, obj *db.UserAccount) (ret graphql.Marshaler) { defer func() { if r := recover(); r != nil { ec.Error(ctx, ec.Recover(ctx, r)) @@ -8055,7 +9611,7 @@ func (ec *executionContext) _UserAccount_profileIcon(ctx context.Context, field } res := resTmp.(*ProfileIcon) fc.Result = res - return ec.marshalNProfileIcon2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProfileIcon(ctx, field.Selections, res) + return ec.marshalNProfileIcon2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProfileIcon(ctx, field.Selections, res) } func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { @@ -9161,6 +10717,30 @@ func (ec *executionContext) unmarshalInputAssignTaskInput(ctx context.Context, o return it, nil } +func (ec *executionContext) unmarshalInputCreateProjectMember(ctx context.Context, obj interface{}) (CreateProjectMember, error) { + var it CreateProjectMember + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "projectID": + var err error + it.ProjectID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "userID": + var err error + it.UserID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputCreateTaskChecklist(ctx context.Context, obj interface{}) (CreateTaskChecklist, error) { var it CreateTaskChecklist var asMap = obj.(map[string]interface{}) @@ -9281,6 +10861,30 @@ func (ec *executionContext) unmarshalInputDeleteProjectLabel(ctx context.Context return it, nil } +func (ec *executionContext) unmarshalInputDeleteProjectMember(ctx context.Context, obj interface{}) (DeleteProjectMember, error) { + var it DeleteProjectMember + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "projectID": + var err error + it.ProjectID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "userID": + var err error + it.UserID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputDeleteTaskChecklist(ctx context.Context, obj interface{}) (DeleteTaskChecklist, error) { var it DeleteTaskChecklist var asMap = obj.(map[string]interface{}) @@ -9371,6 +10975,30 @@ func (ec *executionContext) unmarshalInputDeleteTeam(ctx context.Context, obj in return it, nil } +func (ec *executionContext) unmarshalInputDeleteTeamMember(ctx context.Context, obj interface{}) (DeleteTeamMember, error) { + var it DeleteTeamMember + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "teamID": + var err error + it.TeamID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "userID": + var err error + it.UserID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputDeleteUserAccount(ctx context.Context, obj interface{}) (DeleteUserAccount, error) { var it DeleteUserAccount var asMap = obj.(map[string]interface{}) @@ -9731,6 +11359,12 @@ func (ec *executionContext) unmarshalInputNewUserAccount(ctx context.Context, ob if err != nil { return it, err } + case "roleCode": + var err error + it.RoleCode, err = ec.unmarshalNString2string(ctx, v) + if err != nil { + return it, err + } } } @@ -9773,6 +11407,30 @@ func (ec *executionContext) unmarshalInputRemoveTaskLabelInput(ctx context.Conte return it, nil } +func (ec *executionContext) unmarshalInputSetProjectOwner(ctx context.Context, obj interface{}) (SetProjectOwner, error) { + var it SetProjectOwner + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "projectID": + var err error + it.ProjectID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "ownerID": + var err error + it.OwnerID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputSetTaskChecklistItemComplete(ctx context.Context, obj interface{}) (SetTaskChecklistItemComplete, error) { var it SetTaskChecklistItemComplete var asMap = obj.(map[string]interface{}) @@ -9821,6 +11479,30 @@ func (ec *executionContext) unmarshalInputSetTaskComplete(ctx context.Context, o return it, nil } +func (ec *executionContext) unmarshalInputSetTeamOwner(ctx context.Context, obj interface{}) (SetTeamOwner, error) { + var it SetTeamOwner + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "teamID": + var err error + it.TeamID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "userID": + var err error + it.UserID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputToggleTaskLabelInput(ctx context.Context, obj interface{}) (ToggleTaskLabelInput, error) { var it ToggleTaskLabelInput var asMap = obj.(map[string]interface{}) @@ -9947,6 +11629,36 @@ func (ec *executionContext) unmarshalInputUpdateProjectLabelName(ctx context.Con return it, nil } +func (ec *executionContext) unmarshalInputUpdateProjectMemberRole(ctx context.Context, obj interface{}) (UpdateProjectMemberRole, error) { + var it UpdateProjectMemberRole + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "projectID": + var err error + it.ProjectID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "userID": + var err error + it.UserID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "roleCode": + var err error + it.RoleCode, err = ec.unmarshalNRoleCode2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRoleCode(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + func (ec *executionContext) unmarshalInputUpdateProjectName(ctx context.Context, obj interface{}) (UpdateProjectName, error) { var it UpdateProjectName var asMap = obj.(map[string]interface{}) @@ -10115,6 +11827,36 @@ func (ec *executionContext) unmarshalInputUpdateTaskName(ctx context.Context, ob return it, nil } +func (ec *executionContext) unmarshalInputUpdateTeamMemberRole(ctx context.Context, obj interface{}) (UpdateTeamMemberRole, error) { + var it UpdateTeamMemberRole + var asMap = obj.(map[string]interface{}) + + for k, v := range asMap { + switch k { + case "teamID": + var err error + it.TeamID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "userID": + var err error + it.UserID, err = ec.unmarshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, v) + if err != nil { + return it, err + } + case "roleCode": + var err error + it.RoleCode, err = ec.unmarshalNRoleCode2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRoleCode(ctx, v) + if err != nil { + return it, err + } + } + } + + return it, nil +} + // endregion **************************** input.gotpl ***************************** // region ************************** interface.gotpl *************************** @@ -10155,6 +11897,38 @@ func (ec *executionContext) _ChecklistBadge(ctx context.Context, sel ast.Selecti return out } +var createProjectMemberPayloadImplementors = []string{"CreateProjectMemberPayload"} + +func (ec *executionContext) _CreateProjectMemberPayload(ctx context.Context, sel ast.SelectionSet, obj *CreateProjectMemberPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, createProjectMemberPayloadImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("CreateProjectMemberPayload") + case "ok": + out.Values[i] = ec._CreateProjectMemberPayload_ok(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "member": + out.Values[i] = ec._CreateProjectMemberPayload_member(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var createTeamMemberPayloadImplementors = []string{"CreateTeamMemberPayload"} func (ec *executionContext) _CreateTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, obj *CreateTeamMemberPayload) graphql.Marshaler { @@ -10187,6 +11961,43 @@ func (ec *executionContext) _CreateTeamMemberPayload(ctx context.Context, sel as return out } +var deleteProjectMemberPayloadImplementors = []string{"DeleteProjectMemberPayload"} + +func (ec *executionContext) _DeleteProjectMemberPayload(ctx context.Context, sel ast.SelectionSet, obj *DeleteProjectMemberPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, deleteProjectMemberPayloadImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DeleteProjectMemberPayload") + case "ok": + out.Values[i] = ec._DeleteProjectMemberPayload_ok(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "member": + out.Values[i] = ec._DeleteProjectMemberPayload_member(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "projectID": + out.Values[i] = ec._DeleteProjectMemberPayload_projectID(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var deleteProjectPayloadImplementors = []string{"DeleteProjectPayload"} func (ec *executionContext) _DeleteProjectPayload(ctx context.Context, sel ast.SelectionSet, obj *DeleteProjectPayload) graphql.Marshaler { @@ -10347,6 +12158,38 @@ func (ec *executionContext) _DeleteTaskPayload(ctx context.Context, sel ast.Sele return out } +var deleteTeamMemberPayloadImplementors = []string{"DeleteTeamMemberPayload"} + +func (ec *executionContext) _DeleteTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, obj *DeleteTeamMemberPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, deleteTeamMemberPayloadImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("DeleteTeamMemberPayload") + case "teamID": + out.Values[i] = ec._DeleteTeamMemberPayload_teamID(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "userID": + out.Values[i] = ec._DeleteTeamMemberPayload_userID(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var deleteTeamPayloadImplementors = []string{"DeleteTeamPayload"} func (ec *executionContext) _DeleteTeamPayload(ctx context.Context, sel ast.SelectionSet, obj *DeleteTeamPayload) graphql.Marshaler { @@ -10418,7 +12261,7 @@ func (ec *executionContext) _DeleteUserAccountPayload(ctx context.Context, sel a var labelColorImplementors = []string{"LabelColor"} -func (ec *executionContext) _LabelColor(ctx context.Context, sel ast.SelectionSet, obj *pg.LabelColor) graphql.Marshaler { +func (ec *executionContext) _LabelColor(ctx context.Context, sel ast.SelectionSet, obj *db.LabelColor) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, labelColorImplementors) out := graphql.NewFieldSet(fields) @@ -10467,6 +12310,53 @@ func (ec *executionContext) _LabelColor(ctx context.Context, sel ast.SelectionSe return out } +var memberImplementors = []string{"Member"} + +func (ec *executionContext) _Member(ctx context.Context, sel ast.SelectionSet, obj *Member) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, memberImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Member") + case "id": + out.Values[i] = ec._Member_id(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "role": + out.Values[i] = ec._Member_role(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "fullName": + out.Values[i] = ec._Member_fullName(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "username": + out.Values[i] = ec._Member_username(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "profileIcon": + out.Values[i] = ec._Member_profileIcon(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var mutationImplementors = []string{"Mutation"} func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { @@ -10482,41 +12372,6 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) switch field.Name { case "__typename": out.Values[i] = graphql.MarshalString("Mutation") - case "createRefreshToken": - out.Values[i] = ec._Mutation_createRefreshToken(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "createUserAccount": - out.Values[i] = ec._Mutation_createUserAccount(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "deleteUserAccount": - out.Values[i] = ec._Mutation_deleteUserAccount(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "deleteTeam": - out.Values[i] = ec._Mutation_deleteTeam(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "createTeam": - out.Values[i] = ec._Mutation_createTeam(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "clearProfileAvatar": - out.Values[i] = ec._Mutation_clearProfileAvatar(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } - case "createTeamMember": - out.Values[i] = ec._Mutation_createTeamMember(ctx, field) - if out.Values[i] == graphql.Null { - invalids++ - } case "createProject": out.Values[i] = ec._Mutation_createProject(ctx, field) if out.Values[i] == graphql.Null { @@ -10557,38 +12412,68 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { invalids++ } - case "createTaskGroup": - out.Values[i] = ec._Mutation_createTaskGroup(ctx, field) + case "createProjectMember": + out.Values[i] = ec._Mutation_createProjectMember(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "updateTaskGroupLocation": - out.Values[i] = ec._Mutation_updateTaskGroupLocation(ctx, field) + case "deleteProjectMember": + out.Values[i] = ec._Mutation_deleteProjectMember(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "updateTaskGroupName": - out.Values[i] = ec._Mutation_updateTaskGroupName(ctx, field) + case "updateProjectMemberRole": + out.Values[i] = ec._Mutation_updateProjectMemberRole(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "deleteTaskGroup": - out.Values[i] = ec._Mutation_deleteTaskGroup(ctx, field) + case "setProjectOwner": + out.Values[i] = ec._Mutation_setProjectOwner(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "addTaskLabel": - out.Values[i] = ec._Mutation_addTaskLabel(ctx, field) + case "createTask": + out.Values[i] = ec._Mutation_createTask(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "removeTaskLabel": - out.Values[i] = ec._Mutation_removeTaskLabel(ctx, field) + case "deleteTask": + out.Values[i] = ec._Mutation_deleteTask(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "toggleTaskLabel": - out.Values[i] = ec._Mutation_toggleTaskLabel(ctx, field) + case "updateTaskDescription": + out.Values[i] = ec._Mutation_updateTaskDescription(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "updateTaskLocation": + out.Values[i] = ec._Mutation_updateTaskLocation(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "updateTaskName": + out.Values[i] = ec._Mutation_updateTaskName(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "setTaskComplete": + out.Values[i] = ec._Mutation_setTaskComplete(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "updateTaskDueDate": + out.Values[i] = ec._Mutation_updateTaskDueDate(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "assignTask": + out.Values[i] = ec._Mutation_assignTask(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "unassignTask": + out.Values[i] = ec._Mutation_unassignTask(ctx, field) if out.Values[i] == graphql.Null { invalids++ } @@ -10627,48 +12512,83 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { invalids++ } - case "createTask": - out.Values[i] = ec._Mutation_createTask(ctx, field) + case "createTaskGroup": + out.Values[i] = ec._Mutation_createTaskGroup(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "updateTaskDescription": - out.Values[i] = ec._Mutation_updateTaskDescription(ctx, field) + case "updateTaskGroupLocation": + out.Values[i] = ec._Mutation_updateTaskGroupLocation(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "updateTaskLocation": - out.Values[i] = ec._Mutation_updateTaskLocation(ctx, field) + case "updateTaskGroupName": + out.Values[i] = ec._Mutation_updateTaskGroupName(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "updateTaskName": - out.Values[i] = ec._Mutation_updateTaskName(ctx, field) + case "deleteTaskGroup": + out.Values[i] = ec._Mutation_deleteTaskGroup(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "setTaskComplete": - out.Values[i] = ec._Mutation_setTaskComplete(ctx, field) + case "addTaskLabel": + out.Values[i] = ec._Mutation_addTaskLabel(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "updateTaskDueDate": - out.Values[i] = ec._Mutation_updateTaskDueDate(ctx, field) + case "removeTaskLabel": + out.Values[i] = ec._Mutation_removeTaskLabel(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "deleteTask": - out.Values[i] = ec._Mutation_deleteTask(ctx, field) + case "toggleTaskLabel": + out.Values[i] = ec._Mutation_toggleTaskLabel(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "assignTask": - out.Values[i] = ec._Mutation_assignTask(ctx, field) + case "deleteTeam": + out.Values[i] = ec._Mutation_deleteTeam(ctx, field) if out.Values[i] == graphql.Null { invalids++ } - case "unassignTask": - out.Values[i] = ec._Mutation_unassignTask(ctx, field) + case "createTeam": + out.Values[i] = ec._Mutation_createTeam(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "setTeamOwner": + out.Values[i] = ec._Mutation_setTeamOwner(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "createTeamMember": + out.Values[i] = ec._Mutation_createTeamMember(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "updateTeamMemberRole": + out.Values[i] = ec._Mutation_updateTeamMemberRole(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deleteTeamMember": + out.Values[i] = ec._Mutation_deleteTeamMember(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "createRefreshToken": + out.Values[i] = ec._Mutation_createRefreshToken(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "createUserAccount": + out.Values[i] = ec._Mutation_createUserAccount(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } + case "deleteUserAccount": + out.Values[i] = ec._Mutation_deleteUserAccount(ctx, field) if out.Values[i] == graphql.Null { invalids++ } @@ -10677,6 +12597,11 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { invalids++ } + case "clearProfileAvatar": + out.Values[i] = ec._Mutation_clearProfileAvatar(ctx, field) + if out.Values[i] == graphql.Null { + invalids++ + } default: panic("unknown field " + strconv.Quote(field.Name)) } @@ -10690,7 +12615,7 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) var organizationImplementors = []string{"Organization"} -func (ec *executionContext) _Organization(ctx context.Context, sel ast.SelectionSet, obj *pg.Organization) graphql.Marshaler { +func (ec *executionContext) _Organization(ctx context.Context, sel ast.SelectionSet, obj *db.Organization) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, organizationImplementors) out := graphql.NewFieldSet(fields) @@ -10759,7 +12684,7 @@ func (ec *executionContext) _ProfileIcon(ctx context.Context, sel ast.SelectionS var projectImplementors = []string{"Project"} -func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, obj *pg.Project) graphql.Marshaler { +func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, obj *db.Project) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, projectImplementors) out := graphql.NewFieldSet(fields) @@ -10875,7 +12800,7 @@ func (ec *executionContext) _Project(ctx context.Context, sel ast.SelectionSet, var projectLabelImplementors = []string{"ProjectLabel"} -func (ec *executionContext) _ProjectLabel(ctx context.Context, sel ast.SelectionSet, obj *pg.ProjectLabel) graphql.Marshaler { +func (ec *executionContext) _ProjectLabel(ctx context.Context, sel ast.SelectionSet, obj *db.ProjectLabel) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, projectLabelImplementors) out := graphql.NewFieldSet(fields) @@ -10939,43 +12864,6 @@ func (ec *executionContext) _ProjectLabel(ctx context.Context, sel ast.Selection return out } -var projectMemberImplementors = []string{"ProjectMember"} - -func (ec *executionContext) _ProjectMember(ctx context.Context, sel ast.SelectionSet, obj *ProjectMember) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, projectMemberImplementors) - - out := graphql.NewFieldSet(fields) - var invalids uint32 - for i, field := range fields { - switch field.Name { - case "__typename": - out.Values[i] = graphql.MarshalString("ProjectMember") - case "id": - out.Values[i] = ec._ProjectMember_id(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "fullName": - out.Values[i] = ec._ProjectMember_fullName(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - case "profileIcon": - out.Values[i] = ec._ProjectMember_profileIcon(ctx, field, obj) - if out.Values[i] == graphql.Null { - invalids++ - } - default: - panic("unknown field " + strconv.Quote(field.Name)) - } - } - out.Dispatch() - if invalids > 0 { - return graphql.Null - } - return out -} - var queryImplementors = []string{"Query"} func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) graphql.Marshaler { @@ -11162,7 +13050,7 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr var refreshTokenImplementors = []string{"RefreshToken"} -func (ec *executionContext) _RefreshToken(ctx context.Context, sel ast.SelectionSet, obj *pg.RefreshToken) graphql.Marshaler { +func (ec *executionContext) _RefreshToken(ctx context.Context, sel ast.SelectionSet, obj *db.RefreshToken) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, refreshTokenImplementors) out := graphql.NewFieldSet(fields) @@ -11211,9 +13099,115 @@ func (ec *executionContext) _RefreshToken(ctx context.Context, sel ast.Selection return out } +var roleImplementors = []string{"Role"} + +func (ec *executionContext) _Role(ctx context.Context, sel ast.SelectionSet, obj *db.Role) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, roleImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("Role") + case "code": + out.Values[i] = ec._Role_code(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "name": + out.Values[i] = ec._Role_name(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var setProjectOwnerPayloadImplementors = []string{"SetProjectOwnerPayload"} + +func (ec *executionContext) _SetProjectOwnerPayload(ctx context.Context, sel ast.SelectionSet, obj *SetProjectOwnerPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, setProjectOwnerPayloadImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SetProjectOwnerPayload") + case "ok": + out.Values[i] = ec._SetProjectOwnerPayload_ok(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "prevOwner": + out.Values[i] = ec._SetProjectOwnerPayload_prevOwner(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "newOwner": + out.Values[i] = ec._SetProjectOwnerPayload_newOwner(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + +var setTeamOwnerPayloadImplementors = []string{"SetTeamOwnerPayload"} + +func (ec *executionContext) _SetTeamOwnerPayload(ctx context.Context, sel ast.SelectionSet, obj *SetTeamOwnerPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, setTeamOwnerPayloadImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("SetTeamOwnerPayload") + case "ok": + out.Values[i] = ec._SetTeamOwnerPayload_ok(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "prevOwner": + out.Values[i] = ec._SetTeamOwnerPayload_prevOwner(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "newOwner": + out.Values[i] = ec._SetTeamOwnerPayload_newOwner(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var taskImplementors = []string{"Task"} -func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj *pg.Task) graphql.Marshaler { +func (ec *executionContext) _Task(ctx context.Context, sel ast.SelectionSet, obj *db.Task) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, taskImplementors) out := graphql.NewFieldSet(fields) @@ -11385,7 +13379,7 @@ func (ec *executionContext) _TaskBadges(ctx context.Context, sel ast.SelectionSe var taskChecklistImplementors = []string{"TaskChecklist"} -func (ec *executionContext) _TaskChecklist(ctx context.Context, sel ast.SelectionSet, obj *pg.TaskChecklist) graphql.Marshaler { +func (ec *executionContext) _TaskChecklist(ctx context.Context, sel ast.SelectionSet, obj *db.TaskChecklist) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, taskChecklistImplementors) out := graphql.NewFieldSet(fields) @@ -11445,7 +13439,7 @@ func (ec *executionContext) _TaskChecklist(ctx context.Context, sel ast.Selectio var taskChecklistItemImplementors = []string{"TaskChecklistItem"} -func (ec *executionContext) _TaskChecklistItem(ctx context.Context, sel ast.SelectionSet, obj *pg.TaskChecklistItem) graphql.Marshaler { +func (ec *executionContext) _TaskChecklistItem(ctx context.Context, sel ast.SelectionSet, obj *db.TaskChecklistItem) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, taskChecklistItemImplementors) out := graphql.NewFieldSet(fields) @@ -11515,7 +13509,7 @@ func (ec *executionContext) _TaskChecklistItem(ctx context.Context, sel ast.Sele var taskGroupImplementors = []string{"TaskGroup"} -func (ec *executionContext) _TaskGroup(ctx context.Context, sel ast.SelectionSet, obj *pg.TaskGroup) graphql.Marshaler { +func (ec *executionContext) _TaskGroup(ctx context.Context, sel ast.SelectionSet, obj *db.TaskGroup) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, taskGroupImplementors) out := graphql.NewFieldSet(fields) @@ -11594,7 +13588,7 @@ func (ec *executionContext) _TaskGroup(ctx context.Context, sel ast.SelectionSet var taskLabelImplementors = []string{"TaskLabel"} -func (ec *executionContext) _TaskLabel(ctx context.Context, sel ast.SelectionSet, obj *pg.TaskLabel) graphql.Marshaler { +func (ec *executionContext) _TaskLabel(ctx context.Context, sel ast.SelectionSet, obj *db.TaskLabel) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, taskLabelImplementors) out := graphql.NewFieldSet(fields) @@ -11649,7 +13643,7 @@ func (ec *executionContext) _TaskLabel(ctx context.Context, sel ast.SelectionSet var teamImplementors = []string{"Team"} -func (ec *executionContext) _Team(ctx context.Context, sel ast.SelectionSet, obj *pg.Team) graphql.Marshaler { +func (ec *executionContext) _Team(ctx context.Context, sel ast.SelectionSet, obj *db.Team) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, teamImplementors) out := graphql.NewFieldSet(fields) @@ -11739,6 +13733,38 @@ func (ec *executionContext) _ToggleTaskLabelPayload(ctx context.Context, sel ast return out } +var updateProjectMemberRolePayloadImplementors = []string{"UpdateProjectMemberRolePayload"} + +func (ec *executionContext) _UpdateProjectMemberRolePayload(ctx context.Context, sel ast.SelectionSet, obj *UpdateProjectMemberRolePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, updateProjectMemberRolePayloadImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("UpdateProjectMemberRolePayload") + case "ok": + out.Values[i] = ec._UpdateProjectMemberRolePayload_ok(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "member": + out.Values[i] = ec._UpdateProjectMemberRolePayload_member(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var updateTaskLocationPayloadImplementors = []string{"UpdateTaskLocationPayload"} func (ec *executionContext) _UpdateTaskLocationPayload(ctx context.Context, sel ast.SelectionSet, obj *UpdateTaskLocationPayload) graphql.Marshaler { @@ -11771,9 +13797,41 @@ func (ec *executionContext) _UpdateTaskLocationPayload(ctx context.Context, sel return out } +var updateTeamMemberRolePayloadImplementors = []string{"UpdateTeamMemberRolePayload"} + +func (ec *executionContext) _UpdateTeamMemberRolePayload(ctx context.Context, sel ast.SelectionSet, obj *UpdateTeamMemberRolePayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, updateTeamMemberRolePayloadImplementors) + + out := graphql.NewFieldSet(fields) + var invalids uint32 + for i, field := range fields { + switch field.Name { + case "__typename": + out.Values[i] = graphql.MarshalString("UpdateTeamMemberRolePayload") + case "ok": + out.Values[i] = ec._UpdateTeamMemberRolePayload_ok(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + case "member": + out.Values[i] = ec._UpdateTeamMemberRolePayload_member(ctx, field, obj) + if out.Values[i] == graphql.Null { + invalids++ + } + default: + panic("unknown field " + strconv.Quote(field.Name)) + } + } + out.Dispatch() + if invalids > 0 { + return graphql.Null + } + return out +} + var userAccountImplementors = []string{"UserAccount"} -func (ec *executionContext) _UserAccount(ctx context.Context, sel ast.SelectionSet, obj *pg.UserAccount) graphql.Marshaler { +func (ec *executionContext) _UserAccount(ctx context.Context, sel ast.SelectionSet, obj *db.UserAccount) graphql.Marshaler { fields := graphql.CollectFields(ec.OperationContext, sel, userAccountImplementors) out := graphql.NewFieldSet(fields) @@ -11816,6 +13874,20 @@ func (ec *executionContext) _UserAccount(ctx context.Context, sel ast.SelectionS if out.Values[i] == graphql.Null { atomic.AddUint32(&invalids, 1) } + case "role": + field := field + out.Concurrently(i, func() (res graphql.Marshaler) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + } + }() + res = ec._UserAccount_role(ctx, field, obj) + if res == graphql.Null { + atomic.AddUint32(&invalids, 1) + } + return res + }) case "username": out.Values[i] = ec._UserAccount_username(ctx, field, obj) if out.Values[i] == graphql.Null { @@ -12105,23 +14177,41 @@ func (ec *executionContext) marshalNBoolean2bool(ctx context.Context, sel ast.Se return res } -func (ec *executionContext) unmarshalNCreateTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTaskChecklist(ctx context.Context, v interface{}) (CreateTaskChecklist, error) { +func (ec *executionContext) unmarshalNCreateProjectMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateProjectMember(ctx context.Context, v interface{}) (CreateProjectMember, error) { + return ec.unmarshalInputCreateProjectMember(ctx, v) +} + +func (ec *executionContext) marshalNCreateProjectMemberPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateProjectMemberPayload(ctx context.Context, sel ast.SelectionSet, v CreateProjectMemberPayload) graphql.Marshaler { + return ec._CreateProjectMemberPayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNCreateProjectMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateProjectMemberPayload(ctx context.Context, sel ast.SelectionSet, v *CreateProjectMemberPayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._CreateProjectMemberPayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNCreateTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTaskChecklist(ctx context.Context, v interface{}) (CreateTaskChecklist, error) { return ec.unmarshalInputCreateTaskChecklist(ctx, v) } -func (ec *executionContext) unmarshalNCreateTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTaskChecklistItem(ctx context.Context, v interface{}) (CreateTaskChecklistItem, error) { +func (ec *executionContext) unmarshalNCreateTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTaskChecklistItem(ctx context.Context, v interface{}) (CreateTaskChecklistItem, error) { return ec.unmarshalInputCreateTaskChecklistItem(ctx, v) } -func (ec *executionContext) unmarshalNCreateTeamMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTeamMember(ctx context.Context, v interface{}) (CreateTeamMember, error) { +func (ec *executionContext) unmarshalNCreateTeamMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTeamMember(ctx context.Context, v interface{}) (CreateTeamMember, error) { return ec.unmarshalInputCreateTeamMember(ctx, v) } -func (ec *executionContext) marshalNCreateTeamMemberPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, v CreateTeamMemberPayload) graphql.Marshaler { +func (ec *executionContext) marshalNCreateTeamMemberPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, v CreateTeamMemberPayload) graphql.Marshaler { return ec._CreateTeamMemberPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNCreateTeamMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐCreateTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, v *CreateTeamMemberPayload) graphql.Marshaler { +func (ec *executionContext) marshalNCreateTeamMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐCreateTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, v *CreateTeamMemberPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12131,19 +14221,37 @@ func (ec *executionContext) marshalNCreateTeamMemberPayload2ᚖgithubᚗcomᚋjo return ec._CreateTeamMemberPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNDeleteProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteProject(ctx context.Context, v interface{}) (DeleteProject, error) { +func (ec *executionContext) unmarshalNDeleteProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProject(ctx context.Context, v interface{}) (DeleteProject, error) { return ec.unmarshalInputDeleteProject(ctx, v) } -func (ec *executionContext) unmarshalNDeleteProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteProjectLabel(ctx context.Context, v interface{}) (DeleteProjectLabel, error) { +func (ec *executionContext) unmarshalNDeleteProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectLabel(ctx context.Context, v interface{}) (DeleteProjectLabel, error) { return ec.unmarshalInputDeleteProjectLabel(ctx, v) } -func (ec *executionContext) marshalNDeleteProjectPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteProjectPayload(ctx context.Context, sel ast.SelectionSet, v DeleteProjectPayload) graphql.Marshaler { +func (ec *executionContext) unmarshalNDeleteProjectMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectMember(ctx context.Context, v interface{}) (DeleteProjectMember, error) { + return ec.unmarshalInputDeleteProjectMember(ctx, v) +} + +func (ec *executionContext) marshalNDeleteProjectMemberPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectMemberPayload(ctx context.Context, sel ast.SelectionSet, v DeleteProjectMemberPayload) graphql.Marshaler { + return ec._DeleteProjectMemberPayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDeleteProjectMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectMemberPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteProjectMemberPayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._DeleteProjectMemberPayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNDeleteProjectPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectPayload(ctx context.Context, sel ast.SelectionSet, v DeleteProjectPayload) graphql.Marshaler { return ec._DeleteProjectPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteProjectPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteProjectPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteProjectPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteProjectPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteProjectPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteProjectPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12153,19 +14261,19 @@ func (ec *executionContext) marshalNDeleteProjectPayload2ᚖgithubᚗcomᚋjorda return ec._DeleteProjectPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNDeleteTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklist(ctx context.Context, v interface{}) (DeleteTaskChecklist, error) { +func (ec *executionContext) unmarshalNDeleteTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklist(ctx context.Context, v interface{}) (DeleteTaskChecklist, error) { return ec.unmarshalInputDeleteTaskChecklist(ctx, v) } -func (ec *executionContext) unmarshalNDeleteTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistItem(ctx context.Context, v interface{}) (DeleteTaskChecklistItem, error) { +func (ec *executionContext) unmarshalNDeleteTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistItem(ctx context.Context, v interface{}) (DeleteTaskChecklistItem, error) { return ec.unmarshalInputDeleteTaskChecklistItem(ctx, v) } -func (ec *executionContext) marshalNDeleteTaskChecklistItemPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistItemPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskChecklistItemPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskChecklistItemPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistItemPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskChecklistItemPayload) graphql.Marshaler { return ec._DeleteTaskChecklistItemPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteTaskChecklistItemPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistItemPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskChecklistItemPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskChecklistItemPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistItemPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskChecklistItemPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12175,11 +14283,11 @@ func (ec *executionContext) marshalNDeleteTaskChecklistItemPayload2ᚖgithubᚗc return ec._DeleteTaskChecklistItemPayload(ctx, sel, v) } -func (ec *executionContext) marshalNDeleteTaskChecklistPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskChecklistPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskChecklistPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskChecklistPayload) graphql.Marshaler { return ec._DeleteTaskChecklistPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteTaskChecklistPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskChecklistPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskChecklistPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskChecklistPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskChecklistPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskChecklistPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12189,15 +14297,15 @@ func (ec *executionContext) marshalNDeleteTaskChecklistPayload2ᚖgithubᚗcom return ec._DeleteTaskChecklistPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNDeleteTaskGroupInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskGroupInput(ctx context.Context, v interface{}) (DeleteTaskGroupInput, error) { +func (ec *executionContext) unmarshalNDeleteTaskGroupInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskGroupInput(ctx context.Context, v interface{}) (DeleteTaskGroupInput, error) { return ec.unmarshalInputDeleteTaskGroupInput(ctx, v) } -func (ec *executionContext) marshalNDeleteTaskGroupPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskGroupPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskGroupPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskGroupPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskGroupPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskGroupPayload) graphql.Marshaler { return ec._DeleteTaskGroupPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteTaskGroupPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskGroupPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskGroupPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskGroupPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskGroupPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskGroupPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12207,15 +14315,15 @@ func (ec *executionContext) marshalNDeleteTaskGroupPayload2ᚖgithubᚗcomᚋjor return ec._DeleteTaskGroupPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNDeleteTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskInput(ctx context.Context, v interface{}) (DeleteTaskInput, error) { +func (ec *executionContext) unmarshalNDeleteTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskInput(ctx context.Context, v interface{}) (DeleteTaskInput, error) { return ec.unmarshalInputDeleteTaskInput(ctx, v) } -func (ec *executionContext) marshalNDeleteTaskPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTaskPayload) graphql.Marshaler { return ec._DeleteTaskPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteTaskPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTaskPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTaskPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTaskPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTaskPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12225,15 +14333,33 @@ func (ec *executionContext) marshalNDeleteTaskPayload2ᚖgithubᚗcomᚋjordankn return ec._DeleteTaskPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNDeleteTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTeam(ctx context.Context, v interface{}) (DeleteTeam, error) { +func (ec *executionContext) unmarshalNDeleteTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeam(ctx context.Context, v interface{}) (DeleteTeam, error) { return ec.unmarshalInputDeleteTeam(ctx, v) } -func (ec *executionContext) marshalNDeleteTeamPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTeamPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTeamPayload) graphql.Marshaler { +func (ec *executionContext) unmarshalNDeleteTeamMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamMember(ctx context.Context, v interface{}) (DeleteTeamMember, error) { + return ec.unmarshalInputDeleteTeamMember(ctx, v) +} + +func (ec *executionContext) marshalNDeleteTeamMemberPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTeamMemberPayload) graphql.Marshaler { + return ec._DeleteTeamMemberPayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNDeleteTeamMemberPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamMemberPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTeamMemberPayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._DeleteTeamMemberPayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNDeleteTeamPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamPayload(ctx context.Context, sel ast.SelectionSet, v DeleteTeamPayload) graphql.Marshaler { return ec._DeleteTeamPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteTeamPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteTeamPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTeamPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteTeamPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteTeamPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteTeamPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12243,15 +14369,15 @@ func (ec *executionContext) marshalNDeleteTeamPayload2ᚖgithubᚗcomᚋjordankn return ec._DeleteTeamPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNDeleteUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteUserAccount(ctx context.Context, v interface{}) (DeleteUserAccount, error) { +func (ec *executionContext) unmarshalNDeleteUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteUserAccount(ctx context.Context, v interface{}) (DeleteUserAccount, error) { return ec.unmarshalInputDeleteUserAccount(ctx, v) } -func (ec *executionContext) marshalNDeleteUserAccountPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteUserAccountPayload(ctx context.Context, sel ast.SelectionSet, v DeleteUserAccountPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteUserAccountPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteUserAccountPayload(ctx context.Context, sel ast.SelectionSet, v DeleteUserAccountPayload) graphql.Marshaler { return ec._DeleteUserAccountPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteUserAccountPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐDeleteUserAccountPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteUserAccountPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteUserAccountPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐDeleteUserAccountPayload(ctx context.Context, sel ast.SelectionSet, v *DeleteUserAccountPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12261,19 +14387,19 @@ func (ec *executionContext) marshalNDeleteUserAccountPayload2ᚖgithubᚗcomᚋj return ec._DeleteUserAccountPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNFindProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindProject(ctx context.Context, v interface{}) (FindProject, error) { +func (ec *executionContext) unmarshalNFindProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindProject(ctx context.Context, v interface{}) (FindProject, error) { return ec.unmarshalInputFindProject(ctx, v) } -func (ec *executionContext) unmarshalNFindTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindTask(ctx context.Context, v interface{}) (FindTask, error) { +func (ec *executionContext) unmarshalNFindTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindTask(ctx context.Context, v interface{}) (FindTask, error) { return ec.unmarshalInputFindTask(ctx, v) } -func (ec *executionContext) unmarshalNFindTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindTeam(ctx context.Context, v interface{}) (FindTeam, error) { +func (ec *executionContext) unmarshalNFindTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindTeam(ctx context.Context, v interface{}) (FindTeam, error) { return ec.unmarshalInputFindTeam(ctx, v) } -func (ec *executionContext) unmarshalNFindUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐFindUser(ctx context.Context, v interface{}) (FindUser, error) { +func (ec *executionContext) unmarshalNFindUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐFindUser(ctx context.Context, v interface{}) (FindUser, error) { return ec.unmarshalInputFindUser(ctx, v) } @@ -12319,11 +14445,11 @@ func (ec *executionContext) marshalNInt2int(ctx context.Context, sel ast.Selecti return res } -func (ec *executionContext) marshalNLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐLabelColor(ctx context.Context, sel ast.SelectionSet, v pg.LabelColor) graphql.Marshaler { +func (ec *executionContext) marshalNLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐLabelColor(ctx context.Context, sel ast.SelectionSet, v db.LabelColor) graphql.Marshaler { return ec._LabelColor(ctx, sel, &v) } -func (ec *executionContext) marshalNLabelColor2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐLabelColorᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.LabelColor) graphql.Marshaler { +func (ec *executionContext) marshalNLabelColor2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐLabelColorᚄ(ctx context.Context, sel ast.SelectionSet, v []db.LabelColor) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12347,7 +14473,7 @@ func (ec *executionContext) marshalNLabelColor2ᚕgithubᚗcomᚋjordanknottᚋp if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐLabelColor(ctx, sel, v[i]) + ret[i] = ec.marshalNLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐLabelColor(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12360,7 +14486,7 @@ func (ec *executionContext) marshalNLabelColor2ᚕgithubᚗcomᚋjordanknottᚋp return ret } -func (ec *executionContext) marshalNLabelColor2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐLabelColor(ctx context.Context, sel ast.SelectionSet, v *pg.LabelColor) graphql.Marshaler { +func (ec *executionContext) marshalNLabelColor2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐLabelColor(ctx context.Context, sel ast.SelectionSet, v *db.LabelColor) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12370,51 +14496,15 @@ func (ec *executionContext) marshalNLabelColor2ᚖgithubᚗcomᚋjordanknottᚋp return ec._LabelColor(ctx, sel, v) } -func (ec *executionContext) unmarshalNLogoutUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐLogoutUser(ctx context.Context, v interface{}) (LogoutUser, error) { +func (ec *executionContext) unmarshalNLogoutUser2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐLogoutUser(ctx context.Context, v interface{}) (LogoutUser, error) { return ec.unmarshalInputLogoutUser(ctx, v) } -func (ec *executionContext) unmarshalNNewProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewProject(ctx context.Context, v interface{}) (NewProject, error) { - return ec.unmarshalInputNewProject(ctx, v) +func (ec *executionContext) marshalNMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx context.Context, sel ast.SelectionSet, v Member) graphql.Marshaler { + return ec._Member(ctx, sel, &v) } -func (ec *executionContext) unmarshalNNewProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewProjectLabel(ctx context.Context, v interface{}) (NewProjectLabel, error) { - return ec.unmarshalInputNewProjectLabel(ctx, v) -} - -func (ec *executionContext) unmarshalNNewRefreshToken2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewRefreshToken(ctx context.Context, v interface{}) (NewRefreshToken, error) { - return ec.unmarshalInputNewRefreshToken(ctx, v) -} - -func (ec *executionContext) unmarshalNNewTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTask(ctx context.Context, v interface{}) (NewTask, error) { - return ec.unmarshalInputNewTask(ctx, v) -} - -func (ec *executionContext) unmarshalNNewTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTaskGroup(ctx context.Context, v interface{}) (NewTaskGroup, error) { - return ec.unmarshalInputNewTaskGroup(ctx, v) -} - -func (ec *executionContext) unmarshalNNewTaskGroupLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTaskGroupLocation(ctx context.Context, v interface{}) (NewTaskGroupLocation, error) { - return ec.unmarshalInputNewTaskGroupLocation(ctx, v) -} - -func (ec *executionContext) unmarshalNNewTaskLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTaskLocation(ctx context.Context, v interface{}) (NewTaskLocation, error) { - return ec.unmarshalInputNewTaskLocation(ctx, v) -} - -func (ec *executionContext) unmarshalNNewTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewTeam(ctx context.Context, v interface{}) (NewTeam, error) { - return ec.unmarshalInputNewTeam(ctx, v) -} - -func (ec *executionContext) unmarshalNNewUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐNewUserAccount(ctx context.Context, v interface{}) (NewUserAccount, error) { - return ec.unmarshalInputNewUserAccount(ctx, v) -} - -func (ec *executionContext) marshalNOrganization2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐOrganization(ctx context.Context, sel ast.SelectionSet, v pg.Organization) graphql.Marshaler { - return ec._Organization(ctx, sel, &v) -} - -func (ec *executionContext) marshalNOrganization2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐOrganizationᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.Organization) graphql.Marshaler { +func (ec *executionContext) marshalNMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMemberᚄ(ctx context.Context, sel ast.SelectionSet, v []Member) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12438,7 +14528,7 @@ func (ec *executionContext) marshalNOrganization2ᚕgithubᚗcomᚋjordanknott if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNOrganization2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐOrganization(ctx, sel, v[i]) + ret[i] = ec.marshalNMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12451,11 +14541,98 @@ func (ec *executionContext) marshalNOrganization2ᚕgithubᚗcomᚋjordanknott return ret } -func (ec *executionContext) marshalNProfileIcon2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProfileIcon(ctx context.Context, sel ast.SelectionSet, v ProfileIcon) graphql.Marshaler { +func (ec *executionContext) marshalNMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐMember(ctx context.Context, sel ast.SelectionSet, v *Member) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Member(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNNewProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewProject(ctx context.Context, v interface{}) (NewProject, error) { + return ec.unmarshalInputNewProject(ctx, v) +} + +func (ec *executionContext) unmarshalNNewProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewProjectLabel(ctx context.Context, v interface{}) (NewProjectLabel, error) { + return ec.unmarshalInputNewProjectLabel(ctx, v) +} + +func (ec *executionContext) unmarshalNNewRefreshToken2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewRefreshToken(ctx context.Context, v interface{}) (NewRefreshToken, error) { + return ec.unmarshalInputNewRefreshToken(ctx, v) +} + +func (ec *executionContext) unmarshalNNewTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTask(ctx context.Context, v interface{}) (NewTask, error) { + return ec.unmarshalInputNewTask(ctx, v) +} + +func (ec *executionContext) unmarshalNNewTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTaskGroup(ctx context.Context, v interface{}) (NewTaskGroup, error) { + return ec.unmarshalInputNewTaskGroup(ctx, v) +} + +func (ec *executionContext) unmarshalNNewTaskGroupLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTaskGroupLocation(ctx context.Context, v interface{}) (NewTaskGroupLocation, error) { + return ec.unmarshalInputNewTaskGroupLocation(ctx, v) +} + +func (ec *executionContext) unmarshalNNewTaskLocation2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTaskLocation(ctx context.Context, v interface{}) (NewTaskLocation, error) { + return ec.unmarshalInputNewTaskLocation(ctx, v) +} + +func (ec *executionContext) unmarshalNNewTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewTeam(ctx context.Context, v interface{}) (NewTeam, error) { + return ec.unmarshalInputNewTeam(ctx, v) +} + +func (ec *executionContext) unmarshalNNewUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐNewUserAccount(ctx context.Context, v interface{}) (NewUserAccount, error) { + return ec.unmarshalInputNewUserAccount(ctx, v) +} + +func (ec *executionContext) marshalNOrganization2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐOrganization(ctx context.Context, sel ast.SelectionSet, v db.Organization) graphql.Marshaler { + return ec._Organization(ctx, sel, &v) +} + +func (ec *executionContext) marshalNOrganization2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐOrganizationᚄ(ctx context.Context, sel ast.SelectionSet, v []db.Organization) graphql.Marshaler { + ret := make(graphql.Array, len(v)) + var wg sync.WaitGroup + isLen1 := len(v) == 1 + if !isLen1 { + wg.Add(len(v)) + } + for i := range v { + i := i + fc := &graphql.FieldContext{ + Index: &i, + Result: &v[i], + } + ctx := graphql.WithFieldContext(ctx, fc) + f := func(i int) { + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = nil + } + }() + if !isLen1 { + defer wg.Done() + } + ret[i] = ec.marshalNOrganization2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐOrganization(ctx, sel, v[i]) + } + if isLen1 { + f(i) + } else { + go f(i) + } + + } + wg.Wait() + return ret +} + +func (ec *executionContext) marshalNProfileIcon2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProfileIcon(ctx context.Context, sel ast.SelectionSet, v ProfileIcon) graphql.Marshaler { return ec._ProfileIcon(ctx, sel, &v) } -func (ec *executionContext) marshalNProfileIcon2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProfileIcon(ctx context.Context, sel ast.SelectionSet, v *ProfileIcon) graphql.Marshaler { +func (ec *executionContext) marshalNProfileIcon2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProfileIcon(ctx context.Context, sel ast.SelectionSet, v *ProfileIcon) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12465,11 +14642,11 @@ func (ec *executionContext) marshalNProfileIcon2ᚖgithubᚗcomᚋjordanknottᚋ return ec._ProfileIcon(ctx, sel, v) } -func (ec *executionContext) marshalNProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProject(ctx context.Context, sel ast.SelectionSet, v pg.Project) graphql.Marshaler { +func (ec *executionContext) marshalNProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProject(ctx context.Context, sel ast.SelectionSet, v db.Project) graphql.Marshaler { return ec._Project(ctx, sel, &v) } -func (ec *executionContext) marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.Project) graphql.Marshaler { +func (ec *executionContext) marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectᚄ(ctx context.Context, sel ast.SelectionSet, v []db.Project) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12493,7 +14670,7 @@ func (ec *executionContext) marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋproj if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProject(ctx, sel, v[i]) + ret[i] = ec.marshalNProject2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProject(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12506,7 +14683,7 @@ func (ec *executionContext) marshalNProject2ᚕgithubᚗcomᚋjordanknottᚋproj return ret } -func (ec *executionContext) marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProject(ctx context.Context, sel ast.SelectionSet, v *pg.Project) graphql.Marshaler { +func (ec *executionContext) marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProject(ctx context.Context, sel ast.SelectionSet, v *db.Project) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12516,11 +14693,11 @@ func (ec *executionContext) marshalNProject2ᚖgithubᚗcomᚋjordanknottᚋproj return ec._Project(ctx, sel, v) } -func (ec *executionContext) marshalNProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx context.Context, sel ast.SelectionSet, v pg.ProjectLabel) graphql.Marshaler { +func (ec *executionContext) marshalNProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx context.Context, sel ast.SelectionSet, v db.ProjectLabel) graphql.Marshaler { return ec._ProjectLabel(ctx, sel, &v) } -func (ec *executionContext) marshalNProjectLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabelᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.ProjectLabel) graphql.Marshaler { +func (ec *executionContext) marshalNProjectLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabelᚄ(ctx context.Context, sel ast.SelectionSet, v []db.ProjectLabel) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12544,7 +14721,7 @@ func (ec *executionContext) marshalNProjectLabel2ᚕgithubᚗcomᚋjordanknott if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx, sel, v[i]) + ret[i] = ec.marshalNProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12557,7 +14734,7 @@ func (ec *executionContext) marshalNProjectLabel2ᚕgithubᚗcomᚋjordanknott return ret } -func (ec *executionContext) marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐProjectLabel(ctx context.Context, sel ast.SelectionSet, v *pg.ProjectLabel) graphql.Marshaler { +func (ec *executionContext) marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐProjectLabel(ctx context.Context, sel ast.SelectionSet, v *db.ProjectLabel) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12567,62 +14744,11 @@ func (ec *executionContext) marshalNProjectLabel2ᚖgithubᚗcomᚋjordanknott return ec._ProjectLabel(ctx, sel, v) } -func (ec *executionContext) marshalNProjectMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMember(ctx context.Context, sel ast.SelectionSet, v ProjectMember) graphql.Marshaler { - return ec._ProjectMember(ctx, sel, &v) -} - -func (ec *executionContext) marshalNProjectMember2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMemberᚄ(ctx context.Context, sel ast.SelectionSet, v []ProjectMember) graphql.Marshaler { - ret := make(graphql.Array, len(v)) - var wg sync.WaitGroup - isLen1 := len(v) == 1 - if !isLen1 { - wg.Add(len(v)) - } - for i := range v { - i := i - fc := &graphql.FieldContext{ - Index: &i, - Result: &v[i], - } - ctx := graphql.WithFieldContext(ctx, fc) - f := func(i int) { - defer func() { - if r := recover(); r != nil { - ec.Error(ctx, ec.Recover(ctx, r)) - ret = nil - } - }() - if !isLen1 { - defer wg.Done() - } - ret[i] = ec.marshalNProjectMember2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMember(ctx, sel, v[i]) - } - if isLen1 { - f(i) - } else { - go f(i) - } - - } - wg.Wait() - return ret -} - -func (ec *executionContext) marshalNProjectMember2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectMember(ctx context.Context, sel ast.SelectionSet, v *ProjectMember) graphql.Marshaler { - if v == nil { - if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { - ec.Errorf(ctx, "must not be null") - } - return graphql.Null - } - return ec._ProjectMember(ctx, sel, v) -} - -func (ec *executionContext) marshalNRefreshToken2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐRefreshToken(ctx context.Context, sel ast.SelectionSet, v pg.RefreshToken) graphql.Marshaler { +func (ec *executionContext) marshalNRefreshToken2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐRefreshToken(ctx context.Context, sel ast.SelectionSet, v db.RefreshToken) graphql.Marshaler { return ec._RefreshToken(ctx, sel, &v) } -func (ec *executionContext) marshalNRefreshToken2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐRefreshToken(ctx context.Context, sel ast.SelectionSet, v *pg.RefreshToken) graphql.Marshaler { +func (ec *executionContext) marshalNRefreshToken2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐRefreshToken(ctx context.Context, sel ast.SelectionSet, v *db.RefreshToken) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12632,14 +14758,73 @@ func (ec *executionContext) marshalNRefreshToken2ᚖgithubᚗcomᚋjordanknott return ec._RefreshToken(ctx, sel, v) } -func (ec *executionContext) unmarshalNSetTaskChecklistItemComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐSetTaskChecklistItemComplete(ctx context.Context, v interface{}) (SetTaskChecklistItemComplete, error) { +func (ec *executionContext) marshalNRole2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐRole(ctx context.Context, sel ast.SelectionSet, v db.Role) graphql.Marshaler { + return ec._Role(ctx, sel, &v) +} + +func (ec *executionContext) marshalNRole2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐRole(ctx context.Context, sel ast.SelectionSet, v *db.Role) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._Role(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNRoleCode2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRoleCode(ctx context.Context, v interface{}) (RoleCode, error) { + var res RoleCode + return res, res.UnmarshalGQL(v) +} + +func (ec *executionContext) marshalNRoleCode2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRoleCode(ctx context.Context, sel ast.SelectionSet, v RoleCode) graphql.Marshaler { + return v +} + +func (ec *executionContext) unmarshalNSetProjectOwner2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetProjectOwner(ctx context.Context, v interface{}) (SetProjectOwner, error) { + return ec.unmarshalInputSetProjectOwner(ctx, v) +} + +func (ec *executionContext) marshalNSetProjectOwnerPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetProjectOwnerPayload(ctx context.Context, sel ast.SelectionSet, v SetProjectOwnerPayload) graphql.Marshaler { + return ec._SetProjectOwnerPayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSetProjectOwnerPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetProjectOwnerPayload(ctx context.Context, sel ast.SelectionSet, v *SetProjectOwnerPayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._SetProjectOwnerPayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNSetTaskChecklistItemComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTaskChecklistItemComplete(ctx context.Context, v interface{}) (SetTaskChecklistItemComplete, error) { return ec.unmarshalInputSetTaskChecklistItemComplete(ctx, v) } -func (ec *executionContext) unmarshalNSetTaskComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐSetTaskComplete(ctx context.Context, v interface{}) (SetTaskComplete, error) { +func (ec *executionContext) unmarshalNSetTaskComplete2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTaskComplete(ctx context.Context, v interface{}) (SetTaskComplete, error) { return ec.unmarshalInputSetTaskComplete(ctx, v) } +func (ec *executionContext) unmarshalNSetTeamOwner2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTeamOwner(ctx context.Context, v interface{}) (SetTeamOwner, error) { + return ec.unmarshalInputSetTeamOwner(ctx, v) +} + +func (ec *executionContext) marshalNSetTeamOwnerPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTeamOwnerPayload(ctx context.Context, sel ast.SelectionSet, v SetTeamOwnerPayload) graphql.Marshaler { + return ec._SetTeamOwnerPayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNSetTeamOwnerPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐSetTeamOwnerPayload(ctx context.Context, sel ast.SelectionSet, v *SetTeamOwnerPayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._SetTeamOwnerPayload(ctx, sel, v) +} + func (ec *executionContext) unmarshalNString2string(ctx context.Context, v interface{}) (string, error) { return graphql.UnmarshalString(v) } @@ -12654,11 +14839,11 @@ func (ec *executionContext) marshalNString2string(ctx context.Context, sel ast.S return res } -func (ec *executionContext) marshalNTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx context.Context, sel ast.SelectionSet, v pg.Task) graphql.Marshaler { +func (ec *executionContext) marshalNTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx context.Context, sel ast.SelectionSet, v db.Task) graphql.Marshaler { return ec._Task(ctx, sel, &v) } -func (ec *executionContext) marshalNTask2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.Task) graphql.Marshaler { +func (ec *executionContext) marshalNTask2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskᚄ(ctx context.Context, sel ast.SelectionSet, v []db.Task) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12682,7 +14867,7 @@ func (ec *executionContext) marshalNTask2ᚕgithubᚗcomᚋjordanknottᚋproject if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx, sel, v[i]) + ret[i] = ec.marshalNTask2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12695,7 +14880,7 @@ func (ec *executionContext) marshalNTask2ᚕgithubᚗcomᚋjordanknottᚋproject return ret } -func (ec *executionContext) marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTask(ctx context.Context, sel ast.SelectionSet, v *pg.Task) graphql.Marshaler { +func (ec *executionContext) marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTask(ctx context.Context, sel ast.SelectionSet, v *db.Task) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12705,11 +14890,11 @@ func (ec *executionContext) marshalNTask2ᚖgithubᚗcomᚋjordanknottᚋproject return ec._Task(ctx, sel, v) } -func (ec *executionContext) marshalNTaskBadges2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐTaskBadges(ctx context.Context, sel ast.SelectionSet, v TaskBadges) graphql.Marshaler { +func (ec *executionContext) marshalNTaskBadges2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐTaskBadges(ctx context.Context, sel ast.SelectionSet, v TaskBadges) graphql.Marshaler { return ec._TaskBadges(ctx, sel, &v) } -func (ec *executionContext) marshalNTaskBadges2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐTaskBadges(ctx context.Context, sel ast.SelectionSet, v *TaskBadges) graphql.Marshaler { +func (ec *executionContext) marshalNTaskBadges2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐTaskBadges(ctx context.Context, sel ast.SelectionSet, v *TaskBadges) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12719,11 +14904,11 @@ func (ec *executionContext) marshalNTaskBadges2ᚖgithubᚗcomᚋjordanknottᚋp return ec._TaskBadges(ctx, sel, v) } -func (ec *executionContext) marshalNTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklist(ctx context.Context, sel ast.SelectionSet, v pg.TaskChecklist) graphql.Marshaler { +func (ec *executionContext) marshalNTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklist(ctx context.Context, sel ast.SelectionSet, v db.TaskChecklist) graphql.Marshaler { return ec._TaskChecklist(ctx, sel, &v) } -func (ec *executionContext) marshalNTaskChecklist2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.TaskChecklist) graphql.Marshaler { +func (ec *executionContext) marshalNTaskChecklist2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistᚄ(ctx context.Context, sel ast.SelectionSet, v []db.TaskChecklist) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12747,7 +14932,7 @@ func (ec *executionContext) marshalNTaskChecklist2ᚕgithubᚗcomᚋjordanknott if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklist(ctx, sel, v[i]) + ret[i] = ec.marshalNTaskChecklist2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklist(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12760,7 +14945,7 @@ func (ec *executionContext) marshalNTaskChecklist2ᚕgithubᚗcomᚋjordanknott return ret } -func (ec *executionContext) marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklist(ctx context.Context, sel ast.SelectionSet, v *pg.TaskChecklist) graphql.Marshaler { +func (ec *executionContext) marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklist(ctx context.Context, sel ast.SelectionSet, v *db.TaskChecklist) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12770,11 +14955,11 @@ func (ec *executionContext) marshalNTaskChecklist2ᚖgithubᚗcomᚋjordanknott return ec._TaskChecklist(ctx, sel, v) } -func (ec *executionContext) marshalNTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItem(ctx context.Context, sel ast.SelectionSet, v pg.TaskChecklistItem) graphql.Marshaler { +func (ec *executionContext) marshalNTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItem(ctx context.Context, sel ast.SelectionSet, v db.TaskChecklistItem) graphql.Marshaler { return ec._TaskChecklistItem(ctx, sel, &v) } -func (ec *executionContext) marshalNTaskChecklistItem2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItemᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.TaskChecklistItem) graphql.Marshaler { +func (ec *executionContext) marshalNTaskChecklistItem2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItemᚄ(ctx context.Context, sel ast.SelectionSet, v []db.TaskChecklistItem) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12798,7 +14983,7 @@ func (ec *executionContext) marshalNTaskChecklistItem2ᚕgithubᚗcomᚋjordankn if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItem(ctx, sel, v[i]) + ret[i] = ec.marshalNTaskChecklistItem2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItem(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12811,7 +14996,7 @@ func (ec *executionContext) marshalNTaskChecklistItem2ᚕgithubᚗcomᚋjordankn return ret } -func (ec *executionContext) marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskChecklistItem(ctx context.Context, sel ast.SelectionSet, v *pg.TaskChecklistItem) graphql.Marshaler { +func (ec *executionContext) marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskChecklistItem(ctx context.Context, sel ast.SelectionSet, v *db.TaskChecklistItem) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12821,11 +15006,11 @@ func (ec *executionContext) marshalNTaskChecklistItem2ᚖgithubᚗcomᚋjordankn return ec._TaskChecklistItem(ctx, sel, v) } -func (ec *executionContext) marshalNTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx context.Context, sel ast.SelectionSet, v pg.TaskGroup) graphql.Marshaler { +func (ec *executionContext) marshalNTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx context.Context, sel ast.SelectionSet, v db.TaskGroup) graphql.Marshaler { return ec._TaskGroup(ctx, sel, &v) } -func (ec *executionContext) marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroupᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.TaskGroup) graphql.Marshaler { +func (ec *executionContext) marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroupᚄ(ctx context.Context, sel ast.SelectionSet, v []db.TaskGroup) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12849,7 +15034,7 @@ func (ec *executionContext) marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋpr if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx, sel, v[i]) + ret[i] = ec.marshalNTaskGroup2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12862,7 +15047,7 @@ func (ec *executionContext) marshalNTaskGroup2ᚕgithubᚗcomᚋjordanknottᚋpr return ret } -func (ec *executionContext) marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskGroup(ctx context.Context, sel ast.SelectionSet, v *pg.TaskGroup) graphql.Marshaler { +func (ec *executionContext) marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskGroup(ctx context.Context, sel ast.SelectionSet, v *db.TaskGroup) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12872,11 +15057,11 @@ func (ec *executionContext) marshalNTaskGroup2ᚖgithubᚗcomᚋjordanknottᚋpr return ec._TaskGroup(ctx, sel, v) } -func (ec *executionContext) marshalNTaskLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskLabel(ctx context.Context, sel ast.SelectionSet, v pg.TaskLabel) graphql.Marshaler { +func (ec *executionContext) marshalNTaskLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskLabel(ctx context.Context, sel ast.SelectionSet, v db.TaskLabel) graphql.Marshaler { return ec._TaskLabel(ctx, sel, &v) } -func (ec *executionContext) marshalNTaskLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskLabelᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.TaskLabel) graphql.Marshaler { +func (ec *executionContext) marshalNTaskLabel2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskLabelᚄ(ctx context.Context, sel ast.SelectionSet, v []db.TaskLabel) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12900,7 +15085,7 @@ func (ec *executionContext) marshalNTaskLabel2ᚕgithubᚗcomᚋjordanknottᚋpr if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTaskLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTaskLabel(ctx, sel, v[i]) + ret[i] = ec.marshalNTaskLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTaskLabel(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12913,11 +15098,11 @@ func (ec *executionContext) marshalNTaskLabel2ᚕgithubᚗcomᚋjordanknottᚋpr return ret } -func (ec *executionContext) marshalNTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx context.Context, sel ast.SelectionSet, v pg.Team) graphql.Marshaler { +func (ec *executionContext) marshalNTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx context.Context, sel ast.SelectionSet, v db.Team) graphql.Marshaler { return ec._Team(ctx, sel, &v) } -func (ec *executionContext) marshalNTeam2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeamᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.Team) graphql.Marshaler { +func (ec *executionContext) marshalNTeam2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeamᚄ(ctx context.Context, sel ast.SelectionSet, v []db.Team) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -12941,7 +15126,7 @@ func (ec *executionContext) marshalNTeam2ᚕgithubᚗcomᚋjordanknottᚋproject if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx, sel, v[i]) + ret[i] = ec.marshalNTeam2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx, sel, v[i]) } if isLen1 { f(i) @@ -12954,7 +15139,7 @@ func (ec *executionContext) marshalNTeam2ᚕgithubᚗcomᚋjordanknottᚋproject return ret } -func (ec *executionContext) marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐTeam(ctx context.Context, sel ast.SelectionSet, v *pg.Team) graphql.Marshaler { +func (ec *executionContext) marshalNTeam2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐTeam(ctx context.Context, sel ast.SelectionSet, v *db.Team) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -12996,15 +15181,15 @@ func (ec *executionContext) marshalNTime2ᚖtimeᚐTime(ctx context.Context, sel return ec.marshalNTime2timeᚐTime(ctx, sel, *v) } -func (ec *executionContext) unmarshalNToggleTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐToggleTaskLabelInput(ctx context.Context, v interface{}) (ToggleTaskLabelInput, error) { +func (ec *executionContext) unmarshalNToggleTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐToggleTaskLabelInput(ctx context.Context, v interface{}) (ToggleTaskLabelInput, error) { return ec.unmarshalInputToggleTaskLabelInput(ctx, v) } -func (ec *executionContext) marshalNToggleTaskLabelPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐToggleTaskLabelPayload(ctx context.Context, sel ast.SelectionSet, v ToggleTaskLabelPayload) graphql.Marshaler { +func (ec *executionContext) marshalNToggleTaskLabelPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐToggleTaskLabelPayload(ctx context.Context, sel ast.SelectionSet, v ToggleTaskLabelPayload) graphql.Marshaler { return ec._ToggleTaskLabelPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNToggleTaskLabelPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐToggleTaskLabelPayload(ctx context.Context, sel ast.SelectionSet, v *ToggleTaskLabelPayload) graphql.Marshaler { +func (ec *executionContext) marshalNToggleTaskLabelPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐToggleTaskLabelPayload(ctx context.Context, sel ast.SelectionSet, v *ToggleTaskLabelPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -13028,43 +15213,61 @@ func (ec *executionContext) marshalNUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx return res } -func (ec *executionContext) unmarshalNUpdateProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectLabel(ctx context.Context, v interface{}) (UpdateProjectLabel, error) { +func (ec *executionContext) unmarshalNUpdateProjectLabel2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectLabel(ctx context.Context, v interface{}) (UpdateProjectLabel, error) { return ec.unmarshalInputUpdateProjectLabel(ctx, v) } -func (ec *executionContext) unmarshalNUpdateProjectLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectLabelColor(ctx context.Context, v interface{}) (UpdateProjectLabelColor, error) { +func (ec *executionContext) unmarshalNUpdateProjectLabelColor2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectLabelColor(ctx context.Context, v interface{}) (UpdateProjectLabelColor, error) { return ec.unmarshalInputUpdateProjectLabelColor(ctx, v) } -func (ec *executionContext) unmarshalNUpdateProjectLabelName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectLabelName(ctx context.Context, v interface{}) (UpdateProjectLabelName, error) { +func (ec *executionContext) unmarshalNUpdateProjectLabelName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectLabelName(ctx context.Context, v interface{}) (UpdateProjectLabelName, error) { return ec.unmarshalInputUpdateProjectLabelName(ctx, v) } -func (ec *executionContext) unmarshalNUpdateTaskChecklistItemName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskChecklistItemName(ctx context.Context, v interface{}) (UpdateTaskChecklistItemName, error) { +func (ec *executionContext) unmarshalNUpdateProjectMemberRole2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectMemberRole(ctx context.Context, v interface{}) (UpdateProjectMemberRole, error) { + return ec.unmarshalInputUpdateProjectMemberRole(ctx, v) +} + +func (ec *executionContext) marshalNUpdateProjectMemberRolePayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectMemberRolePayload(ctx context.Context, sel ast.SelectionSet, v UpdateProjectMemberRolePayload) graphql.Marshaler { + return ec._UpdateProjectMemberRolePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUpdateProjectMemberRolePayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectMemberRolePayload(ctx context.Context, sel ast.SelectionSet, v *UpdateProjectMemberRolePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._UpdateProjectMemberRolePayload(ctx, sel, v) +} + +func (ec *executionContext) unmarshalNUpdateTaskChecklistItemName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskChecklistItemName(ctx context.Context, v interface{}) (UpdateTaskChecklistItemName, error) { return ec.unmarshalInputUpdateTaskChecklistItemName(ctx, v) } -func (ec *executionContext) unmarshalNUpdateTaskChecklistName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskChecklistName(ctx context.Context, v interface{}) (UpdateTaskChecklistName, error) { +func (ec *executionContext) unmarshalNUpdateTaskChecklistName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskChecklistName(ctx context.Context, v interface{}) (UpdateTaskChecklistName, error) { return ec.unmarshalInputUpdateTaskChecklistName(ctx, v) } -func (ec *executionContext) unmarshalNUpdateTaskDescriptionInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskDescriptionInput(ctx context.Context, v interface{}) (UpdateTaskDescriptionInput, error) { +func (ec *executionContext) unmarshalNUpdateTaskDescriptionInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskDescriptionInput(ctx context.Context, v interface{}) (UpdateTaskDescriptionInput, error) { return ec.unmarshalInputUpdateTaskDescriptionInput(ctx, v) } -func (ec *executionContext) unmarshalNUpdateTaskDueDate2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskDueDate(ctx context.Context, v interface{}) (UpdateTaskDueDate, error) { +func (ec *executionContext) unmarshalNUpdateTaskDueDate2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskDueDate(ctx context.Context, v interface{}) (UpdateTaskDueDate, error) { return ec.unmarshalInputUpdateTaskDueDate(ctx, v) } -func (ec *executionContext) unmarshalNUpdateTaskGroupName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskGroupName(ctx context.Context, v interface{}) (UpdateTaskGroupName, error) { +func (ec *executionContext) unmarshalNUpdateTaskGroupName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskGroupName(ctx context.Context, v interface{}) (UpdateTaskGroupName, error) { return ec.unmarshalInputUpdateTaskGroupName(ctx, v) } -func (ec *executionContext) marshalNUpdateTaskLocationPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskLocationPayload(ctx context.Context, sel ast.SelectionSet, v UpdateTaskLocationPayload) graphql.Marshaler { +func (ec *executionContext) marshalNUpdateTaskLocationPayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskLocationPayload(ctx context.Context, sel ast.SelectionSet, v UpdateTaskLocationPayload) graphql.Marshaler { return ec._UpdateTaskLocationPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNUpdateTaskLocationPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskLocationPayload(ctx context.Context, sel ast.SelectionSet, v *UpdateTaskLocationPayload) graphql.Marshaler { +func (ec *executionContext) marshalNUpdateTaskLocationPayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskLocationPayload(ctx context.Context, sel ast.SelectionSet, v *UpdateTaskLocationPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -13074,15 +15277,33 @@ func (ec *executionContext) marshalNUpdateTaskLocationPayload2ᚖgithubᚗcomᚋ return ec._UpdateTaskLocationPayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNUpdateTaskName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateTaskName(ctx context.Context, v interface{}) (UpdateTaskName, error) { +func (ec *executionContext) unmarshalNUpdateTaskName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTaskName(ctx context.Context, v interface{}) (UpdateTaskName, error) { return ec.unmarshalInputUpdateTaskName(ctx, v) } -func (ec *executionContext) marshalNUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx context.Context, sel ast.SelectionSet, v pg.UserAccount) graphql.Marshaler { +func (ec *executionContext) unmarshalNUpdateTeamMemberRole2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTeamMemberRole(ctx context.Context, v interface{}) (UpdateTeamMemberRole, error) { + return ec.unmarshalInputUpdateTeamMemberRole(ctx, v) +} + +func (ec *executionContext) marshalNUpdateTeamMemberRolePayload2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTeamMemberRolePayload(ctx context.Context, sel ast.SelectionSet, v UpdateTeamMemberRolePayload) graphql.Marshaler { + return ec._UpdateTeamMemberRolePayload(ctx, sel, &v) +} + +func (ec *executionContext) marshalNUpdateTeamMemberRolePayload2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateTeamMemberRolePayload(ctx context.Context, sel ast.SelectionSet, v *UpdateTeamMemberRolePayload) graphql.Marshaler { + if v == nil { + if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { + ec.Errorf(ctx, "must not be null") + } + return graphql.Null + } + return ec._UpdateTeamMemberRolePayload(ctx, sel, v) +} + +func (ec *executionContext) marshalNUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx context.Context, sel ast.SelectionSet, v db.UserAccount) graphql.Marshaler { return ec._UserAccount(ctx, sel, &v) } -func (ec *executionContext) marshalNUserAccount2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccountᚄ(ctx context.Context, sel ast.SelectionSet, v []pg.UserAccount) graphql.Marshaler { +func (ec *executionContext) marshalNUserAccount2ᚕgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccountᚄ(ctx context.Context, sel ast.SelectionSet, v []db.UserAccount) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -13106,7 +15327,7 @@ func (ec *executionContext) marshalNUserAccount2ᚕgithubᚗcomᚋjordanknottᚋ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx, sel, v[i]) + ret[i] = ec.marshalNUserAccount2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx, sel, v[i]) } if isLen1 { f(i) @@ -13119,7 +15340,7 @@ func (ec *executionContext) marshalNUserAccount2ᚕgithubᚗcomᚋjordanknottᚋ return ret } -func (ec *executionContext) marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋpgᚐUserAccount(ctx context.Context, sel ast.SelectionSet, v *pg.UserAccount) graphql.Marshaler { +func (ec *executionContext) marshalNUserAccount2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋdbᚐUserAccount(ctx context.Context, sel ast.SelectionSet, v *db.UserAccount) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { ec.Errorf(ctx, "must not be null") @@ -13355,27 +15576,27 @@ func (ec *executionContext) marshalN__TypeKind2string(ctx context.Context, sel a return res } -func (ec *executionContext) unmarshalOAddTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAddTaskLabelInput(ctx context.Context, v interface{}) (AddTaskLabelInput, error) { +func (ec *executionContext) unmarshalOAddTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAddTaskLabelInput(ctx context.Context, v interface{}) (AddTaskLabelInput, error) { return ec.unmarshalInputAddTaskLabelInput(ctx, v) } -func (ec *executionContext) unmarshalOAddTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAddTaskLabelInput(ctx context.Context, v interface{}) (*AddTaskLabelInput, error) { +func (ec *executionContext) unmarshalOAddTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAddTaskLabelInput(ctx context.Context, v interface{}) (*AddTaskLabelInput, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOAddTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAddTaskLabelInput(ctx, v) + res, err := ec.unmarshalOAddTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAddTaskLabelInput(ctx, v) return &res, err } -func (ec *executionContext) unmarshalOAssignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAssignTaskInput(ctx context.Context, v interface{}) (AssignTaskInput, error) { +func (ec *executionContext) unmarshalOAssignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAssignTaskInput(ctx context.Context, v interface{}) (AssignTaskInput, error) { return ec.unmarshalInputAssignTaskInput(ctx, v) } -func (ec *executionContext) unmarshalOAssignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAssignTaskInput(ctx context.Context, v interface{}) (*AssignTaskInput, error) { +func (ec *executionContext) unmarshalOAssignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAssignTaskInput(ctx context.Context, v interface{}) (*AssignTaskInput, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOAssignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐAssignTaskInput(ctx, v) + res, err := ec.unmarshalOAssignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐAssignTaskInput(ctx, v) return &res, err } @@ -13402,38 +15623,38 @@ func (ec *executionContext) marshalOBoolean2ᚖbool(ctx context.Context, sel ast return ec.marshalOBoolean2bool(ctx, sel, *v) } -func (ec *executionContext) marshalOChecklistBadge2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐChecklistBadge(ctx context.Context, sel ast.SelectionSet, v ChecklistBadge) graphql.Marshaler { +func (ec *executionContext) marshalOChecklistBadge2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐChecklistBadge(ctx context.Context, sel ast.SelectionSet, v ChecklistBadge) graphql.Marshaler { return ec._ChecklistBadge(ctx, sel, &v) } -func (ec *executionContext) marshalOChecklistBadge2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐChecklistBadge(ctx context.Context, sel ast.SelectionSet, v *ChecklistBadge) graphql.Marshaler { +func (ec *executionContext) marshalOChecklistBadge2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐChecklistBadge(ctx context.Context, sel ast.SelectionSet, v *ChecklistBadge) graphql.Marshaler { if v == nil { return graphql.Null } return ec._ChecklistBadge(ctx, sel, v) } -func (ec *executionContext) unmarshalOProjectsFilter2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectsFilter(ctx context.Context, v interface{}) (ProjectsFilter, error) { +func (ec *executionContext) unmarshalOProjectsFilter2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProjectsFilter(ctx context.Context, v interface{}) (ProjectsFilter, error) { return ec.unmarshalInputProjectsFilter(ctx, v) } -func (ec *executionContext) unmarshalOProjectsFilter2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectsFilter(ctx context.Context, v interface{}) (*ProjectsFilter, error) { +func (ec *executionContext) unmarshalOProjectsFilter2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProjectsFilter(ctx context.Context, v interface{}) (*ProjectsFilter, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOProjectsFilter2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐProjectsFilter(ctx, v) + res, err := ec.unmarshalOProjectsFilter2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐProjectsFilter(ctx, v) return &res, err } -func (ec *executionContext) unmarshalORemoveTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐRemoveTaskLabelInput(ctx context.Context, v interface{}) (RemoveTaskLabelInput, error) { +func (ec *executionContext) unmarshalORemoveTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRemoveTaskLabelInput(ctx context.Context, v interface{}) (RemoveTaskLabelInput, error) { return ec.unmarshalInputRemoveTaskLabelInput(ctx, v) } -func (ec *executionContext) unmarshalORemoveTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐRemoveTaskLabelInput(ctx context.Context, v interface{}) (*RemoveTaskLabelInput, error) { +func (ec *executionContext) unmarshalORemoveTaskLabelInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRemoveTaskLabelInput(ctx context.Context, v interface{}) (*RemoveTaskLabelInput, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalORemoveTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐRemoveTaskLabelInput(ctx, v) + res, err := ec.unmarshalORemoveTaskLabelInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐRemoveTaskLabelInput(ctx, v) return &res, err } @@ -13506,27 +15727,27 @@ func (ec *executionContext) marshalOUUID2ᚖgithubᚗcomᚋgoogleᚋuuidᚐUUID( return ec.marshalOUUID2githubᚗcomᚋgoogleᚋuuidᚐUUID(ctx, sel, *v) } -func (ec *executionContext) unmarshalOUnassignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUnassignTaskInput(ctx context.Context, v interface{}) (UnassignTaskInput, error) { +func (ec *executionContext) unmarshalOUnassignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUnassignTaskInput(ctx context.Context, v interface{}) (UnassignTaskInput, error) { return ec.unmarshalInputUnassignTaskInput(ctx, v) } -func (ec *executionContext) unmarshalOUnassignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUnassignTaskInput(ctx context.Context, v interface{}) (*UnassignTaskInput, error) { +func (ec *executionContext) unmarshalOUnassignTaskInput2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUnassignTaskInput(ctx context.Context, v interface{}) (*UnassignTaskInput, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOUnassignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUnassignTaskInput(ctx, v) + res, err := ec.unmarshalOUnassignTaskInput2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUnassignTaskInput(ctx, v) return &res, err } -func (ec *executionContext) unmarshalOUpdateProjectName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectName(ctx context.Context, v interface{}) (UpdateProjectName, error) { +func (ec *executionContext) unmarshalOUpdateProjectName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectName(ctx context.Context, v interface{}) (UpdateProjectName, error) { return ec.unmarshalInputUpdateProjectName(ctx, v) } -func (ec *executionContext) unmarshalOUpdateProjectName2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectName(ctx context.Context, v interface{}) (*UpdateProjectName, error) { +func (ec *executionContext) unmarshalOUpdateProjectName2ᚖgithubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectName(ctx context.Context, v interface{}) (*UpdateProjectName, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalOUpdateProjectName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋgraphᚐUpdateProjectName(ctx, v) + res, err := ec.unmarshalOUpdateProjectName2githubᚗcomᚋjordanknottᚋprojectᚑcitadelᚋapiᚋinternalᚋgraphᚐUpdateProjectName(ctx, v) return &res, err } diff --git a/api/graph/graph.go b/api/internal/graph/graph.go similarity index 92% rename from api/graph/graph.go rename to api/internal/graph/graph.go index 089d12b..324d206 100644 --- a/api/graph/graph.go +++ b/api/internal/graph/graph.go @@ -12,11 +12,11 @@ import ( "github.com/99designs/gqlgen/graphql/handler/transport" "github.com/99designs/gqlgen/graphql/playground" "github.com/google/uuid" - "github.com/jordanknott/project-citadel/api/pg" + "github.com/jordanknott/project-citadel/api/internal/db" ) // NewHandler returns a new graphql endpoint handler. -func NewHandler(repo pg.Repository) http.Handler { +func NewHandler(repo db.Repository) http.Handler { srv := handler.New(NewExecutableSchema(Config{ Resolvers: &Resolver{ Repository: repo, diff --git a/api/graph/models_gen.go b/api/internal/graph/models_gen.go similarity index 65% rename from api/graph/models_gen.go rename to api/internal/graph/models_gen.go index 654ebb3..a7a25a1 100644 --- a/api/graph/models_gen.go +++ b/api/internal/graph/models_gen.go @@ -3,10 +3,13 @@ package graph import ( + "fmt" + "io" + "strconv" "time" "github.com/google/uuid" - "github.com/jordanknott/project-citadel/api/pg" + "github.com/jordanknott/project-citadel/api/internal/db" ) type AddTaskLabelInput struct { @@ -24,6 +27,16 @@ type ChecklistBadge struct { Total int `json:"total"` } +type CreateProjectMember struct { + ProjectID uuid.UUID `json:"projectID"` + UserID uuid.UUID `json:"userID"` +} + +type CreateProjectMemberPayload struct { + Ok bool `json:"ok"` + Member *Member `json:"member"` +} + type CreateTaskChecklist struct { TaskID uuid.UUID `json:"taskID"` Name string `json:"name"` @@ -42,8 +55,8 @@ type CreateTeamMember struct { } type CreateTeamMemberPayload struct { - Team *pg.Team `json:"team"` - TeamMember *ProjectMember `json:"teamMember"` + Team *db.Team `json:"team"` + TeamMember *Member `json:"teamMember"` } type DeleteProject struct { @@ -54,9 +67,20 @@ type DeleteProjectLabel struct { ProjectLabelID uuid.UUID `json:"projectLabelID"` } +type DeleteProjectMember struct { + ProjectID uuid.UUID `json:"projectID"` + UserID uuid.UUID `json:"userID"` +} + +type DeleteProjectMemberPayload struct { + Ok bool `json:"ok"` + Member *Member `json:"member"` + ProjectID uuid.UUID `json:"projectID"` +} + type DeleteProjectPayload struct { Ok bool `json:"ok"` - Project *pg.Project `json:"project"` + Project *db.Project `json:"project"` } type DeleteTaskChecklist struct { @@ -69,12 +93,12 @@ type DeleteTaskChecklistItem struct { type DeleteTaskChecklistItemPayload struct { Ok bool `json:"ok"` - TaskChecklistItem *pg.TaskChecklistItem `json:"taskChecklistItem"` + TaskChecklistItem *db.TaskChecklistItem `json:"taskChecklistItem"` } type DeleteTaskChecklistPayload struct { Ok bool `json:"ok"` - TaskChecklist *pg.TaskChecklist `json:"taskChecklist"` + TaskChecklist *db.TaskChecklist `json:"taskChecklist"` } type DeleteTaskGroupInput struct { @@ -84,7 +108,7 @@ type DeleteTaskGroupInput struct { type DeleteTaskGroupPayload struct { Ok bool `json:"ok"` AffectedRows int `json:"affectedRows"` - TaskGroup *pg.TaskGroup `json:"taskGroup"` + TaskGroup *db.TaskGroup `json:"taskGroup"` } type DeleteTaskInput struct { @@ -99,10 +123,20 @@ type DeleteTeam struct { TeamID uuid.UUID `json:"teamID"` } +type DeleteTeamMember struct { + TeamID uuid.UUID `json:"teamID"` + UserID uuid.UUID `json:"userID"` +} + +type DeleteTeamMemberPayload struct { + TeamID uuid.UUID `json:"teamID"` + UserID uuid.UUID `json:"userID"` +} + type DeleteTeamPayload struct { Ok bool `json:"ok"` - Team *pg.Team `json:"team"` - Projects []pg.Project `json:"projects"` + Team *db.Team `json:"team"` + Projects []db.Project `json:"projects"` } type DeleteUserAccount struct { @@ -111,7 +145,7 @@ type DeleteUserAccount struct { type DeleteUserAccountPayload struct { Ok bool `json:"ok"` - UserAccount *pg.UserAccount `json:"userAccount"` + UserAccount *db.UserAccount `json:"userAccount"` } type FindProject struct { @@ -134,6 +168,14 @@ type LogoutUser struct { UserID string `json:"userID"` } +type Member struct { + ID uuid.UUID `json:"id"` + Role *db.Role `json:"role"` + FullName string `json:"fullName"` + Username string `json:"username"` + ProfileIcon *ProfileIcon `json:"profileIcon"` +} + type NewProject struct { UserID uuid.UUID `json:"userID"` TeamID uuid.UUID `json:"teamID"` @@ -184,6 +226,7 @@ type NewUserAccount struct { FullName string `json:"fullName"` Initials string `json:"initials"` Password string `json:"password"` + RoleCode string `json:"roleCode"` } type ProfileIcon struct { @@ -192,12 +235,6 @@ type ProfileIcon struct { BgColor *string `json:"bgColor"` } -type ProjectMember struct { - ID uuid.UUID `json:"id"` - FullName string `json:"fullName"` - ProfileIcon *ProfileIcon `json:"profileIcon"` -} - type ProjectsFilter struct { TeamID *uuid.UUID `json:"teamID"` } @@ -206,6 +243,17 @@ type RemoveTaskLabelInput struct { TaskLabelID uuid.UUID `json:"taskLabelID"` } +type SetProjectOwner struct { + ProjectID uuid.UUID `json:"projectID"` + OwnerID uuid.UUID `json:"ownerID"` +} + +type SetProjectOwnerPayload struct { + Ok bool `json:"ok"` + PrevOwner *Member `json:"prevOwner"` + NewOwner *Member `json:"newOwner"` +} + type SetTaskChecklistItemComplete struct { TaskChecklistItemID uuid.UUID `json:"taskChecklistItemID"` Complete bool `json:"complete"` @@ -216,6 +264,17 @@ type SetTaskComplete struct { Complete bool `json:"complete"` } +type SetTeamOwner struct { + TeamID uuid.UUID `json:"teamID"` + UserID uuid.UUID `json:"userID"` +} + +type SetTeamOwnerPayload struct { + Ok bool `json:"ok"` + PrevOwner *Member `json:"prevOwner"` + NewOwner *Member `json:"newOwner"` +} + type TaskBadges struct { Checklist *ChecklistBadge `json:"checklist"` } @@ -227,7 +286,7 @@ type ToggleTaskLabelInput struct { type ToggleTaskLabelPayload struct { Active bool `json:"active"` - Task *pg.Task `json:"task"` + Task *db.Task `json:"task"` } type UnassignTaskInput struct { @@ -251,6 +310,17 @@ type UpdateProjectLabelName struct { Name string `json:"name"` } +type UpdateProjectMemberRole struct { + ProjectID uuid.UUID `json:"projectID"` + UserID uuid.UUID `json:"userID"` + RoleCode RoleCode `json:"roleCode"` +} + +type UpdateProjectMemberRolePayload struct { + Ok bool `json:"ok"` + Member *Member `json:"member"` +} + type UpdateProjectName struct { ProjectID uuid.UUID `json:"projectID"` Name string `json:"name"` @@ -283,10 +353,66 @@ type UpdateTaskGroupName struct { type UpdateTaskLocationPayload struct { PreviousTaskGroupID uuid.UUID `json:"previousTaskGroupID"` - Task *pg.Task `json:"task"` + Task *db.Task `json:"task"` } type UpdateTaskName struct { TaskID string `json:"taskID"` Name string `json:"name"` } + +type UpdateTeamMemberRole struct { + TeamID uuid.UUID `json:"teamID"` + UserID uuid.UUID `json:"userID"` + RoleCode RoleCode `json:"roleCode"` +} + +type UpdateTeamMemberRolePayload struct { + Ok bool `json:"ok"` + Member *Member `json:"member"` +} + +type RoleCode string + +const ( + RoleCodeOwner RoleCode = "owner" + RoleCodeAdmin RoleCode = "admin" + RoleCodeMember RoleCode = "member" + RoleCodeObserver RoleCode = "observer" +) + +var AllRoleCode = []RoleCode{ + RoleCodeOwner, + RoleCodeAdmin, + RoleCodeMember, + RoleCodeObserver, +} + +func (e RoleCode) IsValid() bool { + switch e { + case RoleCodeOwner, RoleCodeAdmin, RoleCodeMember, RoleCodeObserver: + return true + } + return false +} + +func (e RoleCode) String() string { + return string(e) +} + +func (e *RoleCode) UnmarshalGQL(v interface{}) error { + str, ok := v.(string) + if !ok { + return fmt.Errorf("enums must be strings") + } + + *e = RoleCode(str) + if !e.IsValid() { + return fmt.Errorf("%s is not a valid RoleCode", str) + } + return nil +} + +func (e RoleCode) MarshalGQL(w io.Writer) { + fmt.Fprint(w, strconv.Quote(e.String())) +} diff --git a/api/graph/resolver.go b/api/internal/graph/resolver.go similarity index 51% rename from api/graph/resolver.go rename to api/internal/graph/resolver.go index b3b4a5a..f8c5007 100644 --- a/api/graph/resolver.go +++ b/api/internal/graph/resolver.go @@ -1,13 +1,14 @@ +//go:generate sh ../scripts/genSchema.sh //go:generate go run github.com/99designs/gqlgen package graph import ( "sync" - "github.com/jordanknott/project-citadel/api/pg" + "github.com/jordanknott/project-citadel/api/internal/db" ) type Resolver struct { - Repository pg.Repository + Repository db.Repository mu sync.Mutex } diff --git a/api/graph/scalars.go b/api/internal/graph/scalars.go similarity index 100% rename from api/graph/scalars.go rename to api/internal/graph/scalars.go diff --git a/api/graph/schema.graphqls b/api/internal/graph/schema.graphqls similarity index 78% rename from api/graph/schema.graphqls rename to api/internal/graph/schema.graphqls index bf75fa3..2c172de 100644 --- a/api/graph/schema.graphqls +++ b/api/internal/graph/schema.graphqls @@ -2,6 +2,13 @@ scalar Time scalar UUID scalar Upload +enum RoleCode { + owner + admin + member + observer +} + type ProjectLabel { id: ID! createdDate: Time! @@ -28,9 +35,11 @@ type ProfileIcon { bgColor: String } -type ProjectMember { +type Member { id: ID! + role: Role! fullName: String! + username: String! profileIcon: ProfileIcon! } @@ -41,12 +50,18 @@ type RefreshToken { createdAt: Time! } +type Role { + code: String! + name: String! +} + type UserAccount { id: ID! email: String! createdAt: Time! fullName: String! initials: String! + role: Role! username: String! profileIcon: ProfileIcon! } @@ -55,7 +70,7 @@ type Team { id: ID! createdAt: Time! name: String! - members: [ProjectMember!]! + members: [Member!]! } type Project { @@ -63,9 +78,9 @@ type Project { createdAt: Time! name: String! team: Team! - owner: ProjectMember! + owner: Member! taskGroups: [TaskGroup!]! - members: [ProjectMember!]! + members: [Member!]! labels: [ProjectLabel!]! } @@ -96,127 +111,17 @@ type Task { description: String dueDate: Time complete: Boolean! - assigned: [ProjectMember!]! + assigned: [Member!]! labels: [TaskLabel!]! checklists: [TaskChecklist!]! badges: TaskBadges! } -input ProjectsFilter { - teamID: UUID -} - -input FindUser { - userId: String! -} - -input FindProject { - projectId: String! -} - -input FindTask { - taskID: UUID! -} - type Organization { id: ID! name: String! } -input FindTeam { - teamID: UUID! -} - -type Query { - organizations: [Organization!]! - users: [UserAccount!]! - findUser(input: FindUser!): UserAccount! - findProject(input: FindProject!): Project! - findTask(input: FindTask!): Task! - projects(input: ProjectsFilter): [Project!]! - findTeam(input: FindTeam!): Team! - teams: [Team!]! - labelColors: [LabelColor!]! - taskGroups: [TaskGroup!]! - me: UserAccount! -} - -input NewRefreshToken { - userId: String! -} - -input NewUserAccount { - username: String! - email: String! - fullName: String! - initials: String! - password: String! -} - -input NewTeam { - name: String! - organizationID: UUID! -} - -input NewProject { - userID: UUID! - teamID: UUID! - name: String! -} - -input NewTaskGroup { - projectID: String! - name: String! - position: Float! -} - -input LogoutUser { - userID: String! -} -input NewTask { - taskGroupID: String! - name: String! - position: Float! -} -input NewTaskLocation { - taskID: UUID! - taskGroupID: UUID! - position: Float! -} - -input DeleteTaskInput { - taskID: String! -} - -type DeleteTaskPayload { - taskID: String! -} - -input UpdateTaskName { - taskID: String! - name: String! -} - -input NewTaskGroupLocation { - taskGroupID: UUID! - position: Float! -} - -input DeleteTaskGroupInput { - taskGroupID: UUID! -} - -type DeleteTaskGroupPayload { - ok: Boolean! - affectedRows: Int! - taskGroup: TaskGroup! -} - -type DeleteTaskChecklistItemPayload { - ok: Boolean! - taskChecklistItem: TaskChecklistItem! -} - type TaskChecklistItem { id: ID! name: String! @@ -233,27 +138,75 @@ type TaskChecklist { items: [TaskChecklistItem!]! } -input AssignTaskInput { +type Query { + organizations: [Organization!]! + users: [UserAccount!]! + findUser(input: FindUser!): UserAccount! + findProject(input: FindProject!): Project! + findTask(input: FindTask!): Task! + projects(input: ProjectsFilter): [Project!]! + findTeam(input: FindTeam!): Team! + teams: [Team!]! + labelColors: [LabelColor!]! + taskGroups: [TaskGroup!]! + me: UserAccount! +} + +type Mutation + +input ProjectsFilter { + teamID: UUID +} + +input FindUser { + userId: String! +} + +input FindProject { + projectId: String! +} + +input FindTask { taskID: UUID! +} + +input FindTeam { + teamID: UUID! +} + +extend type Mutation { + createProject(input: NewProject!): Project! + deleteProject(input: DeleteProject!): DeleteProjectPayload! + updateProjectName(input: UpdateProjectName): Project! +} + +input NewProject { userID: UUID! + teamID: UUID! + name: String! } -input UnassignTaskInput { - taskID: UUID! - userID: UUID! -} -input UpdateTaskDescriptionInput { - taskID: UUID! - description: String! +input UpdateProjectName { + projectID: UUID! + name: String! } -input AddTaskLabelInput { - taskID: UUID! - projectLabelID: UUID! +input DeleteProject { + projectID: UUID! } -input RemoveTaskLabelInput { - taskLabelID: UUID! +type DeleteProjectPayload { + ok: Boolean! + project: Project! +} + + +extend type Mutation { + createProjectLabel(input: NewProjectLabel!): ProjectLabel! + deleteProjectLabel(input: DeleteProjectLabel!): ProjectLabel! + updateProjectLabel(input: UpdateProjectLabel!): ProjectLabel! + updateProjectLabelName(input: UpdateProjectLabelName!): ProjectLabel! + updateProjectLabelColor(input: UpdateProjectLabelColor!): ProjectLabel! } input NewProjectLabel { @@ -282,19 +235,88 @@ input UpdateProjectLabelColor { labelColorID: UUID! } -input ToggleTaskLabelInput { - taskID: UUID! - projectLabelID: UUID! +extend type Mutation { + createProjectMember(input: CreateProjectMember!): CreateProjectMemberPayload! + deleteProjectMember(input: DeleteProjectMember!): DeleteProjectMemberPayload! + updateProjectMemberRole(input: UpdateProjectMemberRole!): UpdateProjectMemberRolePayload! + setProjectOwner(input: SetProjectOwner!): SetProjectOwnerPayload! } -type ToggleTaskLabelPayload { - active: Boolean! - task: Task! -} - -input UpdateProjectName { +input CreateProjectMember { projectID: UUID! + userID: UUID! +} + +type CreateProjectMemberPayload { + ok: Boolean! + member: Member! +} + +input DeleteProjectMember { + projectID: UUID! + userID: UUID! +} + +type DeleteProjectMemberPayload { + ok: Boolean! + member: Member! + projectID: UUID! +} + +input UpdateProjectMemberRole { + projectID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateProjectMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetProjectOwner { + projectID: UUID! + ownerID: UUID! +} +type SetProjectOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} + +extend type Mutation { + createTask(input: NewTask!): Task! + deleteTask(input: DeleteTaskInput!): DeleteTaskPayload! + + updateTaskDescription(input: UpdateTaskDescriptionInput!): Task! + updateTaskLocation(input: NewTaskLocation!): UpdateTaskLocationPayload! + updateTaskName(input: UpdateTaskName!): Task! + setTaskComplete(input: SetTaskComplete!): Task! + updateTaskDueDate(input: UpdateTaskDueDate!): Task! + + assignTask(input: AssignTaskInput): Task! + unassignTask(input: UnassignTaskInput): Task! +} + +input NewTask { + taskGroupID: String! name: String! + position: Float! +} + +input AssignTaskInput { + taskID: UUID! + userID: UUID! +} + +input UnassignTaskInput { + taskID: UUID! + userID: UUID! +} + +input UpdateTaskDescriptionInput { + taskID: UUID! + description: String! } type UpdateTaskLocationPayload { @@ -302,11 +324,6 @@ type UpdateTaskLocationPayload { task: Task! } -input UpdateTaskGroupName { - taskGroupID: UUID! - name: String! -} - input UpdateTaskDueDate { taskID: UUID! dueDate: Time @@ -317,12 +334,46 @@ input SetTaskComplete { complete: Boolean! } +input NewTaskLocation { + taskID: UUID! + taskGroupID: UUID! + position: Float! +} + +input DeleteTaskInput { + taskID: String! +} + +type DeleteTaskPayload { + taskID: String! +} + +input UpdateTaskName { + taskID: String! + name: String! +} + +extend type Mutation { + createTaskChecklist(input: CreateTaskChecklist!): TaskChecklist! + deleteTaskChecklist(input: DeleteTaskChecklist!): DeleteTaskChecklistPayload! + updateTaskChecklistName(input: UpdateTaskChecklistName!): TaskChecklist! + createTaskChecklistItem(input: CreateTaskChecklistItem!): TaskChecklistItem! + updateTaskChecklistItemName(input: UpdateTaskChecklistItemName!): TaskChecklistItem! + setTaskChecklistItemComplete(input: SetTaskChecklistItemComplete!): TaskChecklistItem! + deleteTaskChecklistItem(input: DeleteTaskChecklistItem!): DeleteTaskChecklistItemPayload! +} + input CreateTaskChecklist { taskID: UUID! name: String! position: Float! } +type DeleteTaskChecklistItemPayload { + ok: Boolean! + taskChecklistItem: TaskChecklistItem! +} + input CreateTaskChecklistItem { taskChecklistID: UUID! name: String! @@ -333,6 +384,7 @@ input SetTaskChecklistItemComplete { taskChecklistItemID: UUID! complete: Boolean! } + input DeleteTaskChecklistItem { taskChecklistItemID: UUID! } @@ -342,44 +394,6 @@ input UpdateTaskChecklistItemName { name: String! } -input CreateTeamMember { - userID: UUID! - teamID: UUID! -} - -type CreateTeamMemberPayload { - team: Team! - teamMember: ProjectMember! -} - -input DeleteProject { - projectID: UUID! -} - -type DeleteProjectPayload { - ok: Boolean! - project: Project! -} - -input DeleteTeam { - teamID: UUID! -} - -type DeleteTeamPayload { - ok: Boolean! - team: Team! - projects: [Project!]! -} - -input DeleteUserAccount { - userID: UUID! -} - -type DeleteUserAccountPayload { - ok: Boolean! - userAccount: UserAccount! -} - input UpdateTaskChecklistName { taskChecklistID: UUID! name: String! @@ -391,54 +405,163 @@ type DeleteTaskChecklistPayload { ok: Boolean! taskChecklist: TaskChecklist! } -type Mutation { - createRefreshToken(input: NewRefreshToken!): RefreshToken! - - createUserAccount(input: NewUserAccount!): UserAccount! - deleteUserAccount(input: DeleteUserAccount!): DeleteUserAccountPayload! - - deleteTeam(input: DeleteTeam!): DeleteTeamPayload! - createTeam(input: NewTeam!): Team! - clearProfileAvatar: UserAccount! - - createTeamMember(input: CreateTeamMember!): CreateTeamMemberPayload! - - createProject(input: NewProject!): Project! - deleteProject(input: DeleteProject!): DeleteProjectPayload! - updateProjectName(input: UpdateProjectName): Project! - - createProjectLabel(input: NewProjectLabel!): ProjectLabel! - deleteProjectLabel(input: DeleteProjectLabel!): ProjectLabel! - updateProjectLabel(input: UpdateProjectLabel!): ProjectLabel! - updateProjectLabelName(input: UpdateProjectLabelName!): ProjectLabel! - updateProjectLabelColor(input: UpdateProjectLabelColor!): ProjectLabel! +extend type Mutation { createTaskGroup(input: NewTaskGroup!): TaskGroup! updateTaskGroupLocation(input: NewTaskGroupLocation!): TaskGroup! updateTaskGroupName(input: UpdateTaskGroupName!): TaskGroup! deleteTaskGroup(input: DeleteTaskGroupInput!): DeleteTaskGroupPayload! +} +input NewTaskGroupLocation { + taskGroupID: UUID! + position: Float! +} + +input UpdateTaskGroupName { + taskGroupID: UUID! + name: String! +} + +input DeleteTaskGroupInput { + taskGroupID: UUID! +} + +type DeleteTaskGroupPayload { + ok: Boolean! + affectedRows: Int! + taskGroup: TaskGroup! +} + +input NewTaskGroup { + projectID: String! + name: String! + position: Float! +} + +input AddTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +input RemoveTaskLabelInput { + taskLabelID: UUID! +} +input ToggleTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +type ToggleTaskLabelPayload { + active: Boolean! + task: Task! +} +extend type Mutation { addTaskLabel(input: AddTaskLabelInput): Task! removeTaskLabel(input: RemoveTaskLabelInput): Task! toggleTaskLabel(input: ToggleTaskLabelInput!): ToggleTaskLabelPayload! - - createTaskChecklist(input: CreateTaskChecklist!): TaskChecklist! - deleteTaskChecklist(input: DeleteTaskChecklist!): DeleteTaskChecklistPayload! - updateTaskChecklistName(input: UpdateTaskChecklistName!): TaskChecklist! - createTaskChecklistItem(input: CreateTaskChecklistItem!): TaskChecklistItem! - updateTaskChecklistItemName(input: UpdateTaskChecklistItemName!): TaskChecklistItem! - setTaskChecklistItemComplete(input: SetTaskChecklistItemComplete!): TaskChecklistItem! - deleteTaskChecklistItem(input: DeleteTaskChecklistItem!): DeleteTaskChecklistItemPayload! - - createTask(input: NewTask!): Task! - updateTaskDescription(input: UpdateTaskDescriptionInput!): Task! - updateTaskLocation(input: NewTaskLocation!): UpdateTaskLocationPayload! - updateTaskName(input: UpdateTaskName!): Task! - setTaskComplete(input: SetTaskComplete!): Task! - updateTaskDueDate(input: UpdateTaskDueDate!): Task! - deleteTask(input: DeleteTaskInput!): DeleteTaskPayload! - assignTask(input: AssignTaskInput): Task! - unassignTask(input: UnassignTaskInput): Task! - - logoutUser(input: LogoutUser!): Boolean! } + +extend type Mutation { + deleteTeam(input: DeleteTeam!): DeleteTeamPayload! + createTeam(input: NewTeam!): Team! +} + +input NewTeam { + name: String! + organizationID: UUID! +} + +input DeleteTeam { + teamID: UUID! +} + +type DeleteTeamPayload { + ok: Boolean! + team: Team! + projects: [Project!]! +} + +extend type Mutation { + setTeamOwner(input: SetTeamOwner!): SetTeamOwnerPayload! + createTeamMember(input: CreateTeamMember!): CreateTeamMemberPayload! + updateTeamMemberRole(input: UpdateTeamMemberRole!): UpdateTeamMemberRolePayload! + deleteTeamMember(input: DeleteTeamMember!): DeleteTeamMemberPayload! +} + +input DeleteTeamMember { + teamID: UUID! + userID: UUID! +} + +type DeleteTeamMemberPayload { + teamID: UUID! + userID: UUID! +} + +input CreateTeamMember { + userID: UUID! + teamID: UUID! +} + +type CreateTeamMemberPayload { + team: Team! + teamMember: Member! +} + +input UpdateTeamMemberRole { + teamID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateTeamMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetTeamOwner { + teamID: UUID! + userID: UUID! +} + +type SetTeamOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} + +extend type Mutation { + createRefreshToken(input: NewRefreshToken!): RefreshToken! + createUserAccount(input: NewUserAccount!): UserAccount! + deleteUserAccount(input: DeleteUserAccount!): DeleteUserAccountPayload! + logoutUser(input: LogoutUser!): Boolean! + clearProfileAvatar: UserAccount! +} + +input NewRefreshToken { + userId: String! +} + +input NewUserAccount { + username: String! + email: String! + fullName: String! + initials: String! + password: String! + roleCode: String! +} + +input LogoutUser { + userID: String! +} + +input DeleteUserAccount { + userID: UUID! +} + +type DeleteUserAccountPayload { + ok: Boolean! + userAccount: UserAccount! +} + diff --git a/api/internal/graph/schema.graphqls.bak b/api/internal/graph/schema.graphqls.bak new file mode 100644 index 0000000..49449c1 --- /dev/null +++ b/api/internal/graph/schema.graphqls.bak @@ -0,0 +1,560 @@ +scalar Time +scalar UUID +scalar Upload + +enum RoleCode { + owner + admin + member + observer +} + +type ProjectLabel { + id: ID! + createdDate: Time! + labelColor: LabelColor! + name: String +} + +type LabelColor { + id: ID! + name: String! + position: Float! + colorHex: String! +} + +type TaskLabel { + id: ID! + projectLabel: ProjectLabel! + assignedDate: Time! +} + +type ProfileIcon { + url: String + initials: String + bgColor: String +} + +type Member { + id: ID! + role: Role! + fullName: String! + username: String! + profileIcon: ProfileIcon! +} + +type RefreshToken { + id: ID! + userId: UUID! + expiresAt: Time! + createdAt: Time! +} + +type Role { + code: String! + name: String! +} + +type UserAccount { + id: ID! + email: String! + createdAt: Time! + fullName: String! + initials: String! + role: Role! + username: String! + profileIcon: ProfileIcon! +} + +type Team { + id: ID! + createdAt: Time! + name: String! + members: [Member!]! +} + +type Project { + id: ID! + createdAt: Time! + name: String! + team: Team! + owner: Member! + taskGroups: [TaskGroup!]! + members: [Member!]! + labels: [ProjectLabel!]! +} + +type TaskGroup { + id: ID! + projectID: String! + createdAt: Time! + name: String! + position: Float! + tasks: [Task!]! +} + +type ChecklistBadge { + complete: Int! + total: Int! +} + +type TaskBadges { + checklist: ChecklistBadge +} + +type Task { + id: ID! + taskGroup: TaskGroup! + createdAt: Time! + name: String! + position: Float! + description: String + dueDate: Time + complete: Boolean! + assigned: [Member!]! + labels: [TaskLabel!]! + checklists: [TaskChecklist!]! + badges: TaskBadges! +} + +input ProjectsFilter { + teamID: UUID +} + +input FindUser { + userId: String! +} + +input FindProject { + projectId: String! +} + +input FindTask { + taskID: UUID! +} + +type Organization { + id: ID! + name: String! +} + + +input ProjectsFilter { + teamID: UUID +} + +input FindUser { + userId: String! +} + +input FindProject { + projectId: String! +} + +input FindTask { + taskID: UUID! +} + +type Organization { + id: ID! + name: String! +} + +input FindTeam { + teamID: UUID! +} + +type Query { + organizations: [Organization!]! + users: [UserAccount!]! + findUser(input: FindUser!): UserAccount! + findProject(input: FindProject!): Project! + findTask(input: FindTask!): Task! + projects(input: ProjectsFilter): [Project!]! + findTeam(input: FindTeam!): Team! + teams: [Team!]! + labelColors: [LabelColor!]! + taskGroups: [TaskGroup!]! + me: UserAccount! +} + +type Mutation {} + +extend type Mutation { + createTask(input: NewTask!): Task! + deleteTask(input: DeleteTaskInput!): DeleteTaskPayload! + + updateTaskDescription(input: UpdateTaskDescriptionInput!): Task! + updateTaskLocation(input: NewTaskLocation!): UpdateTaskLocationPayload! + updateTaskName(input: UpdateTaskName!): Task! + setTaskComplete(input: SetTaskComplete!): Task! + updateTaskDueDate(input: UpdateTaskDueDate!): Task! + + assignTask(input: AssignTaskInput): Task! + unassignTask(input: UnassignTaskInput): Task! +} + +input NewRefreshToken { + userId: String! +} + +input NewUserAccount { + username: String! + email: String! + fullName: String! + initials: String! + password: String! + roleCode: String! +} + +input NewTeam { + name: String! + organizationID: UUID! +} + +input NewProject { + userID: UUID! + teamID: UUID! + name: String! +} + +input NewTaskGroup { + projectID: String! + name: String! + position: Float! +} + +input LogoutUser { + userID: String! +} +input NewTask { + taskGroupID: String! + name: String! + position: Float! +} +input NewTaskLocation { + taskID: UUID! + taskGroupID: UUID! + position: Float! +} + +input DeleteTaskInput { + taskID: String! +} + +type DeleteTaskPayload { + taskID: String! +} + +input UpdateTaskName { + taskID: String! + name: String! +} + +input NewTaskGroupLocation { + taskGroupID: UUID! + position: Float! +} + +input DeleteTaskGroupInput { + taskGroupID: UUID! +} + +type DeleteTaskGroupPayload { + ok: Boolean! + affectedRows: Int! + taskGroup: TaskGroup! +} + +type DeleteTaskChecklistItemPayload { + ok: Boolean! + taskChecklistItem: TaskChecklistItem! +} + +type TaskChecklistItem { + id: ID! + name: String! + taskChecklistID: UUID! + complete: Boolean! + position: Float! + dueDate: Time! +} + +type TaskChecklist { + id: ID! + name: String! + position: Float! + items: [TaskChecklistItem!]! +} + +input AssignTaskInput { + taskID: UUID! + userID: UUID! +} + +input UnassignTaskInput { + taskID: UUID! + userID: UUID! +} +input UpdateTaskDescriptionInput { + taskID: UUID! + description: String! +} + +input AddTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +input RemoveTaskLabelInput { + taskLabelID: UUID! +} + +input NewProjectLabel { + projectID: UUID! + labelColorID: UUID! + name: String +} + +input DeleteProjectLabel { + projectLabelID: UUID! +} + +input UpdateProjectLabelName { + projectLabelID: UUID! + name: String! +} + +input UpdateProjectLabel { + projectLabelID: UUID! + labelColorID: UUID! + name: String! +} + +input UpdateProjectLabelColor { + projectLabelID: UUID! + labelColorID: UUID! +} + +input ToggleTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +type ToggleTaskLabelPayload { + active: Boolean! + task: Task! +} + +input UpdateProjectName { + projectID: UUID! + name: String! +} + +type UpdateTaskLocationPayload { + previousTaskGroupID: UUID! + task: Task! +} + +input UpdateTaskGroupName { + taskGroupID: UUID! + name: String! +} + +input UpdateTaskDueDate { + taskID: UUID! + dueDate: Time +} + +input SetTaskComplete { + taskID: UUID! + complete: Boolean! +} + +input CreateTaskChecklist { + taskID: UUID! + name: String! + position: Float! +} + +input CreateTaskChecklistItem { + taskChecklistID: UUID! + name: String! + position: Float! +} + +input SetTaskChecklistItemComplete { + taskChecklistItemID: UUID! + complete: Boolean! +} +input DeleteTaskChecklistItem { + taskChecklistItemID: UUID! +} + +input UpdateTaskChecklistItemName { + taskChecklistItemID: UUID! + name: String! +} + +input CreateTeamMember { + userID: UUID! + teamID: UUID! +} + +type CreateTeamMemberPayload { + team: Team! + teamMember: Member! +} + +input DeleteProject { + projectID: UUID! +} + +type DeleteProjectPayload { + ok: Boolean! + project: Project! +} + +input DeleteTeam { + teamID: UUID! +} + +type DeleteTeamPayload { + ok: Boolean! + team: Team! + projects: [Project!]! +} + +input DeleteUserAccount { + userID: UUID! +} + +type DeleteUserAccountPayload { + ok: Boolean! + userAccount: UserAccount! +} + +input UpdateTaskChecklistName { + taskChecklistID: UUID! + name: String! +} +input DeleteTaskChecklist { + taskChecklistID: UUID! +} +type DeleteTaskChecklistPayload { + ok: Boolean! + taskChecklist: TaskChecklist! +} + +input CreateProjectMember { + projectID: UUID! + userID: UUID! +} + +type CreateProjectMemberPayload { + ok: Boolean! + member: Member! +} + +input DeleteProjectMember { + projectID: UUID! + userID: UUID! +} + +type DeleteProjectMemberPayload { + ok: Boolean! + member: Member! + projectID: UUID! +} + +input UpdateProjectMemberRole { + projectID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateProjectMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetProjectOwner { + projectID: UUID! + ownerID: UUID! +} +type SetProjectOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} + +input UpdateTeamMemberRole { + teamID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateTeamMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetTeamOwner { + teamID: UUID! + userID: UUID! +} + +type SetTeamOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} + +type Mutation { + createRefreshToken(input: NewRefreshToken!): RefreshToken! + + createUserAccount(input: NewUserAccount!): UserAccount! + deleteUserAccount(input: DeleteUserAccount!): DeleteUserAccountPayload! + + deleteTeam(input: DeleteTeam!): DeleteTeamPayload! + createTeam(input: NewTeam!): Team! + clearProfileAvatar: UserAccount! + + createTeamMember(input: CreateTeamMember!): CreateTeamMemberPayload! + updateTeamMemberRole(input: UpdateTeamMemberRole!): UpdateTeamMemberRolePayload! + setTeamOwner(input: SetTeamOwner!): SetTeamOwnerPayload! + + createProject(input: NewProject!): Project! + deleteProject(input: DeleteProject!): DeleteProjectPayload! + updateProjectName(input: UpdateProjectName): Project! + createProjectMember(input: CreateProjectMember!): CreateProjectMemberPayload! + deleteProjectMember(input: DeleteProjectMember!): DeleteProjectMemberPayload! + updateProjectMemberRole(input: UpdateProjectMemberRole!): UpdateProjectMemberRolePayload! + setProjectOwner(input: SetProjectOwner!): SetProjectOwnerPayload! + + createProjectLabel(input: NewProjectLabel!): ProjectLabel! + deleteProjectLabel(input: DeleteProjectLabel!): ProjectLabel! + updateProjectLabel(input: UpdateProjectLabel!): ProjectLabel! + updateProjectLabelName(input: UpdateProjectLabelName!): ProjectLabel! + updateProjectLabelColor(input: UpdateProjectLabelColor!): ProjectLabel! + + createTaskGroup(input: NewTaskGroup!): TaskGroup! + updateTaskGroupLocation(input: NewTaskGroupLocation!): TaskGroup! + updateTaskGroupName(input: UpdateTaskGroupName!): TaskGroup! + deleteTaskGroup(input: DeleteTaskGroupInput!): DeleteTaskGroupPayload! + + addTaskLabel(input: AddTaskLabelInput): Task! + removeTaskLabel(input: RemoveTaskLabelInput): Task! + toggleTaskLabel(input: ToggleTaskLabelInput!): ToggleTaskLabelPayload! + + createTaskChecklist(input: CreateTaskChecklist!): TaskChecklist! + deleteTaskChecklist(input: DeleteTaskChecklist!): DeleteTaskChecklistPayload! + updateTaskChecklistName(input: UpdateTaskChecklistName!): TaskChecklist! + createTaskChecklistItem(input: CreateTaskChecklistItem!): TaskChecklistItem! + updateTaskChecklistItemName(input: UpdateTaskChecklistItemName!): TaskChecklistItem! + setTaskChecklistItemComplete(input: SetTaskChecklistItemComplete!): TaskChecklistItem! + deleteTaskChecklistItem(input: DeleteTaskChecklistItem!): DeleteTaskChecklistItemPayload! + + logoutUser(input: LogoutUser!): Boolean! +} + diff --git a/api/graph/schema.resolvers.go b/api/internal/graph/schema.resolvers.go similarity index 51% rename from api/graph/schema.resolvers.go rename to api/internal/graph/schema.resolvers.go index d4b4f82..f4b94b7 100644 --- a/api/graph/schema.resolvers.go +++ b/api/internal/graph/schema.resolvers.go @@ -6,56 +6,530 @@ package graph import ( "context" "database/sql" + "errors" "fmt" "time" "github.com/google/uuid" - "github.com/jordanknott/project-citadel/api/pg" + "github.com/jordanknott/project-citadel/api/internal/db" log "github.com/sirupsen/logrus" "github.com/vektah/gqlparser/v2/gqlerror" "golang.org/x/crypto/bcrypt" ) -func (r *labelColorResolver) ID(ctx context.Context, obj *pg.LabelColor) (uuid.UUID, error) { +func (r *labelColorResolver) ID(ctx context.Context, obj *db.LabelColor) (uuid.UUID, error) { return obj.LabelColorID, nil } -func (r *mutationResolver) CreateRefreshToken(ctx context.Context, input NewRefreshToken) (*pg.RefreshToken, error) { - userID := uuid.MustParse("0183d9ab-d0ed-4c9b-a3df-77a0cdd93dca") - refreshCreatedAt := time.Now().UTC() - refreshExpiresAt := refreshCreatedAt.AddDate(0, 0, 1) - refreshToken, err := r.Repository.CreateRefreshToken(ctx, pg.CreateRefreshTokenParams{userID, refreshCreatedAt, refreshExpiresAt}) - return &refreshToken, err -} - -func (r *mutationResolver) CreateUserAccount(ctx context.Context, input NewUserAccount) (*pg.UserAccount, error) { +func (r *mutationResolver) CreateProject(ctx context.Context, input NewProject) (*db.Project, error) { createdAt := time.Now().UTC() - hashedPwd, err := bcrypt.GenerateFromPassword([]byte(input.Password), 14) - if err != nil { - return &pg.UserAccount{}, err - } - userAccount, err := r.Repository.CreateUserAccount(ctx, pg.CreateUserAccountParams{ - FullName: input.FullName, - Initials: input.Initials, - Email: input.Email, - Username: input.Username, - CreatedAt: createdAt, - PasswordHash: string(hashedPwd), - }) - return &userAccount, err + project, err := r.Repository.CreateProject(ctx, db.CreateProjectParams{input.UserID, input.TeamID, createdAt, input.Name}) + return &project, err } -func (r *mutationResolver) DeleteUserAccount(ctx context.Context, input DeleteUserAccount) (*DeleteUserAccountPayload, error) { +func (r *mutationResolver) DeleteProject(ctx context.Context, input DeleteProject) (*DeleteProjectPayload, error) { + project, err := r.Repository.GetProjectByID(ctx, input.ProjectID) + if err != nil { + return &DeleteProjectPayload{Ok: false}, err + } + err = r.Repository.DeleteProjectByID(ctx, input.ProjectID) + if err != nil { + return &DeleteProjectPayload{Ok: false}, err + } + return &DeleteProjectPayload{Project: &project, Ok: true}, err +} + +func (r *mutationResolver) UpdateProjectName(ctx context.Context, input *UpdateProjectName) (*db.Project, error) { + project, err := r.Repository.UpdateProjectNameByID(ctx, db.UpdateProjectNameByIDParams{ProjectID: input.ProjectID, Name: input.Name}) + if err != nil { + return &db.Project{}, err + } + return &project, nil +} + +func (r *mutationResolver) CreateProjectLabel(ctx context.Context, input NewProjectLabel) (*db.ProjectLabel, error) { + createdAt := time.Now().UTC() + + var name sql.NullString + if input.Name != nil { + name = sql.NullString{ + *input.Name, + true, + } + } else { + name = sql.NullString{ + "", + false, + } + } + projectLabel, err := r.Repository.CreateProjectLabel(ctx, db.CreateProjectLabelParams{input.ProjectID, input.LabelColorID, createdAt, name}) + return &projectLabel, err +} + +func (r *mutationResolver) DeleteProjectLabel(ctx context.Context, input DeleteProjectLabel) (*db.ProjectLabel, error) { + label, err := r.Repository.GetProjectLabelByID(ctx, input.ProjectLabelID) + if err != nil { + return &db.ProjectLabel{}, err + } + err = r.Repository.DeleteProjectLabelByID(ctx, input.ProjectLabelID) + return &label, err +} + +func (r *mutationResolver) UpdateProjectLabel(ctx context.Context, input UpdateProjectLabel) (*db.ProjectLabel, error) { + label, err := r.Repository.UpdateProjectLabel(ctx, db.UpdateProjectLabelParams{ProjectLabelID: input.ProjectLabelID, LabelColorID: input.LabelColorID, Name: sql.NullString{String: input.Name, Valid: true}}) + return &label, err +} + +func (r *mutationResolver) UpdateProjectLabelName(ctx context.Context, input UpdateProjectLabelName) (*db.ProjectLabel, error) { + label, err := r.Repository.UpdateProjectLabelName(ctx, db.UpdateProjectLabelNameParams{ProjectLabelID: input.ProjectLabelID, Name: sql.NullString{String: input.Name, Valid: true}}) + return &label, err +} + +func (r *mutationResolver) UpdateProjectLabelColor(ctx context.Context, input UpdateProjectLabelColor) (*db.ProjectLabel, error) { + label, err := r.Repository.UpdateProjectLabelColor(ctx, db.UpdateProjectLabelColorParams{ProjectLabelID: input.ProjectLabelID, LabelColorID: input.LabelColorID}) + return &label, err +} + +func (r *mutationResolver) CreateProjectMember(ctx context.Context, input CreateProjectMember) (*CreateProjectMemberPayload, error) { + addedAt := time.Now().UTC() + _, err := r.Repository.CreateProjectMember(ctx, db.CreateProjectMemberParams{ProjectID: input.ProjectID, UserID: input.UserID, AddedAt: addedAt, RoleCode: "member"}) + if err != nil { + return &CreateProjectMemberPayload{Ok: false}, err + } user, err := r.Repository.GetUserAccountByID(ctx, input.UserID) if err != nil { - return &DeleteUserAccountPayload{Ok: false}, err + return &CreateProjectMemberPayload{Ok: false}, err + } + var url *string + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} + + role, err := r.Repository.GetRoleForProjectMemberByUserID(ctx, db.GetRoleForProjectMemberByUserIDParams{UserID: input.UserID, ProjectID: input.ProjectID}) + if err != nil { + return &CreateProjectMemberPayload{Ok: false}, err + } + return &CreateProjectMemberPayload{Ok: true, Member: &Member{ + ID: input.UserID, + FullName: user.FullName, + ProfileIcon: profileIcon, + Role: &db.Role{Code: role.Code, Name: role.Name}, + }}, nil +} + +func (r *mutationResolver) DeleteProjectMember(ctx context.Context, input DeleteProjectMember) (*DeleteProjectMemberPayload, error) { + err := r.Repository.DeleteProjectMember(ctx, db.DeleteProjectMemberParams{UserID: input.UserID, ProjectID: input.ProjectID}) + if err != nil { + return &DeleteProjectMemberPayload{Ok: false}, err + } + user, err := r.Repository.GetUserAccountByID(ctx, input.UserID) + if err != nil { + return &DeleteProjectMemberPayload{Ok: false}, err + } + var url *string + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} + role, err := r.Repository.GetRoleForProjectMemberByUserID(ctx, db.GetRoleForProjectMemberByUserIDParams{UserID: input.UserID, ProjectID: input.ProjectID}) + if err != nil { + return &DeleteProjectMemberPayload{Ok: false}, err + } + return &DeleteProjectMemberPayload{Ok: true, Member: &Member{ + ID: input.UserID, + FullName: user.FullName, + ProfileIcon: profileIcon, + Role: &db.Role{Code: role.Code, Name: role.Name}, + }, ProjectID: input.ProjectID}, nil +} + +func (r *mutationResolver) UpdateProjectMemberRole(ctx context.Context, input UpdateProjectMemberRole) (*UpdateProjectMemberRolePayload, error) { + if input.RoleCode == RoleCodeOwner { + return &UpdateProjectMemberRolePayload{Ok: false}, errors.New("can not set project owner through this mutation") + } + user, err := r.Repository.GetUserAccountByID(ctx, input.UserID) + if err != nil { + log.WithError(err).Error("get user account") + return &UpdateProjectMemberRolePayload{Ok: false}, err + } + _, err = r.Repository.UpdateProjectMemberRole(ctx, db.UpdateProjectMemberRoleParams{ProjectID: input.ProjectID, + UserID: input.UserID, RoleCode: input.RoleCode.String()}) + if err != nil { + log.WithError(err).Error("update project member role") + return &UpdateProjectMemberRolePayload{Ok: false}, err + } + role, err := r.Repository.GetRoleForProjectMemberByUserID(ctx, db.GetRoleForProjectMemberByUserIDParams{UserID: user.UserID, ProjectID: input.ProjectID}) + if err != nil { + log.WithError(err).Error("get role for project member") + return &UpdateProjectMemberRolePayload{Ok: false}, err + } + var url *string + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + member := Member{ID: user.UserID, FullName: user.FullName, ProfileIcon: profileIcon, + Role: &db.Role{Code: role.Code, Name: role.Name}, + } + return &UpdateProjectMemberRolePayload{Ok: true, Member: &member}, err +} + +func (r *mutationResolver) SetProjectOwner(ctx context.Context, input SetProjectOwner) (*SetProjectOwnerPayload, error) { + project, err := r.Repository.GetProjectByID(ctx, input.ProjectID) + if project.Owner == input.OwnerID { + return &SetProjectOwnerPayload{Ok: false}, errors.New("new project owner is already project owner") + } + _, err = r.Repository.SetProjectOwner(ctx, db.SetProjectOwnerParams{Owner: input.OwnerID, ProjectID: input.ProjectID}) + if err != nil { + return &SetProjectOwnerPayload{Ok: false}, err + } + err = r.Repository.DeleteProjectMember(ctx, db.DeleteProjectMemberParams{ProjectID: input.ProjectID, UserID: input.OwnerID}) + if err != nil { + return &SetProjectOwnerPayload{Ok: false}, err } - err = r.Repository.DeleteUserAccountByID(ctx, input.UserID) + addedAt := time.Now().UTC() + _, err = r.Repository.CreateProjectMember(ctx, db.CreateProjectMemberParams{ProjectID: input.ProjectID, + UserID: project.Owner, RoleCode: RoleCodeAdmin.String(), AddedAt: addedAt}) if err != nil { - return &DeleteUserAccountPayload{Ok: false}, err + return &SetProjectOwnerPayload{Ok: false}, err } - return &DeleteUserAccountPayload{UserAccount: &user, Ok: true}, nil + + oldUser, err := r.Repository.GetUserAccountByID(ctx, project.Owner) + var url *string + if oldUser.ProfileAvatarUrl.Valid { + url = &oldUser.ProfileAvatarUrl.String + } + profileIcon := &ProfileIcon{url, &oldUser.Initials, &oldUser.ProfileBgColor} + oldUserRole := db.Role{Code: "admin", Name: "Admin"} + oldMember := &Member{ + ID: oldUser.UserID, + Username: oldUser.Username, + FullName: oldUser.FullName, + ProfileIcon: profileIcon, + Role: &oldUserRole, + } + + newUser, err := r.Repository.GetUserAccountByID(ctx, input.OwnerID) + + if newUser.ProfileAvatarUrl.Valid { + url = &newUser.ProfileAvatarUrl.String + } + profileIcon = &ProfileIcon{url, &newUser.Initials, &newUser.ProfileBgColor} + newUserRole := db.Role{Code: "owner", Name: "Owner"} + newMember := &Member{ + ID: newUser.UserID, + Username: newUser.Username, + FullName: newUser.FullName, + ProfileIcon: profileIcon, + Role: &newUserRole, + } + + return &SetProjectOwnerPayload{ + Ok: true, + PrevOwner: oldMember, + NewOwner: newMember, + }, nil +} + +func (r *mutationResolver) CreateTask(ctx context.Context, input NewTask) (*db.Task, error) { + taskGroupID, err := uuid.Parse(input.TaskGroupID) + createdAt := time.Now().UTC() + if err != nil { + return &db.Task{}, err + } + + task, err := r.Repository.CreateTask(ctx, db.CreateTaskParams{taskGroupID, createdAt, input.Name, input.Position}) + return &task, err +} + +func (r *mutationResolver) DeleteTask(ctx context.Context, input DeleteTaskInput) (*DeleteTaskPayload, error) { + taskID, err := uuid.Parse(input.TaskID) + if err != nil { + return &DeleteTaskPayload{}, err + } + + log.WithFields(log.Fields{ + "taskID": taskID.String(), + }).Info("deleting task") + err = r.Repository.DeleteTaskByID(ctx, taskID) + if err != nil { + return &DeleteTaskPayload{}, err + } + return &DeleteTaskPayload{taskID.String()}, nil +} + +func (r *mutationResolver) UpdateTaskDescription(ctx context.Context, input UpdateTaskDescriptionInput) (*db.Task, error) { + task, err := r.Repository.UpdateTaskDescription(ctx, db.UpdateTaskDescriptionParams{input.TaskID, sql.NullString{String: input.Description, Valid: true}}) + return &task, err +} + +func (r *mutationResolver) UpdateTaskLocation(ctx context.Context, input NewTaskLocation) (*UpdateTaskLocationPayload, error) { + previousTask, err := r.Repository.GetTaskByID(ctx, input.TaskID) + if err != nil { + return &UpdateTaskLocationPayload{}, err + } + task, err := r.Repository.UpdateTaskLocation(ctx, db.UpdateTaskLocationParams{input.TaskID, input.TaskGroupID, input.Position}) + + return &UpdateTaskLocationPayload{Task: &task, PreviousTaskGroupID: previousTask.TaskGroupID}, err +} + +func (r *mutationResolver) UpdateTaskName(ctx context.Context, input UpdateTaskName) (*db.Task, error) { + taskID, err := uuid.Parse(input.TaskID) + if err != nil { + return &db.Task{}, err + } + task, err := r.Repository.UpdateTaskName(ctx, db.UpdateTaskNameParams{taskID, input.Name}) + return &task, err +} + +func (r *mutationResolver) SetTaskComplete(ctx context.Context, input SetTaskComplete) (*db.Task, error) { + task, err := r.Repository.SetTaskComplete(ctx, db.SetTaskCompleteParams{TaskID: input.TaskID, Complete: input.Complete}) + if err != nil { + return &db.Task{}, err + } + return &task, nil +} + +func (r *mutationResolver) UpdateTaskDueDate(ctx context.Context, input UpdateTaskDueDate) (*db.Task, error) { + var dueDate sql.NullTime + if input.DueDate == nil { + dueDate = sql.NullTime{Valid: false, Time: time.Now()} + } else { + dueDate = sql.NullTime{Valid: true, Time: *input.DueDate} + } + task, err := r.Repository.UpdateTaskDueDate(ctx, db.UpdateTaskDueDateParams{ + TaskID: input.TaskID, + DueDate: dueDate, + }) + + return &task, err +} + +func (r *mutationResolver) AssignTask(ctx context.Context, input *AssignTaskInput) (*db.Task, error) { + assignedDate := time.Now().UTC() + assignedTask, err := r.Repository.CreateTaskAssigned(ctx, db.CreateTaskAssignedParams{input.TaskID, input.UserID, assignedDate}) + log.WithFields(log.Fields{ + "userID": assignedTask.UserID, + "taskID": assignedTask.TaskID, + "assignedTaskID": assignedTask.TaskAssignedID, + }).Info("assigned task") + if err != nil { + return &db.Task{}, err + } + task, err := r.Repository.GetTaskByID(ctx, input.TaskID) + return &task, err +} + +func (r *mutationResolver) UnassignTask(ctx context.Context, input *UnassignTaskInput) (*db.Task, error) { + task, err := r.Repository.GetTaskByID(ctx, input.TaskID) + if err != nil { + return &db.Task{}, err + } + _, err = r.Repository.DeleteTaskAssignedByID(ctx, db.DeleteTaskAssignedByIDParams{input.TaskID, input.UserID}) + if err != nil { + return &db.Task{}, err + } + return &task, nil +} + +func (r *mutationResolver) CreateTaskChecklist(ctx context.Context, input CreateTaskChecklist) (*db.TaskChecklist, error) { + createdAt := time.Now().UTC() + taskChecklist, err := r.Repository.CreateTaskChecklist(ctx, db.CreateTaskChecklistParams{ + TaskID: input.TaskID, + CreatedAt: createdAt, + Name: input.Name, + Position: input.Position, + }) + if err != nil { + return &db.TaskChecklist{}, err + } + + return &taskChecklist, nil +} + +func (r *mutationResolver) DeleteTaskChecklist(ctx context.Context, input DeleteTaskChecklist) (*DeleteTaskChecklistPayload, error) { + taskChecklist, err := r.Repository.GetTaskChecklistByID(ctx, input.TaskChecklistID) + if err != nil { + return &DeleteTaskChecklistPayload{Ok: false}, err + } + err = r.Repository.DeleteTaskChecklistByID(ctx, input.TaskChecklistID) + if err != nil { + return &DeleteTaskChecklistPayload{Ok: false}, err + } + return &DeleteTaskChecklistPayload{Ok: true, TaskChecklist: &taskChecklist}, nil +} + +func (r *mutationResolver) UpdateTaskChecklistName(ctx context.Context, input UpdateTaskChecklistName) (*db.TaskChecklist, error) { + checklist, err := r.Repository.UpdateTaskChecklistName(ctx, db.UpdateTaskChecklistNameParams{TaskChecklistID: input.TaskChecklistID, Name: input.Name}) + if err != nil { + return &db.TaskChecklist{}, err + } + return &checklist, nil +} + +func (r *mutationResolver) CreateTaskChecklistItem(ctx context.Context, input CreateTaskChecklistItem) (*db.TaskChecklistItem, error) { + createdAt := time.Now().UTC() + taskChecklistItem, err := r.Repository.CreateTaskChecklistItem(ctx, db.CreateTaskChecklistItemParams{ + TaskChecklistID: input.TaskChecklistID, + CreatedAt: createdAt, + Name: input.Name, + Position: input.Position, + }) + if err != nil { + return &db.TaskChecklistItem{}, err + } + + return &taskChecklistItem, nil +} + +func (r *mutationResolver) UpdateTaskChecklistItemName(ctx context.Context, input UpdateTaskChecklistItemName) (*db.TaskChecklistItem, error) { + task, err := r.Repository.UpdateTaskChecklistItemName(ctx, db.UpdateTaskChecklistItemNameParams{TaskChecklistItemID: input.TaskChecklistItemID, + Name: input.Name, + }) + if err != nil { + return &db.TaskChecklistItem{}, err + } + return &task, nil +} + +func (r *mutationResolver) SetTaskChecklistItemComplete(ctx context.Context, input SetTaskChecklistItemComplete) (*db.TaskChecklistItem, error) { + item, err := r.Repository.SetTaskChecklistItemComplete(ctx, db.SetTaskChecklistItemCompleteParams{TaskChecklistItemID: input.TaskChecklistItemID, Complete: input.Complete}) + if err != nil { + return &db.TaskChecklistItem{}, err + } + return &item, nil +} + +func (r *mutationResolver) DeleteTaskChecklistItem(ctx context.Context, input DeleteTaskChecklistItem) (*DeleteTaskChecklistItemPayload, error) { + item, err := r.Repository.GetTaskChecklistItemByID(ctx, input.TaskChecklistItemID) + if err != nil { + return &DeleteTaskChecklistItemPayload{ + Ok: false, + TaskChecklistItem: &db.TaskChecklistItem{}, + }, err + } + err = r.Repository.DeleteTaskChecklistItem(ctx, input.TaskChecklistItemID) + if err != nil { + return &DeleteTaskChecklistItemPayload{ + Ok: false, + TaskChecklistItem: &db.TaskChecklistItem{}, + }, err + } + return &DeleteTaskChecklistItemPayload{ + Ok: true, + TaskChecklistItem: &item, + }, err +} + +func (r *mutationResolver) CreateTaskGroup(ctx context.Context, input NewTaskGroup) (*db.TaskGroup, error) { + createdAt := time.Now().UTC() + projectID, err := uuid.Parse(input.ProjectID) + if err != nil { + return &db.TaskGroup{}, err + } + project, err := r.Repository.CreateTaskGroup(ctx, + db.CreateTaskGroupParams{projectID, createdAt, input.Name, input.Position}) + return &project, err +} + +func (r *mutationResolver) UpdateTaskGroupLocation(ctx context.Context, input NewTaskGroupLocation) (*db.TaskGroup, error) { + taskGroup, err := r.Repository.UpdateTaskGroupLocation(ctx, db.UpdateTaskGroupLocationParams{ + input.TaskGroupID, + input.Position, + }) + return &taskGroup, err +} + +func (r *mutationResolver) UpdateTaskGroupName(ctx context.Context, input UpdateTaskGroupName) (*db.TaskGroup, error) { + taskGroup, err := r.Repository.SetTaskGroupName(ctx, db.SetTaskGroupNameParams{TaskGroupID: input.TaskGroupID, Name: input.Name}) + if err != nil { + return &db.TaskGroup{}, err + } + return &taskGroup, nil +} + +func (r *mutationResolver) DeleteTaskGroup(ctx context.Context, input DeleteTaskGroupInput) (*DeleteTaskGroupPayload, error) { + deletedTasks, err := r.Repository.DeleteTasksByTaskGroupID(ctx, input.TaskGroupID) + if err != nil { + return &DeleteTaskGroupPayload{}, err + } + taskGroup, err := r.Repository.GetTaskGroupByID(ctx, input.TaskGroupID) + if err != nil { + return &DeleteTaskGroupPayload{}, err + } + deletedTaskGroups, err := r.Repository.DeleteTaskGroupByID(ctx, input.TaskGroupID) + if err != nil { + return &DeleteTaskGroupPayload{}, err + } + return &DeleteTaskGroupPayload{true, int(deletedTasks + deletedTaskGroups), &taskGroup}, nil +} + +func (r *mutationResolver) AddTaskLabel(ctx context.Context, input *AddTaskLabelInput) (*db.Task, error) { + assignedDate := time.Now().UTC() + _, err := r.Repository.CreateTaskLabelForTask(ctx, db.CreateTaskLabelForTaskParams{input.TaskID, input.ProjectLabelID, assignedDate}) + if err != nil { + return &db.Task{}, err + } + task, err := r.Repository.GetTaskByID(ctx, input.TaskID) + return &task, nil +} + +func (r *mutationResolver) RemoveTaskLabel(ctx context.Context, input *RemoveTaskLabelInput) (*db.Task, error) { + taskLabel, err := r.Repository.GetTaskLabelByID(ctx, input.TaskLabelID) + if err != nil { + return &db.Task{}, err + } + task, err := r.Repository.GetTaskByID(ctx, taskLabel.TaskID) + if err != nil { + return &db.Task{}, err + } + err = r.Repository.DeleteTaskLabelByID(ctx, input.TaskLabelID) + return &task, err +} + +func (r *mutationResolver) ToggleTaskLabel(ctx context.Context, input ToggleTaskLabelInput) (*ToggleTaskLabelPayload, error) { + task, err := r.Repository.GetTaskByID(ctx, input.TaskID) + if err != nil { + return &ToggleTaskLabelPayload{}, err + } + + _, err = r.Repository.GetTaskLabelForTaskByProjectLabelID(ctx, db.GetTaskLabelForTaskByProjectLabelIDParams{TaskID: input.TaskID, ProjectLabelID: input.ProjectLabelID}) + createdAt := time.Now().UTC() + + if err == sql.ErrNoRows { + log.WithFields(log.Fields{"err": err}).Warning("no rows") + _, err := r.Repository.CreateTaskLabelForTask(ctx, db.CreateTaskLabelForTaskParams{ + TaskID: input.TaskID, + ProjectLabelID: input.ProjectLabelID, + AssignedDate: createdAt, + }) + if err != nil { + return &ToggleTaskLabelPayload{}, err + } + payload := ToggleTaskLabelPayload{Active: true, Task: &task} + return &payload, nil + } + + if err != nil { + return &ToggleTaskLabelPayload{}, err + } + + err = r.Repository.DeleteTaskLabelForTaskByProjectLabelID(ctx, db.DeleteTaskLabelForTaskByProjectLabelIDParams{ + TaskID: input.TaskID, + ProjectLabelID: input.ProjectLabelID, + }) + + if err != nil { + return &ToggleTaskLabelPayload{}, err + } + + payload := ToggleTaskLabelPayload{Active: false, Task: &task} + return &payload, nil } func (r *mutationResolver) DeleteTeam(ctx context.Context, input DeleteTeam) (*DeleteTeamPayload, error) { @@ -78,25 +552,72 @@ func (r *mutationResolver) DeleteTeam(ctx context.Context, input DeleteTeam) (*D return &DeleteTeamPayload{Ok: true, Team: &team, Projects: projects}, nil } -func (r *mutationResolver) CreateTeam(ctx context.Context, input NewTeam) (*pg.Team, error) { +func (r *mutationResolver) CreateTeam(ctx context.Context, input NewTeam) (*db.Team, error) { + userID, ok := GetUserID(ctx) + if !ok { + return &db.Team{}, fmt.Errorf("internal server error") + } createdAt := time.Now().UTC() - team, err := r.Repository.CreateTeam(ctx, pg.CreateTeamParams{input.OrganizationID, createdAt, input.Name}) + team, err := r.Repository.CreateTeam(ctx, db.CreateTeamParams{OrganizationID: input.OrganizationID, CreatedAt: createdAt, Name: input.Name, Owner: userID}) return &team, err } -func (r *mutationResolver) ClearProfileAvatar(ctx context.Context) (*pg.UserAccount, error) { - userID, ok := GetUserID(ctx) - if !ok { - return &pg.UserAccount{}, fmt.Errorf("internal server error") +func (r *mutationResolver) SetTeamOwner(ctx context.Context, input SetTeamOwner) (*SetTeamOwnerPayload, error) { + team, err := r.Repository.GetTeamByID(ctx, input.TeamID) + if team.Owner == input.UserID { + return &SetTeamOwnerPayload{Ok: false}, errors.New("new project owner is already project owner") } - log.WithFields(log.Fields{ - "userID": userID, - }).Info("getting user account") - user, err := r.Repository.UpdateUserAccountProfileAvatarURL(ctx, pg.UpdateUserAccountProfileAvatarURLParams{UserID: userID, ProfileAvatarUrl: sql.NullString{Valid: false, String: ""}}) + _, err = r.Repository.SetTeamOwner(ctx, db.SetTeamOwnerParams{Owner: input.UserID, TeamID: input.TeamID}) if err != nil { - return &pg.UserAccount{}, err + return &SetTeamOwnerPayload{Ok: false}, errors.New("new project owner is already project owner") } - return &user, nil + err = r.Repository.DeleteTeamMember(ctx, db.DeleteTeamMemberParams{TeamID: input.TeamID, UserID: input.UserID}) + if err != nil { + return &SetTeamOwnerPayload{Ok: false}, errors.New("new project owner is already project owner") + } + + addedAt := time.Now().UTC() + _, err = r.Repository.CreateTeamMember(ctx, db.CreateTeamMemberParams{TeamID: input.TeamID, + UserID: team.Owner, RoleCode: RoleCodeAdmin.String(), Addeddate: addedAt}) + if err != nil { + return &SetTeamOwnerPayload{Ok: false}, errors.New("new project owner is already project owner") + } + + oldUser, err := r.Repository.GetUserAccountByID(ctx, team.Owner) + var url *string + if oldUser.ProfileAvatarUrl.Valid { + url = &oldUser.ProfileAvatarUrl.String + } + profileIcon := &ProfileIcon{url, &oldUser.Initials, &oldUser.ProfileBgColor} + oldUserRole := db.Role{Code: "admin", Name: "Admin"} + oldMember := &Member{ + ID: oldUser.UserID, + Username: oldUser.Username, + FullName: oldUser.FullName, + ProfileIcon: profileIcon, + Role: &oldUserRole, + } + + newUser, err := r.Repository.GetUserAccountByID(ctx, input.UserID) + + if newUser.ProfileAvatarUrl.Valid { + url = &newUser.ProfileAvatarUrl.String + } + profileIcon = &ProfileIcon{url, &newUser.Initials, &newUser.ProfileBgColor} + newUserRole := db.Role{Code: "owner", Name: "Owner"} + newMember := &Member{ + ID: newUser.UserID, + Username: newUser.Username, + FullName: newUser.FullName, + ProfileIcon: profileIcon, + Role: &newUserRole, + } + + return &SetTeamOwnerPayload{ + Ok: true, + PrevOwner: oldMember, + NewOwner: newMember, + }, nil } func (r *mutationResolver) CreateTeamMember(ctx context.Context, input CreateTeamMember) (*CreateTeamMemberPayload, error) { @@ -105,7 +626,7 @@ func (r *mutationResolver) CreateTeamMember(ctx context.Context, input CreateTea if err != nil { return &CreateTeamMemberPayload{}, err } - _, err = r.Repository.CreateTeamMember(ctx, pg.CreateTeamMemberParams{TeamID: input.TeamID, UserID: input.UserID, Addeddate: addedDate}) + _, err = r.Repository.CreateTeamMember(ctx, db.CreateTeamMemberParams{TeamID: input.TeamID, UserID: input.UserID, Addeddate: addedDate, RoleCode: RoleCodeMember.String()}) user, err := r.Repository.GetUserAccountByID(ctx, input.UserID) if err != nil { return &CreateTeamMemberPayload{}, err @@ -117,377 +638,98 @@ func (r *mutationResolver) CreateTeamMember(ctx context.Context, input CreateTea profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} return &CreateTeamMemberPayload{ Team: &team, - TeamMember: &ProjectMember{ + TeamMember: &Member{ ID: user.UserID, + Username: user.Username, FullName: user.FullName, ProfileIcon: profileIcon, + Role: &db.Role{Code: "member", Name: "Member"}, }}, nil } -func (r *mutationResolver) CreateProject(ctx context.Context, input NewProject) (*pg.Project, error) { +func (r *mutationResolver) UpdateTeamMemberRole(ctx context.Context, input UpdateTeamMemberRole) (*UpdateTeamMemberRolePayload, error) { + if input.RoleCode == RoleCodeOwner || input.RoleCode == RoleCodeObserver { + return &UpdateTeamMemberRolePayload{Ok: false}, errors.New("can not set project owner through this mutation") + } + user, err := r.Repository.GetUserAccountByID(ctx, input.UserID) + if err != nil { + log.WithError(err).Error("get user account") + return &UpdateTeamMemberRolePayload{Ok: false}, err + } + _, err = r.Repository.UpdateTeamMemberRole(ctx, db.UpdateTeamMemberRoleParams{TeamID: input.TeamID, + UserID: input.UserID, RoleCode: input.RoleCode.String()}) + if err != nil { + log.WithError(err).Error("update project member role") + return &UpdateTeamMemberRolePayload{Ok: false}, err + } + role, err := r.Repository.GetRoleForTeamMember(ctx, db.GetRoleForTeamMemberParams{UserID: user.UserID, TeamID: input.TeamID}) + if err != nil { + log.WithError(err).Error("get role for project member") + return &UpdateTeamMemberRolePayload{Ok: false}, err + } + var url *string + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + member := Member{ID: user.UserID, FullName: user.FullName, ProfileIcon: profileIcon, + Role: &db.Role{Code: role.Code, Name: role.Name}, + } + return &UpdateTeamMemberRolePayload{Ok: true, Member: &member}, err +} + +func (r *mutationResolver) DeleteTeamMember(ctx context.Context, input DeleteTeamMember) (*DeleteTeamMemberPayload, error) { + _, err := r.Repository.GetTeamMemberByID(ctx, db.GetTeamMemberByIDParams{TeamID: input.TeamID, UserID: input.UserID}) + if err != nil { + return &DeleteTeamMemberPayload{}, err + } + err = r.Repository.DeleteTeamMember(ctx, db.DeleteTeamMemberParams{TeamID: input.TeamID, UserID: input.UserID}) + if err != nil { + return &DeleteTeamMemberPayload{}, err + } + return &DeleteTeamMemberPayload{TeamID: input.TeamID, UserID: input.UserID}, nil +} + +func (r *mutationResolver) CreateRefreshToken(ctx context.Context, input NewRefreshToken) (*db.RefreshToken, error) { + userID := uuid.MustParse("0183d9ab-d0ed-4c9b-a3df-77a0cdd93dca") + refreshCreatedAt := time.Now().UTC() + refreshExpiresAt := refreshCreatedAt.AddDate(0, 0, 1) + refreshToken, err := r.Repository.CreateRefreshToken(ctx, db.CreateRefreshTokenParams{userID, refreshCreatedAt, refreshExpiresAt}) + return &refreshToken, err +} + +func (r *mutationResolver) CreateUserAccount(ctx context.Context, input NewUserAccount) (*db.UserAccount, error) { createdAt := time.Now().UTC() - project, err := r.Repository.CreateProject(ctx, pg.CreateProjectParams{input.UserID, input.TeamID, createdAt, input.Name}) - return &project, err -} - -func (r *mutationResolver) DeleteProject(ctx context.Context, input DeleteProject) (*DeleteProjectPayload, error) { - project, err := r.Repository.GetProjectByID(ctx, input.ProjectID) + hashedPwd, err := bcrypt.GenerateFromPassword([]byte(input.Password), 14) if err != nil { - return &DeleteProjectPayload{Ok: false}, err + return &db.UserAccount{}, err } - err = r.Repository.DeleteProjectByID(ctx, input.ProjectID) - if err != nil { - return &DeleteProjectPayload{Ok: false}, err - } - return &DeleteProjectPayload{Project: &project, Ok: true}, err -} - -func (r *mutationResolver) UpdateProjectName(ctx context.Context, input *UpdateProjectName) (*pg.Project, error) { - project, err := r.Repository.UpdateProjectNameByID(ctx, pg.UpdateProjectNameByIDParams{ProjectID: input.ProjectID, Name: input.Name}) - if err != nil { - return &pg.Project{}, err - } - return &project, nil -} - -func (r *mutationResolver) CreateProjectLabel(ctx context.Context, input NewProjectLabel) (*pg.ProjectLabel, error) { - createdAt := time.Now().UTC() - - var name sql.NullString - if input.Name != nil { - name = sql.NullString{ - *input.Name, - true, - } - } else { - name = sql.NullString{ - "", - false, - } - } - projectLabel, err := r.Repository.CreateProjectLabel(ctx, pg.CreateProjectLabelParams{input.ProjectID, - input.LabelColorID, createdAt, name}) - return &projectLabel, err -} - -func (r *mutationResolver) DeleteProjectLabel(ctx context.Context, input DeleteProjectLabel) (*pg.ProjectLabel, error) { - label, err := r.Repository.GetProjectLabelByID(ctx, input.ProjectLabelID) - if err != nil { - return &pg.ProjectLabel{}, err - } - err = r.Repository.DeleteProjectLabelByID(ctx, input.ProjectLabelID) - return &label, err -} - -func (r *mutationResolver) UpdateProjectLabel(ctx context.Context, input UpdateProjectLabel) (*pg.ProjectLabel, error) { - label, err := r.Repository.UpdateProjectLabel(ctx, pg.UpdateProjectLabelParams{ProjectLabelID: input.ProjectLabelID, LabelColorID: input.LabelColorID, Name: sql.NullString{String: input.Name, Valid: true}}) - return &label, err -} - -func (r *mutationResolver) UpdateProjectLabelName(ctx context.Context, input UpdateProjectLabelName) (*pg.ProjectLabel, error) { - label, err := r.Repository.UpdateProjectLabelName(ctx, pg.UpdateProjectLabelNameParams{ProjectLabelID: input.ProjectLabelID, Name: sql.NullString{String: input.Name, Valid: true}}) - return &label, err -} - -func (r *mutationResolver) UpdateProjectLabelColor(ctx context.Context, input UpdateProjectLabelColor) (*pg.ProjectLabel, error) { - label, err := r.Repository.UpdateProjectLabelColor(ctx, pg.UpdateProjectLabelColorParams{ProjectLabelID: input.ProjectLabelID, LabelColorID: input.LabelColorID}) - return &label, err -} - -func (r *mutationResolver) CreateTaskGroup(ctx context.Context, input NewTaskGroup) (*pg.TaskGroup, error) { - createdAt := time.Now().UTC() - projectID, err := uuid.Parse(input.ProjectID) - if err != nil { - return &pg.TaskGroup{}, err - } - project, err := r.Repository.CreateTaskGroup(ctx, - pg.CreateTaskGroupParams{projectID, createdAt, input.Name, input.Position}) - return &project, err -} - -func (r *mutationResolver) UpdateTaskGroupLocation(ctx context.Context, input NewTaskGroupLocation) (*pg.TaskGroup, error) { - taskGroup, err := r.Repository.UpdateTaskGroupLocation(ctx, pg.UpdateTaskGroupLocationParams{ - input.TaskGroupID, - input.Position, + userAccount, err := r.Repository.CreateUserAccount(ctx, db.CreateUserAccountParams{ + FullName: input.FullName, + RoleCode: input.RoleCode, + Initials: input.Initials, + Email: input.Email, + Username: input.Username, + CreatedAt: createdAt, + PasswordHash: string(hashedPwd), }) - return &taskGroup, err + return &userAccount, err } -func (r *mutationResolver) UpdateTaskGroupName(ctx context.Context, input UpdateTaskGroupName) (*pg.TaskGroup, error) { - taskGroup, err := r.Repository.SetTaskGroupName(ctx, pg.SetTaskGroupNameParams{TaskGroupID: input.TaskGroupID, Name: input.Name}) +func (r *mutationResolver) DeleteUserAccount(ctx context.Context, input DeleteUserAccount) (*DeleteUserAccountPayload, error) { + user, err := r.Repository.GetUserAccountByID(ctx, input.UserID) if err != nil { - return &pg.TaskGroup{}, err + return &DeleteUserAccountPayload{Ok: false}, err } - return &taskGroup, nil -} -func (r *mutationResolver) DeleteTaskGroup(ctx context.Context, input DeleteTaskGroupInput) (*DeleteTaskGroupPayload, error) { - deletedTasks, err := r.Repository.DeleteTasksByTaskGroupID(ctx, input.TaskGroupID) + err = r.Repository.DeleteUserAccountByID(ctx, input.UserID) if err != nil { - return &DeleteTaskGroupPayload{}, err + return &DeleteUserAccountPayload{Ok: false}, err } - taskGroup, err := r.Repository.GetTaskGroupByID(ctx, input.TaskGroupID) - if err != nil { - return &DeleteTaskGroupPayload{}, err - } - deletedTaskGroups, err := r.Repository.DeleteTaskGroupByID(ctx, input.TaskGroupID) - if err != nil { - return &DeleteTaskGroupPayload{}, err - } - return &DeleteTaskGroupPayload{true, int(deletedTasks + deletedTaskGroups), &taskGroup}, nil -} - -func (r *mutationResolver) AddTaskLabel(ctx context.Context, input *AddTaskLabelInput) (*pg.Task, error) { - assignedDate := time.Now().UTC() - _, err := r.Repository.CreateTaskLabelForTask(ctx, pg.CreateTaskLabelForTaskParams{input.TaskID, input.ProjectLabelID, assignedDate}) - if err != nil { - return &pg.Task{}, err - } - task, err := r.Repository.GetTaskByID(ctx, input.TaskID) - return &task, nil -} - -func (r *mutationResolver) RemoveTaskLabel(ctx context.Context, input *RemoveTaskLabelInput) (*pg.Task, error) { - taskLabel, err := r.Repository.GetTaskLabelByID(ctx, input.TaskLabelID) - if err != nil { - return &pg.Task{}, err - } - task, err := r.Repository.GetTaskByID(ctx, taskLabel.TaskID) - if err != nil { - return &pg.Task{}, err - } - err = r.Repository.DeleteTaskLabelByID(ctx, input.TaskLabelID) - return &task, err -} - -func (r *mutationResolver) ToggleTaskLabel(ctx context.Context, input ToggleTaskLabelInput) (*ToggleTaskLabelPayload, error) { - task, err := r.Repository.GetTaskByID(ctx, input.TaskID) - if err != nil { - return &ToggleTaskLabelPayload{}, err - } - - _, err = r.Repository.GetTaskLabelForTaskByProjectLabelID(ctx, pg.GetTaskLabelForTaskByProjectLabelIDParams{TaskID: input.TaskID, ProjectLabelID: input.ProjectLabelID}) - createdAt := time.Now().UTC() - - if err == sql.ErrNoRows { - log.WithFields(log.Fields{"err": err}).Warning("no rows") - _, err := r.Repository.CreateTaskLabelForTask(ctx, pg.CreateTaskLabelForTaskParams{ - TaskID: input.TaskID, - ProjectLabelID: input.ProjectLabelID, - AssignedDate: createdAt, - }) - if err != nil { - return &ToggleTaskLabelPayload{}, err - } - payload := ToggleTaskLabelPayload{Active: true, Task: &task} - return &payload, nil - } - - if err != nil { - return &ToggleTaskLabelPayload{}, err - } - - err = r.Repository.DeleteTaskLabelForTaskByProjectLabelID(ctx, pg.DeleteTaskLabelForTaskByProjectLabelIDParams{ - TaskID: input.TaskID, - ProjectLabelID: input.ProjectLabelID, - }) - - if err != nil { - return &ToggleTaskLabelPayload{}, err - } - - payload := ToggleTaskLabelPayload{Active: false, Task: &task} - return &payload, nil -} - -func (r *mutationResolver) CreateTaskChecklist(ctx context.Context, input CreateTaskChecklist) (*pg.TaskChecklist, error) { - createdAt := time.Now().UTC() - taskChecklist, err := r.Repository.CreateTaskChecklist(ctx, pg.CreateTaskChecklistParams{ - TaskID: input.TaskID, - CreatedAt: createdAt, - Name: input.Name, - Position: input.Position, - }) - if err != nil { - return &pg.TaskChecklist{}, err - } - - return &taskChecklist, nil -} - -func (r *mutationResolver) DeleteTaskChecklist(ctx context.Context, input DeleteTaskChecklist) (*DeleteTaskChecklistPayload, error) { - taskChecklist, err := r.Repository.GetTaskChecklistByID(ctx, input.TaskChecklistID) - if err != nil { - return &DeleteTaskChecklistPayload{Ok: false}, err - } - err = r.Repository.DeleteTaskChecklistByID(ctx, input.TaskChecklistID) - if err != nil { - return &DeleteTaskChecklistPayload{Ok: false}, err - } - return &DeleteTaskChecklistPayload{Ok: true, TaskChecklist: &taskChecklist}, nil -} - -func (r *mutationResolver) UpdateTaskChecklistName(ctx context.Context, input UpdateTaskChecklistName) (*pg.TaskChecklist, error) { - checklist, err := r.Repository.UpdateTaskChecklistName(ctx, pg.UpdateTaskChecklistNameParams{TaskChecklistID: input.TaskChecklistID, Name: input.Name}) - if err != nil { - return &pg.TaskChecklist{}, err - } - return &checklist, nil -} - -func (r *mutationResolver) CreateTaskChecklistItem(ctx context.Context, input CreateTaskChecklistItem) (*pg.TaskChecklistItem, error) { - createdAt := time.Now().UTC() - taskChecklistItem, err := r.Repository.CreateTaskChecklistItem(ctx, pg.CreateTaskChecklistItemParams{ - TaskChecklistID: input.TaskChecklistID, - CreatedAt: createdAt, - Name: input.Name, - Position: input.Position, - }) - if err != nil { - return &pg.TaskChecklistItem{}, err - } - - return &taskChecklistItem, nil -} - -func (r *mutationResolver) UpdateTaskChecklistItemName(ctx context.Context, input UpdateTaskChecklistItemName) (*pg.TaskChecklistItem, error) { - task, err := r.Repository.UpdateTaskChecklistItemName(ctx, pg.UpdateTaskChecklistItemNameParams{TaskChecklistItemID: input.TaskChecklistItemID, - Name: input.Name, - }) - if err != nil { - return &pg.TaskChecklistItem{}, err - } - return &task, nil -} - -func (r *mutationResolver) SetTaskChecklistItemComplete(ctx context.Context, input SetTaskChecklistItemComplete) (*pg.TaskChecklistItem, error) { - item, err := r.Repository.SetTaskChecklistItemComplete(ctx, pg.SetTaskChecklistItemCompleteParams{TaskChecklistItemID: input.TaskChecklistItemID, Complete: input.Complete}) - if err != nil { - return &pg.TaskChecklistItem{}, err - } - return &item, nil -} - -func (r *mutationResolver) DeleteTaskChecklistItem(ctx context.Context, input DeleteTaskChecklistItem) (*DeleteTaskChecklistItemPayload, error) { - item, err := r.Repository.GetTaskChecklistItemByID(ctx, input.TaskChecklistItemID) - if err != nil { - return &DeleteTaskChecklistItemPayload{ - Ok: false, - TaskChecklistItem: &pg.TaskChecklistItem{}, - }, err - } - err = r.Repository.DeleteTaskChecklistItem(ctx, input.TaskChecklistItemID) - if err != nil { - return &DeleteTaskChecklistItemPayload{ - Ok: false, - TaskChecklistItem: &pg.TaskChecklistItem{}, - }, err - } - return &DeleteTaskChecklistItemPayload{ - Ok: true, - TaskChecklistItem: &item, - }, err -} - -func (r *mutationResolver) CreateTask(ctx context.Context, input NewTask) (*pg.Task, error) { - taskGroupID, err := uuid.Parse(input.TaskGroupID) - createdAt := time.Now().UTC() - if err != nil { - return &pg.Task{}, err - } - - task, err := r.Repository.CreateTask(ctx, pg.CreateTaskParams{taskGroupID, createdAt, input.Name, input.Position}) - return &task, err -} - -func (r *mutationResolver) UpdateTaskDescription(ctx context.Context, input UpdateTaskDescriptionInput) (*pg.Task, error) { - task, err := r.Repository.UpdateTaskDescription(ctx, pg.UpdateTaskDescriptionParams{input.TaskID, sql.NullString{String: input.Description, Valid: true}}) - return &task, err -} - -func (r *mutationResolver) UpdateTaskLocation(ctx context.Context, input NewTaskLocation) (*UpdateTaskLocationPayload, error) { - previousTask, err := r.Repository.GetTaskByID(ctx, input.TaskID) - if err != nil { - return &UpdateTaskLocationPayload{}, err - } - task, err := r.Repository.UpdateTaskLocation(ctx, pg.UpdateTaskLocationParams{input.TaskID, input.TaskGroupID, input.Position}) - - return &UpdateTaskLocationPayload{Task: &task, PreviousTaskGroupID: previousTask.TaskGroupID}, err -} - -func (r *mutationResolver) UpdateTaskName(ctx context.Context, input UpdateTaskName) (*pg.Task, error) { - taskID, err := uuid.Parse(input.TaskID) - if err != nil { - return &pg.Task{}, err - } - task, err := r.Repository.UpdateTaskName(ctx, pg.UpdateTaskNameParams{taskID, input.Name}) - return &task, err -} - -func (r *mutationResolver) SetTaskComplete(ctx context.Context, input SetTaskComplete) (*pg.Task, error) { - task, err := r.Repository.SetTaskComplete(ctx, pg.SetTaskCompleteParams{TaskID: input.TaskID, Complete: input.Complete}) - if err != nil { - return &pg.Task{}, err - } - return &task, nil -} - -func (r *mutationResolver) UpdateTaskDueDate(ctx context.Context, input UpdateTaskDueDate) (*pg.Task, error) { - var dueDate sql.NullTime - if input.DueDate == nil { - dueDate = sql.NullTime{Valid: false, Time: time.Now()} - } else { - dueDate = sql.NullTime{Valid: true, Time: *input.DueDate} - } - task, err := r.Repository.UpdateTaskDueDate(ctx, pg.UpdateTaskDueDateParams{ - TaskID: input.TaskID, - DueDate: dueDate, - }) - - return &task, err -} - -func (r *mutationResolver) DeleteTask(ctx context.Context, input DeleteTaskInput) (*DeleteTaskPayload, error) { - taskID, err := uuid.Parse(input.TaskID) - if err != nil { - return &DeleteTaskPayload{}, err - } - - log.WithFields(log.Fields{ - "taskID": taskID.String(), - }).Info("deleting task") - err = r.Repository.DeleteTaskByID(ctx, taskID) - if err != nil { - return &DeleteTaskPayload{}, err - } - return &DeleteTaskPayload{taskID.String()}, nil -} - -func (r *mutationResolver) AssignTask(ctx context.Context, input *AssignTaskInput) (*pg.Task, error) { - assignedDate := time.Now().UTC() - assignedTask, err := r.Repository.CreateTaskAssigned(ctx, pg.CreateTaskAssignedParams{input.TaskID, input.UserID, assignedDate}) - log.WithFields(log.Fields{ - "userID": assignedTask.UserID, - "taskID": assignedTask.TaskID, - "assignedTaskID": assignedTask.TaskAssignedID, - }).Info("assigned task") - if err != nil { - return &pg.Task{}, err - } - task, err := r.Repository.GetTaskByID(ctx, input.TaskID) - return &task, err -} - -func (r *mutationResolver) UnassignTask(ctx context.Context, input *UnassignTaskInput) (*pg.Task, error) { - task, err := r.Repository.GetTaskByID(ctx, input.TaskID) - if err != nil { - return &pg.Task{}, err - } - _, err = r.Repository.DeleteTaskAssignedByID(ctx, pg.DeleteTaskAssignedByIDParams{input.TaskID, input.UserID}) - if err != nil { - return &pg.Task{}, err - } - return &task, nil + return &DeleteUserAccountPayload{UserAccount: &user, Ok: true}, nil } func (r *mutationResolver) LogoutUser(ctx context.Context, input LogoutUser) (bool, error) { @@ -500,43 +742,62 @@ func (r *mutationResolver) LogoutUser(ctx context.Context, input LogoutUser) (bo return true, err } -func (r *organizationResolver) ID(ctx context.Context, obj *pg.Organization) (uuid.UUID, error) { +func (r *mutationResolver) ClearProfileAvatar(ctx context.Context) (*db.UserAccount, error) { + userID, ok := GetUserID(ctx) + if !ok { + return &db.UserAccount{}, fmt.Errorf("internal server error") + } + user, err := r.Repository.UpdateUserAccountProfileAvatarURL(ctx, db.UpdateUserAccountProfileAvatarURLParams{UserID: userID, ProfileAvatarUrl: sql.NullString{Valid: false, String: ""}}) + if err != nil { + return &db.UserAccount{}, err + } + return &user, nil +} + +func (r *organizationResolver) ID(ctx context.Context, obj *db.Organization) (uuid.UUID, error) { return obj.OrganizationID, nil } -func (r *projectResolver) ID(ctx context.Context, obj *pg.Project) (uuid.UUID, error) { +func (r *projectResolver) ID(ctx context.Context, obj *db.Project) (uuid.UUID, error) { return obj.ProjectID, nil } -func (r *projectResolver) Team(ctx context.Context, obj *pg.Project) (*pg.Team, error) { +func (r *projectResolver) Team(ctx context.Context, obj *db.Project) (*db.Team, error) { team, err := r.Repository.GetTeamByID(ctx, obj.TeamID) return &team, err } -func (r *projectResolver) Owner(ctx context.Context, obj *pg.Project) (*ProjectMember, error) { +func (r *projectResolver) Owner(ctx context.Context, obj *db.Project) (*Member, error) { user, err := r.Repository.GetUserAccountByID(ctx, obj.Owner) if err != nil { - return &ProjectMember{}, err + return &Member{}, err } var url *string if user.ProfileAvatarUrl.Valid { url = &user.ProfileAvatarUrl.String } profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} - return &ProjectMember{obj.Owner, user.FullName, profileIcon}, nil + role, err := r.Repository.GetRoleForProjectMemberByUserID(ctx, db.GetRoleForProjectMemberByUserIDParams{UserID: user.UserID, ProjectID: obj.ProjectID}) + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + return &Member{ID: obj.Owner, FullName: user.FullName, ProfileIcon: profileIcon, + Role: &db.Role{Code: role.Code, Name: role.Name}, + }, nil } -func (r *projectResolver) TaskGroups(ctx context.Context, obj *pg.Project) ([]pg.TaskGroup, error) { +func (r *projectResolver) TaskGroups(ctx context.Context, obj *db.Project) ([]db.TaskGroup, error) { return r.Repository.GetTaskGroupsForProject(ctx, obj.ProjectID) } -func (r *projectResolver) Members(ctx context.Context, obj *pg.Project) ([]ProjectMember, error) { +func (r *projectResolver) Members(ctx context.Context, obj *db.Project) ([]Member, error) { user, err := r.Repository.GetUserAccountByID(ctx, obj.Owner) - members := []ProjectMember{} + members := []Member{} if err == sql.ErrNoRows { return members, nil } if err != nil { + log.WithError(err).Error("get user account by ID") return members, err } var url *string @@ -544,28 +805,57 @@ func (r *projectResolver) Members(ctx context.Context, obj *pg.Project) ([]Proje url = &user.ProfileAvatarUrl.String } profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} - members = append(members, ProjectMember{obj.Owner, user.FullName, profileIcon}) + members = append(members, Member{ + ID: obj.Owner, FullName: user.FullName, ProfileIcon: profileIcon, Username: user.Username, + Role: &db.Role{Code: "owner", Name: "Owner"}, + }) + projectMembers, err := r.Repository.GetProjectMembersForProjectID(ctx, obj.ProjectID) + if err != nil { + log.WithError(err).Error("get project members for project id") + return members, err + } + + for _, projectMember := range projectMembers { + user, err = r.Repository.GetUserAccountByID(ctx, projectMember.UserID) + if err != nil { + log.WithError(err).Error("get user account by ID") + return members, err + } + var url *string + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + role, err := r.Repository.GetRoleForProjectMemberByUserID(ctx, db.GetRoleForProjectMemberByUserIDParams{UserID: user.UserID, ProjectID: obj.ProjectID}) + if err != nil { + log.WithError(err).Error("get role for projet member by user ID") + return members, err + } + profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} + members = append(members, Member{ID: user.UserID, FullName: user.FullName, ProfileIcon: profileIcon, + Username: user.Username, Role: &db.Role{Code: role.Code, Name: role.Name}, + }) + } return members, nil } -func (r *projectResolver) Labels(ctx context.Context, obj *pg.Project) ([]pg.ProjectLabel, error) { +func (r *projectResolver) Labels(ctx context.Context, obj *db.Project) ([]db.ProjectLabel, error) { labels, err := r.Repository.GetProjectLabelsForProject(ctx, obj.ProjectID) return labels, err } -func (r *projectLabelResolver) ID(ctx context.Context, obj *pg.ProjectLabel) (uuid.UUID, error) { +func (r *projectLabelResolver) ID(ctx context.Context, obj *db.ProjectLabel) (uuid.UUID, error) { return obj.ProjectLabelID, nil } -func (r *projectLabelResolver) LabelColor(ctx context.Context, obj *pg.ProjectLabel) (*pg.LabelColor, error) { +func (r *projectLabelResolver) LabelColor(ctx context.Context, obj *db.ProjectLabel) (*db.LabelColor, error) { labelColor, err := r.Repository.GetLabelColorByID(ctx, obj.LabelColorID) if err != nil { - return &pg.LabelColor{}, err + return &db.LabelColor{}, err } return &labelColor, nil } -func (r *projectLabelResolver) Name(ctx context.Context, obj *pg.ProjectLabel) (*string, error) { +func (r *projectLabelResolver) Name(ctx context.Context, obj *db.ProjectLabel) (*string, error) { var name *string if obj.Name.Valid { name = &obj.Name.String @@ -573,22 +863,22 @@ func (r *projectLabelResolver) Name(ctx context.Context, obj *pg.ProjectLabel) ( return name, nil } -func (r *queryResolver) Organizations(ctx context.Context) ([]pg.Organization, error) { +func (r *queryResolver) Organizations(ctx context.Context) ([]db.Organization, error) { return r.Repository.GetAllOrganizations(ctx) } -func (r *queryResolver) Users(ctx context.Context) ([]pg.UserAccount, error) { +func (r *queryResolver) Users(ctx context.Context) ([]db.UserAccount, error) { return r.Repository.GetAllUserAccounts(ctx) } -func (r *queryResolver) FindUser(ctx context.Context, input FindUser) (*pg.UserAccount, error) { +func (r *queryResolver) FindUser(ctx context.Context, input FindUser) (*db.UserAccount, error) { userId, err := uuid.Parse(input.UserID) if err != nil { - return &pg.UserAccount{}, err + return &db.UserAccount{}, err } account, err := r.Repository.GetUserAccountByID(ctx, userId) if err == sql.ErrNoRows { - return &pg.UserAccount{}, &gqlerror.Error{ + return &db.UserAccount{}, &gqlerror.Error{ Message: "User not found", Extensions: map[string]interface{}{ "code": "10-404", @@ -598,14 +888,14 @@ func (r *queryResolver) FindUser(ctx context.Context, input FindUser) (*pg.UserA return &account, err } -func (r *queryResolver) FindProject(ctx context.Context, input FindProject) (*pg.Project, error) { +func (r *queryResolver) FindProject(ctx context.Context, input FindProject) (*db.Project, error) { projectID, err := uuid.Parse(input.ProjectID) if err != nil { - return &pg.Project{}, err + return &db.Project{}, err } project, err := r.Repository.GetProjectByID(ctx, projectID) if err == sql.ErrNoRows { - return &pg.Project{}, &gqlerror.Error{ + return &db.Project{}, &gqlerror.Error{ Message: "Project not found", Extensions: map[string]interface{}{ "code": "11-404", @@ -615,67 +905,64 @@ func (r *queryResolver) FindProject(ctx context.Context, input FindProject) (*pg return &project, err } -func (r *queryResolver) FindTask(ctx context.Context, input FindTask) (*pg.Task, error) { +func (r *queryResolver) FindTask(ctx context.Context, input FindTask) (*db.Task, error) { task, err := r.Repository.GetTaskByID(ctx, input.TaskID) return &task, err } -func (r *queryResolver) Projects(ctx context.Context, input *ProjectsFilter) ([]pg.Project, error) { +func (r *queryResolver) Projects(ctx context.Context, input *ProjectsFilter) ([]db.Project, error) { if input != nil { return r.Repository.GetAllProjectsForTeam(ctx, *input.TeamID) } return r.Repository.GetAllProjects(ctx) } -func (r *queryResolver) FindTeam(ctx context.Context, input FindTeam) (*pg.Team, error) { +func (r *queryResolver) FindTeam(ctx context.Context, input FindTeam) (*db.Team, error) { team, err := r.Repository.GetTeamByID(ctx, input.TeamID) if err != nil { - return &pg.Team{}, err + return &db.Team{}, err } return &team, nil } -func (r *queryResolver) Teams(ctx context.Context) ([]pg.Team, error) { +func (r *queryResolver) Teams(ctx context.Context) ([]db.Team, error) { return r.Repository.GetAllTeams(ctx) } -func (r *queryResolver) LabelColors(ctx context.Context) ([]pg.LabelColor, error) { +func (r *queryResolver) LabelColors(ctx context.Context) ([]db.LabelColor, error) { return r.Repository.GetLabelColors(ctx) } -func (r *queryResolver) TaskGroups(ctx context.Context) ([]pg.TaskGroup, error) { +func (r *queryResolver) TaskGroups(ctx context.Context) ([]db.TaskGroup, error) { return r.Repository.GetAllTaskGroups(ctx) } -func (r *queryResolver) Me(ctx context.Context) (*pg.UserAccount, error) { +func (r *queryResolver) Me(ctx context.Context) (*db.UserAccount, error) { userID, ok := GetUserID(ctx) if !ok { - return &pg.UserAccount{}, fmt.Errorf("internal server error") + return &db.UserAccount{}, fmt.Errorf("internal server error") } - log.WithFields(log.Fields{ - "userID": userID, - }).Info("getting user account") user, err := r.Repository.GetUserAccountByID(ctx, userID) if err != nil { - return &pg.UserAccount{}, err + return &db.UserAccount{}, err } return &user, err } -func (r *refreshTokenResolver) ID(ctx context.Context, obj *pg.RefreshToken) (uuid.UUID, error) { +func (r *refreshTokenResolver) ID(ctx context.Context, obj *db.RefreshToken) (uuid.UUID, error) { return obj.TokenID, nil } -func (r *taskResolver) ID(ctx context.Context, obj *pg.Task) (uuid.UUID, error) { +func (r *taskResolver) ID(ctx context.Context, obj *db.Task) (uuid.UUID, error) { return obj.TaskID, nil } -func (r *taskResolver) TaskGroup(ctx context.Context, obj *pg.Task) (*pg.TaskGroup, error) { +func (r *taskResolver) TaskGroup(ctx context.Context, obj *db.Task) (*db.TaskGroup, error) { taskGroup, err := r.Repository.GetTaskGroupByID(ctx, obj.TaskGroupID) return &taskGroup, err } -func (r *taskResolver) Description(ctx context.Context, obj *pg.Task) (*string, error) { +func (r *taskResolver) Description(ctx context.Context, obj *db.Task) (*string, error) { task, err := r.Repository.GetTaskByID(ctx, obj.TaskID) if err != nil { return nil, err @@ -686,16 +973,16 @@ func (r *taskResolver) Description(ctx context.Context, obj *pg.Task) (*string, return &task.Description.String, nil } -func (r *taskResolver) DueDate(ctx context.Context, obj *pg.Task) (*time.Time, error) { +func (r *taskResolver) DueDate(ctx context.Context, obj *db.Task) (*time.Time, error) { if obj.DueDate.Valid { return &obj.DueDate.Time, nil } return nil, nil } -func (r *taskResolver) Assigned(ctx context.Context, obj *pg.Task) ([]ProjectMember, error) { +func (r *taskResolver) Assigned(ctx context.Context, obj *db.Task) ([]Member, error) { taskMemberLinks, err := r.Repository.GetAssignedMembersForTask(ctx, obj.TaskID) - taskMembers := []ProjectMember{} + taskMembers := []Member{} if err != nil { return taskMembers, err } @@ -709,20 +996,36 @@ func (r *taskResolver) Assigned(ctx context.Context, obj *pg.Task) ([]ProjectMem url = &user.ProfileAvatarUrl.String } profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} - taskMembers = append(taskMembers, ProjectMember{taskMemberLink.UserID, user.FullName, profileIcon}) + projectID, err := r.Repository.GetProjectIDForTask(ctx, obj.TaskID) + if err != nil { + return taskMembers, err + } + role, err := r.Repository.GetRoleForProjectMemberByUserID(ctx, db.GetRoleForProjectMemberByUserIDParams{UserID: user.UserID, ProjectID: projectID}) + + if err != nil { + if err == sql.ErrNoRows { + role = db.Role{Code: "owner", Name: "Owner"} + } else { + log.WithFields(log.Fields{"userID": user.UserID}).WithError(err).Error("get role for project member") + return taskMembers, err + } + } + taskMembers = append(taskMembers, Member{ID: taskMemberLink.UserID, FullName: user.FullName, ProfileIcon: profileIcon, + Role: &role, + }) } return taskMembers, nil } -func (r *taskResolver) Labels(ctx context.Context, obj *pg.Task) ([]pg.TaskLabel, error) { +func (r *taskResolver) Labels(ctx context.Context, obj *db.Task) ([]db.TaskLabel, error) { return r.Repository.GetTaskLabelsForTaskID(ctx, obj.TaskID) } -func (r *taskResolver) Checklists(ctx context.Context, obj *pg.Task) ([]pg.TaskChecklist, error) { +func (r *taskResolver) Checklists(ctx context.Context, obj *db.Task) ([]db.TaskChecklist, error) { return r.Repository.GetTaskChecklistsForTask(ctx, obj.TaskID) } -func (r *taskResolver) Badges(ctx context.Context, obj *pg.Task) (*TaskBadges, error) { +func (r *taskResolver) Badges(ctx context.Context, obj *db.Task) (*TaskBadges, error) { checklists, err := r.Repository.GetTaskChecklistsForTask(ctx, obj.TaskID) if err != nil { return &TaskBadges{}, err @@ -747,81 +1050,111 @@ func (r *taskResolver) Badges(ctx context.Context, obj *pg.Task) (*TaskBadges, e return &TaskBadges{Checklist: &ChecklistBadge{Total: total, Complete: complete}}, nil } -func (r *taskChecklistResolver) ID(ctx context.Context, obj *pg.TaskChecklist) (uuid.UUID, error) { +func (r *taskChecklistResolver) ID(ctx context.Context, obj *db.TaskChecklist) (uuid.UUID, error) { return obj.TaskChecklistID, nil } -func (r *taskChecklistResolver) Items(ctx context.Context, obj *pg.TaskChecklist) ([]pg.TaskChecklistItem, error) { +func (r *taskChecklistResolver) Items(ctx context.Context, obj *db.TaskChecklist) ([]db.TaskChecklistItem, error) { return r.Repository.GetTaskChecklistItemsForTaskChecklist(ctx, obj.TaskChecklistID) } -func (r *taskChecklistItemResolver) ID(ctx context.Context, obj *pg.TaskChecklistItem) (uuid.UUID, error) { +func (r *taskChecklistItemResolver) ID(ctx context.Context, obj *db.TaskChecklistItem) (uuid.UUID, error) { return obj.TaskChecklistItemID, nil } -func (r *taskChecklistItemResolver) DueDate(ctx context.Context, obj *pg.TaskChecklistItem) (*time.Time, error) { +func (r *taskChecklistItemResolver) DueDate(ctx context.Context, obj *db.TaskChecklistItem) (*time.Time, error) { panic(fmt.Errorf("not implemented")) } -func (r *taskGroupResolver) ID(ctx context.Context, obj *pg.TaskGroup) (uuid.UUID, error) { +func (r *taskGroupResolver) ID(ctx context.Context, obj *db.TaskGroup) (uuid.UUID, error) { return obj.TaskGroupID, nil } -func (r *taskGroupResolver) ProjectID(ctx context.Context, obj *pg.TaskGroup) (string, error) { +func (r *taskGroupResolver) ProjectID(ctx context.Context, obj *db.TaskGroup) (string, error) { return obj.ProjectID.String(), nil } -func (r *taskGroupResolver) Tasks(ctx context.Context, obj *pg.TaskGroup) ([]pg.Task, error) { +func (r *taskGroupResolver) Tasks(ctx context.Context, obj *db.TaskGroup) ([]db.Task, error) { tasks, err := r.Repository.GetTasksForTaskGroupID(ctx, obj.TaskGroupID) return tasks, err } -func (r *taskLabelResolver) ID(ctx context.Context, obj *pg.TaskLabel) (uuid.UUID, error) { +func (r *taskLabelResolver) ID(ctx context.Context, obj *db.TaskLabel) (uuid.UUID, error) { return obj.TaskLabelID, nil } -func (r *taskLabelResolver) ProjectLabel(ctx context.Context, obj *pg.TaskLabel) (*pg.ProjectLabel, error) { +func (r *taskLabelResolver) ProjectLabel(ctx context.Context, obj *db.TaskLabel) (*db.ProjectLabel, error) { projectLabel, err := r.Repository.GetProjectLabelByID(ctx, obj.ProjectLabelID) return &projectLabel, err } -func (r *teamResolver) ID(ctx context.Context, obj *pg.Team) (uuid.UUID, error) { +func (r *teamResolver) ID(ctx context.Context, obj *db.Team) (uuid.UUID, error) { return obj.TeamID, nil } -func (r *teamResolver) Members(ctx context.Context, obj *pg.Team) ([]ProjectMember, error) { - teamMembers, err := r.Repository.GetTeamMembersForTeamID(ctx, obj.TeamID) - var projectMembers []ProjectMember +func (r *teamResolver) Members(ctx context.Context, obj *db.Team) ([]Member, error) { + user, err := r.Repository.GetUserAccountByID(ctx, obj.Owner) + members := []Member{} if err == sql.ErrNoRows { - return projectMembers, nil + return members, nil } if err != nil { - return projectMembers, err + log.WithError(err).Error("get user account by ID") + return members, err } + var url *string + if user.ProfileAvatarUrl.Valid { + url = &user.ProfileAvatarUrl.String + } + profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} + members = append(members, Member{ + ID: obj.Owner, FullName: user.FullName, ProfileIcon: profileIcon, Username: user.Username, + Role: &db.Role{Code: "owner", Name: "Owner"}, + }) + teamMembers, err := r.Repository.GetTeamMembersForTeamID(ctx, obj.TeamID) + if err != nil { + log.WithError(err).Error("get project members for project id") + return members, err + } + for _, teamMember := range teamMembers { - user, err := r.Repository.GetUserAccountByID(ctx, teamMember.UserID) + user, err = r.Repository.GetUserAccountByID(ctx, teamMember.UserID) if err != nil { - return projectMembers, err + log.WithError(err).Error("get user account by ID") + return members, err } var url *string if user.ProfileAvatarUrl.Valid { url = &user.ProfileAvatarUrl.String } + role, err := r.Repository.GetRoleForTeamMember(ctx, db.GetRoleForTeamMemberParams{UserID: user.UserID, TeamID: obj.TeamID}) + if err != nil { + log.WithError(err).Error("get role for projet member by user ID") + return members, err + } profileIcon := &ProfileIcon{url, &user.Initials, &user.ProfileBgColor} - projectMembers = append(projectMembers, ProjectMember{ - ID: user.UserID, - FullName: user.FullName, - ProfileIcon: profileIcon, + members = append(members, Member{ID: user.UserID, FullName: user.FullName, ProfileIcon: profileIcon, + Username: user.Username, Role: &db.Role{Code: role.Code, Name: role.Name}, }) } - return projectMembers, nil + return members, nil } -func (r *userAccountResolver) ID(ctx context.Context, obj *pg.UserAccount) (uuid.UUID, error) { +func (r *userAccountResolver) ID(ctx context.Context, obj *db.UserAccount) (uuid.UUID, error) { return obj.UserID, nil } -func (r *userAccountResolver) ProfileIcon(ctx context.Context, obj *pg.UserAccount) (*ProfileIcon, error) { +func (r *userAccountResolver) Role(ctx context.Context, obj *db.UserAccount) (*db.Role, error) { + role, err := r.Repository.GetRoleForUserID(ctx, obj.UserID) + if err != nil { + log.Info("beep!") + log.WithError(err).Error("get role for user id") + return &db.Role{}, err + } + return &db.Role{Code: role.Code, Name: role.Name}, nil +} + +func (r *userAccountResolver) ProfileIcon(ctx context.Context, obj *db.UserAccount) (*ProfileIcon, error) { var url *string if obj.ProfileAvatarUrl.Valid { url = &obj.ProfileAvatarUrl.String diff --git a/api/internal/graph/schema/_models.gql b/api/internal/graph/schema/_models.gql new file mode 100644 index 0000000..f0d50a8 --- /dev/null +++ b/api/internal/graph/schema/_models.gql @@ -0,0 +1,139 @@ +scalar Time +scalar UUID +scalar Upload + +enum RoleCode { + owner + admin + member + observer +} + +type ProjectLabel { + id: ID! + createdDate: Time! + labelColor: LabelColor! + name: String +} + +type LabelColor { + id: ID! + name: String! + position: Float! + colorHex: String! +} + +type TaskLabel { + id: ID! + projectLabel: ProjectLabel! + assignedDate: Time! +} + +type ProfileIcon { + url: String + initials: String + bgColor: String +} + +type Member { + id: ID! + role: Role! + fullName: String! + username: String! + profileIcon: ProfileIcon! +} + +type RefreshToken { + id: ID! + userId: UUID! + expiresAt: Time! + createdAt: Time! +} + +type Role { + code: String! + name: String! +} + +type UserAccount { + id: ID! + email: String! + createdAt: Time! + fullName: String! + initials: String! + role: Role! + username: String! + profileIcon: ProfileIcon! +} + +type Team { + id: ID! + createdAt: Time! + name: String! + members: [Member!]! +} + +type Project { + id: ID! + createdAt: Time! + name: String! + team: Team! + owner: Member! + taskGroups: [TaskGroup!]! + members: [Member!]! + labels: [ProjectLabel!]! +} + +type TaskGroup { + id: ID! + projectID: String! + createdAt: Time! + name: String! + position: Float! + tasks: [Task!]! +} + +type ChecklistBadge { + complete: Int! + total: Int! +} + +type TaskBadges { + checklist: ChecklistBadge +} + +type Task { + id: ID! + taskGroup: TaskGroup! + createdAt: Time! + name: String! + position: Float! + description: String + dueDate: Time + complete: Boolean! + assigned: [Member!]! + labels: [TaskLabel!]! + checklists: [TaskChecklist!]! + badges: TaskBadges! +} + +type Organization { + id: ID! + name: String! +} + +type TaskChecklistItem { + id: ID! + name: String! + taskChecklistID: UUID! + complete: Boolean! + position: Float! + dueDate: Time! +} + +type TaskChecklist { + id: ID! + name: String! + position: Float! + items: [TaskChecklistItem!]! +} diff --git a/api/internal/graph/schema/_root.gql b/api/internal/graph/schema/_root.gql new file mode 100644 index 0000000..736252e --- /dev/null +++ b/api/internal/graph/schema/_root.gql @@ -0,0 +1,35 @@ +type Query { + organizations: [Organization!]! + users: [UserAccount!]! + findUser(input: FindUser!): UserAccount! + findProject(input: FindProject!): Project! + findTask(input: FindTask!): Task! + projects(input: ProjectsFilter): [Project!]! + findTeam(input: FindTeam!): Team! + teams: [Team!]! + labelColors: [LabelColor!]! + taskGroups: [TaskGroup!]! + me: UserAccount! +} + +type Mutation + +input ProjectsFilter { + teamID: UUID +} + +input FindUser { + userId: String! +} + +input FindProject { + projectId: String! +} + +input FindTask { + taskID: UUID! +} + +input FindTeam { + teamID: UUID! +} diff --git a/api/internal/graph/schema/project.gql b/api/internal/graph/schema/project.gql new file mode 100644 index 0000000..3272bba --- /dev/null +++ b/api/internal/graph/schema/project.gql @@ -0,0 +1,26 @@ +extend type Mutation { + createProject(input: NewProject!): Project! + deleteProject(input: DeleteProject!): DeleteProjectPayload! + updateProjectName(input: UpdateProjectName): Project! +} + +input NewProject { + userID: UUID! + teamID: UUID! + name: String! +} + +input UpdateProjectName { + projectID: UUID! + name: String! +} + +input DeleteProject { + projectID: UUID! +} + +type DeleteProjectPayload { + ok: Boolean! + project: Project! +} + diff --git a/api/internal/graph/schema/project_label.gql b/api/internal/graph/schema/project_label.gql new file mode 100644 index 0000000..2e7cef5 --- /dev/null +++ b/api/internal/graph/schema/project_label.gql @@ -0,0 +1,33 @@ +extend type Mutation { + createProjectLabel(input: NewProjectLabel!): ProjectLabel! + deleteProjectLabel(input: DeleteProjectLabel!): ProjectLabel! + updateProjectLabel(input: UpdateProjectLabel!): ProjectLabel! + updateProjectLabelName(input: UpdateProjectLabelName!): ProjectLabel! + updateProjectLabelColor(input: UpdateProjectLabelColor!): ProjectLabel! +} + +input NewProjectLabel { + projectID: UUID! + labelColorID: UUID! + name: String +} + +input DeleteProjectLabel { + projectLabelID: UUID! +} + +input UpdateProjectLabelName { + projectLabelID: UUID! + name: String! +} + +input UpdateProjectLabel { + projectLabelID: UUID! + labelColorID: UUID! + name: String! +} + +input UpdateProjectLabelColor { + projectLabelID: UUID! + labelColorID: UUID! +} diff --git a/api/internal/graph/schema/project_member.gql b/api/internal/graph/schema/project_member.gql new file mode 100644 index 0000000..c5a415e --- /dev/null +++ b/api/internal/graph/schema/project_member.gql @@ -0,0 +1,48 @@ +extend type Mutation { + createProjectMember(input: CreateProjectMember!): CreateProjectMemberPayload! + deleteProjectMember(input: DeleteProjectMember!): DeleteProjectMemberPayload! + updateProjectMemberRole(input: UpdateProjectMemberRole!): UpdateProjectMemberRolePayload! + setProjectOwner(input: SetProjectOwner!): SetProjectOwnerPayload! +} + +input CreateProjectMember { + projectID: UUID! + userID: UUID! +} + +type CreateProjectMemberPayload { + ok: Boolean! + member: Member! +} + +input DeleteProjectMember { + projectID: UUID! + userID: UUID! +} + +type DeleteProjectMemberPayload { + ok: Boolean! + member: Member! + projectID: UUID! +} + +input UpdateProjectMemberRole { + projectID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateProjectMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetProjectOwner { + projectID: UUID! + ownerID: UUID! +} +type SetProjectOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} diff --git a/api/internal/graph/schema/task.gql b/api/internal/graph/schema/task.gql new file mode 100644 index 0000000..a437735 --- /dev/null +++ b/api/internal/graph/schema/task.gql @@ -0,0 +1,68 @@ +extend type Mutation { + createTask(input: NewTask!): Task! + deleteTask(input: DeleteTaskInput!): DeleteTaskPayload! + + updateTaskDescription(input: UpdateTaskDescriptionInput!): Task! + updateTaskLocation(input: NewTaskLocation!): UpdateTaskLocationPayload! + updateTaskName(input: UpdateTaskName!): Task! + setTaskComplete(input: SetTaskComplete!): Task! + updateTaskDueDate(input: UpdateTaskDueDate!): Task! + + assignTask(input: AssignTaskInput): Task! + unassignTask(input: UnassignTaskInput): Task! +} + +input NewTask { + taskGroupID: String! + name: String! + position: Float! +} + +input AssignTaskInput { + taskID: UUID! + userID: UUID! +} + +input UnassignTaskInput { + taskID: UUID! + userID: UUID! +} + +input UpdateTaskDescriptionInput { + taskID: UUID! + description: String! +} + +type UpdateTaskLocationPayload { + previousTaskGroupID: UUID! + task: Task! +} + +input UpdateTaskDueDate { + taskID: UUID! + dueDate: Time +} + +input SetTaskComplete { + taskID: UUID! + complete: Boolean! +} + +input NewTaskLocation { + taskID: UUID! + taskGroupID: UUID! + position: Float! +} + +input DeleteTaskInput { + taskID: String! +} + +type DeleteTaskPayload { + taskID: String! +} + +input UpdateTaskName { + taskID: String! + name: String! +} diff --git a/api/internal/graph/schema/task_checklist.gql b/api/internal/graph/schema/task_checklist.gql new file mode 100644 index 0000000..2d9c573 --- /dev/null +++ b/api/internal/graph/schema/task_checklist.gql @@ -0,0 +1,52 @@ +extend type Mutation { + createTaskChecklist(input: CreateTaskChecklist!): TaskChecklist! + deleteTaskChecklist(input: DeleteTaskChecklist!): DeleteTaskChecklistPayload! + updateTaskChecklistName(input: UpdateTaskChecklistName!): TaskChecklist! + createTaskChecklistItem(input: CreateTaskChecklistItem!): TaskChecklistItem! + updateTaskChecklistItemName(input: UpdateTaskChecklistItemName!): TaskChecklistItem! + setTaskChecklistItemComplete(input: SetTaskChecklistItemComplete!): TaskChecklistItem! + deleteTaskChecklistItem(input: DeleteTaskChecklistItem!): DeleteTaskChecklistItemPayload! +} + +input CreateTaskChecklist { + taskID: UUID! + name: String! + position: Float! +} + +type DeleteTaskChecklistItemPayload { + ok: Boolean! + taskChecklistItem: TaskChecklistItem! +} + +input CreateTaskChecklistItem { + taskChecklistID: UUID! + name: String! + position: Float! +} + +input SetTaskChecklistItemComplete { + taskChecklistItemID: UUID! + complete: Boolean! +} + +input DeleteTaskChecklistItem { + taskChecklistItemID: UUID! +} + +input UpdateTaskChecklistItemName { + taskChecklistItemID: UUID! + name: String! +} + +input UpdateTaskChecklistName { + taskChecklistID: UUID! + name: String! +} +input DeleteTaskChecklist { + taskChecklistID: UUID! +} +type DeleteTaskChecklistPayload { + ok: Boolean! + taskChecklist: TaskChecklist! +} diff --git a/api/internal/graph/schema/task_group.gql b/api/internal/graph/schema/task_group.gql new file mode 100644 index 0000000..28c7d92 --- /dev/null +++ b/api/internal/graph/schema/task_group.gql @@ -0,0 +1,32 @@ +extend type Mutation { + createTaskGroup(input: NewTaskGroup!): TaskGroup! + updateTaskGroupLocation(input: NewTaskGroupLocation!): TaskGroup! + updateTaskGroupName(input: UpdateTaskGroupName!): TaskGroup! + deleteTaskGroup(input: DeleteTaskGroupInput!): DeleteTaskGroupPayload! +} + +input NewTaskGroupLocation { + taskGroupID: UUID! + position: Float! +} + +input UpdateTaskGroupName { + taskGroupID: UUID! + name: String! +} + +input DeleteTaskGroupInput { + taskGroupID: UUID! +} + +type DeleteTaskGroupPayload { + ok: Boolean! + affectedRows: Int! + taskGroup: TaskGroup! +} + +input NewTaskGroup { + projectID: String! + name: String! + position: Float! +} diff --git a/api/internal/graph/schema/task_label.gql b/api/internal/graph/schema/task_label.gql new file mode 100644 index 0000000..c7a12a0 --- /dev/null +++ b/api/internal/graph/schema/task_label.gql @@ -0,0 +1,22 @@ +input AddTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +input RemoveTaskLabelInput { + taskLabelID: UUID! +} +input ToggleTaskLabelInput { + taskID: UUID! + projectLabelID: UUID! +} + +type ToggleTaskLabelPayload { + active: Boolean! + task: Task! +} +extend type Mutation { + addTaskLabel(input: AddTaskLabelInput): Task! + removeTaskLabel(input: RemoveTaskLabelInput): Task! + toggleTaskLabel(input: ToggleTaskLabelInput!): ToggleTaskLabelPayload! +} diff --git a/api/internal/graph/schema/team.gql b/api/internal/graph/schema/team.gql new file mode 100644 index 0000000..8300e25 --- /dev/null +++ b/api/internal/graph/schema/team.gql @@ -0,0 +1,19 @@ +extend type Mutation { + deleteTeam(input: DeleteTeam!): DeleteTeamPayload! + createTeam(input: NewTeam!): Team! +} + +input NewTeam { + name: String! + organizationID: UUID! +} + +input DeleteTeam { + teamID: UUID! +} + +type DeleteTeamPayload { + ok: Boolean! + team: Team! + projects: [Project!]! +} diff --git a/api/internal/graph/schema/team_member.gql b/api/internal/graph/schema/team_member.gql new file mode 100644 index 0000000..a89c058 --- /dev/null +++ b/api/internal/graph/schema/team_member.gql @@ -0,0 +1,48 @@ +extend type Mutation { + setTeamOwner(input: SetTeamOwner!): SetTeamOwnerPayload! + createTeamMember(input: CreateTeamMember!): CreateTeamMemberPayload! + updateTeamMemberRole(input: UpdateTeamMemberRole!): UpdateTeamMemberRolePayload! + deleteTeamMember(input: DeleteTeamMember!): DeleteTeamMemberPayload! +} + +input DeleteTeamMember { + teamID: UUID! + userID: UUID! +} + +type DeleteTeamMemberPayload { + teamID: UUID! + userID: UUID! +} + +input CreateTeamMember { + userID: UUID! + teamID: UUID! +} + +type CreateTeamMemberPayload { + team: Team! + teamMember: Member! +} + +input UpdateTeamMemberRole { + teamID: UUID! + userID: UUID! + roleCode: RoleCode! +} + +type UpdateTeamMemberRolePayload { + ok: Boolean! + member: Member! +} + +input SetTeamOwner { + teamID: UUID! + userID: UUID! +} + +type SetTeamOwnerPayload { + ok: Boolean! + prevOwner: Member! + newOwner: Member! +} diff --git a/api/internal/graph/schema/user.gql b/api/internal/graph/schema/user.gql new file mode 100644 index 0000000..e508d2c --- /dev/null +++ b/api/internal/graph/schema/user.gql @@ -0,0 +1,33 @@ +extend type Mutation { + createRefreshToken(input: NewRefreshToken!): RefreshToken! + createUserAccount(input: NewUserAccount!): UserAccount! + deleteUserAccount(input: DeleteUserAccount!): DeleteUserAccountPayload! + logoutUser(input: LogoutUser!): Boolean! + clearProfileAvatar: UserAccount! +} + +input NewRefreshToken { + userId: String! +} + +input NewUserAccount { + username: String! + email: String! + fullName: String! + initials: String! + password: String! + roleCode: String! +} + +input LogoutUser { + userID: String! +} + +input DeleteUserAccount { + userID: UUID! +} + +type DeleteUserAccountPayload { + ok: Boolean! + userAccount: UserAccount! +} diff --git a/api/router/logger.go b/api/internal/logger/logger.go similarity index 98% rename from api/router/logger.go rename to api/internal/logger/logger.go index 2989c88..9e8d246 100644 --- a/api/router/logger.go +++ b/api/internal/logger/logger.go @@ -1,4 +1,4 @@ -package router +package logger import ( "fmt" @@ -57,8 +57,7 @@ func (l *StructuredLoggerEntry) Write(status, bytes int, elapsed time.Duration) "resp_status": status, "resp_bytes_length": bytes, "resp_elapsed_ms": float64(elapsed.Nanoseconds()) / 1000000.0, }) - - l.Logger.Infoln("request complete") + l.Logger.Debugln("request complete") } func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte) { diff --git a/api/router/auth.go b/api/internal/route/auth.go similarity index 77% rename from api/router/auth.go rename to api/internal/route/auth.go index 5210ad3..29a9708 100644 --- a/api/router/auth.go +++ b/api/internal/route/auth.go @@ -1,13 +1,15 @@ -package router +package route import ( "encoding/json" "net/http" "time" + "github.com/dgrijalva/jwt-go" "github.com/go-chi/chi" "github.com/google/uuid" - "github.com/jordanknott/project-citadel/api/pg" + "github.com/jordanknott/project-citadel/api/internal/auth" + "github.com/jordanknott/project-citadel/api/internal/db" log "github.com/sirupsen/logrus" "golang.org/x/crypto/bcrypt" ) @@ -16,6 +18,38 @@ var jwtKey = []byte("citadel_test_key") type authResource struct{} +type AccessTokenClaims struct { + UserID string `json:"userId"` + jwt.StandardClaims +} + +type RefreshTokenClaims struct { + UserID string `json:"userId"` + jwt.StandardClaims +} + +type LoginRequestData struct { + Username string + Password string +} + +type LoginResponseData struct { + AccessToken string `json:"accessToken"` +} + +type LogoutResponseData struct { + Status string `json:"status"` +} + +type RefreshTokenResponseData struct { + AccessToken string `json:"accessToken"` +} + +type AvatarUploadResponseData struct { + UserID string `json:"userID"` + URL string `json:"url"` +} + func (h *CitadelHandler) RefreshTokenHandler(w http.ResponseWriter, r *http.Request) { c, err := r.Cookie("refreshToken") if err != nil { @@ -35,14 +69,14 @@ func (h *CitadelHandler) RefreshTokenHandler(w http.ResponseWriter, r *http.Requ refreshCreatedAt := time.Now().UTC() refreshExpiresAt := refreshCreatedAt.AddDate(0, 0, 1) - refreshTokenString, err := h.repo.CreateRefreshToken(r.Context(), pg.CreateRefreshTokenParams{token.UserID, refreshCreatedAt, refreshExpiresAt}) + refreshTokenString, err := h.repo.CreateRefreshToken(r.Context(), db.CreateRefreshTokenParams{token.UserID, refreshCreatedAt, refreshExpiresAt}) err = h.repo.DeleteRefreshTokenByID(r.Context(), token.TokenID) if err != nil { w.WriteHeader(http.StatusInternalServerError) } - accessTokenString, err := NewAccessToken(token.UserID.String()) + accessTokenString, err := auth.NewAccessToken(token.UserID.String()) if err != nil { w.WriteHeader(http.StatusInternalServerError) } @@ -106,9 +140,9 @@ func (h *CitadelHandler) LoginHandler(w http.ResponseWriter, r *http.Request) { refreshCreatedAt := time.Now().UTC() refreshExpiresAt := refreshCreatedAt.AddDate(0, 0, 1) - refreshTokenString, err := h.repo.CreateRefreshToken(r.Context(), pg.CreateRefreshTokenParams{user.UserID, refreshCreatedAt, refreshExpiresAt}) + refreshTokenString, err := h.repo.CreateRefreshToken(r.Context(), db.CreateRefreshTokenParams{user.UserID, refreshCreatedAt, refreshExpiresAt}) - accessTokenString, err := NewAccessToken(user.UserID.String()) + accessTokenString, err := auth.NewAccessToken(user.UserID.String()) if err != nil { w.WriteHeader(http.StatusInternalServerError) } diff --git a/api/internal/route/avatar.go b/api/internal/route/avatar.go new file mode 100644 index 0000000..6c41345 --- /dev/null +++ b/api/internal/route/avatar.go @@ -0,0 +1,52 @@ +package route + +import ( + "database/sql" + "encoding/json" + "io/ioutil" + "net/http" + + "github.com/google/uuid" + log "github.com/sirupsen/logrus" + + "github.com/jordanknott/project-citadel/api/internal/db" +) + +func (h *CitadelHandler) ProfileImageUpload(w http.ResponseWriter, r *http.Request) { + log.Info("preparing to upload file") + userID, ok := r.Context().Value("userID").(uuid.UUID) + if !ok { + log.Error("not a valid uuid") + w.WriteHeader(http.StatusInternalServerError) + return + } + + // Parse our multipart form, 10 << 20 specifies a maximum + // upload of 10 MB files. + r.ParseMultipartForm(10 << 20) + + file, handler, err := r.FormFile("file") + if err != nil { + log.WithError(err).Error("issue while uploading file") + return + } + defer file.Close() + log.WithFields(log.Fields{"filename": handler.Filename, "size": handler.Size, "header": handler.Header}).Info("file metadata") + + fileBytes, err := ioutil.ReadAll(file) + if err != nil { + log.WithError(err).Error("while reading file") + return + } + err = ioutil.WriteFile("uploads/"+handler.Filename, fileBytes, 0644) + if err != nil { + log.WithError(err).Error("while reading file") + return + } + + h.repo.UpdateUserAccountProfileAvatarURL(r.Context(), db.UpdateUserAccountProfileAvatarURLParams{UserID: userID, ProfileAvatarUrl: sql.NullString{String: "http://localhost:3333/uploads/" + handler.Filename, Valid: true}}) + // return that we have successfully uploaded our file! + log.Info("file uploaded") + json.NewEncoder(w).Encode(AvatarUploadResponseData{URL: "http://localhost:3333/uploads/" + handler.Filename, UserID: userID.String()}) + +} diff --git a/api/router/middleware.go b/api/internal/route/middleware.go similarity index 81% rename from api/router/middleware.go rename to api/internal/route/middleware.go index 2f6e823..5e898cb 100644 --- a/api/router/middleware.go +++ b/api/internal/route/middleware.go @@ -1,4 +1,4 @@ -package router +package route import ( "context" @@ -6,6 +6,7 @@ import ( "strings" "github.com/google/uuid" + "github.com/jordanknott/project-citadel/api/internal/auth" log "github.com/sirupsen/logrus" ) @@ -13,17 +14,14 @@ func AuthenticationMiddleware(next http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { bearerTokenRaw := r.Header.Get("Authorization") splitToken := strings.Split(bearerTokenRaw, "Bearer") - log.WithFields(log.Fields{ - "bearerToken": bearerTokenRaw, - }).Warning("loading bearer token") if len(splitToken) != 2 { w.WriteHeader(http.StatusBadRequest) return } accessTokenString := strings.TrimSpace(splitToken[1]) - accessClaims, err := ValidateAccessToken(accessTokenString) + accessClaims, err := auth.ValidateAccessToken(accessTokenString) if err != nil { - if _, ok := err.(*ErrExpiredToken); ok { + if _, ok := err.(*auth.ErrExpiredToken); ok { w.WriteHeader(http.StatusUnauthorized) w.Write([]byte(`{ "data": {}, diff --git a/api/internal/route/route.go b/api/internal/route/route.go new file mode 100644 index 0000000..40faf4a --- /dev/null +++ b/api/internal/route/route.go @@ -0,0 +1,66 @@ +package route + +import ( + "net/http" + "time" + + "github.com/go-chi/chi" + "github.com/go-chi/chi/middleware" + "github.com/go-chi/cors" + "github.com/jmoiron/sqlx" + log "github.com/sirupsen/logrus" + + "github.com/jordanknott/project-citadel/api/internal/db" + "github.com/jordanknott/project-citadel/api/internal/graph" + "github.com/jordanknott/project-citadel/api/internal/logger" +) + +type CitadelHandler struct { + repo db.Repository +} + +func NewRouter(dbConnection *sqlx.DB) (chi.Router, error) { + formatter := new(log.TextFormatter) + formatter.TimestampFormat = "02-01-2006 15:04:05" + formatter.FullTimestamp = true + + routerLogger := log.New() + routerLogger.SetLevel(log.InfoLevel) + routerLogger.Formatter = formatter + r := chi.NewRouter() + cors := cors.New(cors.Options{ + // AllowedOrigins: []string{"https://foo.com"}, // Use this to allow specific origin hosts + AllowedOrigins: []string{"*"}, + // AllowOriginFunc: func(r *http.Request, origin string) bool { return true }, + AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, + AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token", "Cookie"}, + ExposedHeaders: []string{"Link"}, + AllowCredentials: true, + MaxAge: 300, // Maximum value not ignored by any of major browsers + }) + + r.Use(cors.Handler) + r.Use(middleware.RequestID) + r.Use(middleware.RealIP) + r.Use(logger.NewStructuredLogger(routerLogger)) + r.Use(middleware.Recoverer) + r.Use(middleware.Timeout(60 * time.Second)) + + repository := db.NewRepository(dbConnection) + citadelHandler := CitadelHandler{*repository} + + var imgServer = http.FileServer(http.Dir("./uploads/")) + r.Group(func(mux chi.Router) { + mux.Mount("/auth", authResource{}.Routes(citadelHandler)) + mux.Handle("/__graphql", graph.NewPlaygroundHandler("/graphql")) + mux.Mount("/uploads/", http.StripPrefix("/uploads/", imgServer)) + + }) + r.Group(func(mux chi.Router) { + mux.Use(AuthenticationMiddleware) + mux.Post("/users/me/avatar", citadelHandler.ProfileImageUpload) + mux.Handle("/graphql", graph.NewHandler(*repository)) + }) + + return r, nil +} diff --git a/api/magefile.go b/api/magefile.go new file mode 100644 index 0000000..9f55996 --- /dev/null +++ b/api/magefile.go @@ -0,0 +1,45 @@ +//+build mage + +package main + +import ( + "fmt" + "github.com/magefile/mage/sh" + "io/ioutil" + "os" + "strings" +) + +var Aliases = map[string]interface{}{ + "g": Generate, +} + +// Runs go mod download and then installs the binary. +func Generate() error { + + files, err := ioutil.ReadDir("graph/schema/") + if err != nil { + panic(err) + } + var schema strings.Builder + for _, file := range files { + filename := "graph/schema/" + file.Name() + fmt.Println(filename) + f, err := os.Open(filename) + if err != nil { + panic(err) + } + content, err := ioutil.ReadAll(f) + if err != nil { + panic(err) + } + fmt.Fprintln(&schema, string(content)) + } + // return sh.Run("go", "install", "./...") + // fmt.Println(schema.String()) + err = ioutil.WriteFile("graph/schema.graphqls", []byte(schema.String()), os.FileMode(0755)) + if err != nil { + panic(err) + } + return sh.Run("gqlgen") +} diff --git a/api/migrations/0001_add-refresh-token-table.up.sql b/api/migrations/0001_add-refresh-token-table.up.sql index ab498c5..f0059ae 100644 --- a/api/migrations/0001_add-refresh-token-table.up.sql +++ b/api/migrations/0001_add-refresh-token-table.up.sql @@ -1,3 +1,5 @@ +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + CREATE TABLE refresh_token ( token_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), user_id uuid NOT NULL, diff --git a/api/migrations/0007_add-organization-table.up.sql b/api/migrations/0007_add-organization-table.up.sql index 06072ae..067b45e 100644 --- a/api/migrations/0007_add-organization-table.up.sql +++ b/api/migrations/0007_add-organization-table.up.sql @@ -3,3 +3,5 @@ CREATE TABLE organization ( created_at timestamptz NOT NULL, name text NOT NULL ); + +INSERT INTO organization (created_at, name) VALUES (NOW(), 'sys_default_organization'); diff --git a/api/migrations/0012-add-project-label-table.up.sql b/api/migrations/0012_add-project-label-table.up.sql similarity index 100% rename from api/migrations/0012-add-project-label-table.up.sql rename to api/migrations/0012_add-project-label-table.up.sql diff --git a/api/migrations/0036-add-fkey-to-user_id-on-refresh_token-table.up.sql b/api/migrations/0036_add-fkey-to-user_id-on-refresh_token-table.up.sql similarity index 100% rename from api/migrations/0036-add-fkey-to-user_id-on-refresh_token-table.up.sql rename to api/migrations/0036_add-fkey-to-user_id-on-refresh_token-table.up.sql diff --git a/api/migrations/0037_add-project_member-table.up.sql b/api/migrations/0037_add-project_member-table.up.sql new file mode 100644 index 0000000..c29c9cb --- /dev/null +++ b/api/migrations/0037_add-project_member-table.up.sql @@ -0,0 +1,6 @@ +CREATE TABLE project_member ( + project_member_id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), + project_id uuid NOT NULL REFERENCES project(project_id) ON DELETE CASCADE, + user_id uuid NOT NULL REFERENCES user_account(user_id) ON DELETE CASCADE, + added_at timestamptz NOT NULL +); diff --git a/api/migrations/0038_add-role-table.up.sql b/api/migrations/0038_add-role-table.up.sql new file mode 100644 index 0000000..be9ba48 --- /dev/null +++ b/api/migrations/0038_add-role-table.up.sql @@ -0,0 +1,9 @@ +CREATE TABLE role ( + code TEXT PRIMARY KEY, + name TEXT NOT NULL +); + +INSERT INTO role VALUES ('owner', 'Owner'); +INSERT INTO role VALUES ('admin', 'Admin'); +INSERT INTO role VALUES ('member', 'Member'); +INSERT INTO role VALUES ('observer', 'Observer'); diff --git a/api/migrations/0039_add-role-column-to-user_account-table.up.sql b/api/migrations/0039_add-role-column-to-user_account-table.up.sql new file mode 100644 index 0000000..c344d40 --- /dev/null +++ b/api/migrations/0039_add-role-column-to-user_account-table.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE user_account ADD COLUMN role_code text + NOT NULL REFERENCES role(code) ON DELETE CASCADE DEFAULT 'member'; diff --git a/api/migrations/0040_add-unique-constraint-to-project_member-table.up.sql b/api/migrations/0040_add-unique-constraint-to-project_member-table.up.sql new file mode 100644 index 0000000..42ef7c0 --- /dev/null +++ b/api/migrations/0040_add-unique-constraint-to-project_member-table.up.sql @@ -0,0 +1 @@ +ALTER TABLE project_member ADD UNIQUE (project_id, user_id); diff --git a/api/migrations/0041_add-role_code-column-to-project_member-table.up.sql b/api/migrations/0041_add-role_code-column-to-project_member-table.up.sql new file mode 100644 index 0000000..fc541f4 --- /dev/null +++ b/api/migrations/0041_add-role_code-column-to-project_member-table.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE project_member ADD COLUMN role_code TEXT + NOT NULL REFERENCES role(code) ON DELETE CASCADE DEFAULT 'member'; diff --git a/api/migrations/0042_add-default-null-to-profile_avatar_url-on-user_account.up.sql b/api/migrations/0042_add-default-null-to-profile_avatar_url-on-user_account.up.sql new file mode 100644 index 0000000..00cf1d7 --- /dev/null +++ b/api/migrations/0042_add-default-null-to-profile_avatar_url-on-user_account.up.sql @@ -0,0 +1 @@ +ALTER TABLE user_account ALTER COLUMN profile_avatar_url SET DEFAULT null; diff --git a/api/migrations/0043_add-role_code-column-to-team_member-table.up.sql b/api/migrations/0043_add-role_code-column-to-team_member-table.up.sql new file mode 100644 index 0000000..2a5c9a0 --- /dev/null +++ b/api/migrations/0043_add-role_code-column-to-team_member-table.up.sql @@ -0,0 +1 @@ +ALTER TABLE team_member ADD COLUMN role_code TEXT NOT NULL REFERENCES role(code) ON DELETE CASCADE; diff --git a/api/migrations/0044_add-owner-to-team-table.up.sql b/api/migrations/0044_add-owner-to-team-table.up.sql new file mode 100644 index 0000000..0fe6526 --- /dev/null +++ b/api/migrations/0044_add-owner-to-team-table.up.sql @@ -0,0 +1,4 @@ +ALTER TABLE team ADD COLUMN owner uuid REFERENCES user_account(user_id) ON DELETE + CASCADE; +UPDATE team SET owner = (SELECT user_id FROM user_account WHERE role_code = 'admin' LIMIT 1); +ALTER TABLE team ALTER COLUMN owner SET NOT NULL; diff --git a/api/pg/pg.go b/api/pg/pg.go deleted file mode 100644 index b1d5ca1..0000000 --- a/api/pg/pg.go +++ /dev/null @@ -1,114 +0,0 @@ -package pg - -import ( - "context" - "github.com/google/uuid" - "github.com/jmoiron/sqlx" -) - -type Repository interface { - CreateTeamMember(ctx context.Context, arg CreateTeamMemberParams) (TeamMember, error) - DeleteTeamMemberByUserID(ctx context.Context, userID uuid.UUID) error - GetTeamMembersForTeamID(ctx context.Context, teamID uuid.UUID) ([]TeamMember, error) - - CreateTeam(ctx context.Context, arg CreateTeamParams) (Team, error) - DeleteTeamByID(ctx context.Context, teamID uuid.UUID) error - GetTeamByID(ctx context.Context, teamID uuid.UUID) (Team, error) - GetAllTeams(ctx context.Context) ([]Team, error) - - DeleteProjectByID(ctx context.Context, projectID uuid.UUID) error - DeleteUserAccountByID(ctx context.Context, userID uuid.UUID) error - - GetTaskChecklistByID(ctx context.Context, taskChecklistID uuid.UUID) (TaskChecklist, error) - DeleteTaskChecklistByID(ctx context.Context, taskChecklistID uuid.UUID) error - UpdateTaskChecklistName(ctx context.Context, arg UpdateTaskChecklistNameParams) (TaskChecklist, error) - CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error) - GetAllProjects(ctx context.Context) ([]Project, error) - GetAllProjectsForTeam(ctx context.Context, teamID uuid.UUID) ([]Project, error) - GetProjectByID(ctx context.Context, projectID uuid.UUID) (Project, error) - - UpdateTaskChecklistItemName(ctx context.Context, arg UpdateTaskChecklistItemNameParams) (TaskChecklistItem, error) - GetTaskChecklistItemByID(ctx context.Context, taskChecklistItemID uuid.UUID) (TaskChecklistItem, error) - CreateTaskChecklist(ctx context.Context, arg CreateTaskChecklistParams) (TaskChecklist, error) - CreateTaskChecklistItem(ctx context.Context, arg CreateTaskChecklistItemParams) (TaskChecklistItem, error) - GetTaskChecklistItemsForTaskChecklist(ctx context.Context, taskChecklistID uuid.UUID) ([]TaskChecklistItem, error) - GetTaskChecklistsForTask(ctx context.Context, taskID uuid.UUID) ([]TaskChecklist, error) - SetTaskChecklistItemComplete(ctx context.Context, arg SetTaskChecklistItemCompleteParams) (TaskChecklistItem, error) - DeleteTaskChecklistItem(ctx context.Context, taskChecklistItemID uuid.UUID) error - - UpdateUserAccountProfileAvatarURL(ctx context.Context, arg UpdateUserAccountProfileAvatarURLParams) (UserAccount, error) - - CreateUserAccount(ctx context.Context, arg CreateUserAccountParams) (UserAccount, error) - GetUserAccountByID(ctx context.Context, userID uuid.UUID) (UserAccount, error) - GetUserAccountByUsername(ctx context.Context, username string) (UserAccount, error) - GetAllUserAccounts(ctx context.Context) ([]UserAccount, error) - - GetTaskLabelByID(ctx context.Context, taskLabelID uuid.UUID) (TaskLabel, error) - - SetTaskComplete(ctx context.Context, arg SetTaskCompleteParams) (Task, error) - DeleteTaskLabelForTaskByProjectLabelID(ctx context.Context, arg DeleteTaskLabelForTaskByProjectLabelIDParams) error - GetTaskLabelForTaskByProjectLabelID(ctx context.Context, arg GetTaskLabelForTaskByProjectLabelIDParams) (TaskLabel, error) - UpdateProjectNameByID(ctx context.Context, arg UpdateProjectNameByIDParams) (Project, error) - - DeleteTaskLabelByID(ctx context.Context, taskLabelID uuid.UUID) error - UpdateTaskDueDate(ctx context.Context, arg UpdateTaskDueDateParams) (Task, error) - CreateProjectLabel(ctx context.Context, arg CreateProjectLabelParams) (ProjectLabel, error) - GetProjectLabelsForProject(ctx context.Context, projectID uuid.UUID) ([]ProjectLabel, error) - GetProjectLabelByID(ctx context.Context, projectLabelID uuid.UUID) (ProjectLabel, error) - DeleteProjectLabelByID(ctx context.Context, projectLabelID uuid.UUID) error - UpdateProjectLabelColor(ctx context.Context, arg UpdateProjectLabelColorParams) (ProjectLabel, error) - UpdateProjectLabelName(ctx context.Context, arg UpdateProjectLabelNameParams) (ProjectLabel, error) - UpdateProjectLabel(ctx context.Context, arg UpdateProjectLabelParams) (ProjectLabel, error) - - GetLabelColors(ctx context.Context) ([]LabelColor, error) - CreateLabelColor(ctx context.Context, arg CreateLabelColorParams) (LabelColor, error) - - CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) (RefreshToken, error) - GetRefreshTokenByID(ctx context.Context, tokenID uuid.UUID) (RefreshToken, error) - DeleteRefreshTokenByID(ctx context.Context, tokenID uuid.UUID) error - DeleteRefreshTokenByUserID(ctx context.Context, userID uuid.UUID) error - - SetTaskGroupName(ctx context.Context, arg SetTaskGroupNameParams) (TaskGroup, error) - DeleteTaskGroupByID(ctx context.Context, taskGroupID uuid.UUID) (int64, error) - DeleteTasksByTaskGroupID(ctx context.Context, taskGroupID uuid.UUID) (int64, error) - UpdateTaskGroupLocation(ctx context.Context, arg UpdateTaskGroupLocationParams) (TaskGroup, error) - CreateTaskGroup(ctx context.Context, arg CreateTaskGroupParams) (TaskGroup, error) - GetAllTaskGroups(ctx context.Context) ([]TaskGroup, error) - GetTaskGroupsForProject(ctx context.Context, projectID uuid.UUID) ([]TaskGroup, error) - GetTaskGroupByID(ctx context.Context, taskGroupID uuid.UUID) (TaskGroup, error) - - GetAllOrganizations(ctx context.Context) ([]Organization, error) - CreateOrganization(ctx context.Context, arg CreateOrganizationParams) (Organization, error) - - GetTeamsForOrganization(ctx context.Context, organizationID uuid.UUID) ([]Team, error) - - CreateTask(ctx context.Context, arg CreateTaskParams) (Task, error) - GetTaskByID(ctx context.Context, taskID uuid.UUID) (Task, error) - GetAllTasks(ctx context.Context) ([]Task, error) - GetTasksForTaskGroupID(ctx context.Context, taskGroupID uuid.UUID) ([]Task, error) - UpdateTaskLocation(ctx context.Context, arg UpdateTaskLocationParams) (Task, error) - DeleteTaskByID(ctx context.Context, taskID uuid.UUID) error - UpdateTaskName(ctx context.Context, arg UpdateTaskNameParams) (Task, error) - UpdateTaskDescription(ctx context.Context, arg UpdateTaskDescriptionParams) (Task, error) - - CreateTaskLabelForTask(ctx context.Context, arg CreateTaskLabelForTaskParams) (TaskLabel, error) - GetTaskLabelsForTaskID(ctx context.Context, taskID uuid.UUID) ([]TaskLabel, error) - GetLabelColorByID(ctx context.Context, labelColorID uuid.UUID) (LabelColor, error) - - CreateTaskAssigned(ctx context.Context, arg CreateTaskAssignedParams) (TaskAssigned, error) - GetAssignedMembersForTask(ctx context.Context, taskID uuid.UUID) ([]TaskAssigned, error) - DeleteTaskAssignedByID(ctx context.Context, arg DeleteTaskAssignedByIDParams) (TaskAssigned, error) -} - -type repoSvc struct { - *Queries - db *sqlx.DB -} - -// NewRepository returns an implementation of the Repository interface. -func NewRepository(db *sqlx.DB) Repository { - return &repoSvc{ - Queries: New(db.DB), - db: db, - } -} diff --git a/api/pg/project.sql.go b/api/pg/project.sql.go deleted file mode 100644 index 32b449d..0000000 --- a/api/pg/project.sql.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// source: project.sql - -package pg - -import ( - "context" - "time" - - "github.com/google/uuid" -) - -const createProject = `-- name: CreateProject :one -INSERT INTO project(owner, team_id, created_at, name) VALUES ($1, $2, $3, $4) RETURNING project_id, team_id, created_at, name, owner -` - -type CreateProjectParams struct { - Owner uuid.UUID `json:"owner"` - TeamID uuid.UUID `json:"team_id"` - CreatedAt time.Time `json:"created_at"` - Name string `json:"name"` -} - -func (q *Queries) CreateProject(ctx context.Context, arg CreateProjectParams) (Project, error) { - row := q.db.QueryRowContext(ctx, createProject, - arg.Owner, - arg.TeamID, - arg.CreatedAt, - arg.Name, - ) - var i Project - err := row.Scan( - &i.ProjectID, - &i.TeamID, - &i.CreatedAt, - &i.Name, - &i.Owner, - ) - return i, err -} - -const deleteProjectByID = `-- name: DeleteProjectByID :exec -DELETE FROM project WHERE project_id = $1 -` - -func (q *Queries) DeleteProjectByID(ctx context.Context, projectID uuid.UUID) error { - _, err := q.db.ExecContext(ctx, deleteProjectByID, projectID) - return err -} - -const getAllProjects = `-- name: GetAllProjects :many -SELECT project_id, team_id, created_at, name, owner FROM project -` - -func (q *Queries) GetAllProjects(ctx context.Context) ([]Project, error) { - rows, err := q.db.QueryContext(ctx, getAllProjects) - if err != nil { - return nil, err - } - defer rows.Close() - var items []Project - for rows.Next() { - var i Project - if err := rows.Scan( - &i.ProjectID, - &i.TeamID, - &i.CreatedAt, - &i.Name, - &i.Owner, - ); err != nil { - return nil, err - } - items = append(items, i) - } - if err := rows.Close(); err != nil { - return nil, err - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} - -const getAllProjectsForTeam = `-- name: GetAllProjectsForTeam :many -SELECT project_id, team_id, created_at, name, owner FROM project WHERE team_id = $1 -` - -func (q *Queries) GetAllProjectsForTeam(ctx context.Context, teamID uuid.UUID) ([]Project, error) { - rows, err := q.db.QueryContext(ctx, getAllProjectsForTeam, teamID) - if err != nil { - return nil, err - } - defer rows.Close() - var items []Project - for rows.Next() { - var i Project - if err := rows.Scan( - &i.ProjectID, - &i.TeamID, - &i.CreatedAt, - &i.Name, - &i.Owner, - ); err != nil { - return nil, err - } - items = append(items, i) - } - if err := rows.Close(); err != nil { - return nil, err - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} - -const getProjectByID = `-- name: GetProjectByID :one -SELECT project_id, team_id, created_at, name, owner FROM project WHERE project_id = $1 -` - -func (q *Queries) GetProjectByID(ctx context.Context, projectID uuid.UUID) (Project, error) { - row := q.db.QueryRowContext(ctx, getProjectByID, projectID) - var i Project - err := row.Scan( - &i.ProjectID, - &i.TeamID, - &i.CreatedAt, - &i.Name, - &i.Owner, - ) - return i, err -} - -const updateProjectNameByID = `-- name: UpdateProjectNameByID :one -UPDATE project SET name = $2 WHERE project_id = $1 RETURNING project_id, team_id, created_at, name, owner -` - -type UpdateProjectNameByIDParams struct { - ProjectID uuid.UUID `json:"project_id"` - Name string `json:"name"` -} - -func (q *Queries) UpdateProjectNameByID(ctx context.Context, arg UpdateProjectNameByIDParams) (Project, error) { - row := q.db.QueryRowContext(ctx, updateProjectNameByID, arg.ProjectID, arg.Name) - var i Project - err := row.Scan( - &i.ProjectID, - &i.TeamID, - &i.CreatedAt, - &i.Name, - &i.Owner, - ) - return i, err -} diff --git a/api/pg/team_member.sql.go b/api/pg/team_member.sql.go deleted file mode 100644 index 223e3e9..0000000 --- a/api/pg/team_member.sql.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by sqlc. DO NOT EDIT. -// source: team_member.sql - -package pg - -import ( - "context" - "time" - - "github.com/google/uuid" -) - -const createTeamMember = `-- name: CreateTeamMember :one -INSERT INTO team_member (team_id, user_id, addedDate) VALUES ($1, $2, $3) - RETURNING team_member_id, team_id, user_id, addeddate -` - -type CreateTeamMemberParams struct { - TeamID uuid.UUID `json:"team_id"` - UserID uuid.UUID `json:"user_id"` - Addeddate time.Time `json:"addeddate"` -} - -func (q *Queries) CreateTeamMember(ctx context.Context, arg CreateTeamMemberParams) (TeamMember, error) { - row := q.db.QueryRowContext(ctx, createTeamMember, arg.TeamID, arg.UserID, arg.Addeddate) - var i TeamMember - err := row.Scan( - &i.TeamMemberID, - &i.TeamID, - &i.UserID, - &i.Addeddate, - ) - return i, err -} - -const deleteTeamMemberByUserID = `-- name: DeleteTeamMemberByUserID :exec -DELETE FROM team_member WHERE user_id = $1 -` - -func (q *Queries) DeleteTeamMemberByUserID(ctx context.Context, userID uuid.UUID) error { - _, err := q.db.ExecContext(ctx, deleteTeamMemberByUserID, userID) - return err -} - -const getTeamMembersForTeamID = `-- name: GetTeamMembersForTeamID :many -SELECT team_member_id, team_id, user_id, addeddate FROM team_member WHERE team_id = $1 -` - -func (q *Queries) GetTeamMembersForTeamID(ctx context.Context, teamID uuid.UUID) ([]TeamMember, error) { - rows, err := q.db.QueryContext(ctx, getTeamMembersForTeamID, teamID) - if err != nil { - return nil, err - } - defer rows.Close() - var items []TeamMember - for rows.Next() { - var i TeamMember - if err := rows.Scan( - &i.TeamMemberID, - &i.TeamID, - &i.UserID, - &i.Addeddate, - ); err != nil { - return nil, err - } - items = append(items, i) - } - if err := rows.Close(); err != nil { - return nil, err - } - if err := rows.Err(); err != nil { - return nil, err - } - return items, nil -} diff --git a/api/query/project.sql b/api/query/project.sql deleted file mode 100644 index 12a1514..0000000 --- a/api/query/project.sql +++ /dev/null @@ -1,17 +0,0 @@ --- name: GetAllProjects :many -SELECT * FROM project; - --- name: GetAllProjectsForTeam :many -SELECT * FROM project WHERE team_id = $1; - --- name: GetProjectByID :one -SELECT * FROM project WHERE project_id = $1; - --- name: CreateProject :one -INSERT INTO project(owner, team_id, created_at, name) VALUES ($1, $2, $3, $4) RETURNING *; - --- name: UpdateProjectNameByID :one -UPDATE project SET name = $2 WHERE project_id = $1 RETURNING *; - --- name: DeleteProjectByID :exec -DELETE FROM project WHERE project_id = $1; diff --git a/api/query/team_member.sql b/api/query/team_member.sql deleted file mode 100644 index 41a1ddf..0000000 --- a/api/query/team_member.sql +++ /dev/null @@ -1,9 +0,0 @@ --- name: CreateTeamMember :one -INSERT INTO team_member (team_id, user_id, addedDate) VALUES ($1, $2, $3) - RETURNING *; - --- name: GetTeamMembersForTeamID :many -SELECT * FROM team_member WHERE team_id = $1; - --- name: DeleteTeamMemberByUserID :exec -DELETE FROM team_member WHERE user_id = $1; diff --git a/api/router/errors.go b/api/router/errors.go deleted file mode 100644 index 1eaefc5..0000000 --- a/api/router/errors.go +++ /dev/null @@ -1,13 +0,0 @@ -package router - -type ErrExpiredToken struct{} - -func (r *ErrExpiredToken) Error() string { - return "token is expired" -} - -type ErrMalformedToken struct{} - -func (r *ErrMalformedToken) Error() string { - return "token is malformed" -} diff --git a/api/router/handlers.go b/api/router/handlers.go deleted file mode 100644 index 1a9e456..0000000 --- a/api/router/handlers.go +++ /dev/null @@ -1,7 +0,0 @@ -package router - -import "github.com/jordanknott/project-citadel/api/pg" - -type CitadelHandler struct { - repo pg.Repository -} diff --git a/api/router/models.go b/api/router/models.go deleted file mode 100644 index 45af546..0000000 --- a/api/router/models.go +++ /dev/null @@ -1,37 +0,0 @@ -package router - -import ( - "github.com/dgrijalva/jwt-go" -) - -type AccessTokenClaims struct { - UserID string `json:"userId"` - jwt.StandardClaims -} - -type RefreshTokenClaims struct { - UserID string `json:"userId"` - jwt.StandardClaims -} - -type LoginRequestData struct { - Username string - Password string -} - -type LoginResponseData struct { - AccessToken string `json:"accessToken"` -} - -type LogoutResponseData struct { - Status string `json:"status"` -} - -type RefreshTokenResponseData struct { - AccessToken string `json:"accessToken"` -} - -type AvatarUploadResponseData struct { - UserID string `json:"userID"` - URL string `json:"url"` -} diff --git a/api/router/router.go b/api/router/router.go deleted file mode 100644 index aa4669b..0000000 --- a/api/router/router.go +++ /dev/null @@ -1,108 +0,0 @@ -package router - -import ( - "database/sql" - "encoding/json" - "io/ioutil" - "net/http" - "time" - - "github.com/go-chi/chi" - "github.com/go-chi/chi/middleware" - "github.com/go-chi/cors" - "github.com/google/uuid" - "github.com/jmoiron/sqlx" - log "github.com/sirupsen/logrus" - - "github.com/jordanknott/project-citadel/api/graph" - "github.com/jordanknott/project-citadel/api/pg" -) - -func (h *CitadelHandler) PingHandler(w http.ResponseWriter, r *http.Request) { - w.Write([]byte("pong")) -} - -func (h *CitadelHandler) ProfileImageUpload(w http.ResponseWriter, r *http.Request) { - log.Info("preparing to upload file") - userID, ok := r.Context().Value("userID").(uuid.UUID) - if !ok { - log.Error("not a valid uuid") - w.WriteHeader(http.StatusInternalServerError) - return - } - - // Parse our multipart form, 10 << 20 specifies a maximum - // upload of 10 MB files. - r.ParseMultipartForm(10 << 20) - - file, handler, err := r.FormFile("file") - if err != nil { - log.WithError(err).Error("issue while uploading file") - return - } - defer file.Close() - log.WithFields(log.Fields{"filename": handler.Filename, "size": handler.Size, "header": handler.Header}).Info("file metadata") - - fileBytes, err := ioutil.ReadAll(file) - if err != nil { - log.WithError(err).Error("while reading file") - return - } - err = ioutil.WriteFile("uploads/"+handler.Filename, fileBytes, 0644) - if err != nil { - log.WithError(err).Error("while reading file") - return - } - - h.repo.UpdateUserAccountProfileAvatarURL(r.Context(), pg.UpdateUserAccountProfileAvatarURLParams{UserID: userID, ProfileAvatarUrl: sql.NullString{String: "http://localhost:3333/uploads/" + handler.Filename, Valid: true}}) - // return that we have successfully uploaded our file! - log.Info("file uploaded") - json.NewEncoder(w).Encode(AvatarUploadResponseData{URL: "http://localhost:3333/uploads/" + handler.Filename, UserID: userID.String()}) - -} - -func NewRouter(db *sqlx.DB) (chi.Router, error) { - formatter := new(log.TextFormatter) - formatter.TimestampFormat = "02-01-2006 15:04:05" - formatter.FullTimestamp = true - - routerLogger := log.New() - routerLogger.SetLevel(log.DebugLevel) - routerLogger.Formatter = formatter - r := chi.NewRouter() - cors := cors.New(cors.Options{ - // AllowedOrigins: []string{"https://foo.com"}, // Use this to allow specific origin hosts - AllowedOrigins: []string{"*"}, - // AllowOriginFunc: func(r *http.Request, origin string) bool { return true }, - AllowedMethods: []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}, - AllowedHeaders: []string{"Accept", "Authorization", "Content-Type", "X-CSRF-Token", "Cookie"}, - ExposedHeaders: []string{"Link"}, - AllowCredentials: true, - MaxAge: 300, // Maximum value not ignored by any of major browsers - }) - r.Use(cors.Handler) - r.Use(middleware.RequestID) - r.Use(middleware.RealIP) - r.Use(NewStructuredLogger(routerLogger)) - r.Use(middleware.Recoverer) - r.Use(middleware.Timeout(60 * time.Second)) - - repository := pg.NewRepository(db) - citadelHandler := CitadelHandler{repository} - - r.Group(func(mux chi.Router) { - mux.Mount("/auth", authResource{}.Routes(citadelHandler)) - mux.Handle("/__graphql", graph.NewPlaygroundHandler("/graphql")) - var imgServer = http.FileServer(http.Dir("./uploads/")) - mux.Mount("/uploads/", http.StripPrefix("/uploads/", imgServer)) - - }) - r.Group(func(mux chi.Router) { - mux.Use(AuthenticationMiddleware) - mux.Post("/users/me/avatar", citadelHandler.ProfileImageUpload) - mux.Get("/ping", citadelHandler.PingHandler) - mux.Handle("/graphql", graph.NewHandler(repository)) - }) - - return r, nil -} diff --git a/api/sqlc.yaml b/api/sqlc.yaml index d6ea3cf..0d40831 100644 --- a/api/sqlc.yaml +++ b/api/sqlc.yaml @@ -1,10 +1,10 @@ version: "1" packages: - - name: "pg" + - name: "db" emit_json_tags: true emit_prepared_queries: false emit_interface: true - path: "pg" - queries: "./query/" + path: "internal/db" + queries: "./internal/db/query/" schema: "./migrations/" diff --git a/api/templates/mail/user/registered.tmpl b/api/templates/mail/user/registered.tmpl new file mode 100644 index 0000000..fd0671c --- /dev/null +++ b/api/templates/mail/user/registered.tmpl @@ -0,0 +1,12 @@ + + + + + {{.Username}} has been registered + + + +

Hi {{.Username}}, thanks for registering at {{.AppName}}!

+

© {{.Year}} {{.AppName}}

+ + diff --git a/web/report.20200630.191315.2921.0.001.json b/web/report.20200630.191315.2921.0.001.json new file mode 100644 index 0000000..d68a762 --- /dev/null +++ b/web/report.20200630.191315.2921.0.001.json @@ -0,0 +1,501 @@ + +{ + "header": { + "reportVersion": 1, + "event": "Allocation failed - JavaScript heap out of memory", + "trigger": "FatalError", + "filename": "report.20200630.191315.2921.0.001.json", + "dumpEventTime": "2020-06-30T19:13:15Z", + "dumpEventTimeStamp": "1593562395582", + "processId": 2921, + "cwd": "/home/jordan/Projects/project-citadel/web", + "commandLine": [ + "/usr/bin/node", + "/home/jordan/.config/coc/extensions/node_modules/coc-tsserver/bin/tsserverForkStart", + "/home/jordan/Projects/project-citadel/web/node_modules/typescript/lib/tsserver.js", + "--allowLocalPluginLoads", + "--useInferredProjectPerProjectRoot", + "--cancellationPipeName", + "/tmp/coc-nvim-tscancellation-de3655a46bee8a6c5461.sock*", + "--npmLocation", + "\"/usr/bin/npm\"", + "--noGetErrOnBackgroundUpdate", + "--validateDefaultNpmLocation" + ], + "nodejsVersion": "v13.8.0", + "glibcVersionRuntime": "2.30", + "glibcVersionCompiler": "2.30", + "wordSize": 64, + "arch": "x64", + "platform": "linux", + "componentVersions": { + "node": "13.8.0", + "v8": "7.9.317.25-node.28", + "uv": "1.34.1", + "zlib": "1.2.11", + "brotli": "1.0.7", + "ares": "1.15.0", + "modules": "79", + "nghttp2": "1.39.2", + "napi": "5", + "llhttp": "2.0.4", + "openssl": "1.1.1d", + "cldr": "36.0", + "icu": "65.1", + "tz": "2019c", + "unicode": "12.1" + }, + "release": { + "name": "node", + "headersUrl": "https://nodejs.org/download/release/v13.8.0/node-v13.8.0-headers.tar.gz", + "sourceUrl": "https://nodejs.org/download/release/v13.8.0/node-v13.8.0.tar.gz" + }, + "osName": "Linux", + "osRelease": "4.19.101-1-lts", + "osVersion": "#1 SMP Sat, 01 Feb 2020 16:35:36 +0000", + "osMachine": "x86_64", + "cpus": [ + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 928, + "user": 17517600, + "nice": 5000, + "sys": 2658800, + "idle": 54442200, + "irq": 146200 + }, + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 1192, + "user": 16529500, + "nice": 3900, + "sys": 2713400, + "idle": 55020300, + "irq": 289200 + }, + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 1197, + "user": 16764400, + "nice": 3600, + "sys": 2584400, + "idle": 55071500, + "irq": 157600 + }, + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 1196, + "user": 16700100, + "nice": 2500, + "sys": 2588500, + "idle": 55230400, + "irq": 152300 + } + ], + "networkInterfaces": [ + { + "name": "lo", + "internal": true, + "mac": "00:00:00:00:00:00", + "address": "127.0.0.1", + "netmask": "255.0.0.0", + "family": "IPv4" + }, + { + "name": "wlp3s0", + "internal": false, + "mac": "7c:b0:c2:fe:93:86", + "address": "192.168.43.5", + "netmask": "255.255.255.0", + "family": "IPv4" + }, + { + "name": "docker0", + "internal": false, + "mac": "02:42:64:b5:eb:c5", + "address": "172.17.0.1", + "netmask": "255.255.0.0", + "family": "IPv4" + }, + { + "name": "br-e929893879ec", + "internal": false, + "mac": "02:42:77:2b:e8:70", + "address": "172.19.0.1", + "netmask": "255.255.0.0", + "family": "IPv4" + }, + { + "name": "lo", + "internal": true, + "mac": "00:00:00:00:00:00", + "address": "::1", + "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "wlp3s0", + "internal": false, + "mac": "7c:b0:c2:fe:93:86", + "address": "2600:100b:b011:583b:7eb0:c2ff:fefe:9386", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "wlp3s0", + "internal": false, + "mac": "7c:b0:c2:fe:93:86", + "address": "fe80::7eb0:c2ff:fefe:9386", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 3 + }, + { + "name": "docker0", + "internal": false, + "mac": "02:42:64:b5:eb:c5", + "address": "fe80::42:64ff:feb5:ebc5", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 5 + }, + { + "name": "br-e929893879ec", + "internal": false, + "mac": "02:42:77:2b:e8:70", + "address": "fe80::42:77ff:fe2b:e870", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 6 + }, + { + "name": "veth9f2842e", + "internal": false, + "mac": "02:97:03:9d:e0:38", + "address": "fe80::97:3ff:fe9d:e038", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 8 + }, + { + "name": "veth009c2b9", + "internal": false, + "mac": "e2:7b:8b:06:cb:6a", + "address": "fe80::e07b:8bff:fe06:cb6a", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 10 + }, + { + "name": "vethcfe1d35", + "internal": false, + "mac": "de:ee:14:2d:7e:e7", + "address": "fe80::dcee:14ff:fe2d:7ee7", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 12 + }, + { + "name": "vethff03ba3", + "internal": false, + "mac": "0e:99:63:87:38:fc", + "address": "fe80::c99:63ff:fe87:38fc", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 14 + } + ], + "host": "archlinux" + }, + "javascriptStack": { + "message": "No stack.", + "stack": [ + "Unavailable." + ] + }, + "nativeStack": [ + { + "pc": "0x000055daf3226e8a", + "symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, v8::Local) [/usr/bin/node]" + }, + { + "pc": "0x000055daf30e7d48", + "symbol": "node::OnFatalError(char const*, char const*) [/usr/bin/node]" + }, + { + "pc": "0x000055daf325b382", + "symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]" + }, + { + "pc": "0x000055daf325b5e8", + "symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]" + }, + { + "pc": "0x000055daf33e5906", + "symbol": " [/usr/bin/node]" + }, + { + "pc": "0x000055daf33e5a49", + "symbol": " [/usr/bin/node]" + }, + { + "pc": "0x000055daf33f822d", + "symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node]" + }, + { + "pc": "0x000055daf33f8f58", + "symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]" + }, + { + "pc": "0x000055daf33fb48c", + "symbol": "v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node]" + }, + { + "pc": "0x000055daf33fb4f4", + "symbol": "v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node]" + }, + { + "pc": "0x000055daf33c0396", + "symbol": "v8::internal::Factory::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [/usr/bin/node]" + }, + { + "pc": "0x000055daf33c8fd0", + "symbol": "v8::internal::Factory::NewRawTwoByteString(int, v8::internal::AllocationType) [/usr/bin/node]" + }, + { + "pc": "0x000055daf360c29e", + "symbol": "v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle, v8::internal::AllocationType) [/usr/bin/node]" + }, + { + "pc": "0x000055daf360d86c", + "symbol": "v8::internal::String::SlowEquals(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle) [/usr/bin/node]" + }, + { + "pc": "0x000055daf37375ab", + "symbol": "v8::internal::Runtime_StringEqual(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node]" + }, + { + "pc": "0x000055daf3a4abd9", + "symbol": " [/usr/bin/node]" + } + ], + "javascriptHeap": { + "totalMemory": 2152394752, + "totalCommittedMemory": 2150767368, + "usedMemory": 2135044960, + "availableMemory": 47808640, + "memoryLimit": 2197815296, + "heapSpaces": { + "read_only_space": { + "memorySize": 262144, + "committedMemory": 33328, + "capacity": 33040, + "used": 33040, + "available": 0 + }, + "new_space": { + "memorySize": 2097152, + "committedMemory": 1114192, + "capacity": 1047424, + "used": 66000, + "available": 981424 + }, + "old_space": { + "memorySize": 2049843200, + "committedMemory": 2049732712, + "capacity": 2037853328, + "used": 2037494080, + "available": 359248 + }, + "code_space": { + "memorySize": 10129408, + "committedMemory": 9828000, + "capacity": 8619200, + "used": 8619200, + "available": 0 + }, + "map_space": { + "memorySize": 1052672, + "committedMemory": 1048960, + "capacity": 735040, + "used": 735040, + "available": 0 + }, + "large_object_space": { + "memorySize": 88633344, + "committedMemory": 88633344, + "capacity": 87782784, + "used": 87782784, + "available": 0 + }, + "code_large_object_space": { + "memorySize": 376832, + "committedMemory": 376832, + "capacity": 314816, + "used": 314816, + "available": 0 + }, + "new_large_object_space": { + "memorySize": 0, + "committedMemory": 0, + "capacity": 1047424, + "used": 0, + "available": 1047424 + } + } + }, + "resourceUsage": { + "userCpuSeconds": 2203.37, + "kernelCpuSeconds": 38.1817, + "cpuConsumptionPercent": 34.1127, + "maxRss": 2532282368, + "pageFaults": { + "IORequired": 22, + "IONotRequired": 7984554 + }, + "fsActivity": { + "reads": 194080, + "writes": 24 + } + }, + "uvthreadResourceUsage": { + "userCpuSeconds": 1428.9, + "kernelCpuSeconds": 15.9159, + "cpuConsumptionPercent": 21.9878, + "fsActivity": { + "reads": 194080, + "writes": 24 + } + }, + "libuv": [ + ], + "environmentVariables": { + "COLORTERM": "truecolor", + "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus", + "DESKTOP_SESSION": "awesome", + "DISPLAY": ":0.0", + "EDITOR": "nano", + "FZF_DEFAULT_COMMAND": "ag --hidden --ignore .git -g \"\"", + "GDMSESSION": "awesome", + "GO111MODULE": "on", + "GOBIN": "/home/jordan/go/bin", + "GREP_COLOR": "37;45", + "GREP_COLORS": "mt=37;45", + "GTK_MODULES": "canberra-gtk-module", + "HOME": "/home/jordan", + "LANG": "C", + "LESS": "-F -g -i -M -R -S -w -X -z-4", + "LESS_TERMCAP_mb": "\u001b[01;31m", + "LESS_TERMCAP_md": "\u001b[01;31m", + "LESS_TERMCAP_me": "\u001b[0m", + "LESS_TERMCAP_se": "\u001b[0m", + "LESS_TERMCAP_so": "\u001b[00;47;30m", + "LESS_TERMCAP_ue": "\u001b[0m", + "LESS_TERMCAP_us": "\u001b[01;32m", + "LOGNAME": "jordan", + "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", + "MAIL": "/var/spool/mail/jordan", + "OLDPWD": "/home/jordan/Projects/project-citadel/web", + "PAGER": "less", + "PATH": "/home/jordan/.local/bin:/usr/local/bin:/usr/local/sbin:/home/nightwolf/Programs/cmake/bin:/home/nightwolf/Programs/idea-IU-163.13906.18/bin:/home/nightwolf/Programs/wpcli:/home/nightwolf/neovim/bin:/home/nightwolf/Programs/Postman:/home/nightwolf/Programs/Android_SDK/tools/bin:/home/nightwolf/Development/PhantomJS/bin:/home/nightwolf/Programs/node/bin:/home/nightwolf/pyenv/bin:/home/nightwolf/Programs/vv:/usr/bin:/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/go/bin:/home/jordan/go/bin:/home/jordan/.garden/bin:~/Programs/node/bin:~/.utilities:/home/jordan/.fzf/bin:/home/jordan/.gem/ruby/2.6.0/bin:/home/jordan/.garden/bin:~/Programs/node/bin:~/.utilities:/home/jordan/.gem/ruby/2.6.0/bin", + "PWD": "/home/jordan/Projects/project-citadel/web", + "SHELL": "/usr/bin/zsh", + "SHLVL": "2", + "SSH_AGENT_PID": "2150", + "SSH_AUTH_SOCK": "/tmp/ssh-agent.sock.1000", + "TERM": "xterm-256color", + "TMUX": "/tmp//tmux-1000/default,2216,1", + "TMUX_PANE": "%2", + "USER": "jordan", + "VIRTUALENVWRAPPER_PYTHON": "/usr/bin/python3", + "VIRTUAL_ENV_DISABLE_PROMPT": "12", + "VISUAL": "nano", + "VTE_VERSION": "5602", + "WINDOWID": "6291459", + "WORKON_HOME": "/home/jordan/.virtualenvs", + "XAUTHORITY": "/home/jordan/.Xauthority", + "XDG_GREETER_DATA_DIR": "/var/lib/lightdm-data/jordan", + "XDG_RUNTIME_DIR": "/run/user/1000", + "XDG_SEAT": "seat0", + "XDG_SEAT_PATH": "/org/freedesktop/DisplayManager/Seat0", + "XDG_SESSION_CLASS": "user", + "XDG_SESSION_DESKTOP": "awesome", + "XDG_SESSION_ID": "1", + "XDG_SESSION_PATH": "/org/freedesktop/DisplayManager/Session0", + "XDG_SESSION_TYPE": "x11", + "XDG_VTNR": "7", + "_": "/usr/bin/nvim", + "is_vim": "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'", + "tmux_version": "$(tmux -V | sed -En \"s/^tmux ([0-9]+(.[0-9]+)?).*/\\1/p\")", + "LC_MESSAGES": "", + "VIMRUNTIME": "/usr/share/nvim/runtime", + "NVIM_LISTEN_ADDRESS": "/tmp/nvimGEyAE0/0", + "MYVIMRC": "/home/jordan/.config/nvim/init.vim", + "COC_VIMCONFIG": "/home/jordan/.config/nvim", + "COC_DATA_HOME": "/home/jordan/.config/coc", + "TSS_LOG": "-level verbose -file /tmp/coc-nvim-tsc.log", + "NODE_PATH": "/home/jordan/Projects/project-citadel/web/node_modules" + }, + "userLimits": { + "core_file_size_blocks": { + "soft": "unlimited", + "hard": "unlimited" + }, + "data_seg_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "file_size_blocks": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_locked_memory_bytes": { + "soft": 65536, + "hard": 65536 + }, + "max_memory_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "open_files": { + "soft": 524288, + "hard": 524288 + }, + "stack_size_bytes": { + "soft": 8388608, + "hard": "unlimited" + }, + "cpu_time_seconds": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_user_processes": { + "soft": 31138, + "hard": 31138 + }, + "virtual_memory_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + } + }, + "sharedObjects": [ + "linux-vdso.so.1", + "/usr/lib/libz.so.1", + "/usr/lib/libcares.so.2", + "/usr/lib/libnghttp2.so.14", + "/usr/lib/libcrypto.so.1.1", + "/usr/lib/libssl.so.1.1", + "/usr/lib/libicui18n.so.65", + "/usr/lib/libicuuc.so.65", + "/usr/lib/libdl.so.2", + "/usr/lib/libstdc++.so.6", + "/usr/lib/libm.so.6", + "/usr/lib/libgcc_s.so.1", + "/usr/lib/libpthread.so.0", + "/usr/lib/libc.so.6", + "/usr/lib/libicudata.so.65", + "/lib64/ld-linux-x86-64.so.2" + ] +} \ No newline at end of file diff --git a/web/report.20200703.192901.99868.0.001.json b/web/report.20200703.192901.99868.0.001.json new file mode 100644 index 0000000..f45d7ae --- /dev/null +++ b/web/report.20200703.192901.99868.0.001.json @@ -0,0 +1,498 @@ + +{ + "header": { + "reportVersion": 1, + "event": "Allocation failed - JavaScript heap out of memory", + "trigger": "FatalError", + "filename": "report.20200703.192901.99868.0.001.json", + "dumpEventTime": "2020-07-03T19:29:01Z", + "dumpEventTimeStamp": "1593822541435", + "processId": 99868, + "cwd": "/home/jordan/Projects/project-citadel/web", + "commandLine": [ + "/usr/bin/node", + "/home/jordan/.config/coc/extensions/node_modules/coc-tsserver/bin/tsserverForkStart", + "/home/jordan/Projects/project-citadel/web/node_modules/typescript/lib/tsserver.js", + "--allowLocalPluginLoads", + "--useInferredProjectPerProjectRoot", + "--cancellationPipeName", + "/tmp/coc-nvim-tscancellation-c8c6c50b271560f15471.sock*", + "--npmLocation", + "\"/usr/bin/npm\"", + "--noGetErrOnBackgroundUpdate", + "--validateDefaultNpmLocation" + ], + "nodejsVersion": "v13.8.0", + "glibcVersionRuntime": "2.30", + "glibcVersionCompiler": "2.30", + "wordSize": 64, + "arch": "x64", + "platform": "linux", + "componentVersions": { + "node": "13.8.0", + "v8": "7.9.317.25-node.28", + "uv": "1.34.1", + "zlib": "1.2.11", + "brotli": "1.0.7", + "ares": "1.15.0", + "modules": "79", + "nghttp2": "1.39.2", + "napi": "5", + "llhttp": "2.0.4", + "openssl": "1.1.1d", + "cldr": "36.0", + "icu": "65.1", + "tz": "2019c", + "unicode": "12.1" + }, + "release": { + "name": "node", + "headersUrl": "https://nodejs.org/download/release/v13.8.0/node-v13.8.0-headers.tar.gz", + "sourceUrl": "https://nodejs.org/download/release/v13.8.0/node-v13.8.0.tar.gz" + }, + "osName": "Linux", + "osRelease": "4.19.101-1-lts", + "osVersion": "#1 SMP Sat, 01 Feb 2020 16:35:36 +0000", + "osMachine": "x86_64", + "cpus": [ + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 2800, + "user": 49033300, + "nice": 14200, + "sys": 10239800, + "idle": 199777400, + "irq": 1327100 + }, + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 2800, + "user": 46034200, + "nice": 20700, + "sys": 9673500, + "idle": 173927400, + "irq": 721000 + }, + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 2800, + "user": 46463200, + "nice": 15400, + "sys": 9416800, + "idle": 174061400, + "irq": 597100 + }, + { + "model": "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz", + "speed": 2800, + "user": 46337200, + "nice": 14900, + "sys": 9474300, + "idle": 174305900, + "irq": 487800 + } + ], + "networkInterfaces": [ + { + "name": "lo", + "internal": true, + "mac": "00:00:00:00:00:00", + "address": "127.0.0.1", + "netmask": "255.0.0.0", + "family": "IPv4" + }, + { + "name": "wlp3s0", + "internal": false, + "mac": "7c:b0:c2:fe:93:86", + "address": "192.168.43.5", + "netmask": "255.255.255.0", + "family": "IPv4" + }, + { + "name": "docker0", + "internal": false, + "mac": "02:42:84:c7:8c:b4", + "address": "172.17.0.1", + "netmask": "255.255.0.0", + "family": "IPv4" + }, + { + "name": "br-e929893879ec", + "internal": false, + "mac": "02:42:c6:97:95:8c", + "address": "172.19.0.1", + "netmask": "255.255.0.0", + "family": "IPv4" + }, + { + "name": "lo", + "internal": true, + "mac": "00:00:00:00:00:00", + "address": "::1", + "netmask": "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "wlp3s0", + "internal": false, + "mac": "7c:b0:c2:fe:93:86", + "address": "2600:100b:b018:172f:7eb0:c2ff:fefe:9386", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "wlp3s0", + "internal": false, + "mac": "7c:b0:c2:fe:93:86", + "address": "2600:100b:b009:7105:7eb0:c2ff:fefe:9386", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 0 + }, + { + "name": "wlp3s0", + "internal": false, + "mac": "7c:b0:c2:fe:93:86", + "address": "fe80::7eb0:c2ff:fefe:9386", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 3 + }, + { + "name": "docker0", + "internal": false, + "mac": "02:42:84:c7:8c:b4", + "address": "fe80::42:84ff:fec7:8cb4", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 5 + }, + { + "name": "br-e929893879ec", + "internal": false, + "mac": "02:42:c6:97:95:8c", + "address": "fe80::42:c6ff:fe97:958c", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 6 + }, + { + "name": "veth861c75f", + "internal": false, + "mac": "de:7f:bb:fc:33:a0", + "address": "fe80::dc7f:bbff:fefc:33a0", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 8 + }, + { + "name": "veth40b666f", + "internal": false, + "mac": "5e:46:25:1a:79:73", + "address": "fe80::5c46:25ff:fe1a:7973", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 10 + }, + { + "name": "vetha03af75", + "internal": false, + "mac": "7e:23:c2:9d:e8:db", + "address": "fe80::7c23:c2ff:fe9d:e8db", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 12 + }, + { + "name": "vethb492e80", + "internal": false, + "mac": "de:af:a3:79:1e:9a", + "address": "fe80::dcaf:a3ff:fe79:1e9a", + "netmask": "ffff:ffff:ffff:ffff::", + "family": "IPv6", + "scopeid": 14 + } + ], + "host": "archlinux" + }, + "javascriptStack": { + "message": "No stack.", + "stack": [ + "Unavailable." + ] + }, + "nativeStack": [ + { + "pc": "0x000055c2d7ceae8a", + "symbol": "report::TriggerNodeReport(v8::Isolate*, node::Environment*, char const*, char const*, std::__cxx11::basic_string, std::allocator > const&, v8::Local) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7babd48", + "symbol": "node::OnFatalError(char const*, char const*) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7d1f382", + "symbol": "v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7d1f5e8", + "symbol": "v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7ea9906", + "symbol": " [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7ea9a49", + "symbol": " [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7ebc22d", + "symbol": "v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7ebcf58", + "symbol": "v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7ebf48c", + "symbol": "v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7ebf4f4", + "symbol": "v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d7e8499b", + "symbol": "v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d81b5540", + "symbol": "v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node]" + }, + { + "pc": "0x000055c2d850ebd9", + "symbol": " [/usr/bin/node]" + } + ], + "javascriptHeap": { + "totalMemory": 2152599552, + "totalCommittedMemory": 2151011168, + "usedMemory": 2136228312, + "availableMemory": 47169120, + "memoryLimit": 2197815296, + "heapSpaces": { + "read_only_space": { + "memorySize": 262144, + "committedMemory": 33328, + "capacity": 33040, + "used": 33040, + "available": 0 + }, + "new_space": { + "memorySize": 2097152, + "committedMemory": 1353624, + "capacity": 1047424, + "used": 336544, + "available": 710880 + }, + "old_space": { + "memorySize": 2037784576, + "committedMemory": 2037430360, + "capacity": 2026077792, + "used": 2025882720, + "available": 195072 + }, + "code_space": { + "memorySize": 6721536, + "committedMemory": 6463424, + "capacity": 5718144, + "used": 5718144, + "available": 0 + }, + "map_space": { + "memorySize": 1052672, + "committedMemory": 1048960, + "capacity": 737680, + "used": 737680, + "available": 0 + }, + "large_object_space": { + "memorySize": 104304640, + "committedMemory": 104304640, + "capacity": 103205528, + "used": 103205528, + "available": 0 + }, + "code_large_object_space": { + "memorySize": 376832, + "committedMemory": 376832, + "capacity": 314656, + "used": 314656, + "available": 0 + }, + "new_large_object_space": { + "memorySize": 0, + "committedMemory": 0, + "capacity": 1047424, + "used": 0, + "available": 1047424 + } + } + }, + "resourceUsage": { + "userCpuSeconds": 2108.75, + "kernelCpuSeconds": 34.8424, + "cpuConsumptionPercent": 31.044, + "maxRss": 2328186880, + "pageFaults": { + "IORequired": 32, + "IONotRequired": 6292470 + }, + "fsActivity": { + "reads": 250312, + "writes": 24 + } + }, + "uvthreadResourceUsage": { + "userCpuSeconds": 1298.13, + "kernelCpuSeconds": 16.4946, + "cpuConsumptionPercent": 19.0388, + "fsActivity": { + "reads": 250312, + "writes": 24 + } + }, + "libuv": [ + ], + "environmentVariables": { + "COLORTERM": "truecolor", + "DBUS_SESSION_BUS_ADDRESS": "unix:path=/run/user/1000/bus", + "DESKTOP_SESSION": "awesome", + "DISPLAY": ":0.0", + "EDITOR": "nano", + "FZF_DEFAULT_COMMAND": "ag --hidden --ignore .git -g \"\"", + "GDMSESSION": "awesome", + "GO111MODULE": "on", + "GOBIN": "/home/jordan/go/bin", + "GREP_COLOR": "37;45", + "GREP_COLORS": "mt=37;45", + "GTK_MODULES": "canberra-gtk-module", + "HOME": "/home/jordan", + "LANG": "C", + "LESS": "-F -g -i -M -R -S -w -X -z-4", + "LESS_TERMCAP_mb": "\u001b[01;31m", + "LESS_TERMCAP_md": "\u001b[01;31m", + "LESS_TERMCAP_me": "\u001b[0m", + "LESS_TERMCAP_se": "\u001b[0m", + "LESS_TERMCAP_so": "\u001b[00;47;30m", + "LESS_TERMCAP_ue": "\u001b[0m", + "LESS_TERMCAP_us": "\u001b[01;32m", + "LOGNAME": "jordan", + "LS_COLORS": "rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", + "MAIL": "/var/spool/mail/jordan", + "OLDPWD": "/home/jordan/Projects/project-citadel/web", + "PAGER": "less", + "PATH": "/home/jordan/.local/bin:/usr/local/bin:/usr/local/sbin:/home/nightwolf/Programs/cmake/bin:/home/nightwolf/Programs/idea-IU-163.13906.18/bin:/home/nightwolf/Programs/wpcli:/home/nightwolf/neovim/bin:/home/nightwolf/Programs/Postman:/home/nightwolf/Programs/Android_SDK/tools/bin:/home/nightwolf/Development/PhantomJS/bin:/home/nightwolf/Programs/node/bin:/home/nightwolf/pyenv/bin:/home/nightwolf/Programs/vv:/usr/bin:/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/local/go/bin:/home/jordan/go/bin:/home/jordan/.garden/bin:~/Programs/node/bin:~/.utilities:/home/jordan/.fzf/bin:/home/jordan/.gem/ruby/2.6.0/bin:/home/jordan/.garden/bin:~/Programs/node/bin:~/.utilities:/home/jordan/.gem/ruby/2.6.0/bin", + "PWD": "/home/jordan/Projects/project-citadel/web", + "SHELL": "/usr/bin/zsh", + "SHLVL": "2", + "SSH_AGENT_PID": "1475", + "SSH_AUTH_SOCK": "/tmp/ssh-agent.sock.1000", + "TERM": "xterm-256color", + "TMUX": "/tmp//tmux-1000/default,1930,1", + "TMUX_PANE": "%3", + "USER": "jordan", + "VIRTUALENVWRAPPER_PYTHON": "/usr/bin/python3", + "VIRTUAL_ENV_DISABLE_PROMPT": "12", + "VISUAL": "nano", + "VTE_VERSION": "5602", + "WINDOWID": "6291459", + "WORKON_HOME": "/home/jordan/.virtualenvs", + "XAUTHORITY": "/home/jordan/.Xauthority", + "XDG_GREETER_DATA_DIR": "/var/lib/lightdm-data/jordan", + "XDG_RUNTIME_DIR": "/run/user/1000", + "XDG_SEAT": "seat0", + "XDG_SEAT_PATH": "/org/freedesktop/DisplayManager/Seat0", + "XDG_SESSION_CLASS": "user", + "XDG_SESSION_DESKTOP": "awesome", + "XDG_SESSION_ID": "1", + "XDG_SESSION_PATH": "/org/freedesktop/DisplayManager/Session0", + "XDG_SESSION_TYPE": "x11", + "XDG_VTNR": "7", + "_": "/usr/bin/nvim", + "is_vim": "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'", + "tmux_version": "$(tmux -V | sed -En \"s/^tmux ([0-9]+(.[0-9]+)?).*/\\1/p\")", + "LC_MESSAGES": "", + "VIMRUNTIME": "/usr/share/nvim/runtime", + "NVIM_LISTEN_ADDRESS": "/tmp/nvimerL06q/0", + "MYVIMRC": "/home/jordan/.config/nvim/init.vim", + "COC_VIMCONFIG": "/home/jordan/.config/nvim", + "COC_DATA_HOME": "/home/jordan/.config/coc", + "TSS_LOG": "-level verbose -file /tmp/coc-nvim-tsc.log", + "NODE_PATH": "/home/jordan/Projects/project-citadel/web/node_modules" + }, + "userLimits": { + "core_file_size_blocks": { + "soft": "unlimited", + "hard": "unlimited" + }, + "data_seg_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "file_size_blocks": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_locked_memory_bytes": { + "soft": 65536, + "hard": 65536 + }, + "max_memory_size_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + }, + "open_files": { + "soft": 524288, + "hard": 524288 + }, + "stack_size_bytes": { + "soft": 8388608, + "hard": "unlimited" + }, + "cpu_time_seconds": { + "soft": "unlimited", + "hard": "unlimited" + }, + "max_user_processes": { + "soft": 31137, + "hard": 31137 + }, + "virtual_memory_kbytes": { + "soft": "unlimited", + "hard": "unlimited" + } + }, + "sharedObjects": [ + "linux-vdso.so.1", + "/usr/lib/libz.so.1", + "/usr/lib/libcares.so.2", + "/usr/lib/libnghttp2.so.14", + "/usr/lib/libcrypto.so.1.1", + "/usr/lib/libssl.so.1.1", + "/usr/lib/libicui18n.so.65", + "/usr/lib/libicuuc.so.65", + "/usr/lib/libdl.so.2", + "/usr/lib/libstdc++.so.6", + "/usr/lib/libm.so.6", + "/usr/lib/libgcc_s.so.1", + "/usr/lib/libpthread.so.0", + "/usr/lib/libc.so.6", + "/usr/lib/libicudata.so.65", + "/lib64/ld-linux-x86-64.so.2" + ] +} \ No newline at end of file diff --git a/web/src/Admin/index.tsx b/web/src/Admin/index.tsx index 87ebe61..152511e 100644 --- a/web/src/Admin/index.tsx +++ b/web/src/Admin/index.tsx @@ -1,20 +1,57 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import Admin from 'shared/components/Admin'; +import Select from 'shared/components/Select'; import GlobalTopNavbar from 'App/TopNavbar'; -import { useUsersQuery, useCreateUserAccountMutation, UsersDocument } from 'shared/generated/graphql'; +import { + useUsersQuery, + useDeleteUserAccountMutation, + useCreateUserAccountMutation, + UsersDocument, + UsersQuery, +} from 'shared/generated/graphql'; import Input from 'shared/components/Input'; import styled from 'styled-components'; import Button from 'shared/components/Button'; import { useForm } from 'react-hook-form'; import { usePopup, Popup } from 'shared/components/PopupMenu'; import produce from 'immer'; +import updateApolloCache from 'shared/utils/cache'; +const DeleteUserWrapper = styled.div` + display: flex; + flex-direction: column; +`; + +const DeleteUserDescription = styled.p` + font-size: 14px; +`; + +const DeleteUserButton = styled(Button)` + margin-top: 6px; + padding: 6px 12px; + width: 100%; +`; + +type DeleteUserPopupProps = { + onDeleteUser: () => void; +}; +const DeleteUserPopup: React.FC = ({ onDeleteUser }) => { + return ( + + Deleting this user will remove all user related data. + onDeleteUser()} color="danger"> + Delete user + + + ); +}; type CreateUserData = { email: string; username: string; fullName: string; initials: string; password: string; + roleCode: string; }; const CreateUserForm = styled.form` display: flex; @@ -34,11 +71,16 @@ const InputError = styled.span` color: rgba(${props => props.theme.colors.danger}); font-size: 12px; `; + type AddUserPopupProps = { onAddUser: (user: CreateUserData) => void; }; + const AddUserPopup: React.FC = ({ onAddUser }) => { - const { register, handleSubmit, errors } = useForm(); + const { register, handleSubmit, errors, setValue } = useForm(); + const [role, setRole] = useState(null); + register({ name: 'roleCode' }, { required: true }); + const createUser = (data: CreateUserData) => { onAddUser(data); }; @@ -63,6 +105,18 @@ const AddUserPopup: React.FC = ({ onAddUser }) => { variant="alternate" ref={register({ required: 'Email is required' })} /> + { + onChange(e); + }} + value={value} + styles={colourStyles} + classNamePrefix="teamSelect" + options={options} + /> + {label && {label}} + + ); +}; + +export default SelectElement; diff --git a/web/src/shared/components/Settings/Settings.stories.tsx b/web/src/shared/components/Settings/Settings.stories.tsx index 6b84d4c..6bc5a80 100644 --- a/web/src/shared/components/Settings/Settings.stories.tsx +++ b/web/src/shared/components/Settings/Settings.stories.tsx @@ -14,7 +14,12 @@ export default { ], }, }; -const profile = { url: 'http://localhost:3333/uploads/headshot.png', bgColor: '#000', initials: 'JK' }; +const profile = { + id: '1', + fullName: 'Jordan Knott', + username: 'jordanthedev', + profileIcon: { url: 'http://localhost:3333/uploads/headshot.png', bgColor: '#000', initials: 'JK' }, +}; export const Default = () => { return ( <> diff --git a/web/src/shared/components/Settings/index.tsx b/web/src/shared/components/Settings/index.tsx index 4b6378c..82cb0e3 100644 --- a/web/src/shared/components/Settings/index.tsx +++ b/web/src/shared/components/Settings/index.tsx @@ -228,7 +228,7 @@ const SaveButton = styled(Button)` type SettingsProps = { onProfileAvatarChange: () => void; onProfileAvatarRemove: () => void; - profile: ProfileIcon; + profile: TaskUser; }; const Settings: React.FC = ({ onProfileAvatarRemove, onProfileAvatarChange, profile }) => { @@ -261,11 +261,15 @@ const Settings: React.FC = ({ onProfileAvatarRemove, onProfileAva - - - + + + diff --git a/web/src/shared/components/TaskAssignee/index.tsx b/web/src/shared/components/TaskAssignee/index.tsx index 9dc2742..a19f2cf 100644 --- a/web/src/shared/components/TaskAssignee/index.tsx +++ b/web/src/shared/components/TaskAssignee/index.tsx @@ -1,11 +1,28 @@ import React, { useRef } from 'react'; import styled from 'styled-components'; +import { DoubleChevronUp, Crown } from 'shared/icons'; + +export const AdminIcon = styled(DoubleChevronUp)` + bottom: 0; + right: 1px; + position: absolute; + fill: #c377e0; +`; + +export const OwnerIcon = styled(Crown)` + bottom: 0; + right: 1px; + position: absolute; + fill: #c8b928; +`; const TaskDetailAssignee = styled.div` - &:hover { - opacity: 0.8; - } - margin-right: 4px; + cursor: pointer; + margin: 0 0 0 -2px; + border-radius: 50%; + display: flex; + align-items: center; + position: relative; float: left; `; @@ -16,24 +33,30 @@ export const Wrapper = styled.div<{ size: number | string; bgColor: string | nul display: flex; align-items: center; justify-content: center; - color: #fff; + color: rgba(${props => (props.backgroundURL ? props.theme.colors.text.primary : '0,0,0')}); background: ${props => (props.backgroundURL ? `url(${props.backgroundURL})` : props.bgColor)}; background-position: center; background-size: contain; font-size: 14px; font-weight: 400; + &:hover { + opacity: 0.8; + } `; type TaskAssigneeProps = { size: number | string; + showRoleIcons?: boolean; member: TaskUser; onMemberProfile: ($targetRef: React.RefObject, memberID: string) => void; + className?: string; }; -const TaskAssignee: React.FC = ({ member, onMemberProfile, size }) => { +const TaskAssignee: React.FC = ({ showRoleIcons, member, onMemberProfile, size, className }) => { const $memberRef = useRef(null); return ( { e.stopPropagation(); @@ -44,6 +67,8 @@ const TaskAssignee: React.FC = ({ member, onMemberProfile, si {(!member.profileIcon.url && member.profileIcon.initials) ?? ''} + {showRoleIcons && member.role && member.role.code === 'admin' && } + {showRoleIcons && member.role && member.role.code === 'owner' && } ); }; diff --git a/web/src/shared/components/TaskDetails/Styles.ts b/web/src/shared/components/TaskDetails/Styles.ts index e17acc1..ee91c4d 100644 --- a/web/src/shared/components/TaskDetails/Styles.ts +++ b/web/src/shared/components/TaskDetails/Styles.ts @@ -179,6 +179,10 @@ export const TaskDetailsMarkdown = styled.div` margin: 8px 8px 8px 24px; list-style: disc; } + + p a { + color: rgba(${props => props.theme.colors.primary}); + } `; export const TaskDetailsControls = styled.div` diff --git a/web/src/shared/components/TopNavbar/Styles.ts b/web/src/shared/components/TopNavbar/Styles.ts index 1c26cd4..fa2c2b3 100644 --- a/web/src/shared/components/TopNavbar/Styles.ts +++ b/web/src/shared/components/TopNavbar/Styles.ts @@ -3,7 +3,12 @@ import TextareaAutosize from 'react-autosize-textarea'; import { mixin } from 'shared/utils/styles'; import Button from 'shared/components/Button'; import { Citadel } from 'shared/icons'; -import { Link } from 'react-router-dom'; +import { NavLink, Link } from 'react-router-dom'; +import TaskAssignee from 'shared/components/TaskAssignee'; +export const ProjectMember = styled(TaskAssignee)<{ zIndex: number }>` + z-index: ${props => props.zIndex}; + position: relative; +`; export const NavbarWrapper = styled.div` width: 100%; @@ -110,7 +115,7 @@ export const ProjectTabs = styled.div` max-width: 100%; `; -export const ProjectTab = styled.span<{ active?: boolean }>` +export const ProjectTab = styled(NavLink)` font-size: 80%; color: rgba(${props => props.theme.colors.text.primary}); font-size: 15px; @@ -128,18 +133,19 @@ export const ProjectTab = styled.span<{ active?: boolean }>` margin-right: 20px; } - ${props => - props.active - ? css` - box-shadow: inset 0 -2px rgba(${props.theme.colors.secondary}); - color: rgba(${props.theme.colors.secondary}); - ` - : css` - &:hover { - box-shadow: inset 0 -2px rgba(${props.theme.colors.text.secondary}); - color: rgba(${props.theme.colors.text.secondary}); - } - `} + &:hover { + box-shadow: inset 0 -2px rgba(${props => props.theme.colors.text.secondary}); + color: rgba(${props => props.theme.colors.text.secondary}); + } + + &.active { + box-shadow: inset 0 -2px rgba(${props => props.theme.colors.secondary}); + color: rgba(${props => props.theme.colors.secondary}); + } + &.active:hover { + box-shadow: inset 0 -2px rgba(${props => props.theme.colors.secondary}); + color: rgba(${props => props.theme.colors.secondary}); + } `; export const ProjectName = styled.h1` diff --git a/web/src/shared/components/TopNavbar/TopNavbar.stories.tsx b/web/src/shared/components/TopNavbar/TopNavbar.stories.tsx index d56dcb1..22f6bb2 100644 --- a/web/src/shared/components/TopNavbar/TopNavbar.stories.tsx +++ b/web/src/shared/components/TopNavbar/TopNavbar.stories.tsx @@ -37,9 +37,11 @@ export const Default = () => { bgColor: '#000', }, }} + onChangeRole={action('change role')} onNotificationClick={action('notifications click')} onOpenSettings={action('open settings')} onDashboardClick={action('open dashboard')} + onRemoveFromBoard={action('remove project')} onProfileClick={action('profile click')} /> diff --git a/web/src/shared/components/TopNavbar/index.tsx b/web/src/shared/components/TopNavbar/index.tsx index 90af25d..2cfe551 100644 --- a/web/src/shared/components/TopNavbar/index.tsx +++ b/web/src/shared/components/TopNavbar/index.tsx @@ -4,6 +4,7 @@ import styled from 'styled-components'; import ProfileIcon from 'shared/components/ProfileIcon'; import TaskAssignee from 'shared/components/TaskAssignee'; import { usePopup, Popup } from 'shared/components/PopupMenu'; +import { RoleCode } from 'shared/generated/graphql'; import MiniProfile from 'shared/components/MiniProfile'; import { CitadelLogo, @@ -27,6 +28,7 @@ import { ProfileNameWrapper, ProfileNamePrimary, ProfileNameSecondary, + ProjectMember, ProjectMembers, } from './Styles'; import { Link } from 'react-router-dom'; @@ -115,8 +117,9 @@ const ProjectHeading: React.FC = ({ ); }; -type MenuType = { - [key: number]: string; +export type MenuItem = { + name: string; + link: string; }; type MenuTypes = { [key: string]: Array; @@ -128,28 +131,36 @@ export const MENU_TYPES: MenuTypes = { }; type NavBarProps = { - menuType?: Array | null; + menuType?: Array | null; name: string | null; currentTab?: number; + onSetTab?: (tab: number) => void; onOpenProjectFinder: ($target: React.RefObject) => void; + onChangeProjectOwner?: (userID: string) => void; + onChangeRole?: (userID: string, roleCode: RoleCode) => void; onFavorite?: () => void; onProfileClick: ($target: React.RefObject) => void; - onTabClick?: (tab: number) => void; onSaveName?: (name: string) => void; onNotificationClick: () => void; + onInviteUser?: ($target: React.RefObject) => void; onDashboardClick: () => void; user: TaskUser | null; onOpenSettings: ($target: React.RefObject) => void; projectMembers?: Array | null; + onRemoveFromBoard?: (userID: string) => void; }; const NavBar: React.FC = ({ menuType, + onInviteUser, + onChangeProjectOwner, currentTab, onOpenProjectFinder, onFavorite, - onTabClick, + onSetTab, + onChangeRole, name, + onRemoveFromBoard, onSaveName, onProfileClick, onNotificationClick, @@ -165,18 +176,44 @@ const NavBar: React.FC = ({ }; const { showPopup } = usePopup(); const onMemberProfile = ($targetRef: React.RefObject, memberID: string) => { - showPopup( - $targetRef, - {}} tab={0}> + const member = projectMembers ? projectMembers.find(u => u.id === memberID) : null; + const warning = + 'You can’t leave because you are the only admin. To make another user an admin, click their avatar, select “Change permissions…”, and select “Admin”.'; + if (member) { + console.log(member); + showPopup( + $targetRef, {}} - /> - , - ); + warning={member.role && member.role.code === 'owner' ? warning : null} + onChangeProjectOwner={ + member.role && member.role.code !== 'owner' + ? (userID: string) => { + if (user && onChangeProjectOwner) { + onChangeProjectOwner(userID); + } + } + : undefined + } + canChangeRole={member.role && member.role.code !== 'owner'} + onChangeRole={roleCode => { + if (onChangeRole) { + onChangeRole(member.id, roleCode); + } + }} + onRemoveFromBoard={ + member.role && member.role.code === 'owner' + ? undefined + : () => { + if (onRemoveFromBoard) { + onRemoveFromBoard(member.id); + } + } + } + user={member} + bio="" + />, + ); + } }; return ( @@ -196,11 +233,17 @@ const NavBar: React.FC = ({ {name && ( {menuType && - menuType.map((name, idx) => { - console.log(`${name} : ${idx} === ${currentTab}`); + menuType.map((menu, idx) => { return ( - - {name} + { + // TODO + }} + > + {menu.name} ); })} @@ -215,10 +258,26 @@ const NavBar: React.FC = ({ {projectMembers && ( <> - {projectMembers.map(member => ( - + {projectMembers.map((member, idx) => ( + ))} - Invite + { + if (onInviteUser) { + onInviteUser($target); + } + }} + variant="outline" + > + Invite + diff --git a/web/src/shared/constants/labelColors.ts b/web/src/shared/constants/labelColors.ts index 7b0385a..9d74628 100644 --- a/web/src/shared/constants/labelColors.ts +++ b/web/src/shared/constants/labelColors.ts @@ -11,4 +11,22 @@ const LabelColors = { BLACK: '#344563', }; +export const DarkLabelColors = { + RED: '#e8384f', + ORANGE: '#fd612c', + YELLOW_ORANGE: '#fd9a00', + YELLOW: '#eec300', + YELLOW_GREEN: '#a4cf30', + GREEN: '#62d26f', + BLUE_GREEN: '#37c5ab', + AQUA: '#20aaea', + BLUE: '#4186e0', + INDIGO: '#7a6ff0', + PURPLE: '#aa62e3', + MAGENTA: '#e362e3', + HOT_PINK: '#ea4e9d', + PINK: '#fc91ad', + COOL_GRAY: '#8da3a6', +}; + export default LabelColors; diff --git a/web/src/shared/generated/graphql.tsx b/web/src/shared/generated/graphql.tsx index 3893397..a0d38cd 100644 --- a/web/src/shared/generated/graphql.tsx +++ b/web/src/shared/generated/graphql.tsx @@ -17,6 +17,13 @@ export type Scalars = { +export enum RoleCode { + Owner = 'owner', + Admin = 'admin', + Member = 'member', + Observer = 'observer' +} + export type ProjectLabel = { __typename?: 'ProjectLabel'; id: Scalars['ID']; @@ -47,10 +54,12 @@ export type ProfileIcon = { bgColor?: Maybe; }; -export type ProjectMember = { - __typename?: 'ProjectMember'; +export type Member = { + __typename?: 'Member'; id: Scalars['ID']; + role: Role; fullName: Scalars['String']; + username: Scalars['String']; profileIcon: ProfileIcon; }; @@ -62,6 +71,12 @@ export type RefreshToken = { createdAt: Scalars['Time']; }; +export type Role = { + __typename?: 'Role'; + code: Scalars['String']; + name: Scalars['String']; +}; + export type UserAccount = { __typename?: 'UserAccount'; id: Scalars['ID']; @@ -69,6 +84,7 @@ export type UserAccount = { createdAt: Scalars['Time']; fullName: Scalars['String']; initials: Scalars['String']; + role: Role; username: Scalars['String']; profileIcon: ProfileIcon; }; @@ -78,7 +94,7 @@ export type Team = { id: Scalars['ID']; createdAt: Scalars['Time']; name: Scalars['String']; - members: Array; + members: Array; }; export type Project = { @@ -87,9 +103,9 @@ export type Project = { createdAt: Scalars['Time']; name: Scalars['String']; team: Team; - owner: ProjectMember; + owner: Member; taskGroups: Array; - members: Array; + members: Array; labels: Array; }; @@ -124,36 +140,34 @@ export type Task = { description?: Maybe; dueDate?: Maybe; complete: Scalars['Boolean']; - assigned: Array; + assigned: Array; labels: Array; checklists: Array; badges: TaskBadges; }; -export type ProjectsFilter = { - teamID?: Maybe; -}; - -export type FindUser = { - userId: Scalars['String']; -}; - -export type FindProject = { - projectId: Scalars['String']; -}; - -export type FindTask = { - taskID: Scalars['UUID']; -}; - export type Organization = { __typename?: 'Organization'; id: Scalars['ID']; name: Scalars['String']; }; -export type FindTeam = { - teamID: Scalars['UUID']; +export type TaskChecklistItem = { + __typename?: 'TaskChecklistItem'; + id: Scalars['ID']; + name: Scalars['String']; + taskChecklistID: Scalars['UUID']; + complete: Scalars['Boolean']; + position: Scalars['Float']; + dueDate: Scalars['Time']; +}; + +export type TaskChecklist = { + __typename?: 'TaskChecklist'; + id: Scalars['ID']; + name: Scalars['String']; + position: Scalars['Float']; + items: Array; }; export type Query = { @@ -196,21 +210,299 @@ export type QueryFindTeamArgs = { input: FindTeam; }; -export type NewRefreshToken = { +export type Mutation = { + __typename?: 'Mutation'; + addTaskLabel: Task; + assignTask: Task; + clearProfileAvatar: UserAccount; + createProject: Project; + createProjectLabel: ProjectLabel; + createProjectMember: CreateProjectMemberPayload; + createRefreshToken: RefreshToken; + createTask: Task; + createTaskChecklist: TaskChecklist; + createTaskChecklistItem: TaskChecklistItem; + createTaskGroup: TaskGroup; + createTeam: Team; + createTeamMember: CreateTeamMemberPayload; + createUserAccount: UserAccount; + deleteProject: DeleteProjectPayload; + deleteProjectLabel: ProjectLabel; + deleteProjectMember: DeleteProjectMemberPayload; + deleteTask: DeleteTaskPayload; + deleteTaskChecklist: DeleteTaskChecklistPayload; + deleteTaskChecklistItem: DeleteTaskChecklistItemPayload; + deleteTaskGroup: DeleteTaskGroupPayload; + deleteTeam: DeleteTeamPayload; + deleteTeamMember: DeleteTeamMemberPayload; + deleteUserAccount: DeleteUserAccountPayload; + logoutUser: Scalars['Boolean']; + removeTaskLabel: Task; + setProjectOwner: SetProjectOwnerPayload; + setTaskChecklistItemComplete: TaskChecklistItem; + setTaskComplete: Task; + setTeamOwner: SetTeamOwnerPayload; + toggleTaskLabel: ToggleTaskLabelPayload; + unassignTask: Task; + updateProjectLabel: ProjectLabel; + updateProjectLabelColor: ProjectLabel; + updateProjectLabelName: ProjectLabel; + updateProjectMemberRole: UpdateProjectMemberRolePayload; + updateProjectName: Project; + updateTaskChecklistItemName: TaskChecklistItem; + updateTaskChecklistName: TaskChecklist; + updateTaskDescription: Task; + updateTaskDueDate: Task; + updateTaskGroupLocation: TaskGroup; + updateTaskGroupName: TaskGroup; + updateTaskLocation: UpdateTaskLocationPayload; + updateTaskName: Task; + updateTeamMemberRole: UpdateTeamMemberRolePayload; +}; + + +export type MutationAddTaskLabelArgs = { + input?: Maybe; +}; + + +export type MutationAssignTaskArgs = { + input?: Maybe; +}; + + +export type MutationCreateProjectArgs = { + input: NewProject; +}; + + +export type MutationCreateProjectLabelArgs = { + input: NewProjectLabel; +}; + + +export type MutationCreateProjectMemberArgs = { + input: CreateProjectMember; +}; + + +export type MutationCreateRefreshTokenArgs = { + input: NewRefreshToken; +}; + + +export type MutationCreateTaskArgs = { + input: NewTask; +}; + + +export type MutationCreateTaskChecklistArgs = { + input: CreateTaskChecklist; +}; + + +export type MutationCreateTaskChecklistItemArgs = { + input: CreateTaskChecklistItem; +}; + + +export type MutationCreateTaskGroupArgs = { + input: NewTaskGroup; +}; + + +export type MutationCreateTeamArgs = { + input: NewTeam; +}; + + +export type MutationCreateTeamMemberArgs = { + input: CreateTeamMember; +}; + + +export type MutationCreateUserAccountArgs = { + input: NewUserAccount; +}; + + +export type MutationDeleteProjectArgs = { + input: DeleteProject; +}; + + +export type MutationDeleteProjectLabelArgs = { + input: DeleteProjectLabel; +}; + + +export type MutationDeleteProjectMemberArgs = { + input: DeleteProjectMember; +}; + + +export type MutationDeleteTaskArgs = { + input: DeleteTaskInput; +}; + + +export type MutationDeleteTaskChecklistArgs = { + input: DeleteTaskChecklist; +}; + + +export type MutationDeleteTaskChecklistItemArgs = { + input: DeleteTaskChecklistItem; +}; + + +export type MutationDeleteTaskGroupArgs = { + input: DeleteTaskGroupInput; +}; + + +export type MutationDeleteTeamArgs = { + input: DeleteTeam; +}; + + +export type MutationDeleteTeamMemberArgs = { + input: DeleteTeamMember; +}; + + +export type MutationDeleteUserAccountArgs = { + input: DeleteUserAccount; +}; + + +export type MutationLogoutUserArgs = { + input: LogoutUser; +}; + + +export type MutationRemoveTaskLabelArgs = { + input?: Maybe; +}; + + +export type MutationSetProjectOwnerArgs = { + input: SetProjectOwner; +}; + + +export type MutationSetTaskChecklistItemCompleteArgs = { + input: SetTaskChecklistItemComplete; +}; + + +export type MutationSetTaskCompleteArgs = { + input: SetTaskComplete; +}; + + +export type MutationSetTeamOwnerArgs = { + input: SetTeamOwner; +}; + + +export type MutationToggleTaskLabelArgs = { + input: ToggleTaskLabelInput; +}; + + +export type MutationUnassignTaskArgs = { + input?: Maybe; +}; + + +export type MutationUpdateProjectLabelArgs = { + input: UpdateProjectLabel; +}; + + +export type MutationUpdateProjectLabelColorArgs = { + input: UpdateProjectLabelColor; +}; + + +export type MutationUpdateProjectLabelNameArgs = { + input: UpdateProjectLabelName; +}; + + +export type MutationUpdateProjectMemberRoleArgs = { + input: UpdateProjectMemberRole; +}; + + +export type MutationUpdateProjectNameArgs = { + input?: Maybe; +}; + + +export type MutationUpdateTaskChecklistItemNameArgs = { + input: UpdateTaskChecklistItemName; +}; + + +export type MutationUpdateTaskChecklistNameArgs = { + input: UpdateTaskChecklistName; +}; + + +export type MutationUpdateTaskDescriptionArgs = { + input: UpdateTaskDescriptionInput; +}; + + +export type MutationUpdateTaskDueDateArgs = { + input: UpdateTaskDueDate; +}; + + +export type MutationUpdateTaskGroupLocationArgs = { + input: NewTaskGroupLocation; +}; + + +export type MutationUpdateTaskGroupNameArgs = { + input: UpdateTaskGroupName; +}; + + +export type MutationUpdateTaskLocationArgs = { + input: NewTaskLocation; +}; + + +export type MutationUpdateTaskNameArgs = { + input: UpdateTaskName; +}; + + +export type MutationUpdateTeamMemberRoleArgs = { + input: UpdateTeamMemberRole; +}; + +export type ProjectsFilter = { + teamID?: Maybe; +}; + +export type FindUser = { userId: Scalars['String']; }; -export type NewUserAccount = { - username: Scalars['String']; - email: Scalars['String']; - fullName: Scalars['String']; - initials: Scalars['String']; - password: Scalars['String']; +export type FindProject = { + projectId: Scalars['String']; }; -export type NewTeam = { - name: Scalars['String']; - organizationID: Scalars['UUID']; +export type FindTask = { + taskID: Scalars['UUID']; +}; + +export type FindTeam = { + teamID: Scalars['UUID']; }; export type NewProject = { @@ -219,104 +511,19 @@ export type NewProject = { name: Scalars['String']; }; -export type NewTaskGroup = { - projectID: Scalars['String']; - name: Scalars['String']; - position: Scalars['Float']; -}; - -export type LogoutUser = { - userID: Scalars['String']; -}; - -export type NewTask = { - taskGroupID: Scalars['String']; - name: Scalars['String']; - position: Scalars['Float']; -}; - -export type NewTaskLocation = { - taskID: Scalars['UUID']; - taskGroupID: Scalars['UUID']; - position: Scalars['Float']; -}; - -export type DeleteTaskInput = { - taskID: Scalars['String']; -}; - -export type DeleteTaskPayload = { - __typename?: 'DeleteTaskPayload'; - taskID: Scalars['String']; -}; - -export type UpdateTaskName = { - taskID: Scalars['String']; +export type UpdateProjectName = { + projectID: Scalars['UUID']; name: Scalars['String']; }; -export type NewTaskGroupLocation = { - taskGroupID: Scalars['UUID']; - position: Scalars['Float']; +export type DeleteProject = { + projectID: Scalars['UUID']; }; -export type DeleteTaskGroupInput = { - taskGroupID: Scalars['UUID']; -}; - -export type DeleteTaskGroupPayload = { - __typename?: 'DeleteTaskGroupPayload'; +export type DeleteProjectPayload = { + __typename?: 'DeleteProjectPayload'; ok: Scalars['Boolean']; - affectedRows: Scalars['Int']; - taskGroup: TaskGroup; -}; - -export type DeleteTaskChecklistItemPayload = { - __typename?: 'DeleteTaskChecklistItemPayload'; - ok: Scalars['Boolean']; - taskChecklistItem: TaskChecklistItem; -}; - -export type TaskChecklistItem = { - __typename?: 'TaskChecklistItem'; - id: Scalars['ID']; - name: Scalars['String']; - taskChecklistID: Scalars['UUID']; - complete: Scalars['Boolean']; - position: Scalars['Float']; - dueDate: Scalars['Time']; -}; - -export type TaskChecklist = { - __typename?: 'TaskChecklist'; - id: Scalars['ID']; - name: Scalars['String']; - position: Scalars['Float']; - items: Array; -}; - -export type AssignTaskInput = { - taskID: Scalars['UUID']; - userID: Scalars['UUID']; -}; - -export type UnassignTaskInput = { - taskID: Scalars['UUID']; - userID: Scalars['UUID']; -}; - -export type UpdateTaskDescriptionInput = { - taskID: Scalars['UUID']; - description: Scalars['String']; -}; - -export type AddTaskLabelInput = { - taskID: Scalars['UUID']; - projectLabelID: Scalars['UUID']; -}; - -export type RemoveTaskLabelInput = { - taskLabelID: Scalars['UUID']; + project: Project; }; export type NewProjectLabel = { @@ -345,20 +552,72 @@ export type UpdateProjectLabelColor = { labelColorID: Scalars['UUID']; }; -export type ToggleTaskLabelInput = { - taskID: Scalars['UUID']; - projectLabelID: Scalars['UUID']; -}; - -export type ToggleTaskLabelPayload = { - __typename?: 'ToggleTaskLabelPayload'; - active: Scalars['Boolean']; - task: Task; -}; - -export type UpdateProjectName = { +export type CreateProjectMember = { projectID: Scalars['UUID']; + userID: Scalars['UUID']; +}; + +export type CreateProjectMemberPayload = { + __typename?: 'CreateProjectMemberPayload'; + ok: Scalars['Boolean']; + member: Member; +}; + +export type DeleteProjectMember = { + projectID: Scalars['UUID']; + userID: Scalars['UUID']; +}; + +export type DeleteProjectMemberPayload = { + __typename?: 'DeleteProjectMemberPayload'; + ok: Scalars['Boolean']; + member: Member; + projectID: Scalars['UUID']; +}; + +export type UpdateProjectMemberRole = { + projectID: Scalars['UUID']; + userID: Scalars['UUID']; + roleCode: RoleCode; +}; + +export type UpdateProjectMemberRolePayload = { + __typename?: 'UpdateProjectMemberRolePayload'; + ok: Scalars['Boolean']; + member: Member; +}; + +export type SetProjectOwner = { + projectID: Scalars['UUID']; + ownerID: Scalars['UUID']; +}; + +export type SetProjectOwnerPayload = { + __typename?: 'SetProjectOwnerPayload'; + ok: Scalars['Boolean']; + prevOwner: Member; + newOwner: Member; +}; + +export type NewTask = { + taskGroupID: Scalars['String']; name: Scalars['String']; + position: Scalars['Float']; +}; + +export type AssignTaskInput = { + taskID: Scalars['UUID']; + userID: Scalars['UUID']; +}; + +export type UnassignTaskInput = { + taskID: Scalars['UUID']; + userID: Scalars['UUID']; +}; + +export type UpdateTaskDescriptionInput = { + taskID: Scalars['UUID']; + description: Scalars['String']; }; export type UpdateTaskLocationPayload = { @@ -367,11 +626,6 @@ export type UpdateTaskLocationPayload = { task: Task; }; -export type UpdateTaskGroupName = { - taskGroupID: Scalars['UUID']; - name: Scalars['String']; -}; - export type UpdateTaskDueDate = { taskID: Scalars['UUID']; dueDate?: Maybe; @@ -382,12 +636,38 @@ export type SetTaskComplete = { complete: Scalars['Boolean']; }; +export type NewTaskLocation = { + taskID: Scalars['UUID']; + taskGroupID: Scalars['UUID']; + position: Scalars['Float']; +}; + +export type DeleteTaskInput = { + taskID: Scalars['String']; +}; + +export type DeleteTaskPayload = { + __typename?: 'DeleteTaskPayload'; + taskID: Scalars['String']; +}; + +export type UpdateTaskName = { + taskID: Scalars['String']; + name: Scalars['String']; +}; + export type CreateTaskChecklist = { taskID: Scalars['UUID']; name: Scalars['String']; position: Scalars['Float']; }; +export type DeleteTaskChecklistItemPayload = { + __typename?: 'DeleteTaskChecklistItemPayload'; + ok: Scalars['Boolean']; + taskChecklistItem: TaskChecklistItem; +}; + export type CreateTaskChecklistItem = { taskChecklistID: Scalars['UUID']; name: Scalars['String']; @@ -408,48 +688,6 @@ export type UpdateTaskChecklistItemName = { name: Scalars['String']; }; -export type CreateTeamMember = { - userID: Scalars['UUID']; - teamID: Scalars['UUID']; -}; - -export type CreateTeamMemberPayload = { - __typename?: 'CreateTeamMemberPayload'; - team: Team; - teamMember: ProjectMember; -}; - -export type DeleteProject = { - projectID: Scalars['UUID']; -}; - -export type DeleteProjectPayload = { - __typename?: 'DeleteProjectPayload'; - ok: Scalars['Boolean']; - project: Project; -}; - -export type DeleteTeam = { - teamID: Scalars['UUID']; -}; - -export type DeleteTeamPayload = { - __typename?: 'DeleteTeamPayload'; - ok: Scalars['Boolean']; - team: Team; - projects: Array; -}; - -export type DeleteUserAccount = { - userID: Scalars['UUID']; -}; - -export type DeleteUserAccountPayload = { - __typename?: 'DeleteUserAccountPayload'; - ok: Scalars['Boolean']; - userAccount: UserAccount; -}; - export type UpdateTaskChecklistName = { taskChecklistID: Scalars['UUID']; name: Scalars['String']; @@ -465,237 +703,140 @@ export type DeleteTaskChecklistPayload = { taskChecklist: TaskChecklist; }; -export type Mutation = { - __typename?: 'Mutation'; - createRefreshToken: RefreshToken; - createUserAccount: UserAccount; - deleteUserAccount: DeleteUserAccountPayload; - deleteTeam: DeleteTeamPayload; - createTeam: Team; - clearProfileAvatar: UserAccount; - createTeamMember: CreateTeamMemberPayload; - createProject: Project; - deleteProject: DeleteProjectPayload; - updateProjectName: Project; - createProjectLabel: ProjectLabel; - deleteProjectLabel: ProjectLabel; - updateProjectLabel: ProjectLabel; - updateProjectLabelName: ProjectLabel; - updateProjectLabelColor: ProjectLabel; - createTaskGroup: TaskGroup; - updateTaskGroupLocation: TaskGroup; - updateTaskGroupName: TaskGroup; - deleteTaskGroup: DeleteTaskGroupPayload; - addTaskLabel: Task; - removeTaskLabel: Task; - toggleTaskLabel: ToggleTaskLabelPayload; - createTaskChecklist: TaskChecklist; - deleteTaskChecklist: DeleteTaskChecklistPayload; - updateTaskChecklistName: TaskChecklist; - createTaskChecklistItem: TaskChecklistItem; - updateTaskChecklistItemName: TaskChecklistItem; - setTaskChecklistItemComplete: TaskChecklistItem; - deleteTaskChecklistItem: DeleteTaskChecklistItemPayload; - createTask: Task; - updateTaskDescription: Task; - updateTaskLocation: UpdateTaskLocationPayload; - updateTaskName: Task; - setTaskComplete: Task; - updateTaskDueDate: Task; - deleteTask: DeleteTaskPayload; - assignTask: Task; - unassignTask: Task; - logoutUser: Scalars['Boolean']; +export type NewTaskGroupLocation = { + taskGroupID: Scalars['UUID']; + position: Scalars['Float']; }; - -export type MutationCreateRefreshTokenArgs = { - input: NewRefreshToken; +export type UpdateTaskGroupName = { + taskGroupID: Scalars['UUID']; + name: Scalars['String']; }; - -export type MutationCreateUserAccountArgs = { - input: NewUserAccount; +export type DeleteTaskGroupInput = { + taskGroupID: Scalars['UUID']; }; - -export type MutationDeleteUserAccountArgs = { - input: DeleteUserAccount; +export type DeleteTaskGroupPayload = { + __typename?: 'DeleteTaskGroupPayload'; + ok: Scalars['Boolean']; + affectedRows: Scalars['Int']; + taskGroup: TaskGroup; }; - -export type MutationDeleteTeamArgs = { - input: DeleteTeam; +export type NewTaskGroup = { + projectID: Scalars['String']; + name: Scalars['String']; + position: Scalars['Float']; }; - -export type MutationCreateTeamArgs = { - input: NewTeam; +export type AddTaskLabelInput = { + taskID: Scalars['UUID']; + projectLabelID: Scalars['UUID']; }; - -export type MutationCreateTeamMemberArgs = { - input: CreateTeamMember; +export type RemoveTaskLabelInput = { + taskLabelID: Scalars['UUID']; }; - -export type MutationCreateProjectArgs = { - input: NewProject; +export type ToggleTaskLabelInput = { + taskID: Scalars['UUID']; + projectLabelID: Scalars['UUID']; }; - -export type MutationDeleteProjectArgs = { - input: DeleteProject; +export type ToggleTaskLabelPayload = { + __typename?: 'ToggleTaskLabelPayload'; + active: Scalars['Boolean']; + task: Task; }; - -export type MutationUpdateProjectNameArgs = { - input?: Maybe; +export type NewTeam = { + name: Scalars['String']; + organizationID: Scalars['UUID']; }; - -export type MutationCreateProjectLabelArgs = { - input: NewProjectLabel; +export type DeleteTeam = { + teamID: Scalars['UUID']; }; - -export type MutationDeleteProjectLabelArgs = { - input: DeleteProjectLabel; +export type DeleteTeamPayload = { + __typename?: 'DeleteTeamPayload'; + ok: Scalars['Boolean']; + team: Team; + projects: Array; }; - -export type MutationUpdateProjectLabelArgs = { - input: UpdateProjectLabel; +export type DeleteTeamMember = { + teamID: Scalars['UUID']; + userID: Scalars['UUID']; }; - -export type MutationUpdateProjectLabelNameArgs = { - input: UpdateProjectLabelName; +export type DeleteTeamMemberPayload = { + __typename?: 'DeleteTeamMemberPayload'; + teamID: Scalars['UUID']; + userID: Scalars['UUID']; }; - -export type MutationUpdateProjectLabelColorArgs = { - input: UpdateProjectLabelColor; +export type CreateTeamMember = { + userID: Scalars['UUID']; + teamID: Scalars['UUID']; }; - -export type MutationCreateTaskGroupArgs = { - input: NewTaskGroup; +export type CreateTeamMemberPayload = { + __typename?: 'CreateTeamMemberPayload'; + team: Team; + teamMember: Member; }; - -export type MutationUpdateTaskGroupLocationArgs = { - input: NewTaskGroupLocation; +export type UpdateTeamMemberRole = { + teamID: Scalars['UUID']; + userID: Scalars['UUID']; + roleCode: RoleCode; }; - -export type MutationUpdateTaskGroupNameArgs = { - input: UpdateTaskGroupName; +export type UpdateTeamMemberRolePayload = { + __typename?: 'UpdateTeamMemberRolePayload'; + ok: Scalars['Boolean']; + member: Member; }; - -export type MutationDeleteTaskGroupArgs = { - input: DeleteTaskGroupInput; +export type SetTeamOwner = { + teamID: Scalars['UUID']; + userID: Scalars['UUID']; }; - -export type MutationAddTaskLabelArgs = { - input?: Maybe; +export type SetTeamOwnerPayload = { + __typename?: 'SetTeamOwnerPayload'; + ok: Scalars['Boolean']; + prevOwner: Member; + newOwner: Member; }; - -export type MutationRemoveTaskLabelArgs = { - input?: Maybe; +export type NewRefreshToken = { + userId: Scalars['String']; }; - -export type MutationToggleTaskLabelArgs = { - input: ToggleTaskLabelInput; +export type NewUserAccount = { + username: Scalars['String']; + email: Scalars['String']; + fullName: Scalars['String']; + initials: Scalars['String']; + password: Scalars['String']; + roleCode: Scalars['String']; }; - -export type MutationCreateTaskChecklistArgs = { - input: CreateTaskChecklist; +export type LogoutUser = { + userID: Scalars['String']; }; - -export type MutationDeleteTaskChecklistArgs = { - input: DeleteTaskChecklist; +export type DeleteUserAccount = { + userID: Scalars['UUID']; }; - -export type MutationUpdateTaskChecklistNameArgs = { - input: UpdateTaskChecklistName; -}; - - -export type MutationCreateTaskChecklistItemArgs = { - input: CreateTaskChecklistItem; -}; - - -export type MutationUpdateTaskChecklistItemNameArgs = { - input: UpdateTaskChecklistItemName; -}; - - -export type MutationSetTaskChecklistItemCompleteArgs = { - input: SetTaskChecklistItemComplete; -}; - - -export type MutationDeleteTaskChecklistItemArgs = { - input: DeleteTaskChecklistItem; -}; - - -export type MutationCreateTaskArgs = { - input: NewTask; -}; - - -export type MutationUpdateTaskDescriptionArgs = { - input: UpdateTaskDescriptionInput; -}; - - -export type MutationUpdateTaskLocationArgs = { - input: NewTaskLocation; -}; - - -export type MutationUpdateTaskNameArgs = { - input: UpdateTaskName; -}; - - -export type MutationSetTaskCompleteArgs = { - input: SetTaskComplete; -}; - - -export type MutationUpdateTaskDueDateArgs = { - input: UpdateTaskDueDate; -}; - - -export type MutationDeleteTaskArgs = { - input: DeleteTaskInput; -}; - - -export type MutationAssignTaskArgs = { - input?: Maybe; -}; - - -export type MutationUnassignTaskArgs = { - input?: Maybe; -}; - - -export type MutationLogoutUserArgs = { - input: LogoutUser; +export type DeleteUserAccountPayload = { + __typename?: 'DeleteUserAccountPayload'; + ok: Scalars['Boolean']; + userAccount: UserAccount; }; export type AssignTaskMutationVariables = { @@ -710,8 +851,8 @@ export type AssignTaskMutation = ( { __typename?: 'Task' } & Pick & { assigned: Array<( - { __typename?: 'ProjectMember' } - & Pick + { __typename?: 'Member' } + & Pick )> } ) } ); @@ -842,9 +983,12 @@ export type FindProjectQuery = ( { __typename?: 'Project' } & Pick & { members: Array<( - { __typename?: 'ProjectMember' } - & Pick - & { profileIcon: ( + { __typename?: 'Member' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ), profileIcon: ( { __typename?: 'ProfileIcon' } & Pick ) } @@ -866,6 +1010,16 @@ export type FindProjectQuery = ( ), labelColors: Array<( { __typename?: 'LabelColor' } & Pick + )>, users: Array<( + { __typename?: 'UserAccount' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ), profileIcon: ( + { __typename?: 'ProfileIcon' } + & Pick + ) } )> } ); @@ -907,8 +1061,8 @@ export type FindTaskQuery = ( ) } ) } )>, assigned: Array<( - { __typename?: 'ProjectMember' } - & Pick + { __typename?: 'Member' } + & Pick & { profileIcon: ( { __typename?: 'ProfileIcon' } & Pick @@ -941,8 +1095,8 @@ export type TaskFieldsFragment = ( ) } ) } )>, assigned: Array<( - { __typename?: 'ProjectMember' } - & Pick + { __typename?: 'Member' } + & Pick & { profileIcon: ( { __typename?: 'ProfileIcon' } & Pick @@ -986,6 +1140,31 @@ export type MeQuery = ( ) } ); +export type CreateProjectMemberMutationVariables = { + projectID: Scalars['UUID']; + userID: Scalars['UUID']; +}; + + +export type CreateProjectMemberMutation = ( + { __typename?: 'Mutation' } + & { createProjectMember: ( + { __typename?: 'CreateProjectMemberPayload' } + & Pick + & { member: ( + { __typename?: 'Member' } + & Pick + & { profileIcon: ( + { __typename?: 'ProfileIcon' } + & Pick + ), role: ( + { __typename?: 'Role' } + & Pick + ) } + ) } + ) } +); + export type DeleteProjectMutationVariables = { projectID: Scalars['UUID']; }; @@ -1003,6 +1182,76 @@ export type DeleteProjectMutation = ( ) } ); +export type DeleteProjectMemberMutationVariables = { + projectID: Scalars['UUID']; + userID: Scalars['UUID']; +}; + + +export type DeleteProjectMemberMutation = ( + { __typename?: 'Mutation' } + & { deleteProjectMember: ( + { __typename?: 'DeleteProjectMemberPayload' } + & Pick + & { member: ( + { __typename?: 'Member' } + & Pick + ) } + ) } +); + +export type SetProjectOwnerMutationVariables = { + projectID: Scalars['UUID']; + ownerID: Scalars['UUID']; +}; + + +export type SetProjectOwnerMutation = ( + { __typename?: 'Mutation' } + & { setProjectOwner: ( + { __typename?: 'SetProjectOwnerPayload' } + & Pick + & { newOwner: ( + { __typename?: 'Member' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ) } + ), prevOwner: ( + { __typename?: 'Member' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ) } + ) } + ) } +); + +export type UpdateProjectMemberRoleMutationVariables = { + projectID: Scalars['UUID']; + userID: Scalars['UUID']; + roleCode: RoleCode; +}; + + +export type UpdateProjectMemberRoleMutation = ( + { __typename?: 'Mutation' } + & { updateProjectMemberRole: ( + { __typename?: 'UpdateProjectMemberRolePayload' } + & Pick + & { member: ( + { __typename?: 'Member' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ) } + ) } + ) } +); + export type CreateTaskMutationVariables = { taskGroupID: Scalars['String']; name: Scalars['String']; @@ -1174,6 +1423,33 @@ export type CreateTeamMutation = ( ) } ); +export type CreateTeamMemberMutationVariables = { + userID: Scalars['UUID']; + teamID: Scalars['UUID']; +}; + + +export type CreateTeamMemberMutation = ( + { __typename?: 'Mutation' } + & { createTeamMember: ( + { __typename?: 'CreateTeamMemberPayload' } + & { team: ( + { __typename?: 'Team' } + & Pick + ), teamMember: ( + { __typename?: 'Member' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ), profileIcon: ( + { __typename?: 'ProfileIcon' } + & Pick + ) } + ) } + ) } +); + export type DeleteTeamMutationVariables = { teamID: Scalars['UUID']; }; @@ -1191,6 +1467,20 @@ export type DeleteTeamMutation = ( ) } ); +export type DeleteTeamMemberMutationVariables = { + teamID: Scalars['UUID']; + userID: Scalars['UUID']; +}; + + +export type DeleteTeamMemberMutation = ( + { __typename?: 'Mutation' } + & { deleteTeamMember: ( + { __typename?: 'DeleteTeamMemberPayload' } + & Pick + ) } +); + export type GetTeamQueryVariables = { teamID: Scalars['UUID']; }; @@ -1201,6 +1491,17 @@ export type GetTeamQuery = ( & { findTeam: ( { __typename?: 'Team' } & Pick + & { members: Array<( + { __typename?: 'Member' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ), profileIcon: ( + { __typename?: 'ProfileIcon' } + & Pick + ) } + )> } ), projects: Array<( { __typename?: 'Project' } & Pick @@ -1208,6 +1509,16 @@ export type GetTeamQuery = ( { __typename?: 'Team' } & Pick ) } + )>, users: Array<( + { __typename?: 'UserAccount' } + & Pick + & { role: ( + { __typename?: 'Role' } + & Pick + ), profileIcon: ( + { __typename?: 'ProfileIcon' } + & Pick + ) } )> } ); @@ -1253,8 +1564,8 @@ export type UnassignTaskMutation = ( { __typename?: 'Task' } & Pick & { assigned: Array<( - { __typename?: 'ProjectMember' } - & Pick + { __typename?: 'Member' } + & Pick )> } ) } ); @@ -1373,6 +1684,7 @@ export type UpdateTaskNameMutation = ( export type CreateUserAccountMutationVariables = { username: Scalars['String']; + roleCode: Scalars['String']; email: Scalars['String']; fullName: Scalars['String']; initials: Scalars['String']; @@ -1388,6 +1700,26 @@ export type CreateUserAccountMutation = ( & { profileIcon: ( { __typename?: 'ProfileIcon' } & Pick + ), role: ( + { __typename?: 'Role' } + & Pick + ) } + ) } +); + +export type DeleteUserAccountMutationVariables = { + userID: Scalars['UUID']; +}; + + +export type DeleteUserAccountMutation = ( + { __typename?: 'Mutation' } + & { deleteUserAccount: ( + { __typename?: 'DeleteUserAccountPayload' } + & Pick + & { userAccount: ( + { __typename?: 'UserAccount' } + & Pick ) } ) } ); @@ -1400,7 +1732,10 @@ export type UsersQuery = ( & { users: Array<( { __typename?: 'UserAccount' } & Pick - & { profileIcon: ( + & { role: ( + { __typename?: 'Role' } + & Pick + ), profileIcon: ( { __typename?: 'ProfileIcon' } & Pick ) } @@ -1754,6 +2089,11 @@ export const FindProjectDocument = gql` members { id fullName + username + role { + code + name + } profileIcon { url initials @@ -1786,6 +2126,21 @@ export const FindProjectDocument = gql` colorHex name } + users { + id + email + fullName + username + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } } ${TaskFieldsFragmentDoc}`; @@ -1981,6 +2336,53 @@ export function useMeLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptio export type MeQueryHookResult = ReturnType; export type MeLazyQueryHookResult = ReturnType; export type MeQueryResult = ApolloReactCommon.QueryResult; +export const CreateProjectMemberDocument = gql` + mutation createProjectMember($projectID: UUID!, $userID: UUID!) { + createProjectMember(input: {projectID: $projectID, userID: $userID}) { + ok + member { + id + fullName + profileIcon { + url + initials + bgColor + } + username + role { + code + name + } + } + } +} + `; +export type CreateProjectMemberMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useCreateProjectMemberMutation__ + * + * To run a mutation, you first call `useCreateProjectMemberMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCreateProjectMemberMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [createProjectMemberMutation, { data, loading, error }] = useCreateProjectMemberMutation({ + * variables: { + * projectID: // value for 'projectID' + * userID: // value for 'userID' + * }, + * }); + */ +export function useCreateProjectMemberMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(CreateProjectMemberDocument, baseOptions); + } +export type CreateProjectMemberMutationHookResult = ReturnType; +export type CreateProjectMemberMutationResult = ApolloReactCommon.MutationResult; +export type CreateProjectMemberMutationOptions = ApolloReactCommon.BaseMutationOptions; export const DeleteProjectDocument = gql` mutation deleteProject($projectID: UUID!) { deleteProject(input: {projectID: $projectID}) { @@ -2016,6 +2418,131 @@ export function useDeleteProjectMutation(baseOptions?: ApolloReactHooks.Mutation export type DeleteProjectMutationHookResult = ReturnType; export type DeleteProjectMutationResult = ApolloReactCommon.MutationResult; export type DeleteProjectMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const DeleteProjectMemberDocument = gql` + mutation deleteProjectMember($projectID: UUID!, $userID: UUID!) { + deleteProjectMember(input: {projectID: $projectID, userID: $userID}) { + ok + member { + id + } + projectID + } +} + `; +export type DeleteProjectMemberMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useDeleteProjectMemberMutation__ + * + * To run a mutation, you first call `useDeleteProjectMemberMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteProjectMemberMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [deleteProjectMemberMutation, { data, loading, error }] = useDeleteProjectMemberMutation({ + * variables: { + * projectID: // value for 'projectID' + * userID: // value for 'userID' + * }, + * }); + */ +export function useDeleteProjectMemberMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(DeleteProjectMemberDocument, baseOptions); + } +export type DeleteProjectMemberMutationHookResult = ReturnType; +export type DeleteProjectMemberMutationResult = ApolloReactCommon.MutationResult; +export type DeleteProjectMemberMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const SetProjectOwnerDocument = gql` + mutation setProjectOwner($projectID: UUID!, $ownerID: UUID!) { + setProjectOwner(input: {projectID: $projectID, ownerID: $ownerID}) { + ok + newOwner { + id + role { + code + name + } + } + prevOwner { + id + role { + code + name + } + } + } +} + `; +export type SetProjectOwnerMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useSetProjectOwnerMutation__ + * + * To run a mutation, you first call `useSetProjectOwnerMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useSetProjectOwnerMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [setProjectOwnerMutation, { data, loading, error }] = useSetProjectOwnerMutation({ + * variables: { + * projectID: // value for 'projectID' + * ownerID: // value for 'ownerID' + * }, + * }); + */ +export function useSetProjectOwnerMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(SetProjectOwnerDocument, baseOptions); + } +export type SetProjectOwnerMutationHookResult = ReturnType; +export type SetProjectOwnerMutationResult = ApolloReactCommon.MutationResult; +export type SetProjectOwnerMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const UpdateProjectMemberRoleDocument = gql` + mutation updateProjectMemberRole($projectID: UUID!, $userID: UUID!, $roleCode: RoleCode!) { + updateProjectMemberRole(input: {projectID: $projectID, userID: $userID, roleCode: $roleCode}) { + ok + member { + id + role { + code + name + } + } + } +} + `; +export type UpdateProjectMemberRoleMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useUpdateProjectMemberRoleMutation__ + * + * To run a mutation, you first call `useUpdateProjectMemberRoleMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useUpdateProjectMemberRoleMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [updateProjectMemberRoleMutation, { data, loading, error }] = useUpdateProjectMemberRoleMutation({ + * variables: { + * projectID: // value for 'projectID' + * userID: // value for 'userID' + * roleCode: // value for 'roleCode' + * }, + * }); + */ +export function useUpdateProjectMemberRoleMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(UpdateProjectMemberRoleDocument, baseOptions); + } +export type UpdateProjectMemberRoleMutationHookResult = ReturnType; +export type UpdateProjectMemberRoleMutationResult = ApolloReactCommon.MutationResult; +export type UpdateProjectMemberRoleMutationOptions = ApolloReactCommon.BaseMutationOptions; export const CreateTaskDocument = gql` mutation createTask($taskGroupID: String!, $name: String!, $position: Float!) { createTask(input: {taskGroupID: $taskGroupID, name: $name, position: $position}) { @@ -2414,6 +2941,55 @@ export function useCreateTeamMutation(baseOptions?: ApolloReactHooks.MutationHoo export type CreateTeamMutationHookResult = ReturnType; export type CreateTeamMutationResult = ApolloReactCommon.MutationResult; export type CreateTeamMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const CreateTeamMemberDocument = gql` + mutation createTeamMember($userID: UUID!, $teamID: UUID!) { + createTeamMember(input: {userID: $userID, teamID: $teamID}) { + team { + id + } + teamMember { + id + username + fullName + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } + } +} + `; +export type CreateTeamMemberMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useCreateTeamMemberMutation__ + * + * To run a mutation, you first call `useCreateTeamMemberMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useCreateTeamMemberMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [createTeamMemberMutation, { data, loading, error }] = useCreateTeamMemberMutation({ + * variables: { + * userID: // value for 'userID' + * teamID: // value for 'teamID' + * }, + * }); + */ +export function useCreateTeamMemberMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(CreateTeamMemberDocument, baseOptions); + } +export type CreateTeamMemberMutationHookResult = ReturnType; +export type CreateTeamMemberMutationResult = ApolloReactCommon.MutationResult; +export type CreateTeamMemberMutationOptions = ApolloReactCommon.BaseMutationOptions; export const DeleteTeamDocument = gql` mutation deleteTeam($teamID: UUID!) { deleteTeam(input: {teamID: $teamID}) { @@ -2449,12 +3025,60 @@ export function useDeleteTeamMutation(baseOptions?: ApolloReactHooks.MutationHoo export type DeleteTeamMutationHookResult = ReturnType; export type DeleteTeamMutationResult = ApolloReactCommon.MutationResult; export type DeleteTeamMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const DeleteTeamMemberDocument = gql` + mutation deleteTeamMember($teamID: UUID!, $userID: UUID!) { + deleteTeamMember(input: {teamID: $teamID, userID: $userID}) { + teamID + userID + } +} + `; +export type DeleteTeamMemberMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useDeleteTeamMemberMutation__ + * + * To run a mutation, you first call `useDeleteTeamMemberMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteTeamMemberMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [deleteTeamMemberMutation, { data, loading, error }] = useDeleteTeamMemberMutation({ + * variables: { + * teamID: // value for 'teamID' + * userID: // value for 'userID' + * }, + * }); + */ +export function useDeleteTeamMemberMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(DeleteTeamMemberDocument, baseOptions); + } +export type DeleteTeamMemberMutationHookResult = ReturnType; +export type DeleteTeamMemberMutationResult = ApolloReactCommon.MutationResult; +export type DeleteTeamMemberMutationOptions = ApolloReactCommon.BaseMutationOptions; export const GetTeamDocument = gql` query getTeam($teamID: UUID!) { findTeam(input: {teamID: $teamID}) { id createdAt name + members { + id + fullName + username + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } } projects(input: {teamID: $teamID}) { id @@ -2464,6 +3088,21 @@ export const GetTeamDocument = gql` name } } + users { + id + email + fullName + username + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } } `; @@ -2837,8 +3476,8 @@ export type UpdateTaskNameMutationHookResult = ReturnType; export type UpdateTaskNameMutationOptions = ApolloReactCommon.BaseMutationOptions; export const CreateUserAccountDocument = gql` - mutation createUserAccount($username: String!, $email: String!, $fullName: String!, $initials: String!, $password: String!) { - createUserAccount(input: {username: $username, email: $email, fullName: $fullName, initials: $initials, password: $password}) { + mutation createUserAccount($username: String!, $roleCode: String!, $email: String!, $fullName: String!, $initials: String!, $password: String!) { + createUserAccount(input: {roleCode: $roleCode, username: $username, email: $email, fullName: $fullName, initials: $initials, password: $password}) { id email fullName @@ -2849,6 +3488,10 @@ export const CreateUserAccountDocument = gql` initials bgColor } + role { + code + name + } } } `; @@ -2868,6 +3511,7 @@ export type CreateUserAccountMutationFn = ApolloReactCommon.MutationFunction; export type CreateUserAccountMutationResult = ApolloReactCommon.MutationResult; export type CreateUserAccountMutationOptions = ApolloReactCommon.BaseMutationOptions; +export const DeleteUserAccountDocument = gql` + mutation deleteUserAccount($userID: UUID!) { + deleteUserAccount(input: {userID: $userID}) { + ok + userAccount { + id + } + } +} + `; +export type DeleteUserAccountMutationFn = ApolloReactCommon.MutationFunction; + +/** + * __useDeleteUserAccountMutation__ + * + * To run a mutation, you first call `useDeleteUserAccountMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useDeleteUserAccountMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [deleteUserAccountMutation, { data, loading, error }] = useDeleteUserAccountMutation({ + * variables: { + * userID: // value for 'userID' + * }, + * }); + */ +export function useDeleteUserAccountMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { + return ApolloReactHooks.useMutation(DeleteUserAccountDocument, baseOptions); + } +export type DeleteUserAccountMutationHookResult = ReturnType; +export type DeleteUserAccountMutationResult = ApolloReactCommon.MutationResult; +export type DeleteUserAccountMutationOptions = ApolloReactCommon.BaseMutationOptions; export const UsersDocument = gql` query users { users { @@ -2888,6 +3567,10 @@ export const UsersDocument = gql` email fullName username + role { + code + name + } profileIcon { url initials diff --git a/web/src/shared/graphql/findProject.ts b/web/src/shared/graphql/findProject.ts index 0714ce8..1012c43 100644 --- a/web/src/shared/graphql/findProject.ts +++ b/web/src/shared/graphql/findProject.ts @@ -8,6 +8,11 @@ query findProject($projectId: String!) { members { id fullName + username + role { + code + name + } profileIcon { url initials @@ -40,6 +45,21 @@ query findProject($projectId: String!) { colorHex name } + users { + id + email + fullName + username + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } ${TASK_FRAGMENT} } `; diff --git a/web/src/shared/graphql/project/createProjectMember.ts b/web/src/shared/graphql/project/createProjectMember.ts new file mode 100644 index 0000000..ddad02d --- /dev/null +++ b/web/src/shared/graphql/project/createProjectMember.ts @@ -0,0 +1,25 @@ +import gql from 'graphql-tag'; + +export const CREATE_PROJECT_MEMBER_MUTATION = gql` + mutation createProjectMember($projectID: UUID!, $userID: UUID!) { + createProjectMember(input: { projectID: $projectID, userID: $userID }) { + ok + member { + id + fullName + profileIcon { + url + initials + bgColor + } + username + role { + code + name + } + } + } + } +`; + +export default CREATE_PROJECT_MEMBER_MUTATION; diff --git a/web/src/shared/graphql/project/deleteProjectMember.ts b/web/src/shared/graphql/project/deleteProjectMember.ts new file mode 100644 index 0000000..fbe5757 --- /dev/null +++ b/web/src/shared/graphql/project/deleteProjectMember.ts @@ -0,0 +1,15 @@ +import gql from 'graphql-tag'; + +export const DELETE_PROJECT_MEMBER_MUTATION = gql` + mutation deleteProjectMember($projectID: UUID!, $userID: UUID!) { + deleteProjectMember(input: { projectID: $projectID, userID: $userID }) { + ok + member { + id + } + projectID + } + } +`; + +export default DELETE_PROJECT_MEMBER_MUTATION; diff --git a/web/src/shared/graphql/project/setProjectOwner.ts b/web/src/shared/graphql/project/setProjectOwner.ts new file mode 100644 index 0000000..5310de6 --- /dev/null +++ b/web/src/shared/graphql/project/setProjectOwner.ts @@ -0,0 +1,25 @@ +import gql from 'graphql-tag'; + +export const SET_PROJECT_OWNER_MUTATION = gql` + mutation setProjectOwner($projectID: UUID!, $ownerID: UUID!) { + setProjectOwner(input: { projectID: $projectID, ownerID: $ownerID }) { + ok + newOwner { + id + role { + code + name + } + } + prevOwner { + id + role { + code + name + } + } + } + } +`; + +export default SET_PROJECT_OWNER_MUTATION; diff --git a/web/src/shared/graphql/project/updateProjectMemberRole.ts b/web/src/shared/graphql/project/updateProjectMemberRole.ts new file mode 100644 index 0000000..016051f --- /dev/null +++ b/web/src/shared/graphql/project/updateProjectMemberRole.ts @@ -0,0 +1,18 @@ +import gql from 'graphql-tag'; + +export const UPDATE_PROJECT_MEMBER_ROLE_MUTATION = gql` + mutation updateProjectMemberRole($projectID: UUID!, $userID: UUID!, $roleCode: RoleCode!) { + updateProjectMemberRole(input: { projectID: $projectID, userID: $userID, roleCode: $roleCode }) { + ok + member { + id + role { + code + name + } + } + } + } +`; + +export default UPDATE_PROJECT_MEMBER_ROLE_MUTATION; diff --git a/web/src/shared/graphql/team/createTeamMember.ts b/web/src/shared/graphql/team/createTeamMember.ts new file mode 100644 index 0000000..30ca3ad --- /dev/null +++ b/web/src/shared/graphql/team/createTeamMember.ts @@ -0,0 +1,27 @@ +import gql from 'graphql-tag'; + +export const CREATE_TEAM_MEMBER_MUTATION = gql` + mutation createTeamMember($userID: UUID!, $teamID: UUID!) { + createTeamMember(input: { userID: $userID, teamID: $teamID }) { + team { + id + } + teamMember { + id + username + fullName + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } + } + } +`; + +export default CREATE_TEAM_MEMBER_MUTATION; diff --git a/web/src/shared/graphql/team/deleteTeamMember.ts b/web/src/shared/graphql/team/deleteTeamMember.ts new file mode 100644 index 0000000..9f0a949 --- /dev/null +++ b/web/src/shared/graphql/team/deleteTeamMember.ts @@ -0,0 +1,12 @@ +import gql from 'graphql-tag'; + +export const DELETE_TEAM_MEMBER_MUTATION = gql` + mutation deleteTeamMember($teamID: UUID!, $userID: UUID!) { + deleteTeamMember(input: { teamID: $teamID, userID: $userID }) { + teamID + userID + } + } +`; + +export default DELETE_TEAM_MEMBER_MUTATION; diff --git a/web/src/shared/graphql/team/getTeam.ts b/web/src/shared/graphql/team/getTeam.ts index 316d2cd..e8590e6 100644 --- a/web/src/shared/graphql/team/getTeam.ts +++ b/web/src/shared/graphql/team/getTeam.ts @@ -6,6 +6,20 @@ export const GET_TEAM_QUERY = gql` id createdAt name + members { + id + fullName + username + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } } projects(input: { teamID: $teamID }) { id @@ -15,6 +29,21 @@ export const GET_TEAM_QUERY = gql` name } } + users { + id + email + fullName + username + role { + code + name + } + profileIcon { + url + initials + bgColor + } + } } `; diff --git a/web/src/shared/graphql/user/createUser.ts b/web/src/shared/graphql/user/createUser.ts index eeab07b..0bb3a01 100644 --- a/web/src/shared/graphql/user/createUser.ts +++ b/web/src/shared/graphql/user/createUser.ts @@ -3,13 +3,21 @@ import gql from 'graphql-tag'; export const CREATE_USER_MUTATION = gql` mutation createUserAccount( $username: String! + $roleCode: String! $email: String! $fullName: String! $initials: String! $password: String! ) { createUserAccount( - input: { username: $username, email: $email, fullName: $fullName, initials: $initials, password: $password } + input: { + roleCode: $roleCode + username: $username + email: $email + fullName: $fullName + initials: $initials + password: $password + } ) { id email @@ -21,6 +29,10 @@ export const CREATE_USER_MUTATION = gql` initials bgColor } + role { + code + name + } } } `; diff --git a/web/src/shared/graphql/user/deleteUser.ts b/web/src/shared/graphql/user/deleteUser.ts new file mode 100644 index 0000000..f96029e --- /dev/null +++ b/web/src/shared/graphql/user/deleteUser.ts @@ -0,0 +1,14 @@ +import gql from 'graphql-tag'; + +export const DELETE_USER_MUTATION = gql` + mutation deleteUserAccount($userID: UUID!) { + deleteUserAccount(input: { userID: $userID }) { + ok + userAccount { + id + } + } + } +`; + +export default DELETE_USER_MUTATION; diff --git a/web/src/shared/graphql/users.graphqls b/web/src/shared/graphql/users.graphqls index 85dcc7e..f8c7074 100644 --- a/web/src/shared/graphql/users.graphqls +++ b/web/src/shared/graphql/users.graphqls @@ -4,6 +4,10 @@ query users { email fullName username + role { + code + name + } profileIcon { url initials diff --git a/web/src/shared/icons/Crown.tsx b/web/src/shared/icons/Crown.tsx new file mode 100644 index 0000000..db9948a --- /dev/null +++ b/web/src/shared/icons/Crown.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import Icon, { IconProps } from './Icon'; + +const Crown: React.FC = ({ width = '16px', height = '16px', onClick, className }) => { + return ( + + + + ); +}; + +export default Crown; diff --git a/web/src/shared/icons/DoubleChevronUp.tsx b/web/src/shared/icons/DoubleChevronUp.tsx new file mode 100644 index 0000000..b5982fb --- /dev/null +++ b/web/src/shared/icons/DoubleChevronUp.tsx @@ -0,0 +1,13 @@ +import React from 'react'; +import Icon, { IconProps } from './Icon'; + +const DoubleChevronUp: React.FC = ({ width = '16px', height = '16px', onClick, className }) => { + return ( + + + + + ); +}; + +export default DoubleChevronUp; diff --git a/web/src/shared/icons/UserPlus.tsx b/web/src/shared/icons/UserPlus.tsx new file mode 100644 index 0000000..ebe5c45 --- /dev/null +++ b/web/src/shared/icons/UserPlus.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import Icon, { IconProps } from './Icon'; + +const UserPlus: React.FC = ({ width = '16px', height = '16px', onClick, className }) => { + return ( + + + + ); +}; + +export default UserPlus; diff --git a/web/src/shared/icons/index.ts b/web/src/shared/icons/index.ts index ffe8cc6..8e9a6db 100644 --- a/web/src/shared/icons/index.ts +++ b/web/src/shared/icons/index.ts @@ -2,7 +2,10 @@ import Cross from './Cross'; import Cog from './Cog'; import Sort from './Sort'; import Filter from './Filter'; +import DoubleChevronUp from './DoubleChevronUp'; +import Crown from './Crown'; import BarChart from './BarChart'; +import UserPlus from './UserPlus'; import Trash from './Trash'; import CheckCircle from './CheckCircle'; import Clock from './Clock'; @@ -65,5 +68,8 @@ export { Square, Filter, Sort, + DoubleChevronUp, + UserPlus, + Crown, ToggleOn, }; diff --git a/web/src/shared/undraw/Empty.tsx b/web/src/shared/undraw/Empty.tsx new file mode 100644 index 0000000..1335c2c --- /dev/null +++ b/web/src/shared/undraw/Empty.tsx @@ -0,0 +1,211 @@ +import React from 'react'; + +type Props = { + width: number; + height: number; + className?: string; +}; + +const Empty: React.FC = ({ width, height, className }) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; +export default Empty;