diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml index af4f5dcb8c3ed..0c0923a12ac73 100644 --- a/.github/workflows/frontend-tests.yml +++ b/.github/workflows/frontend-tests.yml @@ -11,7 +11,7 @@ on: - "web/**" jobs: - eslint-checks: + static-checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -28,6 +28,9 @@ jobs: - name: Run eslint check run: pnpm lint working-directory: web + - name: Run type checks + run: pnpm type-check + working-directory: web frontend-build: runs-on: ubuntu-latest diff --git a/bin/memos/main.go b/bin/memos/main.go index 9669d8188f661..c28d1aeedca02 100644 --- a/bin/memos/main.go +++ b/bin/memos/main.go @@ -14,7 +14,7 @@ import ( "github.com/usememos/memos/internal/jobs" "github.com/usememos/memos/server" - _profile "github.com/usememos/memos/server/profile" + "github.com/usememos/memos/server/profile" "github.com/usememos/memos/store" "github.com/usememos/memos/store/db" ) @@ -31,21 +31,22 @@ const ( ) var ( - profile *_profile.Profile - mode string - addr string - port int - data string - driver string - dsn string - serveFrontend bool + mode string + addr string + port int + data string + driver string + dsn string + serveFrontend bool + allowedOrigins []string + instanceProfile *profile.Profile rootCmd = &cobra.Command{ Use: "memos", - Short: `An open-source, self-hosted memo hub with knowledge management and social networking.`, + Short: `An open source, lightweight note-taking service. Easily capture and share your great thoughts.`, Run: func(_cmd *cobra.Command, _args []string) { ctx, cancel := context.WithCancel(context.Background()) - dbDriver, err := db.NewDBDriver(profile) + dbDriver, err := db.NewDBDriver(instanceProfile) if err != nil { cancel() slog.Error("failed to create db driver", err) @@ -57,14 +58,14 @@ var ( return } - storeInstance := store.New(dbDriver, profile) + storeInstance := store.New(dbDriver, instanceProfile) if err := storeInstance.MigrateManually(ctx); err != nil { cancel() slog.Error("failed to migrate manually", err) return } - s, err := server.NewServer(ctx, profile, storeInstance) + s, err := server.NewServer(ctx, instanceProfile, storeInstance) if err != nil { cancel() slog.Error("failed to create server", err) @@ -114,6 +115,7 @@ func init() { rootCmd.PersistentFlags().StringVarP(&driver, "driver", "", "", "database driver") rootCmd.PersistentFlags().StringVarP(&dsn, "dsn", "", "", "database source name(aka. DSN)") rootCmd.PersistentFlags().BoolVarP(&serveFrontend, "frontend", "", true, "serve frontend files") + rootCmd.PersistentFlags().StringArrayVarP(&allowedOrigins, "origins", "", []string{}, "CORS allowed domain origins") err := viper.BindPFlag("mode", rootCmd.PersistentFlags().Lookup("mode")) if err != nil { @@ -143,19 +145,24 @@ func init() { if err != nil { panic(err) } + err = viper.BindPFlag("origins", rootCmd.PersistentFlags().Lookup("origins")) + if err != nil { + panic(err) + } viper.SetDefault("mode", "demo") viper.SetDefault("driver", "sqlite") viper.SetDefault("addr", "") viper.SetDefault("port", 8081) viper.SetDefault("frontend", true) + viper.SetDefault("origins", []string{}) viper.SetEnvPrefix("memos") } func initConfig() { viper.AutomaticEnv() var err error - profile, err = _profile.GetProfile() + instanceProfile, err = profile.GetProfile() if err != nil { fmt.Printf("failed to get profile, error: %+v\n", err) return @@ -172,15 +179,15 @@ mode: %s driver: %s frontend: %t --- -`, profile.Version, profile.Data, profile.DSN, profile.Addr, profile.Port, profile.Mode, profile.Driver, profile.Frontend) +`, instanceProfile.Version, instanceProfile.Data, instanceProfile.DSN, instanceProfile.Addr, instanceProfile.Port, instanceProfile.Mode, instanceProfile.Driver, instanceProfile.Frontend) } func printGreetings() { print(greetingBanner) - if len(profile.Addr) == 0 { - fmt.Printf("Version %s has been started on port %d\n", profile.Version, profile.Port) + if len(instanceProfile.Addr) == 0 { + fmt.Printf("Version %s has been started on port %d\n", instanceProfile.Version, instanceProfile.Port) } else { - fmt.Printf("Version %s has been started on address '%s' and port %d\n", profile.Version, profile.Addr, profile.Port) + fmt.Printf("Version %s has been started on address '%s' and port %d\n", instanceProfile.Version, instanceProfile.Addr, instanceProfile.Port) } fmt.Printf(`--- See more in: diff --git a/go.mod b/go.mod index a0eb3ba590952..1087c098f6b7d 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,6 @@ require ( github.com/labstack/echo/v4 v4.11.4 github.com/lib/pq v1.10.9 github.com/lithammer/shortuuid/v4 v4.0.0 - github.com/microcosm-cc/bluemonday v1.0.26 github.com/pkg/errors v0.9.1 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 @@ -30,7 +29,6 @@ require ( github.com/swaggo/swag v1.16.3 github.com/yourselfhosted/gomark v0.0.0-20240228170507-6a73bfad2eb6 golang.org/x/crypto v0.19.0 - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/mod v0.15.0 golang.org/x/net v0.21.0 golang.org/x/oauth2 v0.17.0 @@ -42,21 +40,19 @@ require ( require ( github.com/KyleBanks/depth v1.2.1 // indirect github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect - github.com/aymerick/douceur v0.2.0 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/go-openapi/jsonpointer v0.20.0 // indirect - github.com/go-openapi/jsonreference v0.20.2 // indirect - github.com/go-openapi/spec v0.20.9 // indirect - github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/jsonreference v0.20.4 // indirect + github.com/go-openapi/spec v0.20.14 // indirect + github.com/go-openapi/swag v0.22.9 // indirect github.com/go-zoox/chalk v1.0.2 // indirect github.com/go-zoox/connect v1.12.0 // indirect github.com/go-zoox/core-utils v1.4.5 // indirect github.com/go-zoox/crypto v1.1.8 // indirect github.com/go-zoox/datetime v1.3.1 // indirect github.com/go-zoox/jwt v1.3.0 // indirect - github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -67,6 +63,7 @@ require ( github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sourcegraph/conc v0.3.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect + golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect golang.org/x/image v0.15.0 // indirect golang.org/x/tools v0.18.0 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect diff --git a/go.sum b/go.sum index 736980018e585..fc71d656275bb 100644 --- a/go.sum +++ b/go.sum @@ -64,8 +64,6 @@ github.com/aws/aws-sdk-go-v2/service/sts v1.27.0 h1:cjTRjh700H36MQ8M0LnDn33W3Jmw github.com/aws/aws-sdk-go-v2/service/sts v1.27.0/go.mod h1:nXfOBMWPokIbOY+Gi7a1psWMSvskUCemZzI+SMB7Akc= github.com/aws/smithy-go v1.20.0 h1:6+kZsCXZwKxZS9RfISnPc4EXlHoyAkm2hPuM8X2BrrQ= github.com/aws/smithy-go v1.20.0/go.mod h1:uo5RKksAl4PzhqaAbjd4rLgFoq5koTsQKYuGe7dklGc= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= 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/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -88,7 +86,6 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc 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.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -128,21 +125,14 @@ github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgO 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-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= -github.com/go-openapi/jsonpointer v0.20.0 h1:ESKJdU9ASRfaPNOPRx12IUyA1vn3R9GiE3KYD14BXdQ= -github.com/go-openapi/jsonpointer v0.20.0/go.mod h1:6PGzBjjIIumbLYysB73Klnms1mwnU4G3YHOECG3CedA= -github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= -github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= -github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/spec v0.20.9 h1:xnlYNQAwKd2VQRRfwTEI0DcK+2cbuvI/0c7jx3gA8/8= -github.com/go-openapi/spec v0.20.9/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= -github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= -github.com/go-openapi/swag v0.22.4 h1:QLMzNJnMGPRNDCbySlcj1x01tzU8/9LTTL9hZZZogBU= -github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU= +github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4= +github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do= +github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= +github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE= +github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= @@ -228,8 +218,6 @@ github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= github.com/gorilla/feeds v1.1.1 h1:HwKXxqzcRNg9to+BbvJog4+f3s/xzvtZXICcQGutYfY= github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBbaightA= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -301,7 +289,6 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/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/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -322,9 +309,6 @@ github.com/lithammer/shortuuid/v4 v4.0.0/go.mod h1:Zs8puNcrvf2rV9rTH51ZLLcj7ZXqQ github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= -github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= @@ -340,8 +324,6 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y= github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/microcosm-cc/bluemonday v1.0.26 h1:xbqSvqzQMeEHCqMi64VAs4d8uy6Mequs3rQ0k/Khz58= -github.com/microcosm-cc/bluemonday v1.0.26/go.mod h1:JyzOCs9gkyQyjs+6h10UEVSe02CGwkhd72Xdqh78TWs= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -369,7 +351,6 @@ github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxzi github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4= github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= @@ -429,8 +410,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94 github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.10.1 h1:L0uuZVXIKlI1SShY2nhFfo44TYvDPQ1w4oFkUJNfhyo= github.com/rs/cors v1.10.1/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -478,7 +459,6 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE 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/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= @@ -708,7 +688,6 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks 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/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= @@ -730,7 +709,6 @@ gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/util/resource_name.go b/internal/util/resource_name.go index 6fc10c6660f35..f7a1124a9e708 100644 --- a/internal/util/resource_name.go +++ b/internal/util/resource_name.go @@ -3,5 +3,5 @@ package util import "regexp" var ( - ResourceNameMatcher = regexp.MustCompile("^[a-zA-Z0-9]([a-zA-Z0-9-]{1,30}[a-zA-Z0-9])$") + UIDMatcher = regexp.MustCompile("^[a-zA-Z0-9]([a-zA-Z0-9-]{1,30}[a-zA-Z0-9])$") ) diff --git a/plugin/http-getter/image.go b/plugin/http-getter/image.go index cabc0be3a1fd5..0567830698af9 100644 --- a/plugin/http-getter/image.go +++ b/plugin/http-getter/image.go @@ -6,8 +6,6 @@ import ( "net/http" "net/url" "strings" - - "github.com/microcosm-cc/bluemonday" ) type Image struct { @@ -39,21 +37,9 @@ func GetImage(urlStr string) (*Image, error) { return nil, err } - bodyBytes, err = SanitizeContent(bodyBytes) - if err != nil { - return nil, err - } - image := &Image{ Blob: bodyBytes, Mediatype: mediatype, } return image, nil } - -func SanitizeContent(content []byte) ([]byte, error) { - bodyString := string(content) - - bm := bluemonday.UGCPolicy() - return []byte(bm.Sanitize(bodyString)), nil -} diff --git a/plugin/webhook/webhook.go b/plugin/webhook/webhook.go index aadc5344df2bf..113fabd84e796 100644 --- a/plugin/webhook/webhook.go +++ b/plugin/webhook/webhook.go @@ -30,7 +30,8 @@ type Memo struct { } type Resource struct { - ID int32 `json:"id"` + ID int32 `json:"id"` + UID string `json:"uid"` // Standard fields CreatorID int32 `json:"creatorId"` diff --git a/proto/api/v2/idp_service.proto b/proto/api/v2/idp_service.proto new file mode 100644 index 0000000000000..db2ded42ce616 --- /dev/null +++ b/proto/api/v2/idp_service.proto @@ -0,0 +1,124 @@ +syntax = "proto3"; + +package memos.api.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/protobuf/field_mask.proto"; + +option go_package = "gen/api/v2"; + +service IdentityProviderService { + rpc ListIdentityProviders(ListIdentityProvidersRequest) returns (ListIdentityProvidersResponse) { + option (google.api.http) = {get: "/api/v2/identityProviders"}; + } + rpc GetIdentityProvider(GetIdentityProviderRequest) returns (GetIdentityProviderResponse) { + option (google.api.http) = {get: "/api/v2/{name=identityProviders/*}"}; + option (google.api.method_signature) = "name"; + } + rpc CreateIdentityProvider(CreateIdentityProviderRequest) returns (CreateIdentityProviderResponse) { + option (google.api.http) = {post: "/api/v2/identityProviders"}; + } + // UpdateIdentityProvider updates an identity provider. + rpc UpdateIdentityProvider(UpdateIdentityProviderRequest) returns (UpdateIdentityProviderResponse) { + option (google.api.http) = { + patch: "/api/v2/{identity_provider.name=identityProviders/*}" + body: "identity_provider" + }; + option (google.api.method_signature) = "identity_provider,update_mask"; + } + // DeleteIdentityProvider deletes an identity provider. + rpc DeleteIdentityProvider(DeleteIdentityProviderRequest) returns (DeleteIdentityProviderResponse) { + option (google.api.http) = {delete: "/api/v2/{name=identityProviders/*}"}; + option (google.api.method_signature) = "name"; + } +} + +message IdentityProvider { + // The name of the identityProvider. + // Format: identityProviders/{id} + string name = 1; + + enum Type { + TYPE_UNSPECIFIED = 0; + OAUTH2 = 1; + } + Type type = 2; + + string title = 3; + + string identifier_filter = 4; + + message Config { + message FieldMapping { + string identifier = 1; + string display_name = 2; + string email = 3; + } + + message OAuth2 { + string client_id = 1; + string client_secret = 2; + string auth_url = 3; + string token_url = 4; + string user_info_url = 5; + repeated string scopes = 6; + FieldMapping field_mapping = 7; + } + + oneof config { + OAuth2 oauth2 = 1; + } + } + + Config config = 5; +} + +message ListIdentityProvidersRequest {} + +message ListIdentityProvidersResponse { + repeated IdentityProvider identity_providers = 1; +} + +message GetIdentityProviderRequest { + // The name of the identityProvider to get. + // Format: identityProviders/{id} + string name = 1; +} + +message GetIdentityProviderResponse { + // The identityProvider. + IdentityProvider identity_provider = 1; +} + +message CreateIdentityProviderRequest { + // The identityProvider to create. + IdentityProvider identity_provider = 1; +} + +message CreateIdentityProviderResponse { + // The created identityProvider. + IdentityProvider identity_provider = 1; +} + +message UpdateIdentityProviderRequest { + // The identityProvider to update. + IdentityProvider identity_provider = 1; + + // The update mask applies to the resource. Only the top level fields of + // IdentityProvider are supported. + google.protobuf.FieldMask update_mask = 2; +} + +message UpdateIdentityProviderResponse { + // The updated identityProvider. + IdentityProvider identity_provider = 1; +} + +message DeleteIdentityProviderRequest { + // The name of the identityProvider to delete. + // Format: identityProviders/{id} + string name = 1; +} + +message DeleteIdentityProviderResponse {} diff --git a/proto/api/v2/inbox_service.proto b/proto/api/v2/inbox_service.proto index bb937ca10d195..50d13b42ebc1c 100644 --- a/proto/api/v2/inbox_service.proto +++ b/proto/api/v2/inbox_service.proto @@ -31,11 +31,11 @@ service InboxService { message Inbox { // The name of the inbox. - // Format: inboxes/{uid} + // Format: inboxes/{id} string name = 1; - // Format: users/{username} + // Format: users/{id} string sender = 2; - // Format: users/{username} + // Format: users/{id} string receiver = 3; enum Status { @@ -58,7 +58,7 @@ message Inbox { } message ListInboxesRequest { - // Format: users/{username} + // Format: users/{id} string user = 1; } @@ -78,7 +78,7 @@ message UpdateInboxResponse { message DeleteInboxRequest { // The name of the inbox to delete. - // Format: inboxes/{uid} + // Format: inboxes/{id} string name = 1; } diff --git a/proto/api/v2/link_service.proto b/proto/api/v2/link_service.proto index 47b80a8234ba6..d3373098e1d03 100644 --- a/proto/api/v2/link_service.proto +++ b/proto/api/v2/link_service.proto @@ -8,20 +8,20 @@ option go_package = "gen/api/v2"; service LinkService { rpc GetLinkMetadata(GetLinkMetadataRequest) returns (GetLinkMetadataResponse) { - option (google.api.http) = {get: "/api/v2/metadata"}; + option (google.api.http) = {get: "/api/v2/link_metadata"}; } } -message LinkMetadata { - string title = 1; - string description = 2; - string image = 3; -} - message GetLinkMetadataRequest { string link = 1; } message GetLinkMetadataResponse { - LinkMetadata metadata = 1; + LinkMetadata link_metadata = 1; +} + +message LinkMetadata { + string title = 1; + string description = 2; + string image = 3; } diff --git a/proto/api/v2/memo_relation_service.proto b/proto/api/v2/memo_relation_service.proto index 8bd9175742c82..c8387e3b30165 100644 --- a/proto/api/v2/memo_relation_service.proto +++ b/proto/api/v2/memo_relation_service.proto @@ -5,8 +5,13 @@ package memos.api.v2; option go_package = "gen/api/v2"; message MemoRelation { - int32 memo_id = 1; - int32 related_memo_id = 2; + // The name of memo. + // Format: "memos/{uid}" + string memo = 1; + + // The name of related memo. + // Format: "memos/{uid}" + string related_memo = 2; enum Type { TYPE_UNSPECIFIED = 0; diff --git a/proto/api/v2/memo_service.proto b/proto/api/v2/memo_service.proto index 4ec5dad5fadb9..7fd7ad2a0357c 100644 --- a/proto/api/v2/memo_service.proto +++ b/proto/api/v2/memo_service.proto @@ -26,28 +26,27 @@ service MemoService { rpc ListMemos(ListMemosRequest) returns (ListMemosResponse) { option (google.api.http) = {get: "/api/v2/memos"}; } - // GetMemo gets a memo by id. - rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}"}; - option (google.api.method_signature) = "id"; + // SearchMemos searches memos. + rpc SearchMemos(SearchMemosRequest) returns (SearchMemosResponse) { + option (google.api.http) = {get: "/api/v2/memos:search"}; } - // GetMemoByName gets a memo by name. - rpc GetMemoByName(GetMemoByNameRequest) returns (GetMemoByNameResponse) { - option (google.api.http) = {get: "/api/v2/memos/name/{name}"}; + // GetMemo gets a memo. + rpc GetMemo(GetMemoRequest) returns (GetMemoResponse) { + option (google.api.http) = {get: "/api/v2/{name=memos/*}"}; option (google.api.method_signature) = "name"; } // UpdateMemo updates a memo. rpc UpdateMemo(UpdateMemoRequest) returns (UpdateMemoResponse) { option (google.api.http) = { - patch: "/api/v2/memos/{memo.id}" + patch: "/api/v2/{memo.name=memos/*}" body: "memo" }; option (google.api.method_signature) = "memo,update_mask"; } - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. rpc DeleteMemo(DeleteMemoRequest) returns (DeleteMemoResponse) { - option (google.api.http) = {delete: "/api/v2/memos/{id}"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {delete: "/api/v2/{name=memos/*}"}; + option (google.api.method_signature) = "name"; } // ExportMemos exports memos. rpc ExportMemos(ExportMemosRequest) returns (ExportMemosResponse) { @@ -56,38 +55,38 @@ service MemoService { // SetMemoResources sets resources for a memo. rpc SetMemoResources(SetMemoResourcesRequest) returns (SetMemoResourcesResponse) { option (google.api.http) = { - post: "/api/v2/memos/{id}/resources" + post: "/api/v2/{name=memos/*}/resources" body: "*" }; - option (google.api.method_signature) = "id"; + option (google.api.method_signature) = "name"; } // ListMemoResources lists resources for a memo. rpc ListMemoResources(ListMemoResourcesRequest) returns (ListMemoResourcesResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/resources"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/resources"}; + option (google.api.method_signature) = "name"; } // SetMemoRelations sets relations for a memo. rpc SetMemoRelations(SetMemoRelationsRequest) returns (SetMemoRelationsResponse) { option (google.api.http) = { - post: "/api/v2/memos/{id}/relations" + post: "/api/v2/{name=memos/*}/relations" body: "*" }; - option (google.api.method_signature) = "id"; + option (google.api.method_signature) = "name"; } // ListMemoRelations lists relations for a memo. rpc ListMemoRelations(ListMemoRelationsRequest) returns (ListMemoRelationsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/relations"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/relations"}; + option (google.api.method_signature) = "name"; } // CreateMemoComment creates a comment for a memo. rpc CreateMemoComment(CreateMemoCommentRequest) returns (CreateMemoCommentResponse) { - option (google.api.http) = {post: "/api/v2/memos/{id}/comments"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {post: "/api/v2/{name=memos/*}/comments"}; + option (google.api.method_signature) = "name"; } // ListMemoComments lists comments for a memo. rpc ListMemoComments(ListMemoCommentsRequest) returns (ListMemoCommentsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/comments"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/comments"}; + option (google.api.method_signature) = "name"; } // GetUserMemosStats gets stats of memos for a user. rpc GetUserMemosStats(GetUserMemosStatsRequest) returns (GetUserMemosStatsResponse) { @@ -96,18 +95,18 @@ service MemoService { } // ListMemoReactions lists reactions for a memo. rpc ListMemoReactions(ListMemoReactionsRequest) returns (ListMemoReactionsResponse) { - option (google.api.http) = {get: "/api/v2/memos/{id}/reactions"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {get: "/api/v2/{name=memos/*}/reactions"}; + option (google.api.method_signature) = "name"; } // UpsertMemoReaction upserts a reaction for a memo. rpc UpsertMemoReaction(UpsertMemoReactionRequest) returns (UpsertMemoReactionResponse) { - option (google.api.http) = {post: "/api/v2/memos/{id}/reactions"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {post: "/api/v2/{name=memos/*}/reactions"}; + option (google.api.method_signature) = "name"; } // DeleteMemoReaction deletes a reaction for a memo. rpc DeleteMemoReaction(DeleteMemoReactionRequest) returns (DeleteMemoReactionResponse) { - option (google.api.http) = {delete: "/api/v2/memos/{id}/reactions/{reaction_id}"}; - option (google.api.method_signature) = "id,reaction_id"; + option (google.api.http) = {delete: "/api/v2/reactions/{reaction_id}"}; + option (google.api.method_signature) = "reaction_id"; } } @@ -122,39 +121,39 @@ enum Visibility { } message Memo { - // id is the system generated unique identifier. - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + // id is the system generated id. + string name = 1; - // name is the user provided name. - string name = 2; + // The user defined id of the memo. + string uid = 2; RowStatus row_status = 3; // The name of the creator. - // Format: users/{username} + // Format: users/{id} string creator = 4; - int32 creator_id = 5; + google.protobuf.Timestamp create_time = 5; - google.protobuf.Timestamp create_time = 6; + google.protobuf.Timestamp update_time = 6; - google.protobuf.Timestamp update_time = 7; + google.protobuf.Timestamp display_time = 78; - google.protobuf.Timestamp display_time = 8; + string content = 8; - string content = 9; + Visibility visibility = 9; - Visibility visibility = 10; + bool pinned = 10; - bool pinned = 11; + optional int32 parent_id = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - optional int32 parent_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated Resource resources = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - repeated Resource resources = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated MemoRelation relations = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - repeated MemoRelation relations = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - repeated Reaction reactions = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + repeated Reaction reactions = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; } message CreateMemoRequest { @@ -176,7 +175,7 @@ message ListMemosRequest { string page_token = 2; // Filter is used to filter memos returned in the list. - // Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" string filter = 3; } @@ -188,19 +187,23 @@ message ListMemosResponse { string next_page_token = 2; } -message GetMemoRequest { - int32 id = 1; +message SearchMemosRequest { + // Filter is used to filter memos returned. + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + string filter = 1; } -message GetMemoResponse { - Memo memo = 1; +message SearchMemosResponse { + repeated Memo memos = 1; } -message GetMemoByNameRequest { +message GetMemoRequest { + // The name of the memo. + // Format: memos/{id} string name = 1; } -message GetMemoByNameResponse { +message GetMemoResponse { Memo memo = 1; } @@ -215,7 +218,9 @@ message UpdateMemoResponse { } message DeleteMemoRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message DeleteMemoResponse {} @@ -230,7 +235,9 @@ message ExportMemosResponse { } message SetMemoResourcesRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; repeated Resource resources = 2; } @@ -238,7 +245,9 @@ message SetMemoResourcesRequest { message SetMemoResourcesResponse {} message ListMemoResourcesRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoResourcesResponse { @@ -246,7 +255,9 @@ message ListMemoResourcesResponse { } message SetMemoRelationsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; repeated MemoRelation relations = 2; } @@ -254,7 +265,9 @@ message SetMemoRelationsRequest { message SetMemoRelationsResponse {} message ListMemoRelationsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoRelationsResponse { @@ -262,10 +275,11 @@ message ListMemoRelationsResponse { } message CreateMemoCommentRequest { - // id is the memo id to create comment for. - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; - CreateMemoRequest create = 2; + CreateMemoRequest comment = 2; } message CreateMemoCommentResponse { @@ -273,7 +287,9 @@ message CreateMemoCommentResponse { } message ListMemoCommentsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoCommentsResponse { @@ -282,7 +298,7 @@ message ListMemoCommentsResponse { message GetUserMemosStatsRequest { // name is the name of the user to get stats for. - // Format: users/{username} + // Format: users/{id} string name = 1; // timezone location @@ -301,7 +317,9 @@ message GetUserMemosStatsResponse { } message ListMemoReactionsRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; } message ListMemoReactionsResponse { @@ -309,7 +327,9 @@ message ListMemoReactionsResponse { } message UpsertMemoReactionRequest { - int32 id = 1; + // The name of the memo. + // Format: memos/{id} + string name = 1; Reaction reaction = 2; } @@ -319,9 +339,7 @@ message UpsertMemoReactionResponse { } message DeleteMemoReactionRequest { - int32 id = 1; - - int32 reaction_id = 2; + int32 reaction_id = 1; } message DeleteMemoReactionResponse {} diff --git a/proto/api/v2/reaction_service.proto b/proto/api/v2/reaction_service.proto index 0ca68382bd3ef..c1c7159f63dd4 100644 --- a/proto/api/v2/reaction_service.proto +++ b/proto/api/v2/reaction_service.proto @@ -7,6 +7,8 @@ option go_package = "gen/api/v2"; message Reaction { int32 id = 1; + // The name of the creator. + // Format: users/{id} string creator = 2; string content_id = 3; diff --git a/proto/api/v2/resource_service.proto b/proto/api/v2/resource_service.proto index 79198c8575829..4a12d8bb2ad3f 100644 --- a/proto/api/v2/resource_service.proto +++ b/proto/api/v2/resource_service.proto @@ -18,37 +18,38 @@ service ResourceService { rpc ListResources(ListResourcesRequest) returns (ListResourcesResponse) { option (google.api.http) = {get: "/api/v2/resources"}; } - // GetResource returns a resource by id. - rpc GetResource(GetResourceRequest) returns (GetResourceResponse) { - option (google.api.http) = {get: "/api/v2/resources/{id}"}; - option (google.api.method_signature) = "id"; + // SearchResources searches memos. + rpc SearchResources(SearchResourcesRequest) returns (SearchResourcesResponse) { + option (google.api.http) = {get: "/api/v2/resources:search"}; } - // GetResourceByName returns a resource by name. - rpc GetResourceByName(GetResourceByNameRequest) returns (GetResourceByNameResponse) { - option (google.api.http) = {get: "/api/v2/resources/name/{name}"}; + // GetResource returns a resource by name. + rpc GetResource(GetResourceRequest) returns (GetResourceResponse) { + option (google.api.http) = {get: "/api/v2/{name=resources/*}"}; option (google.api.method_signature) = "name"; } // UpdateResource updates a resource. rpc UpdateResource(UpdateResourceRequest) returns (UpdateResourceResponse) { option (google.api.http) = { - patch: "/api/v2/resources/{resource.id}", + patch: "/api/v2/{resource.name=resources/*}", body: "resource" }; option (google.api.method_signature) = "resource,update_mask"; } - // DeleteResource deletes a resource by id. + // DeleteResource deletes a resource by name. rpc DeleteResource(DeleteResourceRequest) returns (DeleteResourceResponse) { - option (google.api.http) = {delete: "/api/v2/resources/{id}"}; - option (google.api.method_signature) = "id"; + option (google.api.http) = {delete: "/api/v2/{name=resources/*}"}; + option (google.api.method_signature) = "name"; } } message Resource { + // The name of the resource. + // Format: resources/{id} // id is the system generated unique identifier. - int32 id = 1; + string name = 1; - // name is the user provided name. - string name = 2; + // The user defined id of the resource. + string uid = 2; google.protobuf.Timestamp create_time = 3; @@ -60,14 +61,19 @@ message Resource { int64 size = 7; - optional int32 memo_id = 8; + // Format: memos/{id} + optional string memo = 8; } message CreateResourceRequest { string filename = 1; + string external_link = 2; + string type = 3; - optional int32 memo_id = 4; + + // Format: memos/{id} + optional string memo = 4; } message CreateResourceResponse { @@ -80,19 +86,19 @@ message ListResourcesResponse { repeated Resource resources = 1; } -message GetResourceRequest { - int32 id = 1; +message SearchResourcesRequest { + string filter = 1; } -message GetResourceResponse { - Resource resource = 1; +message SearchResourcesResponse { + repeated Resource resources = 1; } -message GetResourceByNameRequest { +message GetResourceRequest { string name = 1; } -message GetResourceByNameResponse { +message GetResourceResponse { Resource resource = 1; } @@ -107,7 +113,7 @@ message UpdateResourceResponse { } message DeleteResourceRequest { - int32 id = 1; + string name = 1; } message DeleteResourceResponse {} diff --git a/proto/api/v2/tag_service.proto b/proto/api/v2/tag_service.proto index 5646bcf656f02..a50cf4d083238 100644 --- a/proto/api/v2/tag_service.proto +++ b/proto/api/v2/tag_service.proto @@ -37,7 +37,7 @@ service TagService { message Tag { string name = 1; // The creator of tags. - // Format: users/{username} + // Format: users/{id} string creator = 2; } @@ -57,7 +57,7 @@ message BatchUpsertTagResponse {} message ListTagsRequest { // The creator of tags. - // Format: users/{username} + // Format: users/{id} string user = 1; } @@ -67,7 +67,7 @@ message ListTagsResponse { message RenameTagRequest { // The creator of tags. - // Format: users/{username} + // Format: users/{id} string user = 1; string old_name = 2; string new_name = 3; @@ -85,7 +85,7 @@ message DeleteTagResponse {} message GetTagSuggestionsRequest { // The creator of tags. - // Format: users/{username} + // Format: users/{id} string user = 1; } diff --git a/proto/api/v2/user_service.proto b/proto/api/v2/user_service.proto index e5372a2101cea..4a5dec8d3f07b 100644 --- a/proto/api/v2/user_service.proto +++ b/proto/api/v2/user_service.proto @@ -16,11 +16,18 @@ service UserService { rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) { option (google.api.http) = {get: "/api/v2/users"}; } + + // SearchUsers searches users by filter. + rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) { + option (google.api.http) = {get: "/api/v2/users:search"}; + } + // GetUser gets a user by name. rpc GetUser(GetUserRequest) returns (GetUserResponse) { option (google.api.http) = {get: "/api/v2/{name=users/*}"}; option (google.api.method_signature) = "name"; } + // CreateUser creates a new user. rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) { option (google.api.http) = { @@ -29,6 +36,7 @@ service UserService { }; option (google.api.method_signature) = "user"; } + // UpdateUser updates a user. rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) { option (google.api.http) = { @@ -37,16 +45,19 @@ service UserService { }; option (google.api.method_signature) = "user,update_mask"; } + // DeleteUser deletes a user. rpc DeleteUser(DeleteUserRequest) returns (DeleteUserResponse) { option (google.api.http) = {delete: "/api/v2/{name=users/*}"}; option (google.api.method_signature) = "name"; } + // GetUserSetting gets the setting of a user. rpc GetUserSetting(GetUserSettingRequest) returns (GetUserSettingResponse) { option (google.api.http) = {get: "/api/v2/{name=users/*}/setting"}; option (google.api.method_signature) = "name"; } + // UpdateUserSetting updates the setting of a user. rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) { option (google.api.http) = { @@ -55,11 +66,13 @@ service UserService { }; option (google.api.method_signature) = "setting,update_mask"; } + // ListUserAccessTokens returns a list of access tokens for a user. rpc ListUserAccessTokens(ListUserAccessTokensRequest) returns (ListUserAccessTokensResponse) { option (google.api.http) = {get: "/api/v2/{name=users/*}/access_tokens"}; option (google.api.method_signature) = "name"; } + // CreateUserAccessToken creates a new access token for a user. rpc CreateUserAccessToken(CreateUserAccessTokenRequest) returns (CreateUserAccessTokenResponse) { option (google.api.http) = { @@ -68,6 +81,7 @@ service UserService { }; option (google.api.method_signature) = "name"; } + // DeleteUserAccessToken deletes an access token for a user. rpc DeleteUserAccessToken(DeleteUserAccessTokenRequest) returns (DeleteUserAccessTokenResponse) { option (google.api.http) = {delete: "/api/v2/{name=users/*}/access_tokens/{access_token}"}; @@ -77,9 +91,10 @@ service UserService { message User { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; + // The system generated uid of the user. int32 id = 2; enum Role { @@ -98,13 +113,15 @@ message User { string avatar_url = 7; - string password = 8 [(google.api.field_behavior) = INPUT_ONLY]; + string description = 8; - RowStatus row_status = 9; + string password = 9 [(google.api.field_behavior) = INPUT_ONLY]; - google.protobuf.Timestamp create_time = 10; + RowStatus row_status = 10; - google.protobuf.Timestamp update_time = 11; + google.protobuf.Timestamp create_time = 11; + + google.protobuf.Timestamp update_time = 12; } message ListUsersRequest {} @@ -113,9 +130,19 @@ message ListUsersResponse { repeated User users = 1; } +message SearchUsersRequest { + // Filter is used to filter users returned in the list. + // Format: "username == frank" + string filter = 1; +} + +message SearchUsersResponse { + repeated User users = 1; +} + message GetUserRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -143,7 +170,7 @@ message UpdateUserResponse { message DeleteUserRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -151,7 +178,7 @@ message DeleteUserResponse {} message UserSetting { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; // The preferred locale of the user. string locale = 2; @@ -165,7 +192,7 @@ message UserSetting { message GetUserSettingRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -192,7 +219,7 @@ message UserAccessToken { message ListUserAccessTokensRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; } @@ -202,7 +229,7 @@ message ListUserAccessTokensResponse { message CreateUserAccessTokenRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; string description = 2; @@ -216,7 +243,7 @@ message CreateUserAccessTokenResponse { message DeleteUserAccessTokenRequest { // The name of the user. - // Format: users/{username} + // Format: users/{id} string name = 1; // access_token is the access token to delete. string access_token = 2; diff --git a/proto/api/v2/workspace_service.proto b/proto/api/v2/workspace_service.proto index 680c4b4fc4d39..da67e333c23f0 100644 --- a/proto/api/v2/workspace_service.proto +++ b/proto/api/v2/workspace_service.proto @@ -14,18 +14,21 @@ service WorkspaceService { } message WorkspaceProfile { + // The name of intance owner. + // Format: "users/{id}" + string owner = 1; // version is the current version of instance - string version = 1; + string version = 2; // mode is the instance mode (e.g. "prod", "dev" or "demo"). - string mode = 2; - // allow_registration is whether the registration is allowed. - bool allow_registration = 3; - // allow_password_login is whether the password login is allowed. - bool disable_password_login = 4; + string mode = 3; + // disallow_signup is whether the signup is disallowed. + bool disallow_signup = 4; + // disable_password_login is whether the password login is disabled. + bool disable_password_login = 5; // additional_script is the additional script. - string additional_script = 5; + string additional_script = 6; // additional_style is the additional style. - string additional_style = 6; + string additional_style = 7; } message GetWorkspaceProfileRequest {} diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index ae9bb542aa7eb..c4b862fdd06fa 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -35,6 +35,8 @@ - [ListUserAccessTokensResponse](#memos-api-v2-ListUserAccessTokensResponse) - [ListUsersRequest](#memos-api-v2-ListUsersRequest) - [ListUsersResponse](#memos-api-v2-ListUsersResponse) + - [SearchUsersRequest](#memos-api-v2-SearchUsersRequest) + - [SearchUsersResponse](#memos-api-v2-SearchUsersResponse) - [UpdateUserRequest](#memos-api-v2-UpdateUserRequest) - [UpdateUserResponse](#memos-api-v2-UpdateUserResponse) - [UpdateUserSettingRequest](#memos-api-v2-UpdateUserSettingRequest) @@ -61,6 +63,26 @@ - [AuthService](#memos-api-v2-AuthService) +- [api/v2/idp_service.proto](#api_v2_idp_service-proto) + - [CreateIdentityProviderRequest](#memos-api-v2-CreateIdentityProviderRequest) + - [CreateIdentityProviderResponse](#memos-api-v2-CreateIdentityProviderResponse) + - [DeleteIdentityProviderRequest](#memos-api-v2-DeleteIdentityProviderRequest) + - [DeleteIdentityProviderResponse](#memos-api-v2-DeleteIdentityProviderResponse) + - [GetIdentityProviderRequest](#memos-api-v2-GetIdentityProviderRequest) + - [GetIdentityProviderResponse](#memos-api-v2-GetIdentityProviderResponse) + - [IdentityProvider](#memos-api-v2-IdentityProvider) + - [IdentityProvider.Config](#memos-api-v2-IdentityProvider-Config) + - [IdentityProvider.Config.FieldMapping](#memos-api-v2-IdentityProvider-Config-FieldMapping) + - [IdentityProvider.Config.OAuth2](#memos-api-v2-IdentityProvider-Config-OAuth2) + - [ListIdentityProvidersRequest](#memos-api-v2-ListIdentityProvidersRequest) + - [ListIdentityProvidersResponse](#memos-api-v2-ListIdentityProvidersResponse) + - [UpdateIdentityProviderRequest](#memos-api-v2-UpdateIdentityProviderRequest) + - [UpdateIdentityProviderResponse](#memos-api-v2-UpdateIdentityProviderResponse) + + - [IdentityProvider.Type](#memos-api-v2-IdentityProvider-Type) + + - [IdentityProviderService](#memos-api-v2-IdentityProviderService) + - [api/v2/inbox_service.proto](#api_v2_inbox_service-proto) - [DeleteInboxRequest](#memos-api-v2-DeleteInboxRequest) - [DeleteInboxResponse](#memos-api-v2-DeleteInboxResponse) @@ -97,13 +119,13 @@ - [CreateResourceResponse](#memos-api-v2-CreateResourceResponse) - [DeleteResourceRequest](#memos-api-v2-DeleteResourceRequest) - [DeleteResourceResponse](#memos-api-v2-DeleteResourceResponse) - - [GetResourceByNameRequest](#memos-api-v2-GetResourceByNameRequest) - - [GetResourceByNameResponse](#memos-api-v2-GetResourceByNameResponse) - [GetResourceRequest](#memos-api-v2-GetResourceRequest) - [GetResourceResponse](#memos-api-v2-GetResourceResponse) - [ListResourcesRequest](#memos-api-v2-ListResourcesRequest) - [ListResourcesResponse](#memos-api-v2-ListResourcesResponse) - [Resource](#memos-api-v2-Resource) + - [SearchResourcesRequest](#memos-api-v2-SearchResourcesRequest) + - [SearchResourcesResponse](#memos-api-v2-SearchResourcesResponse) - [UpdateResourceRequest](#memos-api-v2-UpdateResourceRequest) - [UpdateResourceResponse](#memos-api-v2-UpdateResourceResponse) @@ -120,8 +142,6 @@ - [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) - [ExportMemosRequest](#memos-api-v2-ExportMemosRequest) - [ExportMemosResponse](#memos-api-v2-ExportMemosResponse) - - [GetMemoByNameRequest](#memos-api-v2-GetMemoByNameRequest) - - [GetMemoByNameResponse](#memos-api-v2-GetMemoByNameResponse) - [GetMemoRequest](#memos-api-v2-GetMemoRequest) - [GetMemoResponse](#memos-api-v2-GetMemoResponse) - [GetUserMemosStatsRequest](#memos-api-v2-GetUserMemosStatsRequest) @@ -138,6 +158,8 @@ - [ListMemosRequest](#memos-api-v2-ListMemosRequest) - [ListMemosResponse](#memos-api-v2-ListMemosResponse) - [Memo](#memos-api-v2-Memo) + - [SearchMemosRequest](#memos-api-v2-SearchMemosRequest) + - [SearchMemosResponse](#memos-api-v2-SearchMemosResponse) - [SetMemoRelationsRequest](#memos-api-v2-SetMemoRelationsRequest) - [SetMemoRelationsResponse](#memos-api-v2-SetMemoRelationsResponse) - [SetMemoResourcesRequest](#memos-api-v2-SetMemoResourcesRequest) @@ -387,7 +409,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | | description | [string](#string) | | | | expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | optional | | @@ -449,7 +471,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | | access_token | [string](#string) | | access_token is the access token to delete. | @@ -475,7 +497,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -500,7 +522,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -530,7 +552,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -560,7 +582,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | @@ -607,6 +629,36 @@ Used internally for obfuscating the page token. + + +### SearchUsersRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| filter | [string](#string) | | Filter is used to filter users returned in the list. Format: "username == frank" | + + + + + + + + +### SearchUsersResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| users | [User](#memos-api-v2-User) | repeated | | + + + + + + ### UpdateUserRequest @@ -677,13 +729,14 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the user. Format: users/{id} | +| id | [int32](#int32) | | The system generated uid of the user. | | role | [User.Role](#memos-api-v2-User-Role) | | | | username | [string](#string) | | | | email | [string](#string) | | | | nickname | [string](#string) | | | | avatar_url | [string](#string) | | | +| description | [string](#string) | | | | password | [string](#string) | | | | row_status | [RowStatus](#memos-api-v2-RowStatus) | | | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | @@ -720,7 +773,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the user. Format: users/{username} | +| name | [string](#string) | | The name of the user. Format: users/{id} | | locale | [string](#string) | | The preferred locale of the user. | | appearance | [string](#string) | | The preferred appearance of the user. | | memo_visibility | [string](#string) | | The default visibility of the memo. | @@ -759,6 +812,7 @@ Used internally for obfuscating the page token. | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| | ListUsers | [ListUsersRequest](#memos-api-v2-ListUsersRequest) | [ListUsersResponse](#memos-api-v2-ListUsersResponse) | ListUsers returns a list of users. | +| SearchUsers | [SearchUsersRequest](#memos-api-v2-SearchUsersRequest) | [SearchUsersResponse](#memos-api-v2-SearchUsersResponse) | SearchUsers searches users by filter. | | GetUser | [GetUserRequest](#memos-api-v2-GetUserRequest) | [GetUserResponse](#memos-api-v2-GetUserResponse) | GetUser gets a user by name. | | CreateUser | [CreateUserRequest](#memos-api-v2-CreateUserRequest) | [CreateUserResponse](#memos-api-v2-CreateUserResponse) | CreateUser creates a new user. | | UpdateUser | [UpdateUserRequest](#memos-api-v2-UpdateUserRequest) | [UpdateUserResponse](#memos-api-v2-UpdateUserResponse) | UpdateUser updates a user. | @@ -943,6 +997,261 @@ Used internally for obfuscating the page token. + +

Top

+ +## api/v2/idp_service.proto + + + + + +### CreateIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The identityProvider to create. | + + + + + + + + +### CreateIdentityProviderResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The created identityProvider. | + + + + + + + + +### DeleteIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the identityProvider to delete. Format: identityProviders/{id} | + + + + + + + + +### DeleteIdentityProviderResponse + + + + + + + + + +### GetIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the identityProvider to get. Format: identityProviders/{id} | + + + + + + + + +### GetIdentityProviderResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The identityProvider. | + + + + + + + + +### IdentityProvider + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the identityProvider. Format: identityProviders/{id} | +| type | [IdentityProvider.Type](#memos-api-v2-IdentityProvider-Type) | | | +| title | [string](#string) | | | +| identifier_filter | [string](#string) | | | +| config | [IdentityProvider.Config](#memos-api-v2-IdentityProvider-Config) | | | + + + + + + + + +### IdentityProvider.Config + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| oauth2 | [IdentityProvider.Config.OAuth2](#memos-api-v2-IdentityProvider-Config-OAuth2) | | | + + + + + + + + +### IdentityProvider.Config.FieldMapping + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identifier | [string](#string) | | | +| display_name | [string](#string) | | | +| email | [string](#string) | | | + + + + + + + + +### IdentityProvider.Config.OAuth2 + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| client_id | [string](#string) | | | +| client_secret | [string](#string) | | | +| auth_url | [string](#string) | | | +| token_url | [string](#string) | | | +| user_info_url | [string](#string) | | | +| scopes | [string](#string) | repeated | | +| field_mapping | [IdentityProvider.Config.FieldMapping](#memos-api-v2-IdentityProvider-Config-FieldMapping) | | | + + + + + + + + +### ListIdentityProvidersRequest + + + + + + + + + +### ListIdentityProvidersResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_providers | [IdentityProvider](#memos-api-v2-IdentityProvider) | repeated | | + + + + + + + + +### UpdateIdentityProviderRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The identityProvider to update. | +| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The update mask applies to the resource. Only the top level fields of IdentityProvider are supported. | + + + + + + + + +### UpdateIdentityProviderResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identity_provider | [IdentityProvider](#memos-api-v2-IdentityProvider) | | The updated identityProvider. | + + + + + + + + + + +### IdentityProvider.Type + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| TYPE_UNSPECIFIED | 0 | | +| OAUTH2 | 1 | | + + + + + + + + + +### IdentityProviderService + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| ListIdentityProviders | [ListIdentityProvidersRequest](#memos-api-v2-ListIdentityProvidersRequest) | [ListIdentityProvidersResponse](#memos-api-v2-ListIdentityProvidersResponse) | | +| GetIdentityProvider | [GetIdentityProviderRequest](#memos-api-v2-GetIdentityProviderRequest) | [GetIdentityProviderResponse](#memos-api-v2-GetIdentityProviderResponse) | | +| CreateIdentityProvider | [CreateIdentityProviderRequest](#memos-api-v2-CreateIdentityProviderRequest) | [CreateIdentityProviderResponse](#memos-api-v2-CreateIdentityProviderResponse) | | +| UpdateIdentityProvider | [UpdateIdentityProviderRequest](#memos-api-v2-UpdateIdentityProviderRequest) | [UpdateIdentityProviderResponse](#memos-api-v2-UpdateIdentityProviderResponse) | UpdateIdentityProvider updates an identity provider. | +| DeleteIdentityProvider | [DeleteIdentityProviderRequest](#memos-api-v2-DeleteIdentityProviderRequest) | [DeleteIdentityProviderResponse](#memos-api-v2-DeleteIdentityProviderResponse) | DeleteIdentityProvider deletes an identity provider. | + + + + +

Top

@@ -958,7 +1267,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the inbox to delete. Format: inboxes/{uid} | +| name | [string](#string) | | The name of the inbox to delete. Format: inboxes/{id} | @@ -983,9 +1292,9 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | The name of the inbox. Format: inboxes/{uid} | -| sender | [string](#string) | | Format: users/{username} | -| receiver | [string](#string) | | Format: users/{username} | +| name | [string](#string) | | The name of the inbox. Format: inboxes/{id} | +| sender | [string](#string) | | Format: users/{id} | +| receiver | [string](#string) | | Format: users/{id} | | status | [Inbox.Status](#memos-api-v2-Inbox-Status) | | | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | type | [Inbox.Type](#memos-api-v2-Inbox-Type) | | | @@ -1004,7 +1313,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | Format: users/{username} | +| user | [string](#string) | | Format: users/{id} | @@ -1134,7 +1443,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| metadata | [LinkMetadata](#memos-api-v2-LinkMetadata) | | | +| link_metadata | [LinkMetadata](#memos-api-v2-LinkMetadata) | | | @@ -1192,8 +1501,8 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| memo_id | [int32](#int32) | | | -| related_memo_id | [int32](#int32) | | | +| memo | [string](#string) | | The name of memo. Format: "memos/{uid}" | +| related_memo | [string](#string) | | The name of related memo. Format: "memos/{uid}" | | type | [MemoRelation.Type](#memos-api-v2-MemoRelation-Type) | | | @@ -1239,7 +1548,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [int32](#int32) | | | -| creator | [string](#string) | | | +| creator | [string](#string) | | The name of the creator. Format: users/{id} | | content_id | [string](#string) | | | | reaction_type | [Reaction.Type](#memos-api-v2-Reaction-Type) | | | @@ -1298,7 +1607,7 @@ Used internally for obfuscating the page token. | filename | [string](#string) | | | | external_link | [string](#string) | | | | type | [string](#string) | | | -| memo_id | [int32](#int32) | optional | | +| memo | [string](#string) | optional | Format: memos/{id} | @@ -1328,7 +1637,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | | @@ -1345,9 +1654,9 @@ Used internally for obfuscating the page token. - + -### GetResourceByNameRequest +### GetResourceRequest @@ -1360,9 +1669,9 @@ Used internally for obfuscating the page token. - + -### GetResourceByNameResponse +### GetResourceResponse @@ -1375,77 +1684,77 @@ Used internally for obfuscating the page token. - - -### GetResourceRequest - + +### ListResourcesRequest -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | - + -### GetResourceResponse +### ListResourcesResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| resource | [Resource](#memos-api-v2-Resource) | | | +| resources | [Resource](#memos-api-v2-Resource) | repeated | | - + -### ListResourcesRequest +### Resource +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | +| uid | [string](#string) | | The user defined id of the resource. | +| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | +| filename | [string](#string) | | | +| external_link | [string](#string) | | | +| type | [string](#string) | | | +| size | [int64](#int64) | | | +| memo | [string](#string) | optional | Format: memos/{id} | - -### ListResourcesResponse + + + +### SearchResourcesRequest | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| resources | [Resource](#memos-api-v2-Resource) | repeated | | +| filter | [string](#string) | | | - + -### Resource +### SearchResourcesResponse | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the system generated unique identifier. | -| name | [string](#string) | | name is the user provided name. | -| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| filename | [string](#string) | | | -| external_link | [string](#string) | | | -| type | [string](#string) | | | -| size | [int64](#int64) | | | -| memo_id | [int32](#int32) | optional | | +| resources | [Resource](#memos-api-v2-Resource) | repeated | | @@ -1498,10 +1807,10 @@ Used internally for obfuscating the page token. | ----------- | ------------ | ------------- | ------------| | CreateResource | [CreateResourceRequest](#memos-api-v2-CreateResourceRequest) | [CreateResourceResponse](#memos-api-v2-CreateResourceResponse) | CreateResource creates a new resource. | | ListResources | [ListResourcesRequest](#memos-api-v2-ListResourcesRequest) | [ListResourcesResponse](#memos-api-v2-ListResourcesResponse) | ListResources lists all resources. | -| GetResource | [GetResourceRequest](#memos-api-v2-GetResourceRequest) | [GetResourceResponse](#memos-api-v2-GetResourceResponse) | GetResource returns a resource by id. | -| GetResourceByName | [GetResourceByNameRequest](#memos-api-v2-GetResourceByNameRequest) | [GetResourceByNameResponse](#memos-api-v2-GetResourceByNameResponse) | GetResourceByName returns a resource by name. | +| SearchResources | [SearchResourcesRequest](#memos-api-v2-SearchResourcesRequest) | [SearchResourcesResponse](#memos-api-v2-SearchResourcesResponse) | SearchResources searches memos. | +| GetResource | [GetResourceRequest](#memos-api-v2-GetResourceRequest) | [GetResourceResponse](#memos-api-v2-GetResourceResponse) | GetResource returns a resource by name. | | UpdateResource | [UpdateResourceRequest](#memos-api-v2-UpdateResourceRequest) | [UpdateResourceResponse](#memos-api-v2-UpdateResourceResponse) | UpdateResource updates a resource. | -| DeleteResource | [DeleteResourceRequest](#memos-api-v2-DeleteResourceRequest) | [DeleteResourceResponse](#memos-api-v2-DeleteResourceResponse) | DeleteResource deletes a resource by id. | +| DeleteResource | [DeleteResourceRequest](#memos-api-v2-DeleteResourceRequest) | [DeleteResourceResponse](#memos-api-v2-DeleteResourceResponse) | DeleteResource deletes a resource by name. | @@ -1522,8 +1831,8 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the memo id to create comment for. | -| create | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | +| comment | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | | | @@ -1584,7 +1893,6 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | | reaction_id | [int32](#int32) | | | @@ -1610,7 +1918,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1657,36 +1965,6 @@ Used internally for obfuscating the page token. - - -### GetMemoByNameRequest - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| name | [string](#string) | | | - - - - - - - - -### GetMemoByNameResponse - - - -| Field | Type | Label | Description | -| ----- | ---- | ----- | ----------- | -| memo | [Memo](#memos-api-v2-Memo) | | | - - - - - - ### GetMemoRequest @@ -1695,7 +1973,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1725,7 +2003,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | name is the name of the user to get stats for. Format: users/{username} | +| name | [string](#string) | | name is the name of the user to get stats for. Format: users/{id} | | timezone | [string](#string) | | timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | | filter | [string](#string) | | Same as ListMemosRequest.filter | @@ -1773,7 +2051,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1803,7 +2081,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1833,7 +2111,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1863,7 +2141,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | @@ -1895,7 +2173,7 @@ Used internally for obfuscating the page token. | ----- | ---- | ----- | ----------- | | page_size | [int32](#int32) | | The maximum number of memos to return. | | page_token | [string](#string) | | A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page. | -| filter | [string](#string) | | Filter is used to filter memos returned in the list. Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" | +| filter | [string](#string) | | Filter is used to filter memos returned in the list. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | @@ -1926,11 +2204,10 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | id is the system generated unique identifier. | -| name | [string](#string) | | name is the user provided name. | +| name | [string](#string) | | The name of the memo. Format: memos/{id} id is the system generated id. | +| uid | [string](#string) | | The user defined id of the memo. | | row_status | [RowStatus](#memos-api-v2-RowStatus) | | | -| creator | [string](#string) | | The name of the creator. Format: users/{username} | -| creator_id | [int32](#int32) | | | +| creator | [string](#string) | | The name of the creator. Format: users/{id} | | create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | display_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | @@ -1947,6 +2224,36 @@ Used internally for obfuscating the page token. + + +### SearchMemosRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| filter | [string](#string) | | Filter is used to filter memos returned. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | + + + + + + + + +### SearchMemosResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| memos | [Memo](#memos-api-v2-Memo) | repeated | | + + + + + + ### SetMemoRelationsRequest @@ -1955,7 +2262,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | | relations | [MemoRelation](#memos-api-v2-MemoRelation) | repeated | | @@ -1981,7 +2288,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | | resources | [Resource](#memos-api-v2-Resource) | repeated | | @@ -2038,7 +2345,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| id | [int32](#int32) | | | +| name | [string](#string) | | The name of the memo. Format: memos/{id} | | reaction | [Reaction](#memos-api-v2-Reaction) | | | @@ -2090,10 +2397,10 @@ Used internally for obfuscating the page token. | ----------- | ------------ | ------------- | ------------| | CreateMemo | [CreateMemoRequest](#memos-api-v2-CreateMemoRequest) | [CreateMemoResponse](#memos-api-v2-CreateMemoResponse) | CreateMemo creates a memo. | | ListMemos | [ListMemosRequest](#memos-api-v2-ListMemosRequest) | [ListMemosResponse](#memos-api-v2-ListMemosResponse) | ListMemos lists memos with pagination and filter. | -| GetMemo | [GetMemoRequest](#memos-api-v2-GetMemoRequest) | [GetMemoResponse](#memos-api-v2-GetMemoResponse) | GetMemo gets a memo by id. | -| GetMemoByName | [GetMemoByNameRequest](#memos-api-v2-GetMemoByNameRequest) | [GetMemoByNameResponse](#memos-api-v2-GetMemoByNameResponse) | GetMemoByName gets a memo by name. | +| SearchMemos | [SearchMemosRequest](#memos-api-v2-SearchMemosRequest) | [SearchMemosResponse](#memos-api-v2-SearchMemosResponse) | SearchMemos searches memos. | +| GetMemo | [GetMemoRequest](#memos-api-v2-GetMemoRequest) | [GetMemoResponse](#memos-api-v2-GetMemoResponse) | GetMemo gets a memo. | | UpdateMemo | [UpdateMemoRequest](#memos-api-v2-UpdateMemoRequest) | [UpdateMemoResponse](#memos-api-v2-UpdateMemoResponse) | UpdateMemo updates a memo. | -| DeleteMemo | [DeleteMemoRequest](#memos-api-v2-DeleteMemoRequest) | [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) | DeleteMemo deletes a memo by id. | +| DeleteMemo | [DeleteMemoRequest](#memos-api-v2-DeleteMemoRequest) | [DeleteMemoResponse](#memos-api-v2-DeleteMemoResponse) | DeleteMemo deletes a memo. | | ExportMemos | [ExportMemosRequest](#memos-api-v2-ExportMemosRequest) | [ExportMemosResponse](#memos-api-v2-ExportMemosResponse) | ExportMemos exports memos. | | SetMemoResources | [SetMemoResourcesRequest](#memos-api-v2-SetMemoResourcesRequest) | [SetMemoResourcesResponse](#memos-api-v2-SetMemoResourcesResponse) | SetMemoResources sets resources for a memo. | | ListMemoResources | [ListMemoResourcesRequest](#memos-api-v2-ListMemoResourcesRequest) | [ListMemoResourcesResponse](#memos-api-v2-ListMemoResourcesResponse) | ListMemoResources lists resources for a memo. | @@ -2175,7 +2482,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | The creator of tags. Format: users/{username} | +| user | [string](#string) | | The creator of tags. Format: users/{id} | @@ -2205,7 +2512,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | The creator of tags. Format: users/{username} | +| user | [string](#string) | | The creator of tags. Format: users/{id} | @@ -2235,7 +2542,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| user | [string](#string) | | The creator of tags. Format: users/{username} | +| user | [string](#string) | | The creator of tags. Format: users/{id} | | old_name | [string](#string) | | | | new_name | [string](#string) | | | @@ -2268,7 +2575,7 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | name | [string](#string) | | | -| creator | [string](#string) | | The creator of tags. Format: users/{username} | +| creator | [string](#string) | | The creator of tags. Format: users/{id} | @@ -2567,10 +2874,11 @@ Used internally for obfuscating the page token. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| owner | [string](#string) | | The name of intance owner. Format: "users/{id}" | | version | [string](#string) | | version is the current version of instance | | mode | [string](#string) | | mode is the instance mode (e.g. "prod", "dev" or "demo"). | -| allow_registration | [bool](#bool) | | allow_registration is whether the registration is allowed. | -| disable_password_login | [bool](#bool) | | allow_password_login is whether the password login is allowed. | +| disallow_signup | [bool](#bool) | | disallow_signup is whether the signup is disallowed. | +| disable_password_login | [bool](#bool) | | disable_password_login is whether the password login is disabled. | | additional_script | [string](#string) | | additional_script is the additional script. | | additional_style | [string](#string) | | additional_style is the additional style. | diff --git a/proto/gen/api/v2/idp_service.pb.go b/proto/gen/api/v2/idp_service.pb.go new file mode 100644 index 0000000000000..f17a4c3f5f056 --- /dev/null +++ b/proto/gen/api/v2/idp_service.pb.go @@ -0,0 +1,1289 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: api/v2/idp_service.proto + +package apiv2 + +import ( + _ "google.golang.org/genproto/googleapis/api/annotations" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type IdentityProvider_Type int32 + +const ( + IdentityProvider_TYPE_UNSPECIFIED IdentityProvider_Type = 0 + IdentityProvider_OAUTH2 IdentityProvider_Type = 1 +) + +// Enum value maps for IdentityProvider_Type. +var ( + IdentityProvider_Type_name = map[int32]string{ + 0: "TYPE_UNSPECIFIED", + 1: "OAUTH2", + } + IdentityProvider_Type_value = map[string]int32{ + "TYPE_UNSPECIFIED": 0, + "OAUTH2": 1, + } +) + +func (x IdentityProvider_Type) Enum() *IdentityProvider_Type { + p := new(IdentityProvider_Type) + *p = x + return p +} + +func (x IdentityProvider_Type) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (IdentityProvider_Type) Descriptor() protoreflect.EnumDescriptor { + return file_api_v2_idp_service_proto_enumTypes[0].Descriptor() +} + +func (IdentityProvider_Type) Type() protoreflect.EnumType { + return &file_api_v2_idp_service_proto_enumTypes[0] +} + +func (x IdentityProvider_Type) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use IdentityProvider_Type.Descriptor instead. +func (IdentityProvider_Type) EnumDescriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0} +} + +type IdentityProvider struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the identityProvider. + // Format: identityProviders/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Type IdentityProvider_Type `protobuf:"varint,2,opt,name=type,proto3,enum=memos.api.v2.IdentityProvider_Type" json:"type,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + IdentifierFilter string `protobuf:"bytes,4,opt,name=identifier_filter,json=identifierFilter,proto3" json:"identifier_filter,omitempty"` + Config *IdentityProvider_Config `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` +} + +func (x *IdentityProvider) Reset() { + *x = IdentityProvider{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider) ProtoMessage() {} + +func (x *IdentityProvider) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentityProvider.ProtoReflect.Descriptor instead. +func (*IdentityProvider) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0} +} + +func (x *IdentityProvider) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *IdentityProvider) GetType() IdentityProvider_Type { + if x != nil { + return x.Type + } + return IdentityProvider_TYPE_UNSPECIFIED +} + +func (x *IdentityProvider) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *IdentityProvider) GetIdentifierFilter() string { + if x != nil { + return x.IdentifierFilter + } + return "" +} + +func (x *IdentityProvider) GetConfig() *IdentityProvider_Config { + if x != nil { + return x.Config + } + return nil +} + +type ListIdentityProvidersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListIdentityProvidersRequest) Reset() { + *x = ListIdentityProvidersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIdentityProvidersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIdentityProvidersRequest) ProtoMessage() {} + +func (x *ListIdentityProvidersRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListIdentityProvidersRequest.ProtoReflect.Descriptor instead. +func (*ListIdentityProvidersRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{1} +} + +type ListIdentityProvidersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IdentityProviders []*IdentityProvider `protobuf:"bytes,1,rep,name=identity_providers,json=identityProviders,proto3" json:"identity_providers,omitempty"` +} + +func (x *ListIdentityProvidersResponse) Reset() { + *x = ListIdentityProvidersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListIdentityProvidersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListIdentityProvidersResponse) ProtoMessage() {} + +func (x *ListIdentityProvidersResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListIdentityProvidersResponse.ProtoReflect.Descriptor instead. +func (*ListIdentityProvidersResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ListIdentityProvidersResponse) GetIdentityProviders() []*IdentityProvider { + if x != nil { + return x.IdentityProviders + } + return nil +} + +type GetIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the identityProvider to get. + // Format: identityProviders/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *GetIdentityProviderRequest) Reset() { + *x = GetIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityProviderRequest) ProtoMessage() {} + +func (x *GetIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*GetIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{3} +} + +func (x *GetIdentityProviderRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type GetIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identityProvider. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *GetIdentityProviderResponse) Reset() { + *x = GetIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetIdentityProviderResponse) ProtoMessage() {} + +func (x *GetIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*GetIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{4} +} + +func (x *GetIdentityProviderResponse) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type CreateIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identityProvider to create. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *CreateIdentityProviderRequest) Reset() { + *x = CreateIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIdentityProviderRequest) ProtoMessage() {} + +func (x *CreateIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[5] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*CreateIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{5} +} + +func (x *CreateIdentityProviderRequest) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type CreateIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The created identityProvider. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *CreateIdentityProviderResponse) Reset() { + *x = CreateIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateIdentityProviderResponse) ProtoMessage() {} + +func (x *CreateIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[6] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*CreateIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateIdentityProviderResponse) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type UpdateIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The identityProvider to update. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` + // The update mask applies to the resource. Only the top level fields of + // IdentityProvider are supported. + UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` +} + +func (x *UpdateIdentityProviderRequest) Reset() { + *x = UpdateIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateIdentityProviderRequest) ProtoMessage() {} + +func (x *UpdateIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*UpdateIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{7} +} + +func (x *UpdateIdentityProviderRequest) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +func (x *UpdateIdentityProviderRequest) GetUpdateMask() *fieldmaskpb.FieldMask { + if x != nil { + return x.UpdateMask + } + return nil +} + +type UpdateIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The updated identityProvider. + IdentityProvider *IdentityProvider `protobuf:"bytes,1,opt,name=identity_provider,json=identityProvider,proto3" json:"identity_provider,omitempty"` +} + +func (x *UpdateIdentityProviderResponse) Reset() { + *x = UpdateIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateIdentityProviderResponse) ProtoMessage() {} + +func (x *UpdateIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*UpdateIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{8} +} + +func (x *UpdateIdentityProviderResponse) GetIdentityProvider() *IdentityProvider { + if x != nil { + return x.IdentityProvider + } + return nil +} + +type DeleteIdentityProviderRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The name of the identityProvider to delete. + // Format: identityProviders/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DeleteIdentityProviderRequest) Reset() { + *x = DeleteIdentityProviderRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteIdentityProviderRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteIdentityProviderRequest) ProtoMessage() {} + +func (x *DeleteIdentityProviderRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteIdentityProviderRequest.ProtoReflect.Descriptor instead. +func (*DeleteIdentityProviderRequest) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{9} +} + +func (x *DeleteIdentityProviderRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeleteIdentityProviderResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteIdentityProviderResponse) Reset() { + *x = DeleteIdentityProviderResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteIdentityProviderResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteIdentityProviderResponse) ProtoMessage() {} + +func (x *DeleteIdentityProviderResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteIdentityProviderResponse.ProtoReflect.Descriptor instead. +func (*DeleteIdentityProviderResponse) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{10} +} + +type IdentityProvider_Config struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Config: + // + // *IdentityProvider_Config_Oauth2 + Config isIdentityProvider_Config_Config `protobuf_oneof:"config"` +} + +func (x *IdentityProvider_Config) Reset() { + *x = IdentityProvider_Config{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider_Config) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider_Config) ProtoMessage() {} + +func (x *IdentityProvider_Config) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentityProvider_Config.ProtoReflect.Descriptor instead. +func (*IdentityProvider_Config) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0} +} + +func (m *IdentityProvider_Config) GetConfig() isIdentityProvider_Config_Config { + if m != nil { + return m.Config + } + return nil +} + +func (x *IdentityProvider_Config) GetOauth2() *IdentityProvider_Config_OAuth2 { + if x, ok := x.GetConfig().(*IdentityProvider_Config_Oauth2); ok { + return x.Oauth2 + } + return nil +} + +type isIdentityProvider_Config_Config interface { + isIdentityProvider_Config_Config() +} + +type IdentityProvider_Config_Oauth2 struct { + Oauth2 *IdentityProvider_Config_OAuth2 `protobuf:"bytes,1,opt,name=oauth2,proto3,oneof"` +} + +func (*IdentityProvider_Config_Oauth2) isIdentityProvider_Config_Config() {} + +type IdentityProvider_Config_FieldMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *IdentityProvider_Config_FieldMapping) Reset() { + *x = IdentityProvider_Config_FieldMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider_Config_FieldMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider_Config_FieldMapping) ProtoMessage() {} + +func (x *IdentityProvider_Config_FieldMapping) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentityProvider_Config_FieldMapping.ProtoReflect.Descriptor instead. +func (*IdentityProvider_Config_FieldMapping) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0, 0} +} + +func (x *IdentityProvider_Config_FieldMapping) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *IdentityProvider_Config_FieldMapping) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *IdentityProvider_Config_FieldMapping) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type IdentityProvider_Config_OAuth2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + AuthUrl string `protobuf:"bytes,3,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + UserInfoUrl string `protobuf:"bytes,5,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"` + Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"` + FieldMapping *IdentityProvider_Config_FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"` +} + +func (x *IdentityProvider_Config_OAuth2) Reset() { + *x = IdentityProvider_Config_OAuth2{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_idp_service_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProvider_Config_OAuth2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProvider_Config_OAuth2) ProtoMessage() {} + +func (x *IdentityProvider_Config_OAuth2) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_idp_service_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentityProvider_Config_OAuth2.ProtoReflect.Descriptor instead. +func (*IdentityProvider_Config_OAuth2) Descriptor() ([]byte, []int) { + return file_api_v2_idp_service_proto_rawDescGZIP(), []int{0, 0, 1} +} + +func (x *IdentityProvider_Config_OAuth2) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetAuthUrl() string { + if x != nil { + return x.AuthUrl + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetTokenUrl() string { + if x != nil { + return x.TokenUrl + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetUserInfoUrl() string { + if x != nil { + return x.UserInfoUrl + } + return "" +} + +func (x *IdentityProvider_Config_OAuth2) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *IdentityProvider_Config_OAuth2) GetFieldMapping() *IdentityProvider_Config_FieldMapping { + if x != nil { + return x.FieldMapping + } + return nil +} + +var File_api_v2_idp_service_proto protoreflect.FileDescriptor + +var file_api_v2_idp_service_proto_rawDesc = []byte{ + 0x0a, 0x18, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x64, 0x70, 0x5f, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, + 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xeb, 0x05, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, + 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0xdd, 0x03, 0x0a, 0x06, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x12, 0x46, 0x0a, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x48, 0x00, + 0x52, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x1a, 0x67, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, + 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, + 0x6c, 0x1a, 0x97, 0x02, 0x0a, 0x06, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x12, 0x1b, 0x0a, 0x09, + 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x19, + 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x22, 0x0a, 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x6e, 0x66, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x55, 0x72, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, + 0x6f, 0x70, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, + 0x65, 0x73, 0x12, 0x57, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x70, 0x70, + 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x66, + 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x42, 0x08, 0x0a, 0x06, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x28, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, + 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x41, 0x55, 0x54, 0x48, 0x32, 0x10, 0x01, 0x22, + 0x1e, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x6e, 0x0a, 0x1d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4d, 0x0a, 0x12, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x11, 0x69, 0x64, + 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x22, + 0x30, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x22, 0x6a, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x4b, 0x0a, 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x6c, 0x0a, + 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, + 0x0a, 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, + 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x6d, 0x0a, 0x1e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, + 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0xa9, 0x01, 0x0a, 0x1d, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4b, 0x0a, 0x11, + 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, + 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x6d, 0x0a, 0x1e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x11, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x22, 0x33, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x20, 0x0a, 0x1e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf8, 0x06, 0x0a, + 0x17, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x93, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, + 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, + 0x72, 0x73, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x64, 0x65, + 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0x9d, + 0x01, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x47, 0x65, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0xda, 0x41, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x96, + 0x01, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x22, 0x19, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, + 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x12, 0xe4, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, + 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, + 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x6f, 0xda, + 0x41, 0x1d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x49, 0x3a, 0x11, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, + 0x70, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x32, 0x34, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x2f, 0x7b, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x5f, 0x70, 0x72, 0x6f, 0x76, + 0x69, 0x64, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, + 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa6, + 0x01, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, + 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x31, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x24, 0x2a, 0x22, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xa7, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x0f, 0x49, 0x64, + 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, + 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, + 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, + 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, + 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_api_v2_idp_service_proto_rawDescOnce sync.Once + file_api_v2_idp_service_proto_rawDescData = file_api_v2_idp_service_proto_rawDesc +) + +func file_api_v2_idp_service_proto_rawDescGZIP() []byte { + file_api_v2_idp_service_proto_rawDescOnce.Do(func() { + file_api_v2_idp_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_api_v2_idp_service_proto_rawDescData) + }) + return file_api_v2_idp_service_proto_rawDescData +} + +var file_api_v2_idp_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_v2_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_api_v2_idp_service_proto_goTypes = []interface{}{ + (IdentityProvider_Type)(0), // 0: memos.api.v2.IdentityProvider.Type + (*IdentityProvider)(nil), // 1: memos.api.v2.IdentityProvider + (*ListIdentityProvidersRequest)(nil), // 2: memos.api.v2.ListIdentityProvidersRequest + (*ListIdentityProvidersResponse)(nil), // 3: memos.api.v2.ListIdentityProvidersResponse + (*GetIdentityProviderRequest)(nil), // 4: memos.api.v2.GetIdentityProviderRequest + (*GetIdentityProviderResponse)(nil), // 5: memos.api.v2.GetIdentityProviderResponse + (*CreateIdentityProviderRequest)(nil), // 6: memos.api.v2.CreateIdentityProviderRequest + (*CreateIdentityProviderResponse)(nil), // 7: memos.api.v2.CreateIdentityProviderResponse + (*UpdateIdentityProviderRequest)(nil), // 8: memos.api.v2.UpdateIdentityProviderRequest + (*UpdateIdentityProviderResponse)(nil), // 9: memos.api.v2.UpdateIdentityProviderResponse + (*DeleteIdentityProviderRequest)(nil), // 10: memos.api.v2.DeleteIdentityProviderRequest + (*DeleteIdentityProviderResponse)(nil), // 11: memos.api.v2.DeleteIdentityProviderResponse + (*IdentityProvider_Config)(nil), // 12: memos.api.v2.IdentityProvider.Config + (*IdentityProvider_Config_FieldMapping)(nil), // 13: memos.api.v2.IdentityProvider.Config.FieldMapping + (*IdentityProvider_Config_OAuth2)(nil), // 14: memos.api.v2.IdentityProvider.Config.OAuth2 + (*fieldmaskpb.FieldMask)(nil), // 15: google.protobuf.FieldMask +} +var file_api_v2_idp_service_proto_depIdxs = []int32{ + 0, // 0: memos.api.v2.IdentityProvider.type:type_name -> memos.api.v2.IdentityProvider.Type + 12, // 1: memos.api.v2.IdentityProvider.config:type_name -> memos.api.v2.IdentityProvider.Config + 1, // 2: memos.api.v2.ListIdentityProvidersResponse.identity_providers:type_name -> memos.api.v2.IdentityProvider + 1, // 3: memos.api.v2.GetIdentityProviderResponse.identity_provider:type_name -> memos.api.v2.IdentityProvider + 1, // 4: memos.api.v2.CreateIdentityProviderRequest.identity_provider:type_name -> memos.api.v2.IdentityProvider + 1, // 5: memos.api.v2.CreateIdentityProviderResponse.identity_provider:type_name -> memos.api.v2.IdentityProvider + 1, // 6: memos.api.v2.UpdateIdentityProviderRequest.identity_provider:type_name -> memos.api.v2.IdentityProvider + 15, // 7: memos.api.v2.UpdateIdentityProviderRequest.update_mask:type_name -> google.protobuf.FieldMask + 1, // 8: memos.api.v2.UpdateIdentityProviderResponse.identity_provider:type_name -> memos.api.v2.IdentityProvider + 14, // 9: memos.api.v2.IdentityProvider.Config.oauth2:type_name -> memos.api.v2.IdentityProvider.Config.OAuth2 + 13, // 10: memos.api.v2.IdentityProvider.Config.OAuth2.field_mapping:type_name -> memos.api.v2.IdentityProvider.Config.FieldMapping + 2, // 11: memos.api.v2.IdentityProviderService.ListIdentityProviders:input_type -> memos.api.v2.ListIdentityProvidersRequest + 4, // 12: memos.api.v2.IdentityProviderService.GetIdentityProvider:input_type -> memos.api.v2.GetIdentityProviderRequest + 6, // 13: memos.api.v2.IdentityProviderService.CreateIdentityProvider:input_type -> memos.api.v2.CreateIdentityProviderRequest + 8, // 14: memos.api.v2.IdentityProviderService.UpdateIdentityProvider:input_type -> memos.api.v2.UpdateIdentityProviderRequest + 10, // 15: memos.api.v2.IdentityProviderService.DeleteIdentityProvider:input_type -> memos.api.v2.DeleteIdentityProviderRequest + 3, // 16: memos.api.v2.IdentityProviderService.ListIdentityProviders:output_type -> memos.api.v2.ListIdentityProvidersResponse + 5, // 17: memos.api.v2.IdentityProviderService.GetIdentityProvider:output_type -> memos.api.v2.GetIdentityProviderResponse + 7, // 18: memos.api.v2.IdentityProviderService.CreateIdentityProvider:output_type -> memos.api.v2.CreateIdentityProviderResponse + 9, // 19: memos.api.v2.IdentityProviderService.UpdateIdentityProvider:output_type -> memos.api.v2.UpdateIdentityProviderResponse + 11, // 20: memos.api.v2.IdentityProviderService.DeleteIdentityProvider:output_type -> memos.api.v2.DeleteIdentityProviderResponse + 16, // [16:21] is the sub-list for method output_type + 11, // [11:16] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_api_v2_idp_service_proto_init() } +func file_api_v2_idp_service_proto_init() { + if File_api_v2_idp_service_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_api_v2_idp_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIdentityProvidersRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListIdentityProvidersResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteIdentityProviderRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteIdentityProviderResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider_Config); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider_Config_FieldMapping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_idp_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProvider_Config_OAuth2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_api_v2_idp_service_proto_msgTypes[11].OneofWrappers = []interface{}{ + (*IdentityProvider_Config_Oauth2)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_api_v2_idp_service_proto_rawDesc, + NumEnums: 1, + NumMessages: 14, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_api_v2_idp_service_proto_goTypes, + DependencyIndexes: file_api_v2_idp_service_proto_depIdxs, + EnumInfos: file_api_v2_idp_service_proto_enumTypes, + MessageInfos: file_api_v2_idp_service_proto_msgTypes, + }.Build() + File_api_v2_idp_service_proto = out.File + file_api_v2_idp_service_proto_rawDesc = nil + file_api_v2_idp_service_proto_goTypes = nil + file_api_v2_idp_service_proto_depIdxs = nil +} diff --git a/proto/gen/api/v2/idp_service.pb.gw.go b/proto/gen/api/v2/idp_service.pb.gw.go new file mode 100644 index 0000000000000..74bdcb5a369cc --- /dev/null +++ b/proto/gen/api/v2/idp_service.pb.gw.go @@ -0,0 +1,599 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: api/v2/idp_service.proto + +/* +Package apiv2 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package apiv2 + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListIdentityProvidersRequest + var metadata runtime.ServerMetadata + + msg, err := client.ListIdentityProviders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_ListIdentityProviders_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListIdentityProvidersRequest + var metadata runtime.ServerMetadata + + msg, err := server.ListIdentityProviders(ctx, &protoReq) + return msg, metadata, err + +} + +func request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.GetIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_GetIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.GetIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_IdentityProviderService_CreateIdentityProvider_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_IdentityProviderService_CreateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateIdentityProviderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_CreateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.CreateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_CreateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq CreateIdentityProviderRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_CreateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.CreateIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_IdentityProviderService_UpdateIdentityProvider_0 = &utilities.DoubleArray{Encoding: map[string]int{"identity_provider": 0, "identityProvider": 1, "name": 2}, Base: []int{1, 3, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 5, 2, 3, 4}} +) + +func request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateIdentityProviderRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IdentityProvider); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.IdentityProvider); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.UpdateMask = fieldMask + } + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["identity_provider.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identity_provider.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "identity_provider.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identity_provider.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_UpdateIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateIdentityProviderRequest + var metadata runtime.ServerMetadata + + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.IdentityProvider); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 { + if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.IdentityProvider); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } else { + protoReq.UpdateMask = fieldMask + } + } + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["identity_provider.name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "identity_provider.name") + } + + err = runtime.PopulateFieldFromPath(&protoReq, "identity_provider.name", val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "identity_provider.name", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_IdentityProviderService_UpdateIdentityProvider_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +func request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, client IdentityProviderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.DeleteIdentityProvider(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_IdentityProviderService_DeleteIdentityProvider_0(ctx context.Context, marshaler runtime.Marshaler, server IdentityProviderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteIdentityProviderRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.DeleteIdentityProvider(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterIdentityProviderServiceHandlerServer registers the http handlers for service IdentityProviderService to "mux". +// UnaryRPC :call IdentityProviderServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterIdentityProviderServiceHandlerFromEndpoint instead. +func RegisterIdentityProviderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server IdentityProviderServiceServer) error { + + mux.Handle("GET", pattern_IdentityProviderService_ListIdentityProviders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_ListIdentityProviders_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_ListIdentityProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_IdentityProviderService_GetIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_GetIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_GetIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_IdentityProviderService_CreateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_IdentityProviderService_UpdateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{identity_provider.name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_IdentityProviderService_DeleteIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterIdentityProviderServiceHandlerFromEndpoint is same as RegisterIdentityProviderServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterIdentityProviderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.DialContext(ctx, endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterIdentityProviderServiceHandler(ctx, mux, conn) +} + +// RegisterIdentityProviderServiceHandler registers the http handlers for service IdentityProviderService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterIdentityProviderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterIdentityProviderServiceHandlerClient(ctx, mux, NewIdentityProviderServiceClient(conn)) +} + +// RegisterIdentityProviderServiceHandlerClient registers the http handlers for service IdentityProviderService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "IdentityProviderServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "IdentityProviderServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "IdentityProviderServiceClient" to call the correct interceptors. +func RegisterIdentityProviderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client IdentityProviderServiceClient) error { + + mux.Handle("GET", pattern_IdentityProviderService_ListIdentityProviders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/ListIdentityProviders", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_ListIdentityProviders_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_ListIdentityProviders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_IdentityProviderService_GetIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/GetIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_GetIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_GetIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_IdentityProviderService_CreateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/CreateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/identityProviders")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_CreateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("PATCH", pattern_IdentityProviderService_UpdateIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{identity_provider.name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_UpdateIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("DELETE", pattern_IdentityProviderService_DeleteIdentityProvider_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider", runtime.WithHTTPPathPattern("/api/v2/{name=identityProviders/*}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_IdentityProviderService_DeleteIdentityProvider_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_IdentityProviderService_ListIdentityProviders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "identityProviders"}, "")) + + pattern_IdentityProviderService_GetIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "name"}, "")) + + pattern_IdentityProviderService_CreateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "identityProviders"}, "")) + + pattern_IdentityProviderService_UpdateIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "identity_provider.name"}, "")) + + pattern_IdentityProviderService_DeleteIdentityProvider_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "identityProviders", "name"}, "")) +) + +var ( + forward_IdentityProviderService_ListIdentityProviders_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_GetIdentityProvider_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_CreateIdentityProvider_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_UpdateIdentityProvider_0 = runtime.ForwardResponseMessage + + forward_IdentityProviderService_DeleteIdentityProvider_0 = runtime.ForwardResponseMessage +) diff --git a/proto/gen/api/v2/idp_service_grpc.pb.go b/proto/gen/api/v2/idp_service_grpc.pb.go new file mode 100644 index 0000000000000..ead15d0607fcf --- /dev/null +++ b/proto/gen/api/v2/idp_service_grpc.pb.go @@ -0,0 +1,262 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc (unknown) +// source: api/v2/idp_service.proto + +package apiv2 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + IdentityProviderService_ListIdentityProviders_FullMethodName = "/memos.api.v2.IdentityProviderService/ListIdentityProviders" + IdentityProviderService_GetIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/GetIdentityProvider" + IdentityProviderService_CreateIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/CreateIdentityProvider" + IdentityProviderService_UpdateIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/UpdateIdentityProvider" + IdentityProviderService_DeleteIdentityProvider_FullMethodName = "/memos.api.v2.IdentityProviderService/DeleteIdentityProvider" +) + +// IdentityProviderServiceClient is the client API for IdentityProviderService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type IdentityProviderServiceClient interface { + ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error) + GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*GetIdentityProviderResponse, error) + CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*CreateIdentityProviderResponse, error) + // UpdateIdentityProvider updates an identity provider. + UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*UpdateIdentityProviderResponse, error) + // DeleteIdentityProvider deletes an identity provider. + DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*DeleteIdentityProviderResponse, error) +} + +type identityProviderServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewIdentityProviderServiceClient(cc grpc.ClientConnInterface) IdentityProviderServiceClient { + return &identityProviderServiceClient{cc} +} + +func (c *identityProviderServiceClient) ListIdentityProviders(ctx context.Context, in *ListIdentityProvidersRequest, opts ...grpc.CallOption) (*ListIdentityProvidersResponse, error) { + out := new(ListIdentityProvidersResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_ListIdentityProviders_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) GetIdentityProvider(ctx context.Context, in *GetIdentityProviderRequest, opts ...grpc.CallOption) (*GetIdentityProviderResponse, error) { + out := new(GetIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_GetIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) CreateIdentityProvider(ctx context.Context, in *CreateIdentityProviderRequest, opts ...grpc.CallOption) (*CreateIdentityProviderResponse, error) { + out := new(CreateIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_CreateIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) UpdateIdentityProvider(ctx context.Context, in *UpdateIdentityProviderRequest, opts ...grpc.CallOption) (*UpdateIdentityProviderResponse, error) { + out := new(UpdateIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_UpdateIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *identityProviderServiceClient) DeleteIdentityProvider(ctx context.Context, in *DeleteIdentityProviderRequest, opts ...grpc.CallOption) (*DeleteIdentityProviderResponse, error) { + out := new(DeleteIdentityProviderResponse) + err := c.cc.Invoke(ctx, IdentityProviderService_DeleteIdentityProvider_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// IdentityProviderServiceServer is the server API for IdentityProviderService service. +// All implementations must embed UnimplementedIdentityProviderServiceServer +// for forward compatibility +type IdentityProviderServiceServer interface { + ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error) + GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*GetIdentityProviderResponse, error) + CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*CreateIdentityProviderResponse, error) + // UpdateIdentityProvider updates an identity provider. + UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*UpdateIdentityProviderResponse, error) + // DeleteIdentityProvider deletes an identity provider. + DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*DeleteIdentityProviderResponse, error) + mustEmbedUnimplementedIdentityProviderServiceServer() +} + +// UnimplementedIdentityProviderServiceServer must be embedded to have forward compatible implementations. +type UnimplementedIdentityProviderServiceServer struct { +} + +func (UnimplementedIdentityProviderServiceServer) ListIdentityProviders(context.Context, *ListIdentityProvidersRequest) (*ListIdentityProvidersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListIdentityProviders not implemented") +} +func (UnimplementedIdentityProviderServiceServer) GetIdentityProvider(context.Context, *GetIdentityProviderRequest) (*GetIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) CreateIdentityProvider(context.Context, *CreateIdentityProviderRequest) (*CreateIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) UpdateIdentityProvider(context.Context, *UpdateIdentityProviderRequest) (*UpdateIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) DeleteIdentityProvider(context.Context, *DeleteIdentityProviderRequest) (*DeleteIdentityProviderResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteIdentityProvider not implemented") +} +func (UnimplementedIdentityProviderServiceServer) mustEmbedUnimplementedIdentityProviderServiceServer() { +} + +// UnsafeIdentityProviderServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to IdentityProviderServiceServer will +// result in compilation errors. +type UnsafeIdentityProviderServiceServer interface { + mustEmbedUnimplementedIdentityProviderServiceServer() +} + +func RegisterIdentityProviderServiceServer(s grpc.ServiceRegistrar, srv IdentityProviderServiceServer) { + s.RegisterService(&IdentityProviderService_ServiceDesc, srv) +} + +func _IdentityProviderService_ListIdentityProviders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListIdentityProvidersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_ListIdentityProviders_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).ListIdentityProviders(ctx, req.(*ListIdentityProvidersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_GetIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_GetIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).GetIdentityProvider(ctx, req.(*GetIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_CreateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_CreateIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).CreateIdentityProvider(ctx, req.(*CreateIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_UpdateIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_UpdateIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).UpdateIdentityProvider(ctx, req.(*UpdateIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _IdentityProviderService_DeleteIdentityProvider_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteIdentityProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: IdentityProviderService_DeleteIdentityProvider_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(IdentityProviderServiceServer).DeleteIdentityProvider(ctx, req.(*DeleteIdentityProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// IdentityProviderService_ServiceDesc is the grpc.ServiceDesc for IdentityProviderService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var IdentityProviderService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "memos.api.v2.IdentityProviderService", + HandlerType: (*IdentityProviderServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListIdentityProviders", + Handler: _IdentityProviderService_ListIdentityProviders_Handler, + }, + { + MethodName: "GetIdentityProvider", + Handler: _IdentityProviderService_GetIdentityProvider_Handler, + }, + { + MethodName: "CreateIdentityProvider", + Handler: _IdentityProviderService_CreateIdentityProvider_Handler, + }, + { + MethodName: "UpdateIdentityProvider", + Handler: _IdentityProviderService_UpdateIdentityProvider_Handler, + }, + { + MethodName: "DeleteIdentityProvider", + Handler: _IdentityProviderService_DeleteIdentityProvider_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "api/v2/idp_service.proto", +} diff --git a/proto/gen/api/v2/inbox_service.pb.go b/proto/gen/api/v2/inbox_service.pb.go index 6359d599caa29..3d4f05671118d 100644 --- a/proto/gen/api/v2/inbox_service.pb.go +++ b/proto/gen/api/v2/inbox_service.pb.go @@ -127,11 +127,11 @@ type Inbox struct { unknownFields protoimpl.UnknownFields // The name of the inbox. - // Format: inboxes/{uid} + // Format: inboxes/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // Format: users/{username} + // Format: users/{id} Sender string `protobuf:"bytes,2,opt,name=sender,proto3" json:"sender,omitempty"` - // Format: users/{username} + // Format: users/{id} Receiver string `protobuf:"bytes,3,opt,name=receiver,proto3" json:"receiver,omitempty"` Status Inbox_Status `protobuf:"varint,4,opt,name=status,proto3,enum=memos.api.v2.Inbox_Status" json:"status,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` @@ -225,7 +225,7 @@ type ListInboxesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -423,7 +423,7 @@ type DeleteInboxRequest struct { unknownFields protoimpl.UnknownFields // The name of the inbox to delete. - // Format: inboxes/{uid} + // Format: inboxes/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } diff --git a/proto/gen/api/v2/link_service.pb.go b/proto/gen/api/v2/link_service.pb.go index f339c82cdd264..4b2d83b4645e1 100644 --- a/proto/gen/api/v2/link_service.pb.go +++ b/proto/gen/api/v2/link_service.pb.go @@ -21,18 +21,16 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type LinkMetadata struct { +type GetLinkMetadataRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` + Link string `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"` } -func (x *LinkMetadata) Reset() { - *x = LinkMetadata{} +func (x *GetLinkMetadataRequest) Reset() { + *x = GetLinkMetadataRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_link_service_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -40,13 +38,13 @@ func (x *LinkMetadata) Reset() { } } -func (x *LinkMetadata) String() string { +func (x *GetLinkMetadataRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*LinkMetadata) ProtoMessage() {} +func (*GetLinkMetadataRequest) ProtoMessage() {} -func (x *LinkMetadata) ProtoReflect() protoreflect.Message { +func (x *GetLinkMetadataRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_link_service_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -58,42 +56,28 @@ func (x *LinkMetadata) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use LinkMetadata.ProtoReflect.Descriptor instead. -func (*LinkMetadata) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLinkMetadataRequest.ProtoReflect.Descriptor instead. +func (*GetLinkMetadataRequest) Descriptor() ([]byte, []int) { return file_api_v2_link_service_proto_rawDescGZIP(), []int{0} } -func (x *LinkMetadata) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *LinkMetadata) GetDescription() string { - if x != nil { - return x.Description - } - return "" -} - -func (x *LinkMetadata) GetImage() string { +func (x *GetLinkMetadataRequest) GetLink() string { if x != nil { - return x.Image + return x.Link } return "" } -type GetLinkMetadataRequest struct { +type GetLinkMetadataResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Link string `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"` + LinkMetadata *LinkMetadata `protobuf:"bytes,1,opt,name=link_metadata,json=linkMetadata,proto3" json:"link_metadata,omitempty"` } -func (x *GetLinkMetadataRequest) Reset() { - *x = GetLinkMetadataRequest{} +func (x *GetLinkMetadataResponse) Reset() { + *x = GetLinkMetadataResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_link_service_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -101,13 +85,13 @@ func (x *GetLinkMetadataRequest) Reset() { } } -func (x *GetLinkMetadataRequest) String() string { +func (x *GetLinkMetadataResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLinkMetadataRequest) ProtoMessage() {} +func (*GetLinkMetadataResponse) ProtoMessage() {} -func (x *GetLinkMetadataRequest) ProtoReflect() protoreflect.Message { +func (x *GetLinkMetadataResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_link_service_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -119,28 +103,30 @@ func (x *GetLinkMetadataRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLinkMetadataRequest.ProtoReflect.Descriptor instead. -func (*GetLinkMetadataRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetLinkMetadataResponse.ProtoReflect.Descriptor instead. +func (*GetLinkMetadataResponse) Descriptor() ([]byte, []int) { return file_api_v2_link_service_proto_rawDescGZIP(), []int{1} } -func (x *GetLinkMetadataRequest) GetLink() string { +func (x *GetLinkMetadataResponse) GetLinkMetadata() *LinkMetadata { if x != nil { - return x.Link + return x.LinkMetadata } - return "" + return nil } -type GetLinkMetadataResponse struct { +type LinkMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Metadata *LinkMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + Image string `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"` } -func (x *GetLinkMetadataResponse) Reset() { - *x = GetLinkMetadataResponse{} +func (x *LinkMetadata) Reset() { + *x = LinkMetadata{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_link_service_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -148,13 +134,13 @@ func (x *GetLinkMetadataResponse) Reset() { } } -func (x *GetLinkMetadataResponse) String() string { +func (x *LinkMetadata) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLinkMetadataResponse) ProtoMessage() {} +func (*LinkMetadata) ProtoMessage() {} -func (x *GetLinkMetadataResponse) ProtoReflect() protoreflect.Message { +func (x *LinkMetadata) ProtoReflect() protoreflect.Message { mi := &file_api_v2_link_service_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -166,16 +152,30 @@ func (x *GetLinkMetadataResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLinkMetadataResponse.ProtoReflect.Descriptor instead. -func (*GetLinkMetadataResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use LinkMetadata.ProtoReflect.Descriptor instead. +func (*LinkMetadata) Descriptor() ([]byte, []int) { return file_api_v2_link_service_proto_rawDescGZIP(), []int{2} } -func (x *GetLinkMetadataResponse) GetMetadata() *LinkMetadata { +func (x *LinkMetadata) GetTitle() string { if x != nil { - return x.Metadata + return x.Title } - return nil + return "" +} + +func (x *LinkMetadata) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *LinkMetadata) GetImage() string { + if x != nil { + return x.Image + } + return "" } var File_api_v2_link_service_proto protoreflect.FileDescriptor @@ -185,41 +185,42 @@ var file_api_v2_link_service_proto_rawDesc = []byte{ 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5c, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x2c, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, - 0x69, 0x6e, 0x6b, 0x22, 0x51, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, - 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x32, 0x87, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x6b, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, - 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, - 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, - 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, - 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2c, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x22, 0x5a, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x3f, 0x0a, 0x0d, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x0c, 0x6c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x22, 0x5c, 0x0a, 0x0c, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x32, + 0x8c, 0x01, 0x0a, 0x0b, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, + 0x7d, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x6e, 0x6b, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x6c, 0x69, 0x6e, 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0xa8, + 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4c, 0x69, 0x6e, 0x6b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, + 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, + 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, + 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -236,14 +237,14 @@ func file_api_v2_link_service_proto_rawDescGZIP() []byte { var file_api_v2_link_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_api_v2_link_service_proto_goTypes = []interface{}{ - (*LinkMetadata)(nil), // 0: memos.api.v2.LinkMetadata - (*GetLinkMetadataRequest)(nil), // 1: memos.api.v2.GetLinkMetadataRequest - (*GetLinkMetadataResponse)(nil), // 2: memos.api.v2.GetLinkMetadataResponse + (*GetLinkMetadataRequest)(nil), // 0: memos.api.v2.GetLinkMetadataRequest + (*GetLinkMetadataResponse)(nil), // 1: memos.api.v2.GetLinkMetadataResponse + (*LinkMetadata)(nil), // 2: memos.api.v2.LinkMetadata } var file_api_v2_link_service_proto_depIdxs = []int32{ - 0, // 0: memos.api.v2.GetLinkMetadataResponse.metadata:type_name -> memos.api.v2.LinkMetadata - 1, // 1: memos.api.v2.LinkService.GetLinkMetadata:input_type -> memos.api.v2.GetLinkMetadataRequest - 2, // 2: memos.api.v2.LinkService.GetLinkMetadata:output_type -> memos.api.v2.GetLinkMetadataResponse + 2, // 0: memos.api.v2.GetLinkMetadataResponse.link_metadata:type_name -> memos.api.v2.LinkMetadata + 0, // 1: memos.api.v2.LinkService.GetLinkMetadata:input_type -> memos.api.v2.GetLinkMetadataRequest + 1, // 2: memos.api.v2.LinkService.GetLinkMetadata:output_type -> memos.api.v2.GetLinkMetadataResponse 2, // [2:3] is the sub-list for method output_type 1, // [1:2] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name @@ -258,7 +259,7 @@ func file_api_v2_link_service_proto_init() { } if !protoimpl.UnsafeEnabled { file_api_v2_link_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LinkMetadata); i { + switch v := v.(*GetLinkMetadataRequest); i { case 0: return &v.state case 1: @@ -270,7 +271,7 @@ func file_api_v2_link_service_proto_init() { } } file_api_v2_link_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLinkMetadataRequest); i { + switch v := v.(*GetLinkMetadataResponse); i { case 0: return &v.state case 1: @@ -282,7 +283,7 @@ func file_api_v2_link_service_proto_init() { } } file_api_v2_link_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetLinkMetadataResponse); i { + switch v := v.(*LinkMetadata); i { case 0: return &v.state case 1: diff --git a/proto/gen/api/v2/link_service.pb.gw.go b/proto/gen/api/v2/link_service.pb.gw.go index e9bed49136992..fdd0e0e373f8a 100644 --- a/proto/gen/api/v2/link_service.pb.gw.go +++ b/proto/gen/api/v2/link_service.pb.gw.go @@ -81,7 +81,7 @@ func RegisterLinkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/metadata")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/link_metadata")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -145,7 +145,7 @@ func RegisterLinkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/metadata")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.LinkService/GetLinkMetadata", runtime.WithHTTPPathPattern("/api/v2/link_metadata")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -165,7 +165,7 @@ func RegisterLinkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux } var ( - pattern_LinkService_GetLinkMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "metadata"}, "")) + pattern_LinkService_GetLinkMetadata_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "link_metadata"}, "")) ) var ( diff --git a/proto/gen/api/v2/memo_relation_service.pb.go b/proto/gen/api/v2/memo_relation_service.pb.go index 28d0644dddcb1..62345e78bc0dc 100644 --- a/proto/gen/api/v2/memo_relation_service.pb.go +++ b/proto/gen/api/v2/memo_relation_service.pb.go @@ -74,9 +74,13 @@ type MemoRelation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MemoId int32 `protobuf:"varint,1,opt,name=memo_id,json=memoId,proto3" json:"memo_id,omitempty"` - RelatedMemoId int32 `protobuf:"varint,2,opt,name=related_memo_id,json=relatedMemoId,proto3" json:"related_memo_id,omitempty"` - Type MemoRelation_Type `protobuf:"varint,3,opt,name=type,proto3,enum=memos.api.v2.MemoRelation_Type" json:"type,omitempty"` + // The name of memo. + // Format: "memos/{uid}" + Memo string `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` + // The name of related memo. + // Format: "memos/{uid}" + RelatedMemo string `protobuf:"bytes,2,opt,name=related_memo,json=relatedMemo,proto3" json:"related_memo,omitempty"` + Type MemoRelation_Type `protobuf:"varint,3,opt,name=type,proto3,enum=memos.api.v2.MemoRelation_Type" json:"type,omitempty"` } func (x *MemoRelation) Reset() { @@ -111,18 +115,18 @@ func (*MemoRelation) Descriptor() ([]byte, []int) { return file_api_v2_memo_relation_service_proto_rawDescGZIP(), []int{0} } -func (x *MemoRelation) GetMemoId() int32 { +func (x *MemoRelation) GetMemo() string { if x != nil { - return x.MemoId + return x.Memo } - return 0 + return "" } -func (x *MemoRelation) GetRelatedMemoId() int32 { +func (x *MemoRelation) GetRelatedMemo() string { if x != nil { - return x.RelatedMemoId + return x.RelatedMemo } - return 0 + return "" } func (x *MemoRelation) GetType() MemoRelation_Type { @@ -138,30 +142,30 @@ var file_api_v2_memo_relation_service_proto_rawDesc = []byte{ 0x0a, 0x22, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x22, 0xbe, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0f, - 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, - 0x6d, 0x6f, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, - 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x38, 0x0a, 0x04, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x46, 0x45, 0x52, - 0x45, 0x4e, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, - 0x54, 0x10, 0x02, 0x42, 0xb0, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, - 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x32, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x33, 0x0a, 0x04, 0x74, 0x79, + 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, + 0x38, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, + 0x09, 0x52, 0x45, 0x46, 0x45, 0x52, 0x45, 0x4e, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, + 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x42, 0xb0, 0x01, 0x0a, 0x10, 0x63, 0x6f, + 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x18, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, + 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, + 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, + 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/gen/api/v2/memo_service.pb.go b/proto/gen/api/v2/memo_service.pb.go index ec662e8e03ce1..690b8e4584bdd 100644 --- a/proto/gen/api/v2/memo_service.pb.go +++ b/proto/gen/api/v2/memo_service.pb.go @@ -80,25 +80,26 @@ type Memo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id is the system generated unique identifier. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // name is the user provided name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + // The name of the memo. + // Format: memos/{id} + // id is the system generated id. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The user defined id of the memo. + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` RowStatus RowStatus `protobuf:"varint,3,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` // The name of the creator. - // Format: users/{username} + // Format: users/{id} Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"` - CreatorId int32 `protobuf:"varint,5,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` - DisplayTime *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=display_time,json=displayTime,proto3" json:"display_time,omitempty"` - Content string `protobuf:"bytes,9,opt,name=content,proto3" json:"content,omitempty"` - Visibility Visibility `protobuf:"varint,10,opt,name=visibility,proto3,enum=memos.api.v2.Visibility" json:"visibility,omitempty"` - Pinned bool `protobuf:"varint,11,opt,name=pinned,proto3" json:"pinned,omitempty"` - ParentId *int32 `protobuf:"varint,12,opt,name=parent_id,json=parentId,proto3,oneof" json:"parent_id,omitempty"` - Resources []*Resource `protobuf:"bytes,13,rep,name=resources,proto3" json:"resources,omitempty"` - Relations []*MemoRelation `protobuf:"bytes,14,rep,name=relations,proto3" json:"relations,omitempty"` - Reactions []*Reaction `protobuf:"bytes,15,rep,name=reactions,proto3" json:"reactions,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + DisplayTime *timestamppb.Timestamp `protobuf:"bytes,78,opt,name=display_time,json=displayTime,proto3" json:"display_time,omitempty"` + Content string `protobuf:"bytes,8,opt,name=content,proto3" json:"content,omitempty"` + Visibility Visibility `protobuf:"varint,9,opt,name=visibility,proto3,enum=memos.api.v2.Visibility" json:"visibility,omitempty"` + Pinned bool `protobuf:"varint,10,opt,name=pinned,proto3" json:"pinned,omitempty"` + ParentId *int32 `protobuf:"varint,11,opt,name=parent_id,json=parentId,proto3,oneof" json:"parent_id,omitempty"` + Resources []*Resource `protobuf:"bytes,12,rep,name=resources,proto3" json:"resources,omitempty"` + Relations []*MemoRelation `protobuf:"bytes,13,rep,name=relations,proto3" json:"relations,omitempty"` + Reactions []*Reaction `protobuf:"bytes,14,rep,name=reactions,proto3" json:"reactions,omitempty"` } func (x *Memo) Reset() { @@ -133,16 +134,16 @@ func (*Memo) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{0} } -func (x *Memo) GetId() int32 { +func (x *Memo) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *Memo) GetName() string { +func (x *Memo) GetUid() string { if x != nil { - return x.Name + return x.Uid } return "" } @@ -161,13 +162,6 @@ func (x *Memo) GetCreator() string { return "" } -func (x *Memo) GetCreatorId() int32 { - if x != nil { - return x.CreatorId - } - return 0 -} - func (x *Memo) GetCreateTime() *timestamppb.Timestamp { if x != nil { return x.CreateTime @@ -351,7 +345,7 @@ type ListMemosRequest struct { // Provide this to retrieve the subsequent page. PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"` // Filter is used to filter memos returned in the list. - // Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" Filter string `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"` } @@ -465,16 +459,18 @@ func (x *ListMemosResponse) GetNextPageToken() string { return "" } -type GetMemoRequest struct { +type SearchMemosRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // Filter is used to filter memos returned. + // Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } -func (x *GetMemoRequest) Reset() { - *x = GetMemoRequest{} +func (x *SearchMemosRequest) Reset() { + *x = SearchMemosRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -482,13 +478,13 @@ func (x *GetMemoRequest) Reset() { } } -func (x *GetMemoRequest) String() string { +func (x *SearchMemosRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoRequest) ProtoMessage() {} +func (*SearchMemosRequest) ProtoMessage() {} -func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { +func (x *SearchMemosRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -500,28 +496,28 @@ func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoRequest.ProtoReflect.Descriptor instead. -func (*GetMemoRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchMemosRequest.ProtoReflect.Descriptor instead. +func (*SearchMemosRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{5} } -func (x *GetMemoRequest) GetId() int32 { +func (x *SearchMemosRequest) GetFilter() string { if x != nil { - return x.Id + return x.Filter } - return 0 + return "" } -type GetMemoResponse struct { +type SearchMemosResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Memo *Memo `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` + Memos []*Memo `protobuf:"bytes,1,rep,name=memos,proto3" json:"memos,omitempty"` } -func (x *GetMemoResponse) Reset() { - *x = GetMemoResponse{} +func (x *SearchMemosResponse) Reset() { + *x = SearchMemosResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -529,13 +525,13 @@ func (x *GetMemoResponse) Reset() { } } -func (x *GetMemoResponse) String() string { +func (x *SearchMemosResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoResponse) ProtoMessage() {} +func (*SearchMemosResponse) ProtoMessage() {} -func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { +func (x *SearchMemosResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -547,28 +543,30 @@ func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoResponse.ProtoReflect.Descriptor instead. -func (*GetMemoResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchMemosResponse.ProtoReflect.Descriptor instead. +func (*SearchMemosResponse) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{6} } -func (x *GetMemoResponse) GetMemo() *Memo { +func (x *SearchMemosResponse) GetMemos() []*Memo { if x != nil { - return x.Memo + return x.Memos } return nil } -type GetMemoByNameRequest struct { +type GetMemoRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of the memo. + // Format: memos/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (x *GetMemoByNameRequest) Reset() { - *x = GetMemoByNameRequest{} +func (x *GetMemoRequest) Reset() { + *x = GetMemoRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -576,13 +574,13 @@ func (x *GetMemoByNameRequest) Reset() { } } -func (x *GetMemoByNameRequest) String() string { +func (x *GetMemoRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoByNameRequest) ProtoMessage() {} +func (*GetMemoRequest) ProtoMessage() {} -func (x *GetMemoByNameRequest) ProtoReflect() protoreflect.Message { +func (x *GetMemoRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -594,19 +592,19 @@ func (x *GetMemoByNameRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoByNameRequest.ProtoReflect.Descriptor instead. -func (*GetMemoByNameRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMemoRequest.ProtoReflect.Descriptor instead. +func (*GetMemoRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{7} } -func (x *GetMemoByNameRequest) GetName() string { +func (x *GetMemoRequest) GetName() string { if x != nil { return x.Name } return "" } -type GetMemoByNameResponse struct { +type GetMemoResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -614,8 +612,8 @@ type GetMemoByNameResponse struct { Memo *Memo `protobuf:"bytes,1,opt,name=memo,proto3" json:"memo,omitempty"` } -func (x *GetMemoByNameResponse) Reset() { - *x = GetMemoByNameResponse{} +func (x *GetMemoResponse) Reset() { + *x = GetMemoResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_memo_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -623,13 +621,13 @@ func (x *GetMemoByNameResponse) Reset() { } } -func (x *GetMemoByNameResponse) String() string { +func (x *GetMemoResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMemoByNameResponse) ProtoMessage() {} +func (*GetMemoResponse) ProtoMessage() {} -func (x *GetMemoByNameResponse) ProtoReflect() protoreflect.Message { +func (x *GetMemoResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_memo_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -641,12 +639,12 @@ func (x *GetMemoByNameResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMemoByNameResponse.ProtoReflect.Descriptor instead. -func (*GetMemoByNameResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetMemoResponse.ProtoReflect.Descriptor instead. +func (*GetMemoResponse) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{8} } -func (x *GetMemoByNameResponse) GetMemo() *Memo { +func (x *GetMemoResponse) GetMemo() *Memo { if x != nil { return x.Memo } @@ -760,7 +758,9 @@ type DeleteMemoRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *DeleteMemoRequest) Reset() { @@ -795,11 +795,11 @@ func (*DeleteMemoRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{11} } -func (x *DeleteMemoRequest) GetId() int32 { +func (x *DeleteMemoRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type DeleteMemoResponse struct { @@ -940,7 +940,9 @@ type SetMemoResourcesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Resources []*Resource `protobuf:"bytes,2,rep,name=resources,proto3" json:"resources,omitempty"` } @@ -976,11 +978,11 @@ func (*SetMemoResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{15} } -func (x *SetMemoResourcesRequest) GetId() int32 { +func (x *SetMemoResourcesRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *SetMemoResourcesRequest) GetResources() []*Resource { @@ -1033,7 +1035,9 @@ type ListMemoResourcesRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoResourcesRequest) Reset() { @@ -1068,11 +1072,11 @@ func (*ListMemoResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{17} } -func (x *ListMemoResourcesRequest) GetId() int32 { +func (x *ListMemoResourcesRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoResourcesResponse struct { @@ -1127,7 +1131,9 @@ type SetMemoRelationsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Relations []*MemoRelation `protobuf:"bytes,2,rep,name=relations,proto3" json:"relations,omitempty"` } @@ -1163,11 +1169,11 @@ func (*SetMemoRelationsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{19} } -func (x *SetMemoRelationsRequest) GetId() int32 { +func (x *SetMemoRelationsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *SetMemoRelationsRequest) GetRelations() []*MemoRelation { @@ -1220,7 +1226,9 @@ type ListMemoRelationsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoRelationsRequest) Reset() { @@ -1255,11 +1263,11 @@ func (*ListMemoRelationsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{21} } -func (x *ListMemoRelationsRequest) GetId() int32 { +func (x *ListMemoRelationsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoRelationsResponse struct { @@ -1314,9 +1322,10 @@ type CreateMemoCommentRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // id is the memo id to create comment for. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Create *CreateMemoRequest `protobuf:"bytes,2,opt,name=create,proto3" json:"create,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Comment *CreateMemoRequest `protobuf:"bytes,2,opt,name=comment,proto3" json:"comment,omitempty"` } func (x *CreateMemoCommentRequest) Reset() { @@ -1351,16 +1360,16 @@ func (*CreateMemoCommentRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{23} } -func (x *CreateMemoCommentRequest) GetId() int32 { +func (x *CreateMemoCommentRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *CreateMemoCommentRequest) GetCreate() *CreateMemoRequest { +func (x *CreateMemoCommentRequest) GetComment() *CreateMemoRequest { if x != nil { - return x.Create + return x.Comment } return nil } @@ -1417,7 +1426,9 @@ type ListMemoCommentsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoCommentsRequest) Reset() { @@ -1452,11 +1463,11 @@ func (*ListMemoCommentsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{25} } -func (x *ListMemoCommentsRequest) GetId() int32 { +func (x *ListMemoCommentsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoCommentsResponse struct { @@ -1512,7 +1523,7 @@ type GetUserMemosStatsRequest struct { unknownFields protoimpl.UnknownFields // name is the name of the user to get stats for. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // timezone location // Format: uses tz identifier @@ -1629,7 +1640,9 @@ type ListMemoReactionsRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListMemoReactionsRequest) Reset() { @@ -1664,11 +1677,11 @@ func (*ListMemoReactionsRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{29} } -func (x *ListMemoReactionsRequest) GetId() int32 { +func (x *ListMemoReactionsRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type ListMemoReactionsResponse struct { @@ -1723,7 +1736,9 @@ type UpsertMemoReactionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the memo. + // Format: memos/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Reaction *Reaction `protobuf:"bytes,2,opt,name=reaction,proto3" json:"reaction,omitempty"` } @@ -1759,11 +1774,11 @@ func (*UpsertMemoReactionRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{31} } -func (x *UpsertMemoReactionRequest) GetId() int32 { +func (x *UpsertMemoReactionRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } func (x *UpsertMemoReactionRequest) GetReaction() *Reaction { @@ -1825,8 +1840,7 @@ type DeleteMemoReactionRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ReactionId int32 `protobuf:"varint,2,opt,name=reaction_id,json=reactionId,proto3" json:"reaction_id,omitempty"` + ReactionId int32 `protobuf:"varint,1,opt,name=reaction_id,json=reactionId,proto3" json:"reaction_id,omitempty"` } func (x *DeleteMemoReactionRequest) Reset() { @@ -1861,13 +1875,6 @@ func (*DeleteMemoReactionRequest) Descriptor() ([]byte, []int) { return file_api_v2_memo_service_proto_rawDescGZIP(), []int{33} } -func (x *DeleteMemoReactionRequest) GetId() int32 { - if x != nil { - return x.Id - } - return 0 -} - func (x *DeleteMemoReactionRequest) GetReactionId() int32 { if x != nil { return x.ReactionId @@ -1935,310 +1942,312 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{ 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaa, 0x05, 0x0a, 0x04, - 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, - 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x05, 0x0a, 0x04, + 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, + 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, + 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x3b, 0x0a, 0x0b, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x74, - 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x54, 0x69, - 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, - 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x12, 0x25, - 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, - 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0e, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, - 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x0f, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, - 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x70, - 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, - 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, - 0x79, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, - 0x66, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, - 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x20, - 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x2a, 0x0a, 0x14, 0x47, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3f, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, - 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, - 0x73, 0x6b, 0x22, 0x3c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, - 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x45, - 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x13, 0x45, 0x78, 0x70, - 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x4e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, + 0x79, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, + 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, + 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, + 0x6e, 0x65, 0x64, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, + 0x64, 0x12, 0x25, 0x0a, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x0b, + 0x20, 0x01, 0x28, 0x05, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x48, 0x00, 0x52, 0x08, 0x70, 0x61, 0x72, + 0x65, 0x6e, 0x74, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x12, 0x3d, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x39, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0xe0, + 0x41, 0x03, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x0c, 0x0a, + 0x0a, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x22, 0x67, 0x0a, 0x11, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x5f, 0x0a, 0x17, 0x53, 0x65, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x56, 0x69, + 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, + 0x6c, 0x69, 0x74, 0x79, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, + 0x6d, 0x6f, 0x22, 0x66, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, + 0x69, 0x7a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, + 0x69, 0x7a, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x65, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x2c, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, + 0x3f, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, + 0x6f, 0x22, 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x3b, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x3c, 0x0a, 0x12, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x27, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x45, 0x78, 0x70, 0x6f, + 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, + 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x2f, 0x0a, 0x13, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, + 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x63, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, + 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x63, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, + 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x67, 0x0a, 0x17, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x1a, 0x0a, 0x18, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x38, 0x0a, 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x18, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x37, 0x0a, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x22, - 0x43, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, - 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x04, - 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x29, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x44, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, 0x62, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x9f, 0x01, 0x0a, 0x19, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, - 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, - 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, - 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, - 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x2a, 0x0a, 0x18, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x5f, 0x0a, 0x19, 0x55, 0x70, + 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x22, 0x55, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, + 0x09, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, + 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x69, 0x0a, 0x18, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x22, 0x43, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x26, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x22, 0x2d, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x44, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, + 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x05, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x22, 0x62, 0x0a, 0x18, + 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, + 0x22, 0x9f, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, + 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x48, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x73, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x74, 0x61, 0x74, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x22, 0x2e, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x51, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x34, 0x0a, 0x09, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x63, 0x0a, 0x19, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x1a, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x1a, 0x55, - 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x4c, 0x0a, - 0x19, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x50, 0x0a, 0x0a, 0x56, 0x69, 0x73, - 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, - 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, - 0x12, 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, - 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0x87, 0x12, 0x0a, 0x0b, - 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x0a, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x08, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3c, 0x0a, 0x19, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x1c, 0x0a, 0x1a, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x50, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, + 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, + 0x0d, 0x0a, 0x09, 0x50, 0x52, 0x4f, 0x54, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x02, 0x12, 0x0a, + 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0xa6, 0x12, 0x0a, 0x0b, 0x4d, + 0x65, 0x6d, 0x6f, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x69, 0x0a, 0x0a, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, + 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x70, 0x0a, 0x0b, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x6d, 0x0a, 0x07, + 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8d, 0x01, 0x0a, 0x0a, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0xda, + 0x41, 0x10, 0x6d, 0x65, 0x6d, 0x6f, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, + 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x32, 0x1b, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6d, 0x65, 0x6d, 0x6f, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x76, 0x0a, 0x0a, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x12, 0x3a, 0x01, 0x2a, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x12, 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x67, 0x0a, 0x07, 0x47, - 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, - 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x42, 0x79, 0x4e, - 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x28, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6e, 0x61, - 0x6d, 0x65, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x89, 0x01, 0x0a, 0x0a, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0xda, 0x41, 0x10, - 0x6d, 0x65, 0x6d, 0x6f, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x32, 0x17, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x6d, 0x65, 0x6d, - 0x6f, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, - 0x65, 0x6d, 0x6f, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x70, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6f, 0x72, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x16, 0x22, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x3a, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x8f, 0x01, 0x0a, 0x10, 0x53, 0x65, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0xda, - 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, 0x2a, 0x22, 0x1c, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x8f, 0x01, 0x0a, 0x11, - 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, - 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x12, - 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x8f, 0x01, - 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x2c, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x3a, 0x01, - 0x2a, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, - 0x8f, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, - 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x8b, 0x01, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, - 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, + 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x65, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x95, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x95, 0x01, + 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x95, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x53, 0x65, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0xda, 0x41, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x95, 0x01, + 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x6c, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x26, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0xda, 0x41, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x22, 0x1f, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x91, 0x01, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x12, 0x25, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x2e, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x21, 0x12, + 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x6d, @@ -2248,47 +2257,47 @@ var file_api_v2_memo_service_proto_rawDesc = []byte{ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x12, - 0x8f, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, + 0x95, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1e, 0x12, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x92, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, - 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x02, - 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x22, 0x1c, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0xac, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, - 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x43, 0xda, 0x41, 0x0e, 0x69, 0x64, 0x2c, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x5f, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2c, 0x2a, 0x2a, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x32, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x72, 0x65, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4d, 0x65, 0x6d, 0x6f, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, - 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, - 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, - 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, - 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, - 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x12, 0x55, 0x70, 0x73, 0x65, + 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, + 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x2f, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, + 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x9e, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, + 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, + 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4d, 0x65, 0x6d, 0x6f, 0x52, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0xda, 0x41, + 0x0b, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x21, 0x2a, 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x7b, 0x72, 0x65, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, 0x4d, 0x65, 0x6d, 0x6f, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, + 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, + 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, + 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2312,10 +2321,10 @@ var file_api_v2_memo_service_proto_goTypes = []interface{}{ (*CreateMemoResponse)(nil), // 3: memos.api.v2.CreateMemoResponse (*ListMemosRequest)(nil), // 4: memos.api.v2.ListMemosRequest (*ListMemosResponse)(nil), // 5: memos.api.v2.ListMemosResponse - (*GetMemoRequest)(nil), // 6: memos.api.v2.GetMemoRequest - (*GetMemoResponse)(nil), // 7: memos.api.v2.GetMemoResponse - (*GetMemoByNameRequest)(nil), // 8: memos.api.v2.GetMemoByNameRequest - (*GetMemoByNameResponse)(nil), // 9: memos.api.v2.GetMemoByNameResponse + (*SearchMemosRequest)(nil), // 6: memos.api.v2.SearchMemosRequest + (*SearchMemosResponse)(nil), // 7: memos.api.v2.SearchMemosResponse + (*GetMemoRequest)(nil), // 8: memos.api.v2.GetMemoRequest + (*GetMemoResponse)(nil), // 9: memos.api.v2.GetMemoResponse (*UpdateMemoRequest)(nil), // 10: memos.api.v2.UpdateMemoRequest (*UpdateMemoResponse)(nil), // 11: memos.api.v2.UpdateMemoResponse (*DeleteMemoRequest)(nil), // 12: memos.api.v2.DeleteMemoRequest @@ -2362,8 +2371,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 0, // 8: memos.api.v2.CreateMemoRequest.visibility:type_name -> memos.api.v2.Visibility 1, // 9: memos.api.v2.CreateMemoResponse.memo:type_name -> memos.api.v2.Memo 1, // 10: memos.api.v2.ListMemosResponse.memos:type_name -> memos.api.v2.Memo - 1, // 11: memos.api.v2.GetMemoResponse.memo:type_name -> memos.api.v2.Memo - 1, // 12: memos.api.v2.GetMemoByNameResponse.memo:type_name -> memos.api.v2.Memo + 1, // 11: memos.api.v2.SearchMemosResponse.memos:type_name -> memos.api.v2.Memo + 1, // 12: memos.api.v2.GetMemoResponse.memo:type_name -> memos.api.v2.Memo 1, // 13: memos.api.v2.UpdateMemoRequest.memo:type_name -> memos.api.v2.Memo 42, // 14: memos.api.v2.UpdateMemoRequest.update_mask:type_name -> google.protobuf.FieldMask 1, // 15: memos.api.v2.UpdateMemoResponse.memo:type_name -> memos.api.v2.Memo @@ -2371,7 +2380,7 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 39, // 17: memos.api.v2.ListMemoResourcesResponse.resources:type_name -> memos.api.v2.Resource 40, // 18: memos.api.v2.SetMemoRelationsRequest.relations:type_name -> memos.api.v2.MemoRelation 40, // 19: memos.api.v2.ListMemoRelationsResponse.relations:type_name -> memos.api.v2.MemoRelation - 2, // 20: memos.api.v2.CreateMemoCommentRequest.create:type_name -> memos.api.v2.CreateMemoRequest + 2, // 20: memos.api.v2.CreateMemoCommentRequest.comment:type_name -> memos.api.v2.CreateMemoRequest 1, // 21: memos.api.v2.CreateMemoCommentResponse.memo:type_name -> memos.api.v2.Memo 1, // 22: memos.api.v2.ListMemoCommentsResponse.memos:type_name -> memos.api.v2.Memo 36, // 23: memos.api.v2.GetUserMemosStatsResponse.stats:type_name -> memos.api.v2.GetUserMemosStatsResponse.StatsEntry @@ -2380,8 +2389,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 41, // 26: memos.api.v2.UpsertMemoReactionResponse.reaction:type_name -> memos.api.v2.Reaction 2, // 27: memos.api.v2.MemoService.CreateMemo:input_type -> memos.api.v2.CreateMemoRequest 4, // 28: memos.api.v2.MemoService.ListMemos:input_type -> memos.api.v2.ListMemosRequest - 6, // 29: memos.api.v2.MemoService.GetMemo:input_type -> memos.api.v2.GetMemoRequest - 8, // 30: memos.api.v2.MemoService.GetMemoByName:input_type -> memos.api.v2.GetMemoByNameRequest + 6, // 29: memos.api.v2.MemoService.SearchMemos:input_type -> memos.api.v2.SearchMemosRequest + 8, // 30: memos.api.v2.MemoService.GetMemo:input_type -> memos.api.v2.GetMemoRequest 10, // 31: memos.api.v2.MemoService.UpdateMemo:input_type -> memos.api.v2.UpdateMemoRequest 12, // 32: memos.api.v2.MemoService.DeleteMemo:input_type -> memos.api.v2.DeleteMemoRequest 14, // 33: memos.api.v2.MemoService.ExportMemos:input_type -> memos.api.v2.ExportMemosRequest @@ -2397,8 +2406,8 @@ var file_api_v2_memo_service_proto_depIdxs = []int32{ 34, // 43: memos.api.v2.MemoService.DeleteMemoReaction:input_type -> memos.api.v2.DeleteMemoReactionRequest 3, // 44: memos.api.v2.MemoService.CreateMemo:output_type -> memos.api.v2.CreateMemoResponse 5, // 45: memos.api.v2.MemoService.ListMemos:output_type -> memos.api.v2.ListMemosResponse - 7, // 46: memos.api.v2.MemoService.GetMemo:output_type -> memos.api.v2.GetMemoResponse - 9, // 47: memos.api.v2.MemoService.GetMemoByName:output_type -> memos.api.v2.GetMemoByNameResponse + 7, // 46: memos.api.v2.MemoService.SearchMemos:output_type -> memos.api.v2.SearchMemosResponse + 9, // 47: memos.api.v2.MemoService.GetMemo:output_type -> memos.api.v2.GetMemoResponse 11, // 48: memos.api.v2.MemoService.UpdateMemo:output_type -> memos.api.v2.UpdateMemoResponse 13, // 49: memos.api.v2.MemoService.DeleteMemo:output_type -> memos.api.v2.DeleteMemoResponse 15, // 50: memos.api.v2.MemoService.ExportMemos:output_type -> memos.api.v2.ExportMemosResponse @@ -2490,7 +2499,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoRequest); i { + switch v := v.(*SearchMemosRequest); i { case 0: return &v.state case 1: @@ -2502,7 +2511,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoResponse); i { + switch v := v.(*SearchMemosResponse); i { case 0: return &v.state case 1: @@ -2514,7 +2523,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoByNameRequest); i { + switch v := v.(*GetMemoRequest); i { case 0: return &v.state case 1: @@ -2526,7 +2535,7 @@ func file_api_v2_memo_service_proto_init() { } } file_api_v2_memo_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetMemoByNameResponse); i { + switch v := v.(*GetMemoResponse); i { case 0: return &v.state case 1: diff --git a/proto/gen/api/v2/memo_service.pb.gw.go b/proto/gen/api/v2/memo_service.pb.gw.go index c6e498f72013a..e7c43ae7e93f3 100644 --- a/proto/gen/api/v2/memo_service.pb.gw.go +++ b/proto/gen/api/v2/memo_service.pb.gw.go @@ -101,60 +101,44 @@ func local_request_MemoService_ListMemos_0(ctx context.Context, marshaler runtim } -func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoRequest - var metadata runtime.ServerMetadata +var ( + filter_MemoService_SearchMemos_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) - var ( - val string - ok bool - err error - _ = err - ) +func request_MemoService_SearchMemos_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchMemosRequest + var metadata runtime.ServerMetadata - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_SearchMemos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.SearchMemos(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoRequest +func local_request_MemoService_SearchMemos_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchMemosRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_MemoService_SearchMemos_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetMemo(ctx, &protoReq) + msg, err := server.SearchMemos(ctx, &protoReq) return msg, metadata, err } -func request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoByNameRequest +func request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMemoRequest var metadata runtime.ServerMetadata var ( @@ -174,13 +158,13 @@ func request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime. return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetMemoByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_MemoService_GetMemoByName_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetMemoByNameRequest +func local_request_MemoService_GetMemo_0(ctx context.Context, marshaler runtime.Marshaler, server MemoServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetMemoRequest var metadata runtime.ServerMetadata var ( @@ -200,13 +184,13 @@ func local_request_MemoService_GetMemoByName_0(ctx context.Context, marshaler ru return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetMemoByName(ctx, &protoReq) + msg, err := server.GetMemo(ctx, &protoReq) return msg, metadata, err } var ( - filter_MemoService_UpdateMemo_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_MemoService_UpdateMemo_0 = &utilities.DoubleArray{Encoding: map[string]int{"memo": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} ) func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -235,14 +219,14 @@ func request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runtime.Mar _ = err ) - val, ok = pathParams["memo.id"] + val, ok = pathParams["memo.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "memo.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "memo.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.name", err) } if err := req.ParseForm(); err != nil { @@ -283,14 +267,14 @@ func local_request_MemoService_UpdateMemo_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["memo.id"] + val, ok = pathParams["memo.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "memo.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "memo.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "memo.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "memo.name", err) } if err := req.ParseForm(); err != nil { @@ -316,14 +300,14 @@ func request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runtime.Mar _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.DeleteMemo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -342,14 +326,14 @@ func local_request_MemoService_DeleteMemo_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.DeleteMemo(ctx, &protoReq) @@ -412,14 +396,14 @@ func request_MemoService_SetMemoResources_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.SetMemoResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -446,14 +430,14 @@ func local_request_MemoService_SetMemoResources_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.SetMemoResources(ctx, &protoReq) @@ -472,14 +456,14 @@ func request_MemoService_ListMemoResources_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -498,14 +482,14 @@ func local_request_MemoService_ListMemoResources_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoResources(ctx, &protoReq) @@ -532,14 +516,14 @@ func request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.SetMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -566,14 +550,14 @@ func local_request_MemoService_SetMemoRelations_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.SetMemoRelations(ctx, &protoReq) @@ -592,14 +576,14 @@ func request_MemoService_ListMemoRelations_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoRelations(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -618,14 +602,14 @@ func local_request_MemoService_ListMemoRelations_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoRelations(ctx, &protoReq) @@ -634,7 +618,7 @@ func local_request_MemoService_ListMemoRelations_0(ctx context.Context, marshale } var ( - filter_MemoService_CreateMemoComment_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_MemoService_CreateMemoComment_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -648,14 +632,14 @@ func request_MemoService_CreateMemoComment_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -681,14 +665,14 @@ func local_request_MemoService_CreateMemoComment_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -714,14 +698,14 @@ func request_MemoService_ListMemoComments_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoComments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -740,14 +724,14 @@ func local_request_MemoService_ListMemoComments_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoComments(ctx, &protoReq) @@ -802,14 +786,14 @@ func request_MemoService_ListMemoReactions_0(ctx context.Context, marshaler runt _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListMemoReactions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -828,14 +812,14 @@ func local_request_MemoService_ListMemoReactions_0(ctx context.Context, marshale _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListMemoReactions(ctx, &protoReq) @@ -844,7 +828,7 @@ func local_request_MemoService_ListMemoReactions_0(ctx context.Context, marshale } var ( - filter_MemoService_UpsertMemoReaction_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} + filter_MemoService_UpsertMemoReaction_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}} ) func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler runtime.Marshaler, client MemoServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -858,14 +842,14 @@ func request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -891,14 +875,14 @@ func local_request_MemoService_UpsertMemoReaction_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } if err := req.ParseForm(); err != nil { @@ -924,16 +908,6 @@ func request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - val, ok = pathParams["reaction_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reaction_id") @@ -960,16 +934,6 @@ func local_request_MemoService_DeleteMemoReaction_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") - } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) - } - val, ok = pathParams["reaction_id"] if !ok { return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reaction_id") @@ -1041,7 +1005,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_SearchMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1049,12 +1013,12 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SearchMemos", runtime.WithHTTPPathPattern("/api/v2/memos:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_MemoService_SearchMemos_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -1062,11 +1026,11 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_SearchMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_MemoService_GetMemoByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -1074,12 +1038,12 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemoByName", runtime.WithHTTPPathPattern("/api/v2/memos/name/{name}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_MemoService_GetMemoByName_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -1087,7 +1051,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux return } - forward_MemoService_GetMemoByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1099,7 +1063,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/{memo.name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1124,7 +1088,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1174,7 +1138,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1199,7 +1163,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1224,7 +1188,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1249,7 +1213,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1274,7 +1238,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1299,7 +1263,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1349,7 +1313,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1374,7 +1338,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1399,7 +1363,7 @@ func RegisterMemoServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions/{reaction_id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/reactions/{reaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1501,47 +1465,47 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) - mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_SearchMemos_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SearchMemos", runtime.WithHTTPPathPattern("/api/v2/memos:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_MemoService_SearchMemos_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_SearchMemos_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_MemoService_GetMemoByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_MemoService_GetMemo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemoByName", runtime.WithHTTPPathPattern("/api/v2/memos/name/{name}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/GetMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_MemoService_GetMemoByName_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_MemoService_GetMemo_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_MemoService_GetMemoByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_MemoService_GetMemo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1551,7 +1515,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{memo.id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpdateMemo", runtime.WithHTTPPathPattern("/api/v2/{memo.name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1573,7 +1537,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/memos/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemo", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1617,7 +1581,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1639,7 +1603,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/resources")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoResources", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/resources")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1661,7 +1625,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/SetMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1683,7 +1647,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/relations")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoRelations", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/relations")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1705,7 +1669,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/CreateMemoComment", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1727,7 +1691,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/comments")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoComments", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/comments")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1771,7 +1735,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/ListMemoReactions", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1793,7 +1757,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/UpsertMemoReaction", runtime.WithHTTPPathPattern("/api/v2/{name=memos/*}/reactions")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1815,7 +1779,7 @@ func RegisterMemoServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/memos/{id}/reactions/{reaction_id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.MemoService/DeleteMemoReaction", runtime.WithHTTPPathPattern("/api/v2/reactions/{reaction_id}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1839,35 +1803,35 @@ var ( pattern_MemoService_ListMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "")) - pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, "")) + pattern_MemoService_SearchMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "search")) - pattern_MemoService_GetMemoByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) + pattern_MemoService_GetMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) - pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "memo.id"}, "")) + pattern_MemoService_UpdateMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "memo.name"}, "")) - pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "memos", "id"}, "")) + pattern_MemoService_DeleteMemo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "memos", "name"}, "")) pattern_MemoService_ExportMemos_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "memos"}, "export")) - pattern_MemoService_SetMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "resources"}, "")) + pattern_MemoService_SetMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "resources"}, "")) - pattern_MemoService_ListMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "resources"}, "")) + pattern_MemoService_ListMemoResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "resources"}, "")) - pattern_MemoService_SetMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "relations"}, "")) + pattern_MemoService_SetMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "relations"}, "")) - pattern_MemoService_ListMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "relations"}, "")) + pattern_MemoService_ListMemoRelations_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "relations"}, "")) - pattern_MemoService_CreateMemoComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "comments"}, "")) + pattern_MemoService_CreateMemoComment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "comments"}, "")) - pattern_MemoService_ListMemoComments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "comments"}, "")) + pattern_MemoService_ListMemoComments_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "comments"}, "")) pattern_MemoService_GetUserMemosStats_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"api", "v2", "memos", "stats"}, "")) - pattern_MemoService_ListMemoReactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "reactions"}, "")) + pattern_MemoService_ListMemoReactions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "reactions"}, "")) - pattern_MemoService_UpsertMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "memos", "id", "reactions"}, "")) + pattern_MemoService_UpsertMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "memos", "name", "reactions"}, "")) - pattern_MemoService_DeleteMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v2", "memos", "id", "reactions", "reaction_id"}, "")) + pattern_MemoService_DeleteMemoReaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "reactions", "reaction_id"}, "")) ) var ( @@ -1875,9 +1839,9 @@ var ( forward_MemoService_ListMemos_0 = runtime.ForwardResponseMessage - forward_MemoService_GetMemo_0 = runtime.ForwardResponseMessage + forward_MemoService_SearchMemos_0 = runtime.ForwardResponseMessage - forward_MemoService_GetMemoByName_0 = runtime.ForwardResponseMessage + forward_MemoService_GetMemo_0 = runtime.ForwardResponseMessage forward_MemoService_UpdateMemo_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/memo_service_grpc.pb.go b/proto/gen/api/v2/memo_service_grpc.pb.go index 1ea896a1a95b0..4b3412ebc1eab 100644 --- a/proto/gen/api/v2/memo_service_grpc.pb.go +++ b/proto/gen/api/v2/memo_service_grpc.pb.go @@ -21,8 +21,8 @@ const _ = grpc.SupportPackageIsVersion7 const ( MemoService_CreateMemo_FullMethodName = "/memos.api.v2.MemoService/CreateMemo" MemoService_ListMemos_FullMethodName = "/memos.api.v2.MemoService/ListMemos" + MemoService_SearchMemos_FullMethodName = "/memos.api.v2.MemoService/SearchMemos" MemoService_GetMemo_FullMethodName = "/memos.api.v2.MemoService/GetMemo" - MemoService_GetMemoByName_FullMethodName = "/memos.api.v2.MemoService/GetMemoByName" MemoService_UpdateMemo_FullMethodName = "/memos.api.v2.MemoService/UpdateMemo" MemoService_DeleteMemo_FullMethodName = "/memos.api.v2.MemoService/DeleteMemo" MemoService_ExportMemos_FullMethodName = "/memos.api.v2.MemoService/ExportMemos" @@ -46,13 +46,13 @@ type MemoServiceClient interface { CreateMemo(ctx context.Context, in *CreateMemoRequest, opts ...grpc.CallOption) (*CreateMemoResponse, error) // ListMemos lists memos with pagination and filter. ListMemos(ctx context.Context, in *ListMemosRequest, opts ...grpc.CallOption) (*ListMemosResponse, error) - // GetMemo gets a memo by id. + // SearchMemos searches memos. + SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) + // GetMemo gets a memo. GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) - // GetMemoByName gets a memo by name. - GetMemoByName(ctx context.Context, in *GetMemoByNameRequest, opts ...grpc.CallOption) (*GetMemoByNameResponse, error) // UpdateMemo updates a memo. UpdateMemo(ctx context.Context, in *UpdateMemoRequest, opts ...grpc.CallOption) (*UpdateMemoResponse, error) - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. DeleteMemo(ctx context.Context, in *DeleteMemoRequest, opts ...grpc.CallOption) (*DeleteMemoResponse, error) // ExportMemos exports memos. ExportMemos(ctx context.Context, in *ExportMemosRequest, opts ...grpc.CallOption) (*ExportMemosResponse, error) @@ -104,18 +104,18 @@ func (c *memoServiceClient) ListMemos(ctx context.Context, in *ListMemosRequest, return out, nil } -func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) { - out := new(GetMemoResponse) - err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...) +func (c *memoServiceClient) SearchMemos(ctx context.Context, in *SearchMemosRequest, opts ...grpc.CallOption) (*SearchMemosResponse, error) { + out := new(SearchMemosResponse) + err := c.cc.Invoke(ctx, MemoService_SearchMemos_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *memoServiceClient) GetMemoByName(ctx context.Context, in *GetMemoByNameRequest, opts ...grpc.CallOption) (*GetMemoByNameResponse, error) { - out := new(GetMemoByNameResponse) - err := c.cc.Invoke(ctx, MemoService_GetMemoByName_FullMethodName, in, out, opts...) +func (c *memoServiceClient) GetMemo(ctx context.Context, in *GetMemoRequest, opts ...grpc.CallOption) (*GetMemoResponse, error) { + out := new(GetMemoResponse) + err := c.cc.Invoke(ctx, MemoService_GetMemo_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -247,13 +247,13 @@ type MemoServiceServer interface { CreateMemo(context.Context, *CreateMemoRequest) (*CreateMemoResponse, error) // ListMemos lists memos with pagination and filter. ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) - // GetMemo gets a memo by id. + // SearchMemos searches memos. + SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) + // GetMemo gets a memo. GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error) - // GetMemoByName gets a memo by name. - GetMemoByName(context.Context, *GetMemoByNameRequest) (*GetMemoByNameResponse, error) // UpdateMemo updates a memo. UpdateMemo(context.Context, *UpdateMemoRequest) (*UpdateMemoResponse, error) - // DeleteMemo deletes a memo by id. + // DeleteMemo deletes a memo. DeleteMemo(context.Context, *DeleteMemoRequest) (*DeleteMemoResponse, error) // ExportMemos exports memos. ExportMemos(context.Context, *ExportMemosRequest) (*ExportMemosResponse, error) @@ -290,12 +290,12 @@ func (UnimplementedMemoServiceServer) CreateMemo(context.Context, *CreateMemoReq func (UnimplementedMemoServiceServer) ListMemos(context.Context, *ListMemosRequest) (*ListMemosResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListMemos not implemented") } +func (UnimplementedMemoServiceServer) SearchMemos(context.Context, *SearchMemosRequest) (*SearchMemosResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchMemos not implemented") +} func (UnimplementedMemoServiceServer) GetMemo(context.Context, *GetMemoRequest) (*GetMemoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetMemo not implemented") } -func (UnimplementedMemoServiceServer) GetMemoByName(context.Context, *GetMemoByNameRequest) (*GetMemoByNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMemoByName not implemented") -} func (UnimplementedMemoServiceServer) UpdateMemo(context.Context, *UpdateMemoRequest) (*UpdateMemoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateMemo not implemented") } @@ -384,38 +384,38 @@ func _MemoService_ListMemos_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } -func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMemoRequest) +func _MemoService_SearchMemos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchMemosRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MemoServiceServer).GetMemo(ctx, in) + return srv.(MemoServiceServer).SearchMemos(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: MemoService_GetMemo_FullMethodName, + FullMethod: MemoService_SearchMemos_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest)) + return srv.(MemoServiceServer).SearchMemos(ctx, req.(*SearchMemosRequest)) } return interceptor(ctx, in, info, handler) } -func _MemoService_GetMemoByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMemoByNameRequest) +func _MemoService_GetMemo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMemoRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MemoServiceServer).GetMemoByName(ctx, in) + return srv.(MemoServiceServer).GetMemo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: MemoService_GetMemoByName_FullMethodName, + FullMethod: MemoService_GetMemo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MemoServiceServer).GetMemoByName(ctx, req.(*GetMemoByNameRequest)) + return srv.(MemoServiceServer).GetMemo(ctx, req.(*GetMemoRequest)) } return interceptor(ctx, in, info, handler) } @@ -670,12 +670,12 @@ var MemoService_ServiceDesc = grpc.ServiceDesc{ Handler: _MemoService_ListMemos_Handler, }, { - MethodName: "GetMemo", - Handler: _MemoService_GetMemo_Handler, + MethodName: "SearchMemos", + Handler: _MemoService_SearchMemos_Handler, }, { - MethodName: "GetMemoByName", - Handler: _MemoService_GetMemoByName_Handler, + MethodName: "GetMemo", + Handler: _MemoService_GetMemo_Handler, }, { MethodName: "UpdateMemo", diff --git a/proto/gen/api/v2/reaction_service.pb.go b/proto/gen/api/v2/reaction_service.pb.go index 62260efd00983..1e3b56bc0cc26 100644 --- a/proto/gen/api/v2/reaction_service.pb.go +++ b/proto/gen/api/v2/reaction_service.pb.go @@ -104,7 +104,9 @@ type Reaction struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // The name of the creator. + // Format: users/{id} Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` ContentId string `protobuf:"bytes,3,opt,name=content_id,json=contentId,proto3" json:"content_id,omitempty"` ReactionType Reaction_Type `protobuf:"varint,4,opt,name=reaction_type,json=reactionType,proto3,enum=memos.api.v2.Reaction_Type" json:"reaction_type,omitempty"` diff --git a/proto/gen/api/v2/resource_service.pb.go b/proto/gen/api/v2/resource_service.pb.go index 24c5e356652ec..c58a03b35948a 100644 --- a/proto/gen/api/v2/resource_service.pb.go +++ b/proto/gen/api/v2/resource_service.pb.go @@ -28,16 +28,19 @@ type Resource struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of the resource. + // Format: resources/{id} // id is the system generated unique identifier. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // name is the user provided name. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The user defined id of the resource. + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid,omitempty"` CreateTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` ExternalLink string `protobuf:"bytes,5,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size,omitempty"` - MemoId *int32 `protobuf:"varint,8,opt,name=memo_id,json=memoId,proto3,oneof" json:"memo_id,omitempty"` + // Format: memos/{id} + Memo *string `protobuf:"bytes,8,opt,name=memo,proto3,oneof" json:"memo,omitempty"` } func (x *Resource) Reset() { @@ -72,16 +75,16 @@ func (*Resource) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{0} } -func (x *Resource) GetId() int32 { +func (x *Resource) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *Resource) GetName() string { +func (x *Resource) GetUid() string { if x != nil { - return x.Name + return x.Uid } return "" } @@ -121,11 +124,11 @@ func (x *Resource) GetSize() int64 { return 0 } -func (x *Resource) GetMemoId() int32 { - if x != nil && x.MemoId != nil { - return *x.MemoId +func (x *Resource) GetMemo() string { + if x != nil && x.Memo != nil { + return *x.Memo } - return 0 + return "" } type CreateResourceRequest struct { @@ -136,7 +139,8 @@ type CreateResourceRequest struct { Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` ExternalLink string `protobuf:"bytes,2,opt,name=external_link,json=externalLink,proto3" json:"external_link,omitempty"` Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` - MemoId *int32 `protobuf:"varint,4,opt,name=memo_id,json=memoId,proto3,oneof" json:"memo_id,omitempty"` + // Format: memos/{id} + Memo *string `protobuf:"bytes,4,opt,name=memo,proto3,oneof" json:"memo,omitempty"` } func (x *CreateResourceRequest) Reset() { @@ -192,11 +196,11 @@ func (x *CreateResourceRequest) GetType() string { return "" } -func (x *CreateResourceRequest) GetMemoId() int32 { - if x != nil && x.MemoId != nil { - return *x.MemoId +func (x *CreateResourceRequest) GetMemo() string { + if x != nil && x.Memo != nil { + return *x.Memo } - return 0 + return "" } type CreateResourceResponse struct { @@ -331,16 +335,16 @@ func (x *ListResourcesResponse) GetResources() []*Resource { return nil } -type GetResourceRequest struct { +type SearchResourcesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` } -func (x *GetResourceRequest) Reset() { - *x = GetResourceRequest{} +func (x *SearchResourcesRequest) Reset() { + *x = SearchResourcesRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -348,13 +352,13 @@ func (x *GetResourceRequest) Reset() { } } -func (x *GetResourceRequest) String() string { +func (x *SearchResourcesRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceRequest) ProtoMessage() {} +func (*SearchResourcesRequest) ProtoMessage() {} -func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { +func (x *SearchResourcesRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -366,28 +370,28 @@ func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceRequest.ProtoReflect.Descriptor instead. -func (*GetResourceRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchResourcesRequest.ProtoReflect.Descriptor instead. +func (*SearchResourcesRequest) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{5} } -func (x *GetResourceRequest) GetId() int32 { +func (x *SearchResourcesRequest) GetFilter() string { if x != nil { - return x.Id + return x.Filter } - return 0 + return "" } -type GetResourceResponse struct { +type SearchResourcesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + Resources []*Resource `protobuf:"bytes,1,rep,name=resources,proto3" json:"resources,omitempty"` } -func (x *GetResourceResponse) Reset() { - *x = GetResourceResponse{} +func (x *SearchResourcesResponse) Reset() { + *x = SearchResourcesResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -395,13 +399,13 @@ func (x *GetResourceResponse) Reset() { } } -func (x *GetResourceResponse) String() string { +func (x *SearchResourcesResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceResponse) ProtoMessage() {} +func (*SearchResourcesResponse) ProtoMessage() {} -func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { +func (x *SearchResourcesResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -413,19 +417,19 @@ func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceResponse.ProtoReflect.Descriptor instead. -func (*GetResourceResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use SearchResourcesResponse.ProtoReflect.Descriptor instead. +func (*SearchResourcesResponse) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{6} } -func (x *GetResourceResponse) GetResource() *Resource { +func (x *SearchResourcesResponse) GetResources() []*Resource { if x != nil { - return x.Resource + return x.Resources } return nil } -type GetResourceByNameRequest struct { +type GetResourceRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -433,8 +437,8 @@ type GetResourceByNameRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (x *GetResourceByNameRequest) Reset() { - *x = GetResourceByNameRequest{} +func (x *GetResourceRequest) Reset() { + *x = GetResourceRequest{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -442,13 +446,13 @@ func (x *GetResourceByNameRequest) Reset() { } } -func (x *GetResourceByNameRequest) String() string { +func (x *GetResourceRequest) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceByNameRequest) ProtoMessage() {} +func (*GetResourceRequest) ProtoMessage() {} -func (x *GetResourceByNameRequest) ProtoReflect() protoreflect.Message { +func (x *GetResourceRequest) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -460,19 +464,19 @@ func (x *GetResourceByNameRequest) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceByNameRequest.ProtoReflect.Descriptor instead. -func (*GetResourceByNameRequest) Descriptor() ([]byte, []int) { +// Deprecated: Use GetResourceRequest.ProtoReflect.Descriptor instead. +func (*GetResourceRequest) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{7} } -func (x *GetResourceByNameRequest) GetName() string { +func (x *GetResourceRequest) GetName() string { if x != nil { return x.Name } return "" } -type GetResourceByNameResponse struct { +type GetResourceResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -480,8 +484,8 @@ type GetResourceByNameResponse struct { Resource *Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` } -func (x *GetResourceByNameResponse) Reset() { - *x = GetResourceByNameResponse{} +func (x *GetResourceResponse) Reset() { + *x = GetResourceResponse{} if protoimpl.UnsafeEnabled { mi := &file_api_v2_resource_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -489,13 +493,13 @@ func (x *GetResourceByNameResponse) Reset() { } } -func (x *GetResourceByNameResponse) String() string { +func (x *GetResourceResponse) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetResourceByNameResponse) ProtoMessage() {} +func (*GetResourceResponse) ProtoMessage() {} -func (x *GetResourceByNameResponse) ProtoReflect() protoreflect.Message { +func (x *GetResourceResponse) ProtoReflect() protoreflect.Message { mi := &file_api_v2_resource_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -507,12 +511,12 @@ func (x *GetResourceByNameResponse) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetResourceByNameResponse.ProtoReflect.Descriptor instead. -func (*GetResourceByNameResponse) Descriptor() ([]byte, []int) { +// Deprecated: Use GetResourceResponse.ProtoReflect.Descriptor instead. +func (*GetResourceResponse) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{8} } -func (x *GetResourceByNameResponse) GetResource() *Resource { +func (x *GetResourceResponse) GetResource() *Resource { if x != nil { return x.Resource } @@ -626,7 +630,7 @@ type DeleteResourceRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *DeleteResourceRequest) Reset() { @@ -661,11 +665,11 @@ func (*DeleteResourceRequest) Descriptor() ([]byte, []int) { return file_api_v2_resource_service_proto_rawDescGZIP(), []int{11} } -func (x *DeleteResourceRequest) GetId() int32 { +func (x *DeleteResourceRequest) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } type DeleteResourceResponse struct { @@ -719,140 +723,139 @@ var file_api_v2_resource_service_proto_rawDesc = []byte{ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfe, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, - 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x1c, - 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x48, - 0x00, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, - 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, 0x64, 0x22, 0x96, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, - 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, - 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x48, 0x00, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x6f, - 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x69, - 0x64, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, - 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x49, 0x0a, 0x13, - 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4f, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, - 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, + 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, + 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, 0x65, + 0x6d, 0x6f, 0x22, 0x8e, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x74, 0x65, + 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0c, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x12, 0x0a, + 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x17, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, + 0x00, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6d, + 0x65, 0x6d, 0x6f, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xb7, 0x06, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, - 0x12, 0x73, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x73, 0x12, 0x22, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x65, 0x22, 0x16, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x15, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x09, 0x72, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x30, 0x0a, 0x16, 0x53, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x22, 0x4f, 0x0a, 0x17, 0x53, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x09, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x22, 0x28, 0x0a, 0x12, 0x47, + 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x3b, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x4c, 0x0a, 0x16, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, + 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x22, 0x2b, 0x0a, 0x15, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x32, 0xb5, 0x06, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x76, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0d, + 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x22, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x13, 0x12, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x77, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0xda, 0x41, 0x02, 0x69, 0x64, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x92, - 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, - 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2c, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1f, 0x12, 0x1d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, - 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x6e, 0x61, 0x6d, 0x65, 0x2f, 0x7b, 0x6e, 0x61, - 0x6d, 0x65, 0x7d, 0x12, 0xa5, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x73, 0x12, 0x80, 0x01, 0x0a, 0x0f, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x3a, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x12, 0x7d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, + 0x72, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, + 0x2f, 0x2a, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x48, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, - 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x1f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x72, - 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x0e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x23, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0xda, 0x41, 0x02, 0x69, 0x64, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, - 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x42, 0xac, - 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x42, 0x14, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, - 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, - 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, - 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, - 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x22, 0x4c, 0xda, 0x41, 0x14, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2c, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, + 0x3a, 0x08, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x32, 0x23, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x6e, 0x61, + 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, + 0x86, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, + 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x2a, 0x1a, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x65, 0x73, 0x6f, + 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x52, + 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -869,41 +872,41 @@ func file_api_v2_resource_service_proto_rawDescGZIP() []byte { var file_api_v2_resource_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_api_v2_resource_service_proto_goTypes = []interface{}{ - (*Resource)(nil), // 0: memos.api.v2.Resource - (*CreateResourceRequest)(nil), // 1: memos.api.v2.CreateResourceRequest - (*CreateResourceResponse)(nil), // 2: memos.api.v2.CreateResourceResponse - (*ListResourcesRequest)(nil), // 3: memos.api.v2.ListResourcesRequest - (*ListResourcesResponse)(nil), // 4: memos.api.v2.ListResourcesResponse - (*GetResourceRequest)(nil), // 5: memos.api.v2.GetResourceRequest - (*GetResourceResponse)(nil), // 6: memos.api.v2.GetResourceResponse - (*GetResourceByNameRequest)(nil), // 7: memos.api.v2.GetResourceByNameRequest - (*GetResourceByNameResponse)(nil), // 8: memos.api.v2.GetResourceByNameResponse - (*UpdateResourceRequest)(nil), // 9: memos.api.v2.UpdateResourceRequest - (*UpdateResourceResponse)(nil), // 10: memos.api.v2.UpdateResourceResponse - (*DeleteResourceRequest)(nil), // 11: memos.api.v2.DeleteResourceRequest - (*DeleteResourceResponse)(nil), // 12: memos.api.v2.DeleteResourceResponse - (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 14: google.protobuf.FieldMask + (*Resource)(nil), // 0: memos.api.v2.Resource + (*CreateResourceRequest)(nil), // 1: memos.api.v2.CreateResourceRequest + (*CreateResourceResponse)(nil), // 2: memos.api.v2.CreateResourceResponse + (*ListResourcesRequest)(nil), // 3: memos.api.v2.ListResourcesRequest + (*ListResourcesResponse)(nil), // 4: memos.api.v2.ListResourcesResponse + (*SearchResourcesRequest)(nil), // 5: memos.api.v2.SearchResourcesRequest + (*SearchResourcesResponse)(nil), // 6: memos.api.v2.SearchResourcesResponse + (*GetResourceRequest)(nil), // 7: memos.api.v2.GetResourceRequest + (*GetResourceResponse)(nil), // 8: memos.api.v2.GetResourceResponse + (*UpdateResourceRequest)(nil), // 9: memos.api.v2.UpdateResourceRequest + (*UpdateResourceResponse)(nil), // 10: memos.api.v2.UpdateResourceResponse + (*DeleteResourceRequest)(nil), // 11: memos.api.v2.DeleteResourceRequest + (*DeleteResourceResponse)(nil), // 12: memos.api.v2.DeleteResourceResponse + (*timestamppb.Timestamp)(nil), // 13: google.protobuf.Timestamp + (*fieldmaskpb.FieldMask)(nil), // 14: google.protobuf.FieldMask } var file_api_v2_resource_service_proto_depIdxs = []int32{ 13, // 0: memos.api.v2.Resource.create_time:type_name -> google.protobuf.Timestamp 0, // 1: memos.api.v2.CreateResourceResponse.resource:type_name -> memos.api.v2.Resource 0, // 2: memos.api.v2.ListResourcesResponse.resources:type_name -> memos.api.v2.Resource - 0, // 3: memos.api.v2.GetResourceResponse.resource:type_name -> memos.api.v2.Resource - 0, // 4: memos.api.v2.GetResourceByNameResponse.resource:type_name -> memos.api.v2.Resource + 0, // 3: memos.api.v2.SearchResourcesResponse.resources:type_name -> memos.api.v2.Resource + 0, // 4: memos.api.v2.GetResourceResponse.resource:type_name -> memos.api.v2.Resource 0, // 5: memos.api.v2.UpdateResourceRequest.resource:type_name -> memos.api.v2.Resource 14, // 6: memos.api.v2.UpdateResourceRequest.update_mask:type_name -> google.protobuf.FieldMask 0, // 7: memos.api.v2.UpdateResourceResponse.resource:type_name -> memos.api.v2.Resource 1, // 8: memos.api.v2.ResourceService.CreateResource:input_type -> memos.api.v2.CreateResourceRequest 3, // 9: memos.api.v2.ResourceService.ListResources:input_type -> memos.api.v2.ListResourcesRequest - 5, // 10: memos.api.v2.ResourceService.GetResource:input_type -> memos.api.v2.GetResourceRequest - 7, // 11: memos.api.v2.ResourceService.GetResourceByName:input_type -> memos.api.v2.GetResourceByNameRequest + 5, // 10: memos.api.v2.ResourceService.SearchResources:input_type -> memos.api.v2.SearchResourcesRequest + 7, // 11: memos.api.v2.ResourceService.GetResource:input_type -> memos.api.v2.GetResourceRequest 9, // 12: memos.api.v2.ResourceService.UpdateResource:input_type -> memos.api.v2.UpdateResourceRequest 11, // 13: memos.api.v2.ResourceService.DeleteResource:input_type -> memos.api.v2.DeleteResourceRequest 2, // 14: memos.api.v2.ResourceService.CreateResource:output_type -> memos.api.v2.CreateResourceResponse 4, // 15: memos.api.v2.ResourceService.ListResources:output_type -> memos.api.v2.ListResourcesResponse - 6, // 16: memos.api.v2.ResourceService.GetResource:output_type -> memos.api.v2.GetResourceResponse - 8, // 17: memos.api.v2.ResourceService.GetResourceByName:output_type -> memos.api.v2.GetResourceByNameResponse + 6, // 16: memos.api.v2.ResourceService.SearchResources:output_type -> memos.api.v2.SearchResourcesResponse + 8, // 17: memos.api.v2.ResourceService.GetResource:output_type -> memos.api.v2.GetResourceResponse 10, // 18: memos.api.v2.ResourceService.UpdateResource:output_type -> memos.api.v2.UpdateResourceResponse 12, // 19: memos.api.v2.ResourceService.DeleteResource:output_type -> memos.api.v2.DeleteResourceResponse 14, // [14:20] is the sub-list for method output_type @@ -980,7 +983,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceRequest); i { + switch v := v.(*SearchResourcesRequest); i { case 0: return &v.state case 1: @@ -992,7 +995,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceResponse); i { + switch v := v.(*SearchResourcesResponse); i { case 0: return &v.state case 1: @@ -1004,7 +1007,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceByNameRequest); i { + switch v := v.(*GetResourceRequest); i { case 0: return &v.state case 1: @@ -1016,7 +1019,7 @@ func file_api_v2_resource_service_proto_init() { } } file_api_v2_resource_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetResourceByNameResponse); i { + switch v := v.(*GetResourceResponse); i { case 0: return &v.state case 1: diff --git a/proto/gen/api/v2/resource_service.pb.gw.go b/proto/gen/api/v2/resource_service.pb.gw.go index 0e980a9efa0aa..9836d31a404d8 100644 --- a/proto/gen/api/v2/resource_service.pb.gw.go +++ b/proto/gen/api/v2/resource_service.pb.gw.go @@ -85,60 +85,44 @@ func local_request_ResourceService_ListResources_0(ctx context.Context, marshale } -func request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceRequest - var metadata runtime.ServerMetadata +var ( + filter_ResourceService_SearchResources_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) - var ( - val string - ok bool - err error - _ = err - ) +func request_ResourceService_SearchResources_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchResourcesRequest + var metadata runtime.ServerMetadata - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ResourceService_SearchResources_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.GetResource(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.SearchResources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceRequest +func local_request_ResourceService_SearchResources_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchResourcesRequest var metadata runtime.ServerMetadata - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - - protoReq.Id, err = runtime.Int32(val) - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_ResourceService_SearchResources_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetResource(ctx, &protoReq) + msg, err := server.SearchResources(ctx, &protoReq) return msg, metadata, err } -func request_ResourceService_GetResourceByName_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceByNameRequest +func request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetResourceRequest var metadata runtime.ServerMetadata var ( @@ -158,13 +142,13 @@ func request_ResourceService_GetResourceByName_0(ctx context.Context, marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetResourceByName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.GetResource(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_ResourceService_GetResourceByName_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetResourceByNameRequest +func local_request_ResourceService_GetResource_0(ctx context.Context, marshaler runtime.Marshaler, server ResourceServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetResourceRequest var metadata runtime.ServerMetadata var ( @@ -184,13 +168,13 @@ func local_request_ResourceService_GetResourceByName_0(ctx context.Context, mars return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetResourceByName(ctx, &protoReq) + msg, err := server.GetResource(ctx, &protoReq) return msg, metadata, err } var ( - filter_ResourceService_UpdateResource_0 = &utilities.DoubleArray{Encoding: map[string]int{"resource": 0, "id": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_ResourceService_UpdateResource_0 = &utilities.DoubleArray{Encoding: map[string]int{"resource": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} ) func request_ResourceService_UpdateResource_0(ctx context.Context, marshaler runtime.Marshaler, client ResourceServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -219,14 +203,14 @@ func request_ResourceService_UpdateResource_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["resource.id"] + val, ok = pathParams["resource.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "resource.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "resource.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.name", err) } if err := req.ParseForm(); err != nil { @@ -267,14 +251,14 @@ func local_request_ResourceService_UpdateResource_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["resource.id"] + val, ok = pathParams["resource.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "resource.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "resource.id", val) + err = runtime.PopulateFieldFromPath(&protoReq, "resource.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "resource.name", err) } if err := req.ParseForm(); err != nil { @@ -300,14 +284,14 @@ func request_ResourceService_DeleteResource_0(ctx context.Context, marshaler run _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.DeleteResource(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -326,14 +310,14 @@ func local_request_ResourceService_DeleteResource_0(ctx context.Context, marshal _ = err ) - val, ok = pathParams["id"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Id, err = runtime.Int32(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.DeleteResource(ctx, &protoReq) @@ -397,7 +381,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv }) - mux.Handle("GET", pattern_ResourceService_GetResource_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_SearchResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -405,12 +389,12 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/SearchResources", runtime.WithHTTPPathPattern("/api/v2/resources:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_ResourceService_SearchResources_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -418,11 +402,11 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv return } - forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_SearchResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_ResourceService_GetResourceByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_GetResource_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() var stream runtime.ServerTransportStream @@ -430,12 +414,12 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResourceByName", runtime.WithHTTPPathPattern("/api/v2/resources/name/{name}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_ResourceService_GetResourceByName_0(annotatedContext, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, server, req, pathParams) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { @@ -443,7 +427,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv return } - forward_ResourceService_GetResourceByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -455,7 +439,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/resources/{resource.id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/{resource.name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -480,7 +464,7 @@ func RegisterResourceServiceHandlerServer(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -582,47 +566,47 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv }) - mux.Handle("GET", pattern_ResourceService_GetResource_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_SearchResources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/SearchResources", runtime.WithHTTPPathPattern("/api/v2/resources:search")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_ResourceService_SearchResources_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_SearchResources_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_ResourceService_GetResourceByName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_ResourceService_GetResource_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResourceByName", runtime.WithHTTPPathPattern("/api/v2/resources/name/{name}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/GetResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_ResourceService_GetResourceByName_0(annotatedContext, inboundMarshaler, client, req, pathParams) + resp, md, err := request_ResourceService_GetResource_0(annotatedContext, inboundMarshaler, client, req, pathParams) annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) if err != nil { runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) return } - forward_ResourceService_GetResourceByName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_ResourceService_GetResource_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -632,7 +616,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/resources/{resource.id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/UpdateResource", runtime.WithHTTPPathPattern("/api/v2/{resource.name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -654,7 +638,7 @@ func RegisterResourceServiceHandlerClient(ctx context.Context, mux *runtime.Serv inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) var err error var annotatedContext context.Context - annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/resources/{id}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.ResourceService/DeleteResource", runtime.WithHTTPPathPattern("/api/v2/{name=resources/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -678,13 +662,13 @@ var ( pattern_ResourceService_ListResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "resources"}, "")) - pattern_ResourceService_GetResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "id"}, "")) + pattern_ResourceService_SearchResources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "resources"}, "search")) - pattern_ResourceService_GetResourceByName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "name"}, "")) + pattern_ResourceService_GetResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "resources", "name"}, "")) - pattern_ResourceService_UpdateResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "resource.id"}, "")) + pattern_ResourceService_UpdateResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "resources", "resource.name"}, "")) - pattern_ResourceService_DeleteResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "resources", "id"}, "")) + pattern_ResourceService_DeleteResource_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "resources", "name"}, "")) ) var ( @@ -692,9 +676,9 @@ var ( forward_ResourceService_ListResources_0 = runtime.ForwardResponseMessage - forward_ResourceService_GetResource_0 = runtime.ForwardResponseMessage + forward_ResourceService_SearchResources_0 = runtime.ForwardResponseMessage - forward_ResourceService_GetResourceByName_0 = runtime.ForwardResponseMessage + forward_ResourceService_GetResource_0 = runtime.ForwardResponseMessage forward_ResourceService_UpdateResource_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/resource_service_grpc.pb.go b/proto/gen/api/v2/resource_service_grpc.pb.go index 3cb293fffbb51..77626b50fd792 100644 --- a/proto/gen/api/v2/resource_service_grpc.pb.go +++ b/proto/gen/api/v2/resource_service_grpc.pb.go @@ -19,12 +19,12 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ResourceService_CreateResource_FullMethodName = "/memos.api.v2.ResourceService/CreateResource" - ResourceService_ListResources_FullMethodName = "/memos.api.v2.ResourceService/ListResources" - ResourceService_GetResource_FullMethodName = "/memos.api.v2.ResourceService/GetResource" - ResourceService_GetResourceByName_FullMethodName = "/memos.api.v2.ResourceService/GetResourceByName" - ResourceService_UpdateResource_FullMethodName = "/memos.api.v2.ResourceService/UpdateResource" - ResourceService_DeleteResource_FullMethodName = "/memos.api.v2.ResourceService/DeleteResource" + ResourceService_CreateResource_FullMethodName = "/memos.api.v2.ResourceService/CreateResource" + ResourceService_ListResources_FullMethodName = "/memos.api.v2.ResourceService/ListResources" + ResourceService_SearchResources_FullMethodName = "/memos.api.v2.ResourceService/SearchResources" + ResourceService_GetResource_FullMethodName = "/memos.api.v2.ResourceService/GetResource" + ResourceService_UpdateResource_FullMethodName = "/memos.api.v2.ResourceService/UpdateResource" + ResourceService_DeleteResource_FullMethodName = "/memos.api.v2.ResourceService/DeleteResource" ) // ResourceServiceClient is the client API for ResourceService service. @@ -35,13 +35,13 @@ type ResourceServiceClient interface { CreateResource(ctx context.Context, in *CreateResourceRequest, opts ...grpc.CallOption) (*CreateResourceResponse, error) // ListResources lists all resources. ListResources(ctx context.Context, in *ListResourcesRequest, opts ...grpc.CallOption) (*ListResourcesResponse, error) - // GetResource returns a resource by id. + // SearchResources searches memos. + SearchResources(ctx context.Context, in *SearchResourcesRequest, opts ...grpc.CallOption) (*SearchResourcesResponse, error) + // GetResource returns a resource by name. GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) - // GetResourceByName returns a resource by name. - GetResourceByName(ctx context.Context, in *GetResourceByNameRequest, opts ...grpc.CallOption) (*GetResourceByNameResponse, error) // UpdateResource updates a resource. UpdateResource(ctx context.Context, in *UpdateResourceRequest, opts ...grpc.CallOption) (*UpdateResourceResponse, error) - // DeleteResource deletes a resource by id. + // DeleteResource deletes a resource by name. DeleteResource(ctx context.Context, in *DeleteResourceRequest, opts ...grpc.CallOption) (*DeleteResourceResponse, error) } @@ -71,18 +71,18 @@ func (c *resourceServiceClient) ListResources(ctx context.Context, in *ListResou return out, nil } -func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) { - out := new(GetResourceResponse) - err := c.cc.Invoke(ctx, ResourceService_GetResource_FullMethodName, in, out, opts...) +func (c *resourceServiceClient) SearchResources(ctx context.Context, in *SearchResourcesRequest, opts ...grpc.CallOption) (*SearchResourcesResponse, error) { + out := new(SearchResourcesResponse) + err := c.cc.Invoke(ctx, ResourceService_SearchResources_FullMethodName, in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *resourceServiceClient) GetResourceByName(ctx context.Context, in *GetResourceByNameRequest, opts ...grpc.CallOption) (*GetResourceByNameResponse, error) { - out := new(GetResourceByNameResponse) - err := c.cc.Invoke(ctx, ResourceService_GetResourceByName_FullMethodName, in, out, opts...) +func (c *resourceServiceClient) GetResource(ctx context.Context, in *GetResourceRequest, opts ...grpc.CallOption) (*GetResourceResponse, error) { + out := new(GetResourceResponse) + err := c.cc.Invoke(ctx, ResourceService_GetResource_FullMethodName, in, out, opts...) if err != nil { return nil, err } @@ -115,13 +115,13 @@ type ResourceServiceServer interface { CreateResource(context.Context, *CreateResourceRequest) (*CreateResourceResponse, error) // ListResources lists all resources. ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) - // GetResource returns a resource by id. + // SearchResources searches memos. + SearchResources(context.Context, *SearchResourcesRequest) (*SearchResourcesResponse, error) + // GetResource returns a resource by name. GetResource(context.Context, *GetResourceRequest) (*GetResourceResponse, error) - // GetResourceByName returns a resource by name. - GetResourceByName(context.Context, *GetResourceByNameRequest) (*GetResourceByNameResponse, error) // UpdateResource updates a resource. UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) - // DeleteResource deletes a resource by id. + // DeleteResource deletes a resource by name. DeleteResource(context.Context, *DeleteResourceRequest) (*DeleteResourceResponse, error) mustEmbedUnimplementedResourceServiceServer() } @@ -136,12 +136,12 @@ func (UnimplementedResourceServiceServer) CreateResource(context.Context, *Creat func (UnimplementedResourceServiceServer) ListResources(context.Context, *ListResourcesRequest) (*ListResourcesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListResources not implemented") } +func (UnimplementedResourceServiceServer) SearchResources(context.Context, *SearchResourcesRequest) (*SearchResourcesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchResources not implemented") +} func (UnimplementedResourceServiceServer) GetResource(context.Context, *GetResourceRequest) (*GetResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetResource not implemented") } -func (UnimplementedResourceServiceServer) GetResourceByName(context.Context, *GetResourceByNameRequest) (*GetResourceByNameResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetResourceByName not implemented") -} func (UnimplementedResourceServiceServer) UpdateResource(context.Context, *UpdateResourceRequest) (*UpdateResourceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateResource not implemented") } @@ -197,38 +197,38 @@ func _ResourceService_ListResources_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } -func _ResourceService_GetResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetResourceRequest) +func _ResourceService_SearchResources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchResourcesRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ResourceServiceServer).GetResource(ctx, in) + return srv.(ResourceServiceServer).SearchResources(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ResourceService_GetResource_FullMethodName, + FullMethod: ResourceService_SearchResources_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceServiceServer).GetResource(ctx, req.(*GetResourceRequest)) + return srv.(ResourceServiceServer).SearchResources(ctx, req.(*SearchResourcesRequest)) } return interceptor(ctx, in, info, handler) } -func _ResourceService_GetResourceByName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetResourceByNameRequest) +func _ResourceService_GetResource_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetResourceRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(ResourceServiceServer).GetResourceByName(ctx, in) + return srv.(ResourceServiceServer).GetResource(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: ResourceService_GetResourceByName_FullMethodName, + FullMethod: ResourceService_GetResource_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ResourceServiceServer).GetResourceByName(ctx, req.(*GetResourceByNameRequest)) + return srv.(ResourceServiceServer).GetResource(ctx, req.(*GetResourceRequest)) } return interceptor(ctx, in, info, handler) } @@ -285,12 +285,12 @@ var ResourceService_ServiceDesc = grpc.ServiceDesc{ Handler: _ResourceService_ListResources_Handler, }, { - MethodName: "GetResource", - Handler: _ResourceService_GetResource_Handler, + MethodName: "SearchResources", + Handler: _ResourceService_SearchResources_Handler, }, { - MethodName: "GetResourceByName", - Handler: _ResourceService_GetResourceByName_Handler, + MethodName: "GetResource", + Handler: _ResourceService_GetResource_Handler, }, { MethodName: "UpdateResource", diff --git a/proto/gen/api/v2/tag_service.pb.go b/proto/gen/api/v2/tag_service.pb.go index e71d997cc89b6..4cf47b293bae8 100644 --- a/proto/gen/api/v2/tag_service.pb.go +++ b/proto/gen/api/v2/tag_service.pb.go @@ -28,7 +28,7 @@ type Tag struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The creator of tags. - // Format: users/{username} + // Format: users/{id} Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` } @@ -263,7 +263,7 @@ type ListTagsRequest struct { unknownFields protoimpl.UnknownFields // The creator of tags. - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } @@ -359,7 +359,7 @@ type RenameTagRequest struct { unknownFields protoimpl.UnknownFields // The creator of tags. - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` OldName string `protobuf:"bytes,2,opt,name=old_name,json=oldName,proto3" json:"old_name,omitempty"` NewName string `protobuf:"bytes,3,opt,name=new_name,json=newName,proto3" json:"new_name,omitempty"` @@ -556,7 +556,7 @@ type GetTagSuggestionsRequest struct { unknownFields protoimpl.UnknownFields // The creator of tags. - // Format: users/{username} + // Format: users/{id} User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } diff --git a/proto/gen/api/v2/user_service.pb.go b/proto/gen/api/v2/user_service.pb.go index 58e60e8556767..80c0572eff7ea 100644 --- a/proto/gen/api/v2/user_service.pb.go +++ b/proto/gen/api/v2/user_service.pb.go @@ -81,18 +81,20 @@ type User struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - Role User_Role `protobuf:"varint,3,opt,name=role,proto3,enum=memos.api.v2.User_Role" json:"role,omitempty"` - Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` - Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` - Nickname string `protobuf:"bytes,6,opt,name=nickname,proto3" json:"nickname,omitempty"` - AvatarUrl string `protobuf:"bytes,7,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` - Password string `protobuf:"bytes,8,opt,name=password,proto3" json:"password,omitempty"` - RowStatus RowStatus `protobuf:"varint,9,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + // Format: users/{id} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The system generated uid of the user. + Id int32 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Role User_Role `protobuf:"varint,3,opt,name=role,proto3,enum=memos.api.v2.User_Role" json:"role,omitempty"` + Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"` + Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` + Nickname string `protobuf:"bytes,6,opt,name=nickname,proto3" json:"nickname,omitempty"` + AvatarUrl string `protobuf:"bytes,7,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + Description string `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"` + Password string `protobuf:"bytes,9,opt,name=password,proto3" json:"password,omitempty"` + RowStatus RowStatus `protobuf:"varint,10,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` + CreateTime *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,12,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` } func (x *User) Reset() { @@ -176,6 +178,13 @@ func (x *User) GetAvatarUrl() string { return "" } +func (x *User) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + func (x *User) GetPassword() string { if x != nil { return x.Password @@ -289,20 +298,116 @@ func (x *ListUsersResponse) GetUsers() []*User { return nil } +type SearchUsersRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Filter is used to filter users returned in the list. + // Format: "username == frank" + Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"` +} + +func (x *SearchUsersRequest) Reset() { + *x = SearchUsersRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_user_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchUsersRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersRequest) ProtoMessage() {} + +func (x *SearchUsersRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_user_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersRequest.ProtoReflect.Descriptor instead. +func (*SearchUsersRequest) Descriptor() ([]byte, []int) { + return file_api_v2_user_service_proto_rawDescGZIP(), []int{3} +} + +func (x *SearchUsersRequest) GetFilter() string { + if x != nil { + return x.Filter + } + return "" +} + +type SearchUsersResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"` +} + +func (x *SearchUsersResponse) Reset() { + *x = SearchUsersResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_user_service_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SearchUsersResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SearchUsersResponse) ProtoMessage() {} + +func (x *SearchUsersResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_user_service_proto_msgTypes[4] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SearchUsersResponse.ProtoReflect.Descriptor instead. +func (*SearchUsersResponse) Descriptor() ([]byte, []int) { + return file_api_v2_user_service_proto_rawDescGZIP(), []int{4} +} + +func (x *SearchUsersResponse) GetUsers() []*User { + if x != nil { + return x.Users + } + return nil +} + type GetUserRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *GetUserRequest) Reset() { *x = GetUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[3] + mi := &file_api_v2_user_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -315,7 +420,7 @@ func (x *GetUserRequest) String() string { func (*GetUserRequest) ProtoMessage() {} func (x *GetUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[3] + mi := &file_api_v2_user_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -328,7 +433,7 @@ func (x *GetUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead. func (*GetUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{3} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{5} } func (x *GetUserRequest) GetName() string { @@ -349,7 +454,7 @@ type GetUserResponse struct { func (x *GetUserResponse) Reset() { *x = GetUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[4] + mi := &file_api_v2_user_service_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -362,7 +467,7 @@ func (x *GetUserResponse) String() string { func (*GetUserResponse) ProtoMessage() {} func (x *GetUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[4] + mi := &file_api_v2_user_service_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -375,7 +480,7 @@ func (x *GetUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserResponse.ProtoReflect.Descriptor instead. func (*GetUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{4} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{6} } func (x *GetUserResponse) GetUser() *User { @@ -396,7 +501,7 @@ type CreateUserRequest struct { func (x *CreateUserRequest) Reset() { *x = CreateUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[5] + mi := &file_api_v2_user_service_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -409,7 +514,7 @@ func (x *CreateUserRequest) String() string { func (*CreateUserRequest) ProtoMessage() {} func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[5] + mi := &file_api_v2_user_service_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -422,7 +527,7 @@ func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead. func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{5} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{7} } func (x *CreateUserRequest) GetUser() *User { @@ -443,7 +548,7 @@ type CreateUserResponse struct { func (x *CreateUserResponse) Reset() { *x = CreateUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[6] + mi := &file_api_v2_user_service_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +561,7 @@ func (x *CreateUserResponse) String() string { func (*CreateUserResponse) ProtoMessage() {} func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[6] + mi := &file_api_v2_user_service_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -469,7 +574,7 @@ func (x *CreateUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserResponse.ProtoReflect.Descriptor instead. func (*CreateUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{6} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{8} } func (x *CreateUserResponse) GetUser() *User { @@ -491,7 +596,7 @@ type UpdateUserRequest struct { func (x *UpdateUserRequest) Reset() { *x = UpdateUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[7] + mi := &file_api_v2_user_service_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -504,7 +609,7 @@ func (x *UpdateUserRequest) String() string { func (*UpdateUserRequest) ProtoMessage() {} func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[7] + mi := &file_api_v2_user_service_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -517,7 +622,7 @@ func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead. func (*UpdateUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{7} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{9} } func (x *UpdateUserRequest) GetUser() *User { @@ -545,7 +650,7 @@ type UpdateUserResponse struct { func (x *UpdateUserResponse) Reset() { *x = UpdateUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[8] + mi := &file_api_v2_user_service_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -558,7 +663,7 @@ func (x *UpdateUserResponse) String() string { func (*UpdateUserResponse) ProtoMessage() {} func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[8] + mi := &file_api_v2_user_service_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -571,7 +676,7 @@ func (x *UpdateUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserResponse.ProtoReflect.Descriptor instead. func (*UpdateUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{8} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{10} } func (x *UpdateUserResponse) GetUser() *User { @@ -587,14 +692,14 @@ type DeleteUserRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *DeleteUserRequest) Reset() { *x = DeleteUserRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[9] + mi := &file_api_v2_user_service_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -607,7 +712,7 @@ func (x *DeleteUserRequest) String() string { func (*DeleteUserRequest) ProtoMessage() {} func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[9] + mi := &file_api_v2_user_service_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -620,7 +725,7 @@ func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead. func (*DeleteUserRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{9} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{11} } func (x *DeleteUserRequest) GetName() string { @@ -639,7 +744,7 @@ type DeleteUserResponse struct { func (x *DeleteUserResponse) Reset() { *x = DeleteUserResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[10] + mi := &file_api_v2_user_service_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -652,7 +757,7 @@ func (x *DeleteUserResponse) String() string { func (*DeleteUserResponse) ProtoMessage() {} func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[10] + mi := &file_api_v2_user_service_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -665,7 +770,7 @@ func (x *DeleteUserResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserResponse.ProtoReflect.Descriptor instead. func (*DeleteUserResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{10} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{12} } type UserSetting struct { @@ -674,7 +779,7 @@ type UserSetting struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // The preferred locale of the user. Locale string `protobuf:"bytes,2,opt,name=locale,proto3" json:"locale,omitempty"` @@ -689,7 +794,7 @@ type UserSetting struct { func (x *UserSetting) Reset() { *x = UserSetting{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[11] + mi := &file_api_v2_user_service_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -702,7 +807,7 @@ func (x *UserSetting) String() string { func (*UserSetting) ProtoMessage() {} func (x *UserSetting) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[11] + mi := &file_api_v2_user_service_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -715,7 +820,7 @@ func (x *UserSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use UserSetting.ProtoReflect.Descriptor instead. func (*UserSetting) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{11} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{13} } func (x *UserSetting) GetName() string { @@ -759,14 +864,14 @@ type GetUserSettingRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *GetUserSettingRequest) Reset() { *x = GetUserSettingRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[12] + mi := &file_api_v2_user_service_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -779,7 +884,7 @@ func (x *GetUserSettingRequest) String() string { func (*GetUserSettingRequest) ProtoMessage() {} func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[12] + mi := &file_api_v2_user_service_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -792,7 +897,7 @@ func (x *GetUserSettingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserSettingRequest.ProtoReflect.Descriptor instead. func (*GetUserSettingRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{12} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{14} } func (x *GetUserSettingRequest) GetName() string { @@ -813,7 +918,7 @@ type GetUserSettingResponse struct { func (x *GetUserSettingResponse) Reset() { *x = GetUserSettingResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[13] + mi := &file_api_v2_user_service_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -826,7 +931,7 @@ func (x *GetUserSettingResponse) String() string { func (*GetUserSettingResponse) ProtoMessage() {} func (x *GetUserSettingResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[13] + mi := &file_api_v2_user_service_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -839,7 +944,7 @@ func (x *GetUserSettingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserSettingResponse.ProtoReflect.Descriptor instead. func (*GetUserSettingResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{13} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{15} } func (x *GetUserSettingResponse) GetSetting() *UserSetting { @@ -861,7 +966,7 @@ type UpdateUserSettingRequest struct { func (x *UpdateUserSettingRequest) Reset() { *x = UpdateUserSettingRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[14] + mi := &file_api_v2_user_service_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -874,7 +979,7 @@ func (x *UpdateUserSettingRequest) String() string { func (*UpdateUserSettingRequest) ProtoMessage() {} func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[14] + mi := &file_api_v2_user_service_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -887,7 +992,7 @@ func (x *UpdateUserSettingRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserSettingRequest.ProtoReflect.Descriptor instead. func (*UpdateUserSettingRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{14} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{16} } func (x *UpdateUserSettingRequest) GetSetting() *UserSetting { @@ -915,7 +1020,7 @@ type UpdateUserSettingResponse struct { func (x *UpdateUserSettingResponse) Reset() { *x = UpdateUserSettingResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[15] + mi := &file_api_v2_user_service_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -928,7 +1033,7 @@ func (x *UpdateUserSettingResponse) String() string { func (*UpdateUserSettingResponse) ProtoMessage() {} func (x *UpdateUserSettingResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[15] + mi := &file_api_v2_user_service_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -941,7 +1046,7 @@ func (x *UpdateUserSettingResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateUserSettingResponse.ProtoReflect.Descriptor instead. func (*UpdateUserSettingResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{15} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{17} } func (x *UpdateUserSettingResponse) GetSetting() *UserSetting { @@ -965,7 +1070,7 @@ type UserAccessToken struct { func (x *UserAccessToken) Reset() { *x = UserAccessToken{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[16] + mi := &file_api_v2_user_service_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -978,7 +1083,7 @@ func (x *UserAccessToken) String() string { func (*UserAccessToken) ProtoMessage() {} func (x *UserAccessToken) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[16] + mi := &file_api_v2_user_service_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -991,7 +1096,7 @@ func (x *UserAccessToken) ProtoReflect() protoreflect.Message { // Deprecated: Use UserAccessToken.ProtoReflect.Descriptor instead. func (*UserAccessToken) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{16} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{18} } func (x *UserAccessToken) GetAccessToken() string { @@ -1028,14 +1133,14 @@ type ListUserAccessTokensRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListUserAccessTokensRequest) Reset() { *x = ListUserAccessTokensRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[17] + mi := &file_api_v2_user_service_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1048,7 +1153,7 @@ func (x *ListUserAccessTokensRequest) String() string { func (*ListUserAccessTokensRequest) ProtoMessage() {} func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[17] + mi := &file_api_v2_user_service_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1061,7 +1166,7 @@ func (x *ListUserAccessTokensRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ListUserAccessTokensRequest.ProtoReflect.Descriptor instead. func (*ListUserAccessTokensRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{17} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{19} } func (x *ListUserAccessTokensRequest) GetName() string { @@ -1082,7 +1187,7 @@ type ListUserAccessTokensResponse struct { func (x *ListUserAccessTokensResponse) Reset() { *x = ListUserAccessTokensResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[18] + mi := &file_api_v2_user_service_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1095,7 +1200,7 @@ func (x *ListUserAccessTokensResponse) String() string { func (*ListUserAccessTokensResponse) ProtoMessage() {} func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[18] + mi := &file_api_v2_user_service_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1108,7 +1213,7 @@ func (x *ListUserAccessTokensResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ListUserAccessTokensResponse.ProtoReflect.Descriptor instead. func (*ListUserAccessTokensResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{18} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{20} } func (x *ListUserAccessTokensResponse) GetAccessTokens() []*UserAccessToken { @@ -1124,7 +1229,7 @@ type CreateUserAccessTokenRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3,oneof" json:"expires_at,omitempty"` @@ -1133,7 +1238,7 @@ type CreateUserAccessTokenRequest struct { func (x *CreateUserAccessTokenRequest) Reset() { *x = CreateUserAccessTokenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[19] + mi := &file_api_v2_user_service_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1146,7 +1251,7 @@ func (x *CreateUserAccessTokenRequest) String() string { func (*CreateUserAccessTokenRequest) ProtoMessage() {} func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[19] + mi := &file_api_v2_user_service_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1159,7 +1264,7 @@ func (x *CreateUserAccessTokenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserAccessTokenRequest.ProtoReflect.Descriptor instead. func (*CreateUserAccessTokenRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{19} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{21} } func (x *CreateUserAccessTokenRequest) GetName() string { @@ -1194,7 +1299,7 @@ type CreateUserAccessTokenResponse struct { func (x *CreateUserAccessTokenResponse) Reset() { *x = CreateUserAccessTokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[20] + mi := &file_api_v2_user_service_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1207,7 +1312,7 @@ func (x *CreateUserAccessTokenResponse) String() string { func (*CreateUserAccessTokenResponse) ProtoMessage() {} func (x *CreateUserAccessTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[20] + mi := &file_api_v2_user_service_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1220,7 +1325,7 @@ func (x *CreateUserAccessTokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateUserAccessTokenResponse.ProtoReflect.Descriptor instead. func (*CreateUserAccessTokenResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{20} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{22} } func (x *CreateUserAccessTokenResponse) GetAccessToken() *UserAccessToken { @@ -1236,7 +1341,7 @@ type DeleteUserAccessTokenRequest struct { unknownFields protoimpl.UnknownFields // The name of the user. - // Format: users/{username} + // Format: users/{id} Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // access_token is the access token to delete. AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` @@ -1245,7 +1350,7 @@ type DeleteUserAccessTokenRequest struct { func (x *DeleteUserAccessTokenRequest) Reset() { *x = DeleteUserAccessTokenRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[21] + mi := &file_api_v2_user_service_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1258,7 +1363,7 @@ func (x *DeleteUserAccessTokenRequest) String() string { func (*DeleteUserAccessTokenRequest) ProtoMessage() {} func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[21] + mi := &file_api_v2_user_service_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1271,7 +1376,7 @@ func (x *DeleteUserAccessTokenRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserAccessTokenRequest.ProtoReflect.Descriptor instead. func (*DeleteUserAccessTokenRequest) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{21} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{23} } func (x *DeleteUserAccessTokenRequest) GetName() string { @@ -1297,7 +1402,7 @@ type DeleteUserAccessTokenResponse struct { func (x *DeleteUserAccessTokenResponse) Reset() { *x = DeleteUserAccessTokenResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_user_service_proto_msgTypes[22] + mi := &file_api_v2_user_service_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1310,7 +1415,7 @@ func (x *DeleteUserAccessTokenResponse) String() string { func (*DeleteUserAccessTokenResponse) ProtoMessage() {} func (x *DeleteUserAccessTokenResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_user_service_proto_msgTypes[22] + mi := &file_api_v2_user_service_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1323,7 +1428,7 @@ func (x *DeleteUserAccessTokenResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteUserAccessTokenResponse.ProtoReflect.Descriptor instead. func (*DeleteUserAccessTokenResponse) Descriptor() ([]byte, []int) { - return file_api_v2_user_service_proto_rawDescGZIP(), []int{22} + return file_api_v2_user_service_proto_rawDescGZIP(), []int{24} } var File_api_v2_user_service_proto protoreflect.FileDescriptor @@ -1342,7 +1447,7 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 0x03, 0x0a, 0x04, 0x55, 0x73, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, 0x03, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2b, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, @@ -1355,240 +1460,256 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, - 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, - 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, - 0x69, 0x6d, 0x65, 0x22, 0x3b, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, - 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, - 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x03, - 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, - 0x65, 0x72, 0x73, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, 0x74, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, - 0x75, 0x73, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, - 0x7d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x75, 0x73, 0x65, - 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, - 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x3c, - 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x27, 0x0a, 0x11, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x01, 0x0a, 0x0b, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, 0x61, - 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, 0x70, - 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, - 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x75, 0x73, 0x65, - 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x65, 0x6c, 0x65, - 0x67, 0x72, 0x61, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x15, 0x47, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x42, - 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, 0x0a, - 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x50, 0x0a, 0x19, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xca, 0x01, 0x0a, - 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, - 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, - 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0x31, 0x0a, 0x1b, 0x4c, 0x69, 0x73, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x1c, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x22, 0xa3, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, - 0x65, 0x73, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x69, - 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x22, 0x61, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, - 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x55, 0x0a, 0x1c, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, - 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x32, 0xb5, 0x0b, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1e, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, - 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x6d, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, - 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x73, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0d, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x8d, 0x01, 0x0a, 0x0a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0xda, 0x41, - 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, - 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x1b, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, - 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x76, 0x0a, 0x0a, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, 0xda, 0x41, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, - 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x12, - 0x1e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, - 0xb3, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0xda, 0x41, 0x13, 0x73, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0x26, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, - 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x7d, 0x12, 0xa2, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x29, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, + 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x63, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x3b, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, + 0x10, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x4f, 0x53, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, + 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, + 0x10, 0x03, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x2c, 0x0a, 0x12, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, + 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, + 0x74, 0x65, 0x72, 0x22, 0x3f, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, + 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, 0x73, + 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x22, 0x24, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x22, 0x3c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x22, 0x7d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, + 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, + 0x3c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x27, 0x0a, + 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xac, 0x01, 0x0a, + 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x61, 0x70, 0x70, 0x65, + 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x61, 0x70, + 0x70, 0x65, 0x61, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x6d, 0x65, 0x6d, 0x6f, + 0x5f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0e, 0x6d, 0x65, 0x6d, 0x6f, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x12, 0x28, 0x0a, 0x10, 0x74, 0x65, 0x6c, 0x65, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x75, 0x73, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x74, 0x65, 0x6c, + 0x65, 0x67, 0x72, 0x61, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x2b, 0x0a, 0x15, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x4d, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, + 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x3b, + 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, + 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x50, 0x0a, 0x19, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x07, 0x73, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x22, 0xca, 0x01, + 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, + 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, + 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x22, 0x31, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, - 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xa8, 0x01, 0x0a, 0x15, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xda, - 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, 0x01, 0x2a, 0x22, - 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, - 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xc1, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, + 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, + 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x22, 0x61, 0x0a, 0x1d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x11, 0x6e, 0x61, 0x6d, - 0x65, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x35, 0x2a, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, - 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xa8, 0x01, 0x0a, 0x10, 0x63, 0x6f, - 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x10, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, - 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, - 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x4d, 0x65, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, - 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, 0x6d, 0x6f, 0x73, - 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x70, 0x69, - 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, + 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0b, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x55, 0x0a, 0x1c, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x22, 0x1f, 0x0a, 0x1d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x32, 0xa7, 0x0c, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, + 0x1e, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x70, 0x0a, 0x0b, 0x53, 0x65, 0x61, 0x72, 0x63, + 0x68, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, 0x65, 0x72, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x6d, 0x0a, 0x07, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x25, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, + 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, + 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x73, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0xda, 0x41, 0x04, 0x75, 0x73, + 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0d, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x8d, 0x01, + 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3c, 0xda, 0x41, 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, + 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, + 0x32, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, + 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x76, 0x0a, + 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x25, + 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, + 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, + 0x02, 0x20, 0x12, 0x1e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0xb3, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x27, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0xda, 0x41, 0x13, 0x73, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x07, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x32, 0x26, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x73, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x2f, + 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x7d, 0x12, 0xa2, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x12, 0x29, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6d, + 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, + 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xa8, 0x01, + 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x36, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a, + 0x01, 0x2a, 0x22, 0x24, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, + 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xc1, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, + 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0xda, 0x41, 0x11, + 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, + 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x2a, 0x33, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, + 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xa8, 0x01, 0x0a, + 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x42, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4d, 0x41, 0x58, 0xaa, 0x02, 0x0c, + 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x4d, + 0x65, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, + 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1604,82 +1725,87 @@ func file_api_v2_user_service_proto_rawDescGZIP() []byte { } var file_api_v2_user_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_api_v2_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 23) +var file_api_v2_user_service_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_api_v2_user_service_proto_goTypes = []interface{}{ (User_Role)(0), // 0: memos.api.v2.User.Role (*User)(nil), // 1: memos.api.v2.User (*ListUsersRequest)(nil), // 2: memos.api.v2.ListUsersRequest (*ListUsersResponse)(nil), // 3: memos.api.v2.ListUsersResponse - (*GetUserRequest)(nil), // 4: memos.api.v2.GetUserRequest - (*GetUserResponse)(nil), // 5: memos.api.v2.GetUserResponse - (*CreateUserRequest)(nil), // 6: memos.api.v2.CreateUserRequest - (*CreateUserResponse)(nil), // 7: memos.api.v2.CreateUserResponse - (*UpdateUserRequest)(nil), // 8: memos.api.v2.UpdateUserRequest - (*UpdateUserResponse)(nil), // 9: memos.api.v2.UpdateUserResponse - (*DeleteUserRequest)(nil), // 10: memos.api.v2.DeleteUserRequest - (*DeleteUserResponse)(nil), // 11: memos.api.v2.DeleteUserResponse - (*UserSetting)(nil), // 12: memos.api.v2.UserSetting - (*GetUserSettingRequest)(nil), // 13: memos.api.v2.GetUserSettingRequest - (*GetUserSettingResponse)(nil), // 14: memos.api.v2.GetUserSettingResponse - (*UpdateUserSettingRequest)(nil), // 15: memos.api.v2.UpdateUserSettingRequest - (*UpdateUserSettingResponse)(nil), // 16: memos.api.v2.UpdateUserSettingResponse - (*UserAccessToken)(nil), // 17: memos.api.v2.UserAccessToken - (*ListUserAccessTokensRequest)(nil), // 18: memos.api.v2.ListUserAccessTokensRequest - (*ListUserAccessTokensResponse)(nil), // 19: memos.api.v2.ListUserAccessTokensResponse - (*CreateUserAccessTokenRequest)(nil), // 20: memos.api.v2.CreateUserAccessTokenRequest - (*CreateUserAccessTokenResponse)(nil), // 21: memos.api.v2.CreateUserAccessTokenResponse - (*DeleteUserAccessTokenRequest)(nil), // 22: memos.api.v2.DeleteUserAccessTokenRequest - (*DeleteUserAccessTokenResponse)(nil), // 23: memos.api.v2.DeleteUserAccessTokenResponse - (RowStatus)(0), // 24: memos.api.v2.RowStatus - (*timestamppb.Timestamp)(nil), // 25: google.protobuf.Timestamp - (*fieldmaskpb.FieldMask)(nil), // 26: google.protobuf.FieldMask + (*SearchUsersRequest)(nil), // 4: memos.api.v2.SearchUsersRequest + (*SearchUsersResponse)(nil), // 5: memos.api.v2.SearchUsersResponse + (*GetUserRequest)(nil), // 6: memos.api.v2.GetUserRequest + (*GetUserResponse)(nil), // 7: memos.api.v2.GetUserResponse + (*CreateUserRequest)(nil), // 8: memos.api.v2.CreateUserRequest + (*CreateUserResponse)(nil), // 9: memos.api.v2.CreateUserResponse + (*UpdateUserRequest)(nil), // 10: memos.api.v2.UpdateUserRequest + (*UpdateUserResponse)(nil), // 11: memos.api.v2.UpdateUserResponse + (*DeleteUserRequest)(nil), // 12: memos.api.v2.DeleteUserRequest + (*DeleteUserResponse)(nil), // 13: memos.api.v2.DeleteUserResponse + (*UserSetting)(nil), // 14: memos.api.v2.UserSetting + (*GetUserSettingRequest)(nil), // 15: memos.api.v2.GetUserSettingRequest + (*GetUserSettingResponse)(nil), // 16: memos.api.v2.GetUserSettingResponse + (*UpdateUserSettingRequest)(nil), // 17: memos.api.v2.UpdateUserSettingRequest + (*UpdateUserSettingResponse)(nil), // 18: memos.api.v2.UpdateUserSettingResponse + (*UserAccessToken)(nil), // 19: memos.api.v2.UserAccessToken + (*ListUserAccessTokensRequest)(nil), // 20: memos.api.v2.ListUserAccessTokensRequest + (*ListUserAccessTokensResponse)(nil), // 21: memos.api.v2.ListUserAccessTokensResponse + (*CreateUserAccessTokenRequest)(nil), // 22: memos.api.v2.CreateUserAccessTokenRequest + (*CreateUserAccessTokenResponse)(nil), // 23: memos.api.v2.CreateUserAccessTokenResponse + (*DeleteUserAccessTokenRequest)(nil), // 24: memos.api.v2.DeleteUserAccessTokenRequest + (*DeleteUserAccessTokenResponse)(nil), // 25: memos.api.v2.DeleteUserAccessTokenResponse + (RowStatus)(0), // 26: memos.api.v2.RowStatus + (*timestamppb.Timestamp)(nil), // 27: google.protobuf.Timestamp + (*fieldmaskpb.FieldMask)(nil), // 28: google.protobuf.FieldMask } var file_api_v2_user_service_proto_depIdxs = []int32{ 0, // 0: memos.api.v2.User.role:type_name -> memos.api.v2.User.Role - 24, // 1: memos.api.v2.User.row_status:type_name -> memos.api.v2.RowStatus - 25, // 2: memos.api.v2.User.create_time:type_name -> google.protobuf.Timestamp - 25, // 3: memos.api.v2.User.update_time:type_name -> google.protobuf.Timestamp + 26, // 1: memos.api.v2.User.row_status:type_name -> memos.api.v2.RowStatus + 27, // 2: memos.api.v2.User.create_time:type_name -> google.protobuf.Timestamp + 27, // 3: memos.api.v2.User.update_time:type_name -> google.protobuf.Timestamp 1, // 4: memos.api.v2.ListUsersResponse.users:type_name -> memos.api.v2.User - 1, // 5: memos.api.v2.GetUserResponse.user:type_name -> memos.api.v2.User - 1, // 6: memos.api.v2.CreateUserRequest.user:type_name -> memos.api.v2.User - 1, // 7: memos.api.v2.CreateUserResponse.user:type_name -> memos.api.v2.User - 1, // 8: memos.api.v2.UpdateUserRequest.user:type_name -> memos.api.v2.User - 26, // 9: memos.api.v2.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask - 1, // 10: memos.api.v2.UpdateUserResponse.user:type_name -> memos.api.v2.User - 12, // 11: memos.api.v2.GetUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting - 12, // 12: memos.api.v2.UpdateUserSettingRequest.setting:type_name -> memos.api.v2.UserSetting - 26, // 13: memos.api.v2.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask - 12, // 14: memos.api.v2.UpdateUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting - 25, // 15: memos.api.v2.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp - 25, // 16: memos.api.v2.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp - 17, // 17: memos.api.v2.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v2.UserAccessToken - 25, // 18: memos.api.v2.CreateUserAccessTokenRequest.expires_at:type_name -> google.protobuf.Timestamp - 17, // 19: memos.api.v2.CreateUserAccessTokenResponse.access_token:type_name -> memos.api.v2.UserAccessToken - 2, // 20: memos.api.v2.UserService.ListUsers:input_type -> memos.api.v2.ListUsersRequest - 4, // 21: memos.api.v2.UserService.GetUser:input_type -> memos.api.v2.GetUserRequest - 6, // 22: memos.api.v2.UserService.CreateUser:input_type -> memos.api.v2.CreateUserRequest - 8, // 23: memos.api.v2.UserService.UpdateUser:input_type -> memos.api.v2.UpdateUserRequest - 10, // 24: memos.api.v2.UserService.DeleteUser:input_type -> memos.api.v2.DeleteUserRequest - 13, // 25: memos.api.v2.UserService.GetUserSetting:input_type -> memos.api.v2.GetUserSettingRequest - 15, // 26: memos.api.v2.UserService.UpdateUserSetting:input_type -> memos.api.v2.UpdateUserSettingRequest - 18, // 27: memos.api.v2.UserService.ListUserAccessTokens:input_type -> memos.api.v2.ListUserAccessTokensRequest - 20, // 28: memos.api.v2.UserService.CreateUserAccessToken:input_type -> memos.api.v2.CreateUserAccessTokenRequest - 22, // 29: memos.api.v2.UserService.DeleteUserAccessToken:input_type -> memos.api.v2.DeleteUserAccessTokenRequest - 3, // 30: memos.api.v2.UserService.ListUsers:output_type -> memos.api.v2.ListUsersResponse - 5, // 31: memos.api.v2.UserService.GetUser:output_type -> memos.api.v2.GetUserResponse - 7, // 32: memos.api.v2.UserService.CreateUser:output_type -> memos.api.v2.CreateUserResponse - 9, // 33: memos.api.v2.UserService.UpdateUser:output_type -> memos.api.v2.UpdateUserResponse - 11, // 34: memos.api.v2.UserService.DeleteUser:output_type -> memos.api.v2.DeleteUserResponse - 14, // 35: memos.api.v2.UserService.GetUserSetting:output_type -> memos.api.v2.GetUserSettingResponse - 16, // 36: memos.api.v2.UserService.UpdateUserSetting:output_type -> memos.api.v2.UpdateUserSettingResponse - 19, // 37: memos.api.v2.UserService.ListUserAccessTokens:output_type -> memos.api.v2.ListUserAccessTokensResponse - 21, // 38: memos.api.v2.UserService.CreateUserAccessToken:output_type -> memos.api.v2.CreateUserAccessTokenResponse - 23, // 39: memos.api.v2.UserService.DeleteUserAccessToken:output_type -> memos.api.v2.DeleteUserAccessTokenResponse - 30, // [30:40] is the sub-list for method output_type - 20, // [20:30] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 1, // 5: memos.api.v2.SearchUsersResponse.users:type_name -> memos.api.v2.User + 1, // 6: memos.api.v2.GetUserResponse.user:type_name -> memos.api.v2.User + 1, // 7: memos.api.v2.CreateUserRequest.user:type_name -> memos.api.v2.User + 1, // 8: memos.api.v2.CreateUserResponse.user:type_name -> memos.api.v2.User + 1, // 9: memos.api.v2.UpdateUserRequest.user:type_name -> memos.api.v2.User + 28, // 10: memos.api.v2.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask + 1, // 11: memos.api.v2.UpdateUserResponse.user:type_name -> memos.api.v2.User + 14, // 12: memos.api.v2.GetUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting + 14, // 13: memos.api.v2.UpdateUserSettingRequest.setting:type_name -> memos.api.v2.UserSetting + 28, // 14: memos.api.v2.UpdateUserSettingRequest.update_mask:type_name -> google.protobuf.FieldMask + 14, // 15: memos.api.v2.UpdateUserSettingResponse.setting:type_name -> memos.api.v2.UserSetting + 27, // 16: memos.api.v2.UserAccessToken.issued_at:type_name -> google.protobuf.Timestamp + 27, // 17: memos.api.v2.UserAccessToken.expires_at:type_name -> google.protobuf.Timestamp + 19, // 18: memos.api.v2.ListUserAccessTokensResponse.access_tokens:type_name -> memos.api.v2.UserAccessToken + 27, // 19: memos.api.v2.CreateUserAccessTokenRequest.expires_at:type_name -> google.protobuf.Timestamp + 19, // 20: memos.api.v2.CreateUserAccessTokenResponse.access_token:type_name -> memos.api.v2.UserAccessToken + 2, // 21: memos.api.v2.UserService.ListUsers:input_type -> memos.api.v2.ListUsersRequest + 4, // 22: memos.api.v2.UserService.SearchUsers:input_type -> memos.api.v2.SearchUsersRequest + 6, // 23: memos.api.v2.UserService.GetUser:input_type -> memos.api.v2.GetUserRequest + 8, // 24: memos.api.v2.UserService.CreateUser:input_type -> memos.api.v2.CreateUserRequest + 10, // 25: memos.api.v2.UserService.UpdateUser:input_type -> memos.api.v2.UpdateUserRequest + 12, // 26: memos.api.v2.UserService.DeleteUser:input_type -> memos.api.v2.DeleteUserRequest + 15, // 27: memos.api.v2.UserService.GetUserSetting:input_type -> memos.api.v2.GetUserSettingRequest + 17, // 28: memos.api.v2.UserService.UpdateUserSetting:input_type -> memos.api.v2.UpdateUserSettingRequest + 20, // 29: memos.api.v2.UserService.ListUserAccessTokens:input_type -> memos.api.v2.ListUserAccessTokensRequest + 22, // 30: memos.api.v2.UserService.CreateUserAccessToken:input_type -> memos.api.v2.CreateUserAccessTokenRequest + 24, // 31: memos.api.v2.UserService.DeleteUserAccessToken:input_type -> memos.api.v2.DeleteUserAccessTokenRequest + 3, // 32: memos.api.v2.UserService.ListUsers:output_type -> memos.api.v2.ListUsersResponse + 5, // 33: memos.api.v2.UserService.SearchUsers:output_type -> memos.api.v2.SearchUsersResponse + 7, // 34: memos.api.v2.UserService.GetUser:output_type -> memos.api.v2.GetUserResponse + 9, // 35: memos.api.v2.UserService.CreateUser:output_type -> memos.api.v2.CreateUserResponse + 11, // 36: memos.api.v2.UserService.UpdateUser:output_type -> memos.api.v2.UpdateUserResponse + 13, // 37: memos.api.v2.UserService.DeleteUser:output_type -> memos.api.v2.DeleteUserResponse + 16, // 38: memos.api.v2.UserService.GetUserSetting:output_type -> memos.api.v2.GetUserSettingResponse + 18, // 39: memos.api.v2.UserService.UpdateUserSetting:output_type -> memos.api.v2.UpdateUserSettingResponse + 21, // 40: memos.api.v2.UserService.ListUserAccessTokens:output_type -> memos.api.v2.ListUserAccessTokensResponse + 23, // 41: memos.api.v2.UserService.CreateUserAccessToken:output_type -> memos.api.v2.CreateUserAccessTokenResponse + 25, // 42: memos.api.v2.UserService.DeleteUserAccessToken:output_type -> memos.api.v2.DeleteUserAccessTokenResponse + 32, // [32:43] is the sub-list for method output_type + 21, // [21:32] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_api_v2_user_service_proto_init() } @@ -1726,7 +1852,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserRequest); i { + switch v := v.(*SearchUsersRequest); i { case 0: return &v.state case 1: @@ -1738,7 +1864,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserResponse); i { + switch v := v.(*SearchUsersResponse); i { case 0: return &v.state case 1: @@ -1750,7 +1876,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserRequest); i { + switch v := v.(*GetUserRequest); i { case 0: return &v.state case 1: @@ -1762,7 +1888,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserResponse); i { + switch v := v.(*GetUserResponse); i { case 0: return &v.state case 1: @@ -1774,7 +1900,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserRequest); i { + switch v := v.(*CreateUserRequest); i { case 0: return &v.state case 1: @@ -1786,7 +1912,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserResponse); i { + switch v := v.(*CreateUserResponse); i { case 0: return &v.state case 1: @@ -1798,7 +1924,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserRequest); i { + switch v := v.(*UpdateUserRequest); i { case 0: return &v.state case 1: @@ -1810,7 +1936,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserResponse); i { + switch v := v.(*UpdateUserResponse); i { case 0: return &v.state case 1: @@ -1822,7 +1948,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserSetting); i { + switch v := v.(*DeleteUserRequest); i { case 0: return &v.state case 1: @@ -1834,7 +1960,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserSettingRequest); i { + switch v := v.(*DeleteUserResponse); i { case 0: return &v.state case 1: @@ -1846,7 +1972,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserSettingResponse); i { + switch v := v.(*UserSetting); i { case 0: return &v.state case 1: @@ -1858,7 +1984,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserSettingRequest); i { + switch v := v.(*GetUserSettingRequest); i { case 0: return &v.state case 1: @@ -1870,7 +1996,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserSettingResponse); i { + switch v := v.(*GetUserSettingResponse); i { case 0: return &v.state case 1: @@ -1882,7 +2008,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserAccessToken); i { + switch v := v.(*UpdateUserSettingRequest); i { case 0: return &v.state case 1: @@ -1894,7 +2020,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserAccessTokensRequest); i { + switch v := v.(*UpdateUserSettingResponse); i { case 0: return &v.state case 1: @@ -1906,7 +2032,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUserAccessTokensResponse); i { + switch v := v.(*UserAccessToken); i { case 0: return &v.state case 1: @@ -1918,7 +2044,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserAccessTokenRequest); i { + switch v := v.(*ListUserAccessTokensRequest); i { case 0: return &v.state case 1: @@ -1930,7 +2056,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserAccessTokenResponse); i { + switch v := v.(*ListUserAccessTokensResponse); i { case 0: return &v.state case 1: @@ -1942,7 +2068,7 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserAccessTokenRequest); i { + switch v := v.(*CreateUserAccessTokenRequest); i { case 0: return &v.state case 1: @@ -1954,6 +2080,30 @@ func file_api_v2_user_service_proto_init() { } } file_api_v2_user_service_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserAccessTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_user_service_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserAccessTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_user_service_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteUserAccessTokenResponse); i { case 0: return &v.state @@ -1966,14 +2116,14 @@ func file_api_v2_user_service_proto_init() { } } } - file_api_v2_user_service_proto_msgTypes[19].OneofWrappers = []interface{}{} + file_api_v2_user_service_proto_msgTypes[21].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v2_user_service_proto_rawDesc, NumEnums: 1, - NumMessages: 23, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/api/v2/user_service.pb.gw.go b/proto/gen/api/v2/user_service.pb.gw.go index 5efaa1aabc9e6..0c1a5bfc1de9f 100644 --- a/proto/gen/api/v2/user_service.pb.gw.go +++ b/proto/gen/api/v2/user_service.pb.gw.go @@ -49,6 +49,42 @@ func local_request_UserService_ListUsers_0(ctx context.Context, marshaler runtim } +var ( + filter_UserService_SearchUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchUsersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_SearchUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SearchUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_SearchUsers_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SearchUsersRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_SearchUsers_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SearchUsers(ctx, &protoReq) + return msg, metadata, err + +} + func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq GetUserRequest var metadata runtime.ServerMetadata @@ -662,6 +698,31 @@ func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_UserService_SearchUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users:search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -950,6 +1011,28 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux }) + mux.Handle("GET", pattern_UserService_SearchUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/SearchUsers", runtime.WithHTTPPathPattern("/api/v2/users:search")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_SearchUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_SearchUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_UserService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1154,6 +1237,8 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux var ( pattern_UserService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "")) + pattern_UserService_SearchUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "search")) + pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "users", "name"}, "")) pattern_UserService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "users"}, "")) @@ -1176,6 +1261,8 @@ var ( var ( forward_UserService_ListUsers_0 = runtime.ForwardResponseMessage + forward_UserService_SearchUsers_0 = runtime.ForwardResponseMessage + forward_UserService_GetUser_0 = runtime.ForwardResponseMessage forward_UserService_CreateUser_0 = runtime.ForwardResponseMessage diff --git a/proto/gen/api/v2/user_service_grpc.pb.go b/proto/gen/api/v2/user_service_grpc.pb.go index d8345427ad095..000913b5d16e4 100644 --- a/proto/gen/api/v2/user_service_grpc.pb.go +++ b/proto/gen/api/v2/user_service_grpc.pb.go @@ -20,6 +20,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( UserService_ListUsers_FullMethodName = "/memos.api.v2.UserService/ListUsers" + UserService_SearchUsers_FullMethodName = "/memos.api.v2.UserService/SearchUsers" UserService_GetUser_FullMethodName = "/memos.api.v2.UserService/GetUser" UserService_CreateUser_FullMethodName = "/memos.api.v2.UserService/CreateUser" UserService_UpdateUser_FullMethodName = "/memos.api.v2.UserService/UpdateUser" @@ -37,6 +38,8 @@ const ( type UserServiceClient interface { // ListUsers returns a list of users. ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) + // SearchUsers searches users by filter. + SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) // GetUser gets a user by name. GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) // CreateUser creates a new user. @@ -74,6 +77,15 @@ func (c *userServiceClient) ListUsers(ctx context.Context, in *ListUsersRequest, return out, nil } +func (c *userServiceClient) SearchUsers(ctx context.Context, in *SearchUsersRequest, opts ...grpc.CallOption) (*SearchUsersResponse, error) { + out := new(SearchUsersResponse) + err := c.cc.Invoke(ctx, UserService_SearchUsers_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *userServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*GetUserResponse, error) { out := new(GetUserResponse) err := c.cc.Invoke(ctx, UserService_GetUser_FullMethodName, in, out, opts...) @@ -161,6 +173,8 @@ func (c *userServiceClient) DeleteUserAccessToken(ctx context.Context, in *Delet type UserServiceServer interface { // ListUsers returns a list of users. ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) + // SearchUsers searches users by filter. + SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) // GetUser gets a user by name. GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) // CreateUser creates a new user. @@ -189,6 +203,9 @@ type UnimplementedUserServiceServer struct { func (UnimplementedUserServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented") } +func (UnimplementedUserServiceServer) SearchUsers(context.Context, *SearchUsersRequest) (*SearchUsersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SearchUsers not implemented") +} func (UnimplementedUserServiceServer) GetUser(context.Context, *GetUserRequest) (*GetUserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") } @@ -247,6 +264,24 @@ func _UserService_ListUsers_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _UserService_SearchUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SearchUsersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).SearchUsers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_SearchUsers_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).SearchUsers(ctx, req.(*SearchUsersRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _UserService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetUserRequest) if err := dec(in); err != nil { @@ -420,6 +455,10 @@ var UserService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListUsers", Handler: _UserService_ListUsers_Handler, }, + { + MethodName: "SearchUsers", + Handler: _UserService_SearchUsers_Handler, + }, { MethodName: "GetUser", Handler: _UserService_GetUser_Handler, diff --git a/proto/gen/api/v2/workspace_service.pb.go b/proto/gen/api/v2/workspace_service.pb.go index 89f88fdc3b778..09c8611933560 100644 --- a/proto/gen/api/v2/workspace_service.pb.go +++ b/proto/gen/api/v2/workspace_service.pb.go @@ -26,18 +26,21 @@ type WorkspaceProfile struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // The name of intance owner. + // Format: "users/{id}" + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` // version is the current version of instance - Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // mode is the instance mode (e.g. "prod", "dev" or "demo"). - Mode string `protobuf:"bytes,2,opt,name=mode,proto3" json:"mode,omitempty"` - // allow_registration is whether the registration is allowed. - AllowRegistration bool `protobuf:"varint,3,opt,name=allow_registration,json=allowRegistration,proto3" json:"allow_registration,omitempty"` - // allow_password_login is whether the password login is allowed. - DisablePasswordLogin bool `protobuf:"varint,4,opt,name=disable_password_login,json=disablePasswordLogin,proto3" json:"disable_password_login,omitempty"` + Mode string `protobuf:"bytes,3,opt,name=mode,proto3" json:"mode,omitempty"` + // disallow_signup is whether the signup is disallowed. + DisallowSignup bool `protobuf:"varint,4,opt,name=disallow_signup,json=disallowSignup,proto3" json:"disallow_signup,omitempty"` + // disable_password_login is whether the password login is disabled. + DisablePasswordLogin bool `protobuf:"varint,5,opt,name=disable_password_login,json=disablePasswordLogin,proto3" json:"disable_password_login,omitempty"` // additional_script is the additional script. - AdditionalScript string `protobuf:"bytes,5,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"` + AdditionalScript string `protobuf:"bytes,6,opt,name=additional_script,json=additionalScript,proto3" json:"additional_script,omitempty"` // additional_style is the additional style. - AdditionalStyle string `protobuf:"bytes,6,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"` + AdditionalStyle string `protobuf:"bytes,7,opt,name=additional_style,json=additionalStyle,proto3" json:"additional_style,omitempty"` } func (x *WorkspaceProfile) Reset() { @@ -72,6 +75,13 @@ func (*WorkspaceProfile) Descriptor() ([]byte, []int) { return file_api_v2_workspace_service_proto_rawDescGZIP(), []int{0} } +func (x *WorkspaceProfile) GetOwner() string { + if x != nil { + return x.Owner + } + return "" +} + func (x *WorkspaceProfile) GetVersion() string { if x != nil { return x.Version @@ -86,9 +96,9 @@ func (x *WorkspaceProfile) GetMode() string { return "" } -func (x *WorkspaceProfile) GetAllowRegistration() bool { +func (x *WorkspaceProfile) GetDisallowSignup() bool { if x != nil { - return x.AllowRegistration + return x.DisallowSignup } return false } @@ -206,22 +216,23 @@ var file_api_v2_workspace_service_proto_rawDesc = []byte{ 0x63, 0x65, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xfd, 0x01, 0x0a, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8d, 0x02, 0x0a, 0x10, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, - 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, - 0x2d, 0x0a, 0x12, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x34, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x6f, 0x77, 0x6e, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, + 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, + 0x77, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x64, 0x69, 0x73, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x53, 0x69, 0x67, 0x6e, 0x75, 0x70, 0x12, 0x34, 0x0a, 0x16, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, - 0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, + 0x72, 0x64, 0x5f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x2b, 0x0a, 0x11, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, - 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x61, 0x6c, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, - 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, + 0x73, 0x74, 0x79, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x53, 0x74, 0x79, 0x6c, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x70, 0x61, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x6a, 0x0a, 0x1b, 0x47, 0x65, diff --git a/proto/gen/store/README.md b/proto/gen/store/README.md index 5164aa2fb41db..e8a4257e073fb 100644 --- a/proto/gen/store/README.md +++ b/proto/gen/store/README.md @@ -11,6 +11,11 @@ - [store/common.proto](#store_common-proto) - [RowStatus](#memos-store-RowStatus) +- [store/idp.proto](#store_idp-proto) + - [IdentityProviderConfig](#memos-store-IdentityProviderConfig) + - [IdentityProviderConfig.FieldMapping](#memos-store-IdentityProviderConfig-FieldMapping) + - [IdentityProviderConfig.OAuth2](#memos-store-IdentityProviderConfig-OAuth2) + - [store/inbox.proto](#store_inbox-proto) - [InboxMessage](#memos-store-InboxMessage) @@ -133,6 +138,75 @@ + +

Top

+ +## store/idp.proto + + + + + +### IdentityProviderConfig + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| oauth2 | [IdentityProviderConfig.OAuth2](#memos-store-IdentityProviderConfig-OAuth2) | | | + + + + + + + + +### IdentityProviderConfig.FieldMapping + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| identifier | [string](#string) | | | +| display_name | [string](#string) | | | +| email | [string](#string) | | | + + + + + + + + +### IdentityProviderConfig.OAuth2 + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| client_id | [string](#string) | | | +| client_secret | [string](#string) | | | +| auth_url | [string](#string) | | | +| token_url | [string](#string) | | | +| user_info_url | [string](#string) | | | +| scopes | [string](#string) | repeated | | +| field_mapping | [IdentityProviderConfig.FieldMapping](#memos-store-IdentityProviderConfig-FieldMapping) | | | + + + + + + + + + + + + + + +

Top

diff --git a/proto/gen/store/idp.pb.go b/proto/gen/store/idp.pb.go new file mode 100644 index 0000000000000..318e1cd97c362 --- /dev/null +++ b/proto/gen/store/idp.pb.go @@ -0,0 +1,388 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: store/idp.proto + +package store + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type IdentityProviderConfig struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Config: + // + // *IdentityProviderConfig_Oauth2 + Config isIdentityProviderConfig_Config `protobuf_oneof:"config"` +} + +func (x *IdentityProviderConfig) Reset() { + *x = IdentityProviderConfig{} + if protoimpl.UnsafeEnabled { + mi := &file_store_idp_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProviderConfig) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProviderConfig) ProtoMessage() {} + +func (x *IdentityProviderConfig) ProtoReflect() protoreflect.Message { + mi := &file_store_idp_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentityProviderConfig.ProtoReflect.Descriptor instead. +func (*IdentityProviderConfig) Descriptor() ([]byte, []int) { + return file_store_idp_proto_rawDescGZIP(), []int{0} +} + +func (m *IdentityProviderConfig) GetConfig() isIdentityProviderConfig_Config { + if m != nil { + return m.Config + } + return nil +} + +func (x *IdentityProviderConfig) GetOauth2() *IdentityProviderConfig_OAuth2 { + if x, ok := x.GetConfig().(*IdentityProviderConfig_Oauth2); ok { + return x.Oauth2 + } + return nil +} + +type isIdentityProviderConfig_Config interface { + isIdentityProviderConfig_Config() +} + +type IdentityProviderConfig_Oauth2 struct { + Oauth2 *IdentityProviderConfig_OAuth2 `protobuf:"bytes,1,opt,name=oauth2,proto3,oneof"` +} + +func (*IdentityProviderConfig_Oauth2) isIdentityProviderConfig_Config() {} + +type IdentityProviderConfig_FieldMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` + DisplayName string `protobuf:"bytes,2,opt,name=display_name,json=displayName,proto3" json:"display_name,omitempty"` + Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` +} + +func (x *IdentityProviderConfig_FieldMapping) Reset() { + *x = IdentityProviderConfig_FieldMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_store_idp_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProviderConfig_FieldMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProviderConfig_FieldMapping) ProtoMessage() {} + +func (x *IdentityProviderConfig_FieldMapping) ProtoReflect() protoreflect.Message { + mi := &file_store_idp_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentityProviderConfig_FieldMapping.ProtoReflect.Descriptor instead. +func (*IdentityProviderConfig_FieldMapping) Descriptor() ([]byte, []int) { + return file_store_idp_proto_rawDescGZIP(), []int{0, 0} +} + +func (x *IdentityProviderConfig_FieldMapping) GetIdentifier() string { + if x != nil { + return x.Identifier + } + return "" +} + +func (x *IdentityProviderConfig_FieldMapping) GetDisplayName() string { + if x != nil { + return x.DisplayName + } + return "" +} + +func (x *IdentityProviderConfig_FieldMapping) GetEmail() string { + if x != nil { + return x.Email + } + return "" +} + +type IdentityProviderConfig_OAuth2 struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ClientId string `protobuf:"bytes,1,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + ClientSecret string `protobuf:"bytes,2,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"` + AuthUrl string `protobuf:"bytes,3,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"` + TokenUrl string `protobuf:"bytes,4,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"` + UserInfoUrl string `protobuf:"bytes,5,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"` + Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"` + FieldMapping *IdentityProviderConfig_FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"` +} + +func (x *IdentityProviderConfig_OAuth2) Reset() { + *x = IdentityProviderConfig_OAuth2{} + if protoimpl.UnsafeEnabled { + mi := &file_store_idp_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *IdentityProviderConfig_OAuth2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdentityProviderConfig_OAuth2) ProtoMessage() {} + +func (x *IdentityProviderConfig_OAuth2) ProtoReflect() protoreflect.Message { + mi := &file_store_idp_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use IdentityProviderConfig_OAuth2.ProtoReflect.Descriptor instead. +func (*IdentityProviderConfig_OAuth2) Descriptor() ([]byte, []int) { + return file_store_idp_proto_rawDescGZIP(), []int{0, 1} +} + +func (x *IdentityProviderConfig_OAuth2) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetClientSecret() string { + if x != nil { + return x.ClientSecret + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetAuthUrl() string { + if x != nil { + return x.AuthUrl + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetTokenUrl() string { + if x != nil { + return x.TokenUrl + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetUserInfoUrl() string { + if x != nil { + return x.UserInfoUrl + } + return "" +} + +func (x *IdentityProviderConfig_OAuth2) GetScopes() []string { + if x != nil { + return x.Scopes + } + return nil +} + +func (x *IdentityProviderConfig_OAuth2) GetFieldMapping() *IdentityProviderConfig_FieldMapping { + if x != nil { + return x.FieldMapping + } + return nil +} + +var File_store_idp_proto protoreflect.FileDescriptor + +var file_store_idp_proto_rawDesc = []byte{ + 0x0a, 0x0f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x69, 0x64, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xe9, + 0x03, 0x0a, 0x16, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, + 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x44, 0x0a, 0x06, 0x6f, 0x61, 0x75, + 0x74, 0x68, 0x32, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, + 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x4f, + 0x41, 0x75, 0x74, 0x68, 0x32, 0x48, 0x00, 0x52, 0x06, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x1a, + 0x67, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, + 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x1a, 0x95, 0x02, 0x0a, 0x06, 0x4f, 0x41, 0x75, + 0x74, 0x68, 0x32, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, + 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, + 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, + 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x75, 0x74, 0x68, 0x55, 0x72, 0x6c, + 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x55, 0x72, 0x6c, 0x12, 0x22, 0x0a, + 0x0d, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x55, 0x72, + 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x55, 0x0a, 0x0d, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x30, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x49, + 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, + 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, + 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x42, 0x93, 0x01, 0x0a, 0x0f, 0x63, + 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x08, + 0x49, 0x64, 0x70, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x75, 0x73, 0x65, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, + 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, + 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x4d, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x4d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x4d, 0x65, 0x6d, 0x6f, + 0x73, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x5c, + 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x0c, 0x4d, 0x65, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_store_idp_proto_rawDescOnce sync.Once + file_store_idp_proto_rawDescData = file_store_idp_proto_rawDesc +) + +func file_store_idp_proto_rawDescGZIP() []byte { + file_store_idp_proto_rawDescOnce.Do(func() { + file_store_idp_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_idp_proto_rawDescData) + }) + return file_store_idp_proto_rawDescData +} + +var file_store_idp_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_store_idp_proto_goTypes = []interface{}{ + (*IdentityProviderConfig)(nil), // 0: memos.store.IdentityProviderConfig + (*IdentityProviderConfig_FieldMapping)(nil), // 1: memos.store.IdentityProviderConfig.FieldMapping + (*IdentityProviderConfig_OAuth2)(nil), // 2: memos.store.IdentityProviderConfig.OAuth2 +} +var file_store_idp_proto_depIdxs = []int32{ + 2, // 0: memos.store.IdentityProviderConfig.oauth2:type_name -> memos.store.IdentityProviderConfig.OAuth2 + 1, // 1: memos.store.IdentityProviderConfig.OAuth2.field_mapping:type_name -> memos.store.IdentityProviderConfig.FieldMapping + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_store_idp_proto_init() } +func file_store_idp_proto_init() { + if File_store_idp_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_store_idp_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProviderConfig); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_idp_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProviderConfig_FieldMapping); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_store_idp_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*IdentityProviderConfig_OAuth2); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_store_idp_proto_msgTypes[0].OneofWrappers = []interface{}{ + (*IdentityProviderConfig_Oauth2)(nil), + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_store_idp_proto_rawDesc, + NumEnums: 0, + NumMessages: 3, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_store_idp_proto_goTypes, + DependencyIndexes: file_store_idp_proto_depIdxs, + MessageInfos: file_store_idp_proto_msgTypes, + }.Build() + File_store_idp_proto = out.File + file_store_idp_proto_rawDesc = nil + file_store_idp_proto_goTypes = nil + file_store_idp_proto_depIdxs = nil +} diff --git a/proto/store/idp.proto b/proto/store/idp.proto new file mode 100644 index 0000000000000..b60c7cedafc7f --- /dev/null +++ b/proto/store/idp.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package memos.store; + +option go_package = "gen/store"; + +message IdentityProviderConfig { + message FieldMapping { + string identifier = 1; + string display_name = 2; + string email = 3; + } + + message OAuth2 { + string client_id = 1; + string client_secret = 2; + string auth_url = 3; + string token_url = 4; + string user_info_url = 5; + repeated string scopes = 6; + FieldMapping field_mapping = 7; + } + + oneof config { + OAuth2 oauth2 = 1; + } +} diff --git a/server/integration/telegram.go b/server/integration/telegram.go index 20f85ac897d45..c19e7cbb03572 100644 --- a/server/integration/telegram.go +++ b/server/integration/telegram.go @@ -74,9 +74,9 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot, } create := &store.Memo{ - ResourceName: shortuuid.New(), - CreatorID: creatorID, - Visibility: store.Private, + UID: shortuuid.New(), + CreatorID: creatorID, + Visibility: store.Private, } if message.Text != nil { create.Content = convertToMarkdown(*message.Text, message.Entities) @@ -121,12 +121,12 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot, for _, attachment := range attachments { // Fill the common field of create create := store.Resource{ - ResourceName: shortuuid.New(), - CreatorID: creatorID, - Filename: filepath.Base(attachment.FileName), - Type: attachment.GetMimeType(), - Size: attachment.FileSize, - MemoID: &memoMessage.ID, + UID: shortuuid.New(), + CreatorID: creatorID, + Filename: filepath.Base(attachment.FileName), + Type: attachment.GetMimeType(), + Size: attachment.FileSize, + MemoID: &memoMessage.ID, } err := apiv1.SaveResourceBlob(ctx, t.store, &create, bytes.NewReader(attachment.Data)) diff --git a/server/profile/profile.go b/server/profile/profile.go index bd22193f8b7a2..d9d15c27fc3a2 100644 --- a/server/profile/profile.go +++ b/server/profile/profile.go @@ -32,6 +32,8 @@ type Profile struct { Version string `json:"version"` // Frontend indicate the frontend is enabled or not Frontend bool `json:"-"` + // Origins is the list of allowed origins + Origins []string `json:"-"` } func (p *Profile) IsDev() bool { @@ -51,11 +53,9 @@ func checkDataDir(dataDir string) (string, error) { // Trim trailing \ or / in case user supplies dataDir = strings.TrimRight(dataDir, "\\/") - if _, err := os.Stat(dataDir); err != nil { return "", errors.Wrapf(err, "unable to access data folder %s", dataDir) } - return dataDir, nil } diff --git a/server/route/api/v1/auth.go b/server/route/api/v1/auth.go index 2912ffa744533..2e5ed1a831ae4 100644 --- a/server/route/api/v1/auth.go +++ b/server/route/api/v1/auth.go @@ -269,7 +269,7 @@ func (s *APIV1Service) SignUp(c echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusBadRequest, "Failed to find users").SetInternal(err) } - if !util.ResourceNameMatcher.MatchString(strings.ToLower(signup.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(signup.Username)) { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid username %s", signup.Username)).SetInternal(err) } diff --git a/server/route/api/v1/memo.go b/server/route/api/v1/memo.go index 90f01f084afb8..08003ea014437 100644 --- a/server/route/api/v1/memo.go +++ b/server/route/api/v1/memo.go @@ -827,7 +827,7 @@ func (s *APIV1Service) UpdateMemo(c echo.Context) error { func (s *APIV1Service) convertMemoFromStore(ctx context.Context, memo *store.Memo) (*Memo, error) { memoMessage := &Memo{ ID: memo.ID, - Name: memo.ResourceName, + Name: memo.UID, RowStatus: RowStatus(memo.RowStatus.String()), CreatorID: memo.CreatorID, CreatedTs: memo.CreatedTs, @@ -921,11 +921,11 @@ func convertCreateMemoRequestToMemoMessage(memoCreate *CreateMemoRequest) *store createdTs = *memoCreate.CreatedTs } return &store.Memo{ - ResourceName: shortuuid.New(), - CreatorID: memoCreate.CreatorID, - CreatedTs: createdTs, - Content: memoCreate.Content, - Visibility: store.Visibility(memoCreate.Visibility), + UID: shortuuid.New(), + CreatorID: memoCreate.CreatorID, + CreatedTs: createdTs, + Content: memoCreate.Content, + Visibility: store.Visibility(memoCreate.Visibility), } } diff --git a/server/route/api/v1/resource.go b/server/route/api/v1/resource.go index 6f51169533ae7..eb1eeb4be2f61 100644 --- a/server/route/api/v1/resource.go +++ b/server/route/api/v1/resource.go @@ -26,6 +26,7 @@ import ( type Resource struct { ID int32 `json:"id"` Name string `json:"name"` + UID string `json:"uid"` // Standard fields CreatorID int32 `json:"creatorId"` @@ -138,7 +139,7 @@ func (s *APIV1Service) CreateResource(c echo.Context) error { } create := &store.Resource{ - ResourceName: shortuuid.New(), + UID: shortuuid.New(), CreatorID: userID, Filename: request.Filename, ExternalLink: request.ExternalLink, @@ -220,11 +221,11 @@ func (s *APIV1Service) UploadResource(c echo.Context) error { defer sourceFile.Close() create := &store.Resource{ - ResourceName: shortuuid.New(), - CreatorID: userID, - Filename: file.Filename, - Type: file.Header.Get("Content-Type"), - Size: file.Size, + UID: shortuuid.New(), + CreatorID: userID, + Filename: file.Filename, + Type: file.Header.Get("Content-Type"), + Size: file.Size, } err = SaveResourceBlob(ctx, s.Store, create, sourceFile) if err != nil { @@ -371,7 +372,8 @@ func replacePathTemplate(path, filename string) string { func convertResourceFromStore(resource *store.Resource) *Resource { return &Resource{ ID: resource.ID, - Name: resource.ResourceName, + Name: fmt.Sprintf("resources/%d", resource.ID), + UID: resource.UID, CreatorID: resource.CreatorID, CreatedTs: resource.CreatedTs, UpdatedTs: resource.UpdatedTs, diff --git a/server/route/api/v1/tag.go b/server/route/api/v1/tag.go index e75416a2ef575..72da0ccc03173 100644 --- a/server/route/api/v1/tag.go +++ b/server/route/api/v1/tag.go @@ -5,10 +5,10 @@ import ( "fmt" "net/http" "regexp" + "slices" "sort" "github.com/labstack/echo/v4" - "golang.org/x/exp/slices" "github.com/usememos/memos/store" ) diff --git a/server/route/api/v1/user.go b/server/route/api/v1/user.go index 1f56fc2b63b5a..f613203cd7ec4 100644 --- a/server/route/api/v1/user.go +++ b/server/route/api/v1/user.go @@ -157,7 +157,7 @@ func (s *APIV1Service) CreateUser(c echo.Context) error { if err := userCreate.Validate(); err != nil { return echo.NewHTTPError(http.StatusBadRequest, "Invalid user create format").SetInternal(err) } - if !util.ResourceNameMatcher.MatchString(strings.ToLower(userCreate.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(userCreate.Username)) { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid username %s", userCreate.Username)).SetInternal(err) } // Disallow host user to be created. @@ -314,14 +314,6 @@ func (s *APIV1Service) DeleteUser(c echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, "Cannot delete current user") } - findUser, err := s.Store.GetUser(ctx, &store.FindUser{ID: &userID}) - if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user").SetInternal(err) - } - if s.Profile.Mode == "demo" && findUser.Username == "memos-demo" { - return echo.NewHTTPError(http.StatusForbidden, "Unauthorized to delete this user in demo mode") - } - if err := s.Store.DeleteUser(ctx, &store.DeleteUser{ ID: userID, }); err != nil { @@ -372,10 +364,6 @@ func (s *APIV1Service) UpdateUser(c echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, "Invalid update user request").SetInternal(err) } - if s.Profile.Mode == "demo" && *request.Username == "memos-demo" { - return echo.NewHTTPError(http.StatusForbidden, "Unauthorized to update user in demo mode") - } - currentTs := time.Now().Unix() userUpdate := &store.UpdateUser{ ID: userID, @@ -389,7 +377,7 @@ func (s *APIV1Service) UpdateUser(c echo.Context) error { } } if request.Username != nil { - if !util.ResourceNameMatcher.MatchString(strings.ToLower(*request.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(*request.Username)) { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid username %s", *request.Username)).SetInternal(err) } userUpdate.Username = request.Username diff --git a/server/route/api/v2/acl_config.go b/server/route/api/v2/acl_config.go index 0ed4fbaa41df5..2eb845b5dac98 100644 --- a/server/route/api/v2/acl_config.go +++ b/server/route/api/v2/acl_config.go @@ -1,7 +1,5 @@ package v2 -import "strings" - var authenticationAllowlistMethods = map[string]bool{ "/memos.api.v2.WorkspaceService/GetWorkspaceProfile": true, "/memos.api.v2.WorkspaceSettingService/GetWorkspaceSetting": true, @@ -11,19 +9,18 @@ var authenticationAllowlistMethods = map[string]bool{ "/memos.api.v2.AuthService/SignOut": true, "/memos.api.v2.AuthService/SignUp": true, "/memos.api.v2.UserService/GetUser": true, + "/memos.api.v2.UserService/SearchUsers": true, "/memos.api.v2.MemoService/ListMemos": true, "/memos.api.v2.MemoService/GetMemo": true, - "/memos.api.v2.MemoService/GetMemoByName": true, + "/memos.api.v2.MemoService/SearchMemos": true, "/memos.api.v2.MemoService/ListMemoResources": true, "/memos.api.v2.MemoService/ListMemoRelations": true, "/memos.api.v2.MemoService/ListMemoComments": true, + "/memos.api.v2.LinkService/GetLinkMetadata": true, } // isUnauthorizeAllowedMethod returns whether the method is exempted from authentication. func isUnauthorizeAllowedMethod(fullMethodName string) bool { - if strings.HasPrefix(fullMethodName, "/grpc.reflection") { - return true - } return authenticationAllowlistMethods[fullMethodName] } diff --git a/server/route/api/v2/apidocs.swagger.md b/server/route/api/v2/apidocs.swagger.md index ee03dcf99c332..57a000981a82b 100644 --- a/server/route/api/v2/apidocs.swagger.md +++ b/server/route/api/v2/apidocs.swagger.md @@ -143,6 +143,24 @@ UpdateInbox updates an inbox. ### /api/v2/{name_1} +#### GET +##### Summary + +GetResource returns a resource by name. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| name_1 | path | | Yes | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2GetResourceResponse](#v2getresourceresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + #### DELETE ##### Summary @@ -161,6 +179,25 @@ DeleteInbox deletes an inbox. | 200 | A successful response. | [v2DeleteInboxResponse](#v2deleteinboxresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | +--- +## LinkService + +### /api/v2/link_metadata + +#### GET +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| link | query | | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2GetLinkMetadataResponse](#v2getlinkmetadataresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + --- ## MemoService @@ -177,7 +214,7 @@ ListMemos lists memos with pagination and filter. | ---- | ---------- | ----------- | -------- | ------ | | pageSize | query | The maximum number of memos to return. | No | integer | | pageToken | query | A page token, received from a previous `ListMemos` call. Provide this to retrieve the subsequent page. | No | string | -| filter | query | Filter is used to filter memos returned in the list. Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | +| filter | query | Filter is used to filter memos returned in the list. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | ##### Responses @@ -204,60 +241,101 @@ CreateMemo creates a memo. | 200 | A successful response. | [v2CreateMemoResponse](#v2creatememoresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/name/{name} +### /api/v2/memos/stats #### GET ##### Summary -GetMemoByName gets a memo by name. +GetUserMemosStats gets stats of memos for a user. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | | Yes | string | +| name | query | name is the name of the user to get stats for. Format: users/{id} | No | string | +| timezone | query | timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | No | string | +| filter | query | Same as ListMemosRequest.filter | No | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetMemoByNameResponse](#v2getmemobynameresponse) | +| 200 | A successful response. | [v2GetUserMemosStatsResponse](#v2getusermemosstatsresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/stats +### /api/v2/memos:export -#### GET +#### POST ##### Summary -GetUserMemosStats gets stats of memos for a user. +ExportMemos exports memos. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | query | name is the name of the user to get stats for. Format: users/{username} | No | string | -| timezone | query | timezone location Format: uses tz identifier https://en.wikipedia.org/wiki/List_of_tz_database_time_zones | No | string | | filter | query | Same as ListMemosRequest.filter | No | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetUserMemosStatsResponse](#v2getusermemosstatsresponse) | +| 200 | A successful response. | [v2ExportMemosResponse](#v2exportmemosresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id} +### /api/v2/memos:search #### GET ##### Summary -GetMemo gets a memo by id. +SearchMemos searches memos. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| filter | query | Filter is used to filter memos returned. Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2SearchMemosResponse](#v2searchmemosresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + +### /api/v2/{memo.name} + +#### PATCH +##### Summary + +UpdateMemo updates a memo. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| memo.name | path | The name of the memo. Format: memos/{id} id is the system generated id. | Yes | string | +| memo | body | | Yes | { **"uid"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"creator"**: string, **"createTime"**: dateTime, **"updateTime"**: dateTime, **"displayTime"**: dateTime, **"content"**: string, **"visibility"**: [v2Visibility](#v2visibility), **"pinned"**: boolean, **"parentId"**: integer, **"resources"**: [ [v2Resource](#v2resource) ], **"relations"**: [ [v2MemoRelation](#v2memorelation) ], **"reactions"**: [ [apiv2Reaction](#apiv2reaction) ] } | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2UpdateMemoResponse](#v2updatememoresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + +### /api/v2/{name_2} + +#### GET +##### Summary + +GetMemo gets a memo. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| name_2 | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -269,13 +347,33 @@ GetMemo gets a memo by id. #### DELETE ##### Summary -DeleteMemo deletes a memo by id. +DeleteResource deletes a resource by name. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name_2 | path | | Yes | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2DeleteResourceResponse](#v2deleteresourceresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + +### /api/v2/{name_3} + +#### DELETE +##### Summary + +DeleteMemo deletes a memo. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| name_3 | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -284,7 +382,7 @@ DeleteMemo deletes a memo by id. | 200 | A successful response. | [v2DeleteMemoResponse](#v2deletememoresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/comments +### /api/v2/{name}/comments #### GET ##### Summary @@ -295,7 +393,7 @@ ListMemoComments lists comments for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -313,9 +411,9 @@ CreateMemoComment creates a comment for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | id is the memo id to create comment for. | Yes | integer | -| create.content | query | | No | string | -| create.visibility | query | | No | string | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | +| comment.content | query | | No | string | +| comment.visibility | query | | No | string | ##### Responses @@ -324,7 +422,7 @@ CreateMemoComment creates a comment for a memo. | 200 | A successful response. | [v2CreateMemoCommentResponse](#v2creatememocommentresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/reactions +### /api/v2/{name}/reactions #### GET ##### Summary @@ -335,7 +433,7 @@ ListMemoReactions lists reactions for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -353,9 +451,9 @@ UpsertMemoReaction upserts a reaction for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | reaction.id | query | | No | integer | -| reaction.creator | query | | No | string | +| reaction.creator | query | The name of the creator. Format: users/{id} | No | string | | reaction.contentId | query | | No | string | | reaction.reactionType | query | | No | string | @@ -366,7 +464,7 @@ UpsertMemoReaction upserts a reaction for a memo. | 200 | A successful response. | [v2UpsertMemoReactionResponse](#v2upsertmemoreactionresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/reactions/{reactionId} +### /api/v2/{name}/reactions/{reactionId} #### DELETE ##### Summary @@ -377,7 +475,7 @@ DeleteMemoReaction deletes a reaction for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | reactionId | path | | Yes | integer | ##### Responses @@ -387,7 +485,7 @@ DeleteMemoReaction deletes a reaction for a memo. | 200 | A successful response. | [v2DeleteMemoReactionResponse](#v2deletememoreactionresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/relations +### /api/v2/{name}/relations #### GET ##### Summary @@ -398,7 +496,7 @@ ListMemoRelations lists relations for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -416,7 +514,7 @@ SetMemoRelations sets relations for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | body | body | | Yes | [MemoServiceSetMemoRelationsBody](#memoservicesetmemorelationsbody) | ##### Responses @@ -426,7 +524,7 @@ SetMemoRelations sets relations for a memo. | 200 | A successful response. | [v2SetMemoRelationsResponse](#v2setmemorelationsresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{id}/resources +### /api/v2/{name}/resources #### GET ##### Summary @@ -437,7 +535,7 @@ ListMemoResources lists resources for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses @@ -455,7 +553,7 @@ SetMemoResources sets resources for a memo. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name | path | The name of the memo. Format: memos/{id} | Yes | string | | body | body | | Yes | [MemoServiceSetMemoResourcesBody](#memoservicesetmemoresourcesbody) | ##### Responses @@ -465,135 +563,132 @@ SetMemoResources sets resources for a memo. | 200 | A successful response. | [v2SetMemoResourcesResponse](#v2setmemoresourcesresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos/{memo.id} - -#### PATCH -##### Summary +--- +## ResourceService -UpdateMemo updates a memo. +### /api/v2/resources -##### Parameters +#### GET +##### Summary -| Name | Located in | Description | Required | Schema | -| ---- | ---------- | ----------- | -------- | ------ | -| memo.id | path | id is the system generated unique identifier. | Yes | integer | -| memo | body | | Yes | { **"name"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"creator"**: string, **"creatorId"**: integer, **"createTime"**: dateTime, **"updateTime"**: dateTime, **"displayTime"**: dateTime, **"content"**: string, **"visibility"**: [v2Visibility](#v2visibility), **"pinned"**: boolean, **"parentId"**: integer, **"resources"**: [ [v2Resource](#v2resource) ], **"relations"**: [ [v2MemoRelation](#v2memorelation) ], **"reactions"**: [ [apiv2Reaction](#apiv2reaction) ] } | +ListResources lists all resources. ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2UpdateMemoResponse](#v2updatememoresponse) | +| 200 | A successful response. | [v2ListResourcesResponse](#v2listresourcesresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/memos:export - #### POST ##### Summary -ExportMemos exports memos. +CreateResource creates a new resource. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| filter | query | Same as ListMemosRequest.filter | No | string | +| filename | query | | No | string | +| externalLink | query | | No | string | +| type | query | | No | string | +| memoId | query | | No | integer | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2ExportMemosResponse](#v2exportmemosresponse) | +| 200 | A successful response. | [v2CreateResourceResponse](#v2createresourceresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | ---- -## ResourceService - -### /api/v2/resources +### /api/v2/resources:search #### GET ##### Summary -ListResources lists all resources. +SearchResources searches memos. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| filter | query | | No | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2ListResourcesResponse](#v2listresourcesresponse) | +| 200 | A successful response. | [v2SearchResourcesResponse](#v2searchresourcesresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -#### POST +### /api/v2/{name_1} + +#### GET ##### Summary -CreateResource creates a new resource. +GetResource returns a resource by name. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| filename | query | | No | string | -| externalLink | query | | No | string | -| type | query | | No | string | -| memoId | query | | No | integer | +| name_1 | path | | Yes | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2CreateResourceResponse](#v2createresourceresponse) | +| 200 | A successful response. | [v2GetResourceResponse](#v2getresourceresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/resources/name/{name} - -#### GET +#### DELETE ##### Summary -GetResourceByName returns a resource by name. +DeleteInbox deletes an inbox. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | | Yes | string | +| name_1 | path | The name of the inbox to delete. Format: inboxes/{uid} | Yes | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetResourceByNameResponse](#v2getresourcebynameresponse) | +| 200 | A successful response. | [v2DeleteInboxResponse](#v2deleteinboxresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/resources/{id} +### /api/v2/{name_2} #### GET ##### Summary -GetResource returns a resource by id. +GetMemo gets a memo. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name_2 | path | The name of the memo. Format: memos/{id} | Yes | string | ##### Responses | Code | Description | Schema | | ---- | ----------- | ------ | -| 200 | A successful response. | [v2GetResourceResponse](#v2getresourceresponse) | +| 200 | A successful response. | [v2GetMemoResponse](#v2getmemoresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | #### DELETE ##### Summary -DeleteResource deletes a resource by id. +DeleteResource deletes a resource by name. ##### Parameters | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| id | path | | Yes | integer | +| name_2 | path | | Yes | string | ##### Responses @@ -602,7 +697,7 @@ DeleteResource deletes a resource by id. | 200 | A successful response. | [v2DeleteResourceResponse](#v2deleteresourceresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | -### /api/v2/resources/{resource.id} +### /api/v2/{resource.name} #### PATCH ##### Summary @@ -613,8 +708,8 @@ UpdateResource updates a resource. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| resource.id | path | id is the system generated unique identifier. | Yes | integer | -| resource | body | | Yes | { **"name"**: string, **"createTime"**: dateTime, **"filename"**: string, **"externalLink"**: string, **"type"**: string, **"size"**: string (int64), **"memoId"**: integer } | +| resource.name | path | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | Yes | string | +| resource | body | | Yes | { **"uid"**: string, **"createTime"**: dateTime, **"filename"**: string, **"externalLink"**: string, **"type"**: string, **"size"**: string (int64), **"memoId"**: integer } | ##### Responses @@ -637,7 +732,7 @@ ListTags lists tags. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{id} | No | string | ##### Responses @@ -656,7 +751,7 @@ DeleteTag deletes a tag. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | | tag.name | query | | No | string | -| tag.creator | query | The creator of tags. Format: users/{username} | No | string | +| tag.creator | query | The creator of tags. Format: users/{id} | No | string | ##### Responses @@ -694,7 +789,7 @@ GetTagSuggestions gets tag suggestions from the user's memos. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{id} | No | string | ##### Responses @@ -729,7 +824,7 @@ All related memos will be updated. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user | query | The creator of tags. Format: users/{username} | No | string | +| user | query | The creator of tags. Format: users/{id} | No | string | | oldName | query | | No | string | | newName | query | | No | string | @@ -775,6 +870,26 @@ CreateUser creates a new user. | 200 | A successful response. | [v2CreateUserResponse](#v2createuserresponse) | | default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | +### /api/v2/users:search + +#### GET +##### Summary + +SearchUsers searches users by filter. + +##### Parameters + +| Name | Located in | Description | Required | Schema | +| ---- | ---------- | ----------- | -------- | ------ | +| filter | query | | No | string | + +##### Responses + +| Code | Description | Schema | +| ---- | ----------- | ------ | +| 200 | A successful response. | [v2SearchUsersResponse](#v2searchusersresponse) | +| default | An unexpected error response. | [googlerpcStatus](#googlerpcstatus) | + ### /api/v2/{name} #### GET @@ -786,7 +901,7 @@ GetUser gets a user by name. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -804,7 +919,7 @@ DeleteUser deletes a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -824,7 +939,7 @@ ListUserAccessTokens returns a list of access tokens for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -842,7 +957,7 @@ CreateUserAccessToken creates a new access token for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | | body | body | | Yes | [UserServiceCreateUserAccessTokenBody](#userservicecreateuseraccesstokenbody) | ##### Responses @@ -863,7 +978,7 @@ DeleteUserAccessToken deletes an access token for a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | | accessToken | path | access_token is the access token to delete. | Yes | string | ##### Responses @@ -884,7 +999,7 @@ GetUserSetting gets the setting of a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| name | path | The name of the user. Format: users/{username} | Yes | string | +| name | path | The name of the user. Format: users/{id} | Yes | string | ##### Responses @@ -904,8 +1019,8 @@ UpdateUserSetting updates the setting of a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| setting.name | path | The name of the user. Format: users/{username} | Yes | string | -| setting | body | | Yes | { **"locale"**: string, **"appearance"**: string, **"memoVisibility"**: string, **"telegramUserId"**: string, **"compactView"**: boolean } | +| setting.name | path | The name of the user. Format: users/{id} | Yes | string | +| setting | body | | Yes | { **"locale"**: string, **"appearance"**: string, **"memoVisibility"**: string, **"telegramUserId"**: string } | ##### Responses @@ -925,8 +1040,8 @@ UpdateUser updates a user. | Name | Located in | Description | Required | Schema | | ---- | ---------- | ----------- | -------- | ------ | -| user.name | path | The name of the user. Format: users/{username} | Yes | string | -| user | body | | Yes | { **"id"**: integer, **"role"**: [UserRole](#userrole), **"username"**: string, **"email"**: string, **"nickname"**: string, **"avatarUrl"**: string, **"password"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"createTime"**: dateTime, **"updateTime"**: dateTime } | +| user.name | path | The name of the user. Format: users/{id} | Yes | string | +| user | body | | Yes | { **"id"**: integer, **"role"**: [UserRole](#userrole), **"username"**: string, **"email"**: string, **"nickname"**: string, **"avatarUrl"**: string, **"description"**: string, **"password"**: string, **"rowStatus"**: [apiv2RowStatus](#apiv2rowstatus), **"createTime"**: dateTime, **"updateTime"**: dateTime } | ##### Responses @@ -1197,7 +1312,6 @@ GetActivity returns the activity with the given id. | appearance | string | The preferred appearance of the user. | No | | memoVisibility | string | The default visibility of the memo. | No | | telegramUserId | string | The telegram user id of the user. | No | -| compactView | boolean | The compact view for a memo. | No | #### apiv2Webhook @@ -1375,11 +1489,11 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | user | [v2User](#v2user) | | No | -#### v2GetMemoByNameResponse +#### v2GetLinkMetadataResponse | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| memo | [v2Memo](#v2memo) | | No | +| linkMetadata | [v2LinkMetadata](#v2linkmetadata) | | No | #### v2GetMemoResponse @@ -1387,12 +1501,6 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | memo | [v2Memo](#v2memo) | | No | -#### v2GetResourceByNameResponse - -| Name | Type | Description | Required | -| ---- | ---- | ----------- | -------- | -| resource | [v2Resource](#v2resource) | | No | - #### v2GetResourceResponse | Name | Type | Description | Required | @@ -1465,6 +1573,14 @@ GetActivity returns the activity with the given id. | ---- | ---- | ----------- | -------- | | v2InboxType | string | | | +#### v2LinkMetadata + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| title | string | | No | +| description | string | | No | +| image | string | | No | + #### v2ListInboxesResponse | Name | Type | Description | Required | @@ -1536,11 +1652,10 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| id | integer | id is the system generated unique identifier. | No | -| name | string | name is the user provided name. | No | +| name | string | The name of the memo. Format: memos/{id} id is the system generated id. | No | +| uid | string | The user defined id of the memo. | No | | rowStatus | [apiv2RowStatus](#apiv2rowstatus) | | No | | creator | string | | No | -| creatorId | integer | | No | | createTime | dateTime | | No | | updateTime | dateTime | | No | | displayTime | dateTime | | No | @@ -1556,8 +1671,8 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| memoId | integer | | No | -| relatedMemoId | integer | | No | +| memo | string | | No | +| relatedMemo | string | | No | | type | [v2MemoRelationType](#v2memorelationtype) | | No | #### v2MemoRelationType @@ -1576,8 +1691,8 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | -| id | integer | id is the system generated unique identifier. | No | -| name | string | name is the user provided name. | No | +| name | string | The name of the resource. Format: resources/{id} id is the system generated unique identifier. | No | +| uid | string | The user defined id of the resource. | No | | createTime | dateTime | | No | | filename | string | | No | | externalLink | string | | No | @@ -1585,6 +1700,24 @@ GetActivity returns the activity with the given id. | size | string (int64) | | No | | memoId | integer | | No | +#### v2SearchMemosResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| memos | [ [v2Memo](#v2memo) ] | | No | + +#### v2SearchResourcesResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| resources | [ [v2Resource](#v2resource) ] | | No | + +#### v2SearchUsersResponse + +| Name | Type | Description | Required | +| ---- | ---- | ----------- | -------- | +| users | [ [v2User](#v2user) ] | | No | + #### v2SetMemoRelationsResponse | Name | Type | Description | Required | @@ -1693,12 +1826,13 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | | name | string | | No | -| id | integer | | No | +| id | integer | The system generated uid of the user. | No | | role | [UserRole](#userrole) | | No | | username | string | | No | | email | string | | No | | nickname | string | | No | | avatarUrl | string | | No | +| description | string | | No | | password | string | | No | | rowStatus | [apiv2RowStatus](#apiv2rowstatus) | | No | | createTime | dateTime | | No | @@ -1723,9 +1857,10 @@ GetActivity returns the activity with the given id. | Name | Type | Description | Required | | ---- | ---- | ----------- | -------- | +| owner | string | | No | | version | string | | No | | mode | string | mode is the instance mode (e.g. "prod", "dev" or "demo"). | No | -| allowRegistration | boolean | allow_registration is whether the registration is allowed. | No | -| disablePasswordLogin | boolean | allow_password_login is whether the password login is allowed. | No | +| disallowSignup | boolean | disallow_signup is whether the signup is disallowed. | No | +| disablePasswordLogin | boolean | disable_password_login is whether the password login is disabled. | No | | additionalScript | string | additional_script is the additional script. | No | | additionalStyle | string | additional_style is the additional style. | No | diff --git a/server/route/api/v2/apidocs.swagger.yaml b/server/route/api/v2/apidocs.swagger.yaml index a495910fa64bd..a6ec1eb0519af 100644 --- a/server/route/api/v2/apidocs.swagger.yaml +++ b/server/route/api/v2/apidocs.swagger.yaml @@ -6,6 +6,7 @@ tags: - name: ActivityService - name: UserService - name: AuthService + - name: IdentityProviderService - name: InboxService - name: LinkService - name: ResourceService @@ -130,6 +131,96 @@ paths: $ref: '#/definitions/googlerpcStatus' tags: - AuthService + /api/v2/identityProviders: + get: + operationId: IdentityProviderService_ListIdentityProviders + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2ListIdentityProvidersResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - IdentityProviderService + post: + operationId: IdentityProviderService_CreateIdentityProvider + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2CreateIdentityProviderResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: identityProvider.name + description: |- + The name of the identityProvider. + Format: identityProviders/{id} + in: query + required: false + type: string + - name: identityProvider.type + in: query + required: false + type: string + enum: + - TYPE_UNSPECIFIED + - OAUTH2 + default: TYPE_UNSPECIFIED + - name: identityProvider.title + in: query + required: false + type: string + - name: identityProvider.identifierFilter + in: query + required: false + type: string + - name: identityProvider.config.oauth2.clientId + in: query + required: false + type: string + - name: identityProvider.config.oauth2.clientSecret + in: query + required: false + type: string + - name: identityProvider.config.oauth2.authUrl + in: query + required: false + type: string + - name: identityProvider.config.oauth2.tokenUrl + in: query + required: false + type: string + - name: identityProvider.config.oauth2.userInfoUrl + in: query + required: false + type: string + - name: identityProvider.config.oauth2.scopes + in: query + required: false + type: array + items: + type: string + collectionFormat: multi + - name: identityProvider.config.oauth2.fieldMapping.identifier + in: query + required: false + type: string + - name: identityProvider.config.oauth2.fieldMapping.displayName + in: query + required: false + type: string + - name: identityProvider.config.oauth2.fieldMapping.email + in: query + required: false + type: string + tags: + - IdentityProviderService /api/v2/inboxes: get: summary: ListInboxes lists inboxes for a user. @@ -145,12 +236,31 @@ paths: $ref: '#/definitions/googlerpcStatus' parameters: - name: user - description: 'Format: users/{username}' + description: 'Format: users/{id}' in: query required: false type: string tags: - InboxService + /api/v2/link_metadata: + get: + operationId: LinkService_GetLinkMetadata + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2GetLinkMetadataResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: link + in: query + required: false + type: string + tags: + - LinkService /api/v2/memos: get: summary: ListMemos lists memos with pagination and filter. @@ -181,7 +291,7 @@ paths: - name: filter description: |- Filter is used to filter memos returned in the list. - Format: "creator == users/{username} && visibilities == ['PUBLIC', 'PROTECTED']" + Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" in: query required: false type: string @@ -207,26 +317,6 @@ paths: $ref: '#/definitions/v2CreateMemoRequest' tags: - MemoService - /api/v2/memos/name/{name}: - get: - summary: GetMemoByName gets a memo by name. - operationId: MemoService_GetMemoByName - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2GetMemoByNameResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: name - in: path - required: true - type: string - tags: - - MemoService /api/v2/memos/stats: get: summary: GetUserMemosStats gets stats of memos for a user. @@ -244,7 +334,7 @@ paths: - name: name description: |- name is the name of the user to get stats for. - Format: users/{username} + Format: users/{id} in: query required: false type: string @@ -263,888 +353,992 @@ paths: type: string tags: - MemoService - /api/v2/memos/{id}: - get: - summary: GetMemo gets a memo by id. - operationId: MemoService_GetMemo - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2GetMemoResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - parameters: - - name: id - in: path - required: true - type: integer - format: int32 - tags: - - MemoService - delete: - summary: DeleteMemo deletes a memo by id. - operationId: MemoService_DeleteMemo + /api/v2/memos:export: + post: + summary: ExportMemos exports memos. + operationId: MemoService_ExportMemos responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteMemoResponse' + $ref: '#/definitions/v2ExportMemosResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: filter + description: Same as ListMemosRequest.filter + in: query + required: false + type: string tags: - MemoService - /api/v2/memos/{id}/comments: + /api/v2/memos:search: get: - summary: ListMemoComments lists comments for a memo. - operationId: MemoService_ListMemoComments + summary: SearchMemos searches memos. + operationId: MemoService_SearchMemos responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoCommentsResponse' + $ref: '#/definitions/v2SearchMemosResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: filter + description: |- + Filter is used to filter memos returned. + Format: "creator == users/{uid} && visibilities == ['PUBLIC', 'PROTECTED']" + in: query + required: false + type: string tags: - MemoService - post: - summary: CreateMemoComment creates a comment for a memo. - operationId: MemoService_CreateMemoComment + /api/v2/reactions/{reactionId}: + delete: + summary: DeleteMemoReaction deletes a reaction for a memo. + operationId: MemoService_DeleteMemoReaction responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateMemoCommentResponse' + $ref: '#/definitions/v2DeleteMemoReactionResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - description: id is the memo id to create comment for. + - name: reactionId in: path required: true type: integer format: int32 - - name: create.content - in: query - required: false - type: string - - name: create.visibility - in: query - required: false - type: string - enum: - - VISIBILITY_UNSPECIFIED - - PRIVATE - - PROTECTED - - PUBLIC - default: VISIBILITY_UNSPECIFIED tags: - MemoService - /api/v2/memos/{id}/reactions: + /api/v2/resources: get: - summary: ListMemoReactions lists reactions for a memo. - operationId: MemoService_ListMemoReactions + summary: ListResources lists all resources. + operationId: ResourceService_ListResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoReactionsResponse' + $ref: '#/definitions/v2ListResourcesResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' - parameters: - - name: id - in: path - required: true - type: integer - format: int32 tags: - - MemoService + - ResourceService post: - summary: UpsertMemoReaction upserts a reaction for a memo. - operationId: MemoService_UpsertMemoReaction + summary: CreateResource creates a new resource. + operationId: ResourceService_CreateResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpsertMemoReactionResponse' + $ref: '#/definitions/v2CreateResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: reaction.id + - name: filename in: query required: false - type: integer - format: int32 - - name: reaction.creator + type: string + - name: externalLink in: query required: false type: string - - name: reaction.contentId + - name: type in: query required: false type: string - - name: reaction.reactionType + - name: memo + description: 'Format: memos/{id}' in: query required: false type: string - enum: - - TYPE_UNSPECIFIED - - THUMBS_UP - - THUMBS_DOWN - - HEART - - FIRE - - CLAPPING_HANDS - - LAUGH - - OK_HAND - - ROCKET - - EYES - - THINKING_FACE - - CLOWN_FACE - - QUESTION_MARK - default: TYPE_UNSPECIFIED tags: - - MemoService - /api/v2/memos/{id}/reactions/{reactionId}: - delete: - summary: DeleteMemoReaction deletes a reaction for a memo. - operationId: MemoService_DeleteMemoReaction + - ResourceService + /api/v2/resources:search: + get: + summary: SearchResources searches memos. + operationId: ResourceService_SearchResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteMemoReactionResponse' + $ref: '#/definitions/v2SearchResourcesResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: reactionId - in: path - required: true - type: integer - format: int32 + - name: filter + in: query + required: false + type: string tags: - - MemoService - /api/v2/memos/{id}/relations: + - ResourceService + /api/v2/tags: get: - summary: ListMemoRelations lists relations for a memo. - operationId: MemoService_ListMemoRelations + summary: ListTags lists tags. + operationId: TagService_ListTags responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoRelationsResponse' + $ref: '#/definitions/v2ListTagsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: user + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string tags: - - MemoService - post: - summary: SetMemoRelations sets relations for a memo. - operationId: MemoService_SetMemoRelations + - TagService + delete: + summary: DeleteTag deletes a tag. + operationId: TagService_DeleteTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetMemoRelationsResponse' + $ref: '#/definitions/v2DeleteTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: body - in: body - required: true + - name: tag.name + in: query + required: false + type: string + - name: tag.creator + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string + tags: + - TagService + post: + summary: UpsertTag upserts a tag. + operationId: TagService_UpsertTag + responses: + "200": + description: A successful response. schema: - $ref: '#/definitions/MemoServiceSetMemoRelationsBody' + $ref: '#/definitions/v2UpsertTagResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name + in: query + required: false + type: string tags: - - MemoService - /api/v2/memos/{id}/resources: + - TagService + /api/v2/tags/suggestion: get: - summary: ListMemoResources lists resources for a memo. - operationId: MemoService_ListMemoResources + summary: GetTagSuggestions gets tag suggestions from the user's memos. + operationId: TagService_GetTagSuggestions responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListMemoResourcesResponse' + $ref: '#/definitions/v2GetTagSuggestionsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 + - name: user + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string tags: - - MemoService + - TagService + /api/v2/tags:batchUpsert: post: - summary: SetMemoResources sets resources for a memo. - operationId: MemoService_SetMemoResources + summary: BatchUpsertTag upserts multiple tags. + operationId: TagService_BatchUpsertTag responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetMemoResourcesResponse' + $ref: '#/definitions/v2BatchUpsertTagResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + tags: + - TagService + /api/v2/tags:rename: + patch: + summary: |- + RenameTag renames a tag. + All related memos will be updated. + operationId: TagService_RenameTag + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2RenameTagResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id - in: path - required: true - type: integer - format: int32 - - name: body - in: body - required: true + - name: user + description: |- + The creator of tags. + Format: users/{id} + in: query + required: false + type: string + - name: oldName + in: query + required: false + type: string + - name: newName + in: query + required: false + type: string + tags: + - TagService + /api/v2/users: + get: + summary: ListUsers returns a list of users. + operationId: UserService_ListUsers + responses: + "200": + description: A successful response. schema: - $ref: '#/definitions/MemoServiceSetMemoResourcesBody' + $ref: '#/definitions/v2ListUsersResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' tags: - - MemoService - /api/v2/memos/{memo.id}: - patch: - summary: UpdateMemo updates a memo. - operationId: MemoService_UpdateMemo + - UserService + post: + summary: CreateUser creates a new user. + operationId: UserService_CreateUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateMemoResponse' + $ref: '#/definitions/v2CreateUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: memo.id - description: id is the system generated unique identifier. - in: path - required: true - type: integer - format: int32 - - name: memo + - name: user in: body required: true schema: - type: object - properties: - name: - type: string - description: name is the user provided name. - rowStatus: - $ref: '#/definitions/apiv2RowStatus' - creator: - type: string - title: |- - The name of the creator. - Format: users/{username} - creatorId: - type: integer - format: int32 - createTime: - type: string - format: date-time - updateTime: - type: string - format: date-time - displayTime: - type: string - format: date-time - content: - type: string - visibility: - $ref: '#/definitions/v2Visibility' - pinned: - type: boolean - parentId: - type: integer - format: int32 - readOnly: true - resources: - type: array - items: - type: object - $ref: '#/definitions/v2Resource' - readOnly: true - relations: - type: array - items: - type: object - $ref: '#/definitions/v2MemoRelation' - readOnly: true - reactions: - type: array - items: - type: object - $ref: '#/definitions/apiv2Reaction' - readOnly: true + $ref: '#/definitions/v2User' tags: - - MemoService - /api/v2/memos:export: - post: - summary: ExportMemos exports memos. - operationId: MemoService_ExportMemos + - UserService + /api/v2/users:search: + get: + summary: SearchUsers searches users by filter. + operationId: UserService_SearchUsers responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ExportMemosResponse' + $ref: '#/definitions/v2SearchUsersResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - name: filter - description: Same as ListMemosRequest.filter + description: |- + Filter is used to filter users returned in the list. + Format: "username == frank" in: query required: false type: string tags: - - MemoService - /api/v2/metadata: + - UserService + /api/v2/webhooks: get: - operationId: LinkService_GetLinkMetadata + summary: ListWebhooks returns a list of webhooks. + operationId: WebhookService_ListWebhooks responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetLinkMetadataResponse' + $ref: '#/definitions/v2ListWebhooksResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: link + - name: creatorId in: query required: false - type: string + type: integer + format: int32 tags: - - LinkService - /api/v2/resources: + - WebhookService + post: + summary: CreateWebhook creates a new webhook. + operationId: WebhookService_CreateWebhook + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2CreateWebhookResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: body + in: body + required: true + schema: + $ref: '#/definitions/v2CreateWebhookRequest' + tags: + - WebhookService + /api/v2/webhooks/{id}: get: - summary: ListResources lists all resources. - operationId: ResourceService_ListResources + summary: GetWebhook returns a webhook by id. + operationId: WebhookService_GetWebhook responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListResourcesResponse' + $ref: '#/definitions/v2GetWebhookResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' + parameters: + - name: id + in: path + required: true + type: integer + format: int32 tags: - - ResourceService - post: - summary: CreateResource creates a new resource. - operationId: ResourceService_CreateResource + - WebhookService + delete: + summary: DeleteWebhook deletes a webhook by id. + operationId: WebhookService_DeleteWebhook responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateResourceResponse' + $ref: '#/definitions/v2DeleteWebhookResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: filename - in: query - required: false - type: string - - name: externalLink - in: query - required: false - type: string - - name: type - in: query - required: false - type: string - - name: memoId - in: query - required: false + - name: id + in: path + required: true + type: integer + format: int32 + tags: + - WebhookService + /api/v2/webhooks/{webhook.id}: + patch: + summary: UpdateWebhook updates a webhook. + operationId: WebhookService_UpdateWebhook + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2UpdateWebhookResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' + parameters: + - name: webhook.id + in: path + required: true type: integer format: int32 + - name: webhook + in: body + required: true + schema: + type: object + properties: + creatorId: + type: integer + format: int32 + createdTime: + type: string + format: date-time + updatedTime: + type: string + format: date-time + rowStatus: + $ref: '#/definitions/apiv2RowStatus' + name: + type: string + url: + type: string + tags: + - WebhookService + /api/v2/workspace/profile: + get: + summary: GetWorkspaceProfile returns the workspace profile. + operationId: WorkspaceService_GetWorkspaceProfile + responses: + "200": + description: A successful response. + schema: + $ref: '#/definitions/v2GetWorkspaceProfileResponse' + default: + description: An unexpected error response. + schema: + $ref: '#/definitions/googlerpcStatus' tags: - - ResourceService - /api/v2/resources/name/{name}: + - WorkspaceService + /api/v2/workspace/{name}: get: - summary: GetResourceByName returns a resource by name. - operationId: ResourceService_GetResourceByName + summary: GetWorkspaceSetting returns the setting by name. + operationId: WorkspaceSettingService_GetWorkspaceSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetResourceByNameResponse' + $ref: '#/definitions/v2GetWorkspaceSettingResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - name: name + description: |- + The resource name of the workspace setting. + Format: settings/{setting} in: path required: true type: string + pattern: settings/[^/]+ tags: - - ResourceService - /api/v2/resources/{id}: - get: - summary: GetResource returns a resource by id. - operationId: ResourceService_GetResource + - WorkspaceSettingService + /api/v2/workspace/{setting.name}: + patch: + summary: SetWorkspaceSetting updates the setting. + operationId: WorkspaceSettingService_SetWorkspaceSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetResourceResponse' + $ref: '#/definitions/v2SetWorkspaceSettingResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: setting.name + description: |- + name is the name of the setting. + Format: settings/{setting} in: path required: true - type: integer - format: int32 + type: string + pattern: settings/[^/]+ + - name: setting + description: setting is the setting to update. + in: body + required: true + schema: + type: object + properties: + generalSetting: + $ref: '#/definitions/apiv2WorkspaceGeneralSetting' + description: general_setting is the general setting of workspace. + title: setting is the setting to update. tags: - - ResourceService - delete: - summary: DeleteResource deletes a resource by id. - operationId: ResourceService_DeleteResource + - WorkspaceSettingService + /api/v2/{identityProvider.name}: + patch: + summary: UpdateIdentityProvider updates an identity provider. + operationId: IdentityProviderService_UpdateIdentityProvider responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteResourceResponse' + $ref: '#/definitions/v2UpdateIdentityProviderResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: identityProvider.name + description: |- + The name of the identityProvider. + Format: identityProviders/{id} in: path required: true - type: integer - format: int32 + type: string + pattern: identityProviders/[^/]+ + - name: identityProvider + description: The identityProvider to update. + in: body + required: true + schema: + type: object + properties: + type: + $ref: '#/definitions/v2IdentityProviderType' + title: + type: string + identifierFilter: + type: string + config: + $ref: '#/definitions/IdentityProviderConfig' + title: The identityProvider to update. tags: - - ResourceService - /api/v2/resources/{resource.id}: + - IdentityProviderService + /api/v2/{inbox.name}: patch: - summary: UpdateResource updates a resource. - operationId: ResourceService_UpdateResource + summary: UpdateInbox updates an inbox. + operationId: InboxService_UpdateInbox responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateResourceResponse' + $ref: '#/definitions/v2UpdateInboxResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: resource.id - description: id is the system generated unique identifier. + - name: inbox.name + description: |- + The name of the inbox. + Format: inboxes/{id} in: path required: true - type: integer - format: int32 - - name: resource + type: string + pattern: inboxes/[^/]+ + - name: inbox in: body required: true schema: type: object properties: - name: + sender: + type: string + title: 'Format: users/{id}' + receiver: type: string - description: name is the user provided name. + title: 'Format: users/{id}' + status: + $ref: '#/definitions/v2InboxStatus' createTime: type: string format: date-time - filename: - type: string - externalLink: - type: string type: - type: string - size: - type: string - format: int64 - memoId: + $ref: '#/definitions/v2InboxType' + activityId: type: integer format: int32 tags: - - ResourceService - /api/v2/tags: - get: - summary: ListTags lists tags. - operationId: TagService_ListTags + - InboxService + /api/v2/{memo.name}: + patch: + summary: UpdateMemo updates a memo. + operationId: MemoService_UpdateMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListTagsResponse' + $ref: '#/definitions/v2UpdateMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user + - name: memo.name description: |- - The creator of tags. - Format: users/{username} - in: query - required: false + The name of the memo. + Format: memos/{id} + id is the system generated id. + in: path + required: true type: string + pattern: memos/[^/]+ + - name: memo + in: body + required: true + schema: + type: object + properties: + uid: + type: string + description: The user defined id of the memo. + rowStatus: + $ref: '#/definitions/apiv2RowStatus' + creator: + type: string + title: |- + The name of the creator. + Format: users/{id} + createTime: + type: string + format: date-time + updateTime: + type: string + format: date-time + displayTime: + type: string + format: date-time + content: + type: string + visibility: + $ref: '#/definitions/v2Visibility' + pinned: + type: boolean + parentId: + type: integer + format: int32 + readOnly: true + resources: + type: array + items: + type: object + $ref: '#/definitions/v2Resource' + readOnly: true + relations: + type: array + items: + type: object + $ref: '#/definitions/v2MemoRelation' + readOnly: true + reactions: + type: array + items: + type: object + $ref: '#/definitions/apiv2Reaction' + readOnly: true tags: - - TagService - delete: - summary: DeleteTag deletes a tag. - operationId: TagService_DeleteTag + - MemoService + /api/v2/{name_1}: + get: + operationId: IdentityProviderService_GetIdentityProvider responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteTagResponse' + $ref: '#/definitions/v2GetIdentityProviderResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: tag.name - in: query - required: false - type: string - - name: tag.creator + - name: name_1 description: |- - The creator of tags. - Format: users/{username} - in: query - required: false + The name of the identityProvider to get. + Format: identityProviders/{id} + in: path + required: true type: string + pattern: identityProviders/[^/]+ tags: - - TagService - post: - summary: UpsertTag upserts a tag. - operationId: TagService_UpsertTag + - IdentityProviderService + delete: + summary: DeleteIdentityProvider deletes an identity provider. + operationId: IdentityProviderService_DeleteIdentityProvider responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpsertTagResponse' + $ref: '#/definitions/v2DeleteIdentityProviderResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name - in: query - required: false + - name: name_1 + description: |- + The name of the identityProvider to delete. + Format: identityProviders/{id} + in: path + required: true type: string + pattern: identityProviders/[^/]+ tags: - - TagService - /api/v2/tags/suggestion: + - IdentityProviderService + /api/v2/{name_2}: get: - summary: GetTagSuggestions gets tag suggestions from the user's memos. - operationId: TagService_GetTagSuggestions + summary: GetResource returns a resource by name. + operationId: ResourceService_GetResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetTagSuggestionsResponse' + $ref: '#/definitions/v2GetResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user - description: |- - The creator of tags. - Format: users/{username} - in: query - required: false + - name: name_2 + in: path + required: true type: string + pattern: resources/[^/]+ tags: - - TagService - /api/v2/tags:batchUpsert: - post: - summary: BatchUpsertTag upserts multiple tags. - operationId: TagService_BatchUpsertTag - responses: - "200": - description: A successful response. - schema: - $ref: '#/definitions/v2BatchUpsertTagResponse' - default: - description: An unexpected error response. - schema: - $ref: '#/definitions/googlerpcStatus' - tags: - - TagService - /api/v2/tags:rename: - patch: - summary: |- - RenameTag renames a tag. - All related memos will be updated. - operationId: TagService_RenameTag + - ResourceService + delete: + summary: DeleteInbox deletes an inbox. + operationId: InboxService_DeleteInbox responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2RenameTagResponse' + $ref: '#/definitions/v2DeleteInboxResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user + - name: name_2 description: |- - The creator of tags. - Format: users/{username} - in: query - required: false - type: string - - name: oldName - in: query - required: false - type: string - - name: newName - in: query - required: false + The name of the inbox to delete. + Format: inboxes/{id} + in: path + required: true type: string + pattern: inboxes/[^/]+ tags: - - TagService - /api/v2/users: + - InboxService + /api/v2/{name_3}: get: - summary: ListUsers returns a list of users. - operationId: UserService_ListUsers + summary: GetMemo gets a memo. + operationId: MemoService_GetMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListUsersResponse' + $ref: '#/definitions/v2GetMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name_3 + description: |- + The name of the memo. + Format: memos/{id} + in: path + required: true + type: string + pattern: memos/[^/]+ tags: - - UserService - post: - summary: CreateUser creates a new user. - operationId: UserService_CreateUser + - MemoService + delete: + summary: DeleteResource deletes a resource by name. + operationId: ResourceService_DeleteResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateUserResponse' + $ref: '#/definitions/v2DeleteResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: user - in: body + - name: name_3 + in: path required: true - schema: - $ref: '#/definitions/v2User' + type: string + pattern: resources/[^/]+ tags: - - UserService - /api/v2/webhooks: - get: - summary: ListWebhooks returns a list of webhooks. - operationId: WebhookService_ListWebhooks + - ResourceService + /api/v2/{name_4}: + delete: + summary: DeleteMemo deletes a memo. + operationId: MemoService_DeleteMemo responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListWebhooksResponse' + $ref: '#/definitions/v2DeleteMemoResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: creatorId - in: query - required: false - type: integer - format: int32 + - name: name_4 + description: |- + The name of the memo. + Format: memos/{id} + in: path + required: true + type: string + pattern: memos/[^/]+ tags: - - WebhookService - post: - summary: CreateWebhook creates a new webhook. - operationId: WebhookService_CreateWebhook + - MemoService + /api/v2/{name}: + get: + summary: GetUser gets a user by name. + operationId: UserService_GetUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateWebhookResponse' + $ref: '#/definitions/v2GetUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: body - in: body + - name: name + description: |- + The name of the user. + Format: users/{id} + in: path required: true - schema: - $ref: '#/definitions/v2CreateWebhookRequest' + type: string + pattern: users/[^/]+ tags: - - WebhookService - /api/v2/webhooks/{id}: - get: - summary: GetWebhook returns a webhook by id. - operationId: WebhookService_GetWebhook + - UserService + delete: + summary: DeleteUser deletes a user. + operationId: UserService_DeleteUser responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWebhookResponse' + $ref: '#/definitions/v2DeleteUserResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: name + description: |- + The name of the user. + Format: users/{id} in: path required: true - type: integer - format: int32 + type: string + pattern: users/[^/]+ tags: - - WebhookService - delete: - summary: DeleteWebhook deletes a webhook by id. - operationId: WebhookService_DeleteWebhook + - UserService + /api/v2/{name}/access_tokens: + get: + summary: ListUserAccessTokens returns a list of access tokens for a user. + operationId: UserService_ListUserAccessTokens responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteWebhookResponse' + $ref: '#/definitions/v2ListUserAccessTokensResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: id + - name: name + description: |- + The name of the user. + Format: users/{id} in: path required: true - type: integer - format: int32 + type: string + pattern: users/[^/]+ tags: - - WebhookService - /api/v2/webhooks/{webhook.id}: - patch: - summary: UpdateWebhook updates a webhook. - operationId: WebhookService_UpdateWebhook + - UserService + post: + summary: CreateUserAccessToken creates a new access token for a user. + operationId: UserService_CreateUserAccessToken responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateWebhookResponse' + $ref: '#/definitions/v2CreateUserAccessTokenResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: webhook.id + - name: name + description: |- + The name of the user. + Format: users/{id} in: path required: true - type: integer - format: int32 - - name: webhook + type: string + pattern: users/[^/]+ + - name: body in: body required: true schema: - type: object - properties: - creatorId: - type: integer - format: int32 - createdTime: - type: string - format: date-time - updatedTime: - type: string - format: date-time - rowStatus: - $ref: '#/definitions/apiv2RowStatus' - name: - type: string - url: - type: string + $ref: '#/definitions/UserServiceCreateUserAccessTokenBody' tags: - - WebhookService - /api/v2/workspace/profile: - get: - summary: GetWorkspaceProfile returns the workspace profile. - operationId: WorkspaceService_GetWorkspaceProfile + - UserService + /api/v2/{name}/access_tokens/{accessToken}: + delete: + summary: DeleteUserAccessToken deletes an access token for a user. + operationId: UserService_DeleteUserAccessToken responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWorkspaceProfileResponse' + $ref: '#/definitions/v2DeleteUserAccessTokenResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' + parameters: + - name: name + description: |- + The name of the user. + Format: users/{id} + in: path + required: true + type: string + pattern: users/[^/]+ + - name: accessToken + description: access_token is the access token to delete. + in: path + required: true + type: string tags: - - WorkspaceService - /api/v2/workspace/{name}: + - UserService + /api/v2/{name}/comments: get: - summary: GetWorkspaceSetting returns the setting by name. - operationId: WorkspaceSettingService_GetWorkspaceSetting + summary: ListMemoComments lists comments for a memo. + operationId: MemoService_ListMemoComments responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetWorkspaceSettingResponse' + $ref: '#/definitions/v2ListMemoCommentsResponse' default: description: An unexpected error response. schema: @@ -1152,128 +1346,142 @@ paths: parameters: - name: name description: |- - The resource name of the workspace setting. - Format: settings/{setting} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: settings/[^/]+ + pattern: memos/[^/]+ tags: - - WorkspaceSettingService - /api/v2/workspace/{setting.name}: - patch: - summary: SetWorkspaceSetting updates the setting. - operationId: WorkspaceSettingService_SetWorkspaceSetting + - MemoService + post: + summary: CreateMemoComment creates a comment for a memo. + operationId: MemoService_CreateMemoComment responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2SetWorkspaceSettingResponse' + $ref: '#/definitions/v2CreateMemoCommentResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: setting.name + - name: name description: |- - name is the name of the setting. - Format: settings/{setting} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: settings/[^/]+ - - name: setting - description: setting is the setting to update. - in: body - required: true - schema: - type: object - properties: - generalSetting: - $ref: '#/definitions/apiv2WorkspaceGeneralSetting' - description: general_setting is the general setting of workspace. - title: setting is the setting to update. + pattern: memos/[^/]+ + - name: comment.content + in: query + required: false + type: string + - name: comment.visibility + in: query + required: false + type: string + enum: + - VISIBILITY_UNSPECIFIED + - PRIVATE + - PROTECTED + - PUBLIC + default: VISIBILITY_UNSPECIFIED tags: - - WorkspaceSettingService - /api/v2/{inbox.name}: - patch: - summary: UpdateInbox updates an inbox. - operationId: InboxService_UpdateInbox + - MemoService + /api/v2/{name}/reactions: + get: + summary: ListMemoReactions lists reactions for a memo. + operationId: MemoService_ListMemoReactions responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2UpdateInboxResponse' + $ref: '#/definitions/v2ListMemoReactionsResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: inbox.name + - name: name description: |- - The name of the inbox. - Format: inboxes/{uid} + The name of the memo. + Format: memos/{id} in: path required: true - type: string - pattern: inboxes/[^/]+ - - name: inbox - in: body - required: true - schema: - type: object - properties: - sender: - type: string - title: 'Format: users/{username}' - receiver: - type: string - title: 'Format: users/{username}' - status: - $ref: '#/definitions/v2InboxStatus' - createTime: - type: string - format: date-time - type: - $ref: '#/definitions/v2InboxType' - activityId: - type: integer - format: int32 - tags: - - InboxService - /api/v2/{name_1}: - delete: - summary: DeleteInbox deletes an inbox. - operationId: InboxService_DeleteInbox + type: string + pattern: memos/[^/]+ + tags: + - MemoService + post: + summary: UpsertMemoReaction upserts a reaction for a memo. + operationId: MemoService_UpsertMemoReaction responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteInboxResponse' + $ref: '#/definitions/v2UpsertMemoReactionResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name_1 + - name: name description: |- - The name of the inbox to delete. - Format: inboxes/{uid} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: inboxes/[^/]+ + pattern: memos/[^/]+ + - name: reaction.id + in: query + required: false + type: integer + format: int32 + - name: reaction.creator + description: |- + The name of the creator. + Format: users/{id} + in: query + required: false + type: string + - name: reaction.contentId + in: query + required: false + type: string + - name: reaction.reactionType + in: query + required: false + type: string + enum: + - TYPE_UNSPECIFIED + - THUMBS_UP + - THUMBS_DOWN + - HEART + - FIRE + - CLAPPING_HANDS + - LAUGH + - OK_HAND + - ROCKET + - EYES + - THINKING_FACE + - CLOWN_FACE + - QUESTION_MARK + default: TYPE_UNSPECIFIED tags: - - InboxService - /api/v2/{name}: + - MemoService + /api/v2/{name}/relations: get: - summary: GetUser gets a user by name. - operationId: UserService_GetUser + summary: ListMemoRelations lists relations for a memo. + operationId: MemoService_ListMemoRelations responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetUserResponse' + $ref: '#/definitions/v2ListMemoRelationsResponse' default: description: An unexpected error response. schema: @@ -1281,22 +1489,22 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ tags: - - UserService - delete: - summary: DeleteUser deletes a user. - operationId: UserService_DeleteUser + - MemoService + post: + summary: SetMemoRelations sets relations for a memo. + operationId: MemoService_SetMemoRelations responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteUserResponse' + $ref: '#/definitions/v2SetMemoRelationsResponse' default: description: An unexpected error response. schema: @@ -1304,23 +1512,28 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ + - name: body + in: body + required: true + schema: + $ref: '#/definitions/MemoServiceSetMemoRelationsBody' tags: - - UserService - /api/v2/{name}/access_tokens: + - MemoService + /api/v2/{name}/resources: get: - summary: ListUserAccessTokens returns a list of access tokens for a user. - operationId: UserService_ListUserAccessTokens + summary: ListMemoResources lists resources for a memo. + operationId: MemoService_ListMemoResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2ListUserAccessTokensResponse' + $ref: '#/definitions/v2ListMemoResourcesResponse' default: description: An unexpected error response. schema: @@ -1328,22 +1541,22 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ tags: - - UserService + - MemoService post: - summary: CreateUserAccessToken creates a new access token for a user. - operationId: UserService_CreateUserAccessToken + summary: SetMemoResources sets resources for a memo. + operationId: MemoService_SetMemoResources responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2CreateUserAccessTokenResponse' + $ref: '#/definitions/v2SetMemoResourcesResponse' default: description: An unexpected error response. schema: @@ -1351,28 +1564,28 @@ paths: parameters: - name: name description: |- - The name of the user. - Format: users/{username} + The name of the memo. + Format: memos/{id} in: path required: true type: string - pattern: users/[^/]+ + pattern: memos/[^/]+ - name: body in: body required: true schema: - $ref: '#/definitions/UserServiceCreateUserAccessTokenBody' + $ref: '#/definitions/MemoServiceSetMemoResourcesBody' tags: - - UserService - /api/v2/{name}/access_tokens/{accessToken}: - delete: - summary: DeleteUserAccessToken deletes an access token for a user. - operationId: UserService_DeleteUserAccessToken + - MemoService + /api/v2/{name}/setting: + get: + summary: GetUserSetting gets the setting of a user. + operationId: UserService_GetUserSetting responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2DeleteUserAccessTokenResponse' + $ref: '#/definitions/v2GetUserSettingResponse' default: description: An unexpected error response. schema: @@ -1381,42 +1594,62 @@ paths: - name: name description: |- The name of the user. - Format: users/{username} + Format: users/{id} in: path required: true type: string pattern: users/[^/]+ - - name: accessToken - description: access_token is the access token to delete. - in: path - required: true - type: string tags: - UserService - /api/v2/{name}/setting: - get: - summary: GetUserSetting gets the setting of a user. - operationId: UserService_GetUserSetting + /api/v2/{resource.name}: + patch: + summary: UpdateResource updates a resource. + operationId: ResourceService_UpdateResource responses: "200": description: A successful response. schema: - $ref: '#/definitions/v2GetUserSettingResponse' + $ref: '#/definitions/v2UpdateResourceResponse' default: description: An unexpected error response. schema: $ref: '#/definitions/googlerpcStatus' parameters: - - name: name + - name: resource.name description: |- - The name of the user. - Format: users/{username} + The name of the resource. + Format: resources/{id} + id is the system generated unique identifier. in: path required: true type: string - pattern: users/[^/]+ + pattern: resources/[^/]+ + - name: resource + in: body + required: true + schema: + type: object + properties: + uid: + type: string + description: The user defined id of the resource. + createTime: + type: string + format: date-time + filename: + type: string + externalLink: + type: string + type: + type: string + size: + type: string + format: int64 + memo: + type: string + title: 'Format: memos/{id}' tags: - - UserService + - ResourceService /api/v2/{setting.name}: patch: summary: UpdateUserSetting updates the setting of a user. @@ -1434,7 +1667,7 @@ paths: - name: setting.name description: |- The name of the user. - Format: users/{username} + Format: users/{id} in: path required: true type: string @@ -1476,7 +1709,7 @@ paths: - name: user.name description: |- The name of the user. - Format: users/{username} + Format: users/{id} in: path required: true type: string @@ -1490,6 +1723,7 @@ paths: id: type: integer format: int32 + description: The system generated uid of the user. role: $ref: '#/definitions/UserRole' username: @@ -1500,6 +1734,8 @@ paths: type: string avatarUrl: type: string + description: + type: string password: type: string rowStatus: @@ -1534,6 +1770,39 @@ paths: tags: - ActivityService definitions: + IdentityProviderConfig: + type: object + properties: + oauth2: + $ref: '#/definitions/IdentityProviderConfigOAuth2' + IdentityProviderConfigFieldMapping: + type: object + properties: + identifier: + type: string + displayName: + type: string + email: + type: string + IdentityProviderConfigOAuth2: + type: object + properties: + clientId: + type: string + clientSecret: + type: string + authUrl: + type: string + tokenUrl: + type: string + userInfoUrl: + type: string + scopes: + type: array + items: + type: string + fieldMapping: + $ref: '#/definitions/IdentityProviderConfigFieldMapping' MemoServiceSetMemoRelationsBody: type: object properties: @@ -1595,6 +1864,9 @@ definitions: format: int32 creator: type: string + title: |- + The name of the creator. + Format: users/{id} contentId: type: string reactionType: @@ -1630,7 +1902,7 @@ definitions: type: string title: |- The name of the user. - Format: users/{username} + Format: users/{id} locale: type: string description: The preferred locale of the user. @@ -1732,6 +2004,12 @@ definitions: $ref: '#/definitions/apiv2ActivityPayload' v2BatchUpsertTagResponse: type: object + v2CreateIdentityProviderResponse: + type: object + properties: + identityProvider: + $ref: '#/definitions/v2IdentityProvider' + description: The created identityProvider. v2CreateMemoCommentResponse: type: object properties: @@ -1776,6 +2054,8 @@ definitions: properties: webhook: $ref: '#/definitions/apiv2Webhook' + v2DeleteIdentityProviderResponse: + type: object v2DeleteInboxResponse: type: object v2DeleteMemoReactionResponse: @@ -1808,26 +2088,22 @@ definitions: properties: user: $ref: '#/definitions/v2User' - v2GetLinkMetadataResponse: + v2GetIdentityProviderResponse: type: object properties: - metadata: - $ref: '#/definitions/v2LinkMetadata' - v2GetMemoByNameResponse: + identityProvider: + $ref: '#/definitions/v2IdentityProvider' + description: The identityProvider. + v2GetLinkMetadataResponse: type: object properties: - memo: - $ref: '#/definitions/v2Memo' + linkMetadata: + $ref: '#/definitions/v2LinkMetadata' v2GetMemoResponse: type: object properties: memo: $ref: '#/definitions/v2Memo' - v2GetResourceByNameResponse: - type: object - properties: - resource: - $ref: '#/definitions/v2Resource' v2GetResourceResponse: type: object properties: @@ -1876,6 +2152,28 @@ definitions: properties: setting: $ref: '#/definitions/apiv2WorkspaceSetting' + v2IdentityProvider: + type: object + properties: + name: + type: string + title: |- + The name of the identityProvider. + Format: identityProviders/{id} + type: + $ref: '#/definitions/v2IdentityProviderType' + title: + type: string + identifierFilter: + type: string + config: + $ref: '#/definitions/IdentityProviderConfig' + v2IdentityProviderType: + type: string + enum: + - TYPE_UNSPECIFIED + - OAUTH2 + default: TYPE_UNSPECIFIED v2Inbox: type: object properties: @@ -1883,13 +2181,13 @@ definitions: type: string title: |- The name of the inbox. - Format: inboxes/{uid} + Format: inboxes/{id} sender: type: string - title: 'Format: users/{username}' + title: 'Format: users/{id}' receiver: type: string - title: 'Format: users/{username}' + title: 'Format: users/{id}' status: $ref: '#/definitions/v2InboxStatus' createTime: @@ -1923,6 +2221,14 @@ definitions: type: string image: type: string + v2ListIdentityProvidersResponse: + type: object + properties: + identityProviders: + type: array + items: + type: object + $ref: '#/definitions/v2IdentityProvider' v2ListInboxesResponse: type: object properties: @@ -2019,23 +2325,22 @@ definitions: v2Memo: type: object properties: - id: - type: integer - format: int32 - description: id is the system generated unique identifier. name: type: string - description: name is the user provided name. + description: |- + The name of the memo. + Format: memos/{id} + id is the system generated id. + uid: + type: string + description: The user defined id of the memo. rowStatus: $ref: '#/definitions/apiv2RowStatus' creator: type: string title: |- The name of the creator. - Format: users/{username} - creatorId: - type: integer - format: int32 + Format: users/{id} createTime: type: string format: date-time @@ -2076,12 +2381,16 @@ definitions: v2MemoRelation: type: object properties: - memoId: - type: integer - format: int32 - relatedMemoId: - type: integer - format: int32 + memo: + type: string + title: |- + The name of memo. + Format: "memos/{uid}" + relatedMemo: + type: string + title: |- + The name of related memo. + Format: "memos/{uid}" type: $ref: '#/definitions/v2MemoRelationType' v2MemoRelationType: @@ -2099,13 +2408,15 @@ definitions: v2Resource: type: object properties: - id: - type: integer - format: int32 - description: id is the system generated unique identifier. name: type: string - description: name is the user provided name. + description: |- + The name of the resource. + Format: resources/{id} + id is the system generated unique identifier. + uid: + type: string + description: The user defined id of the resource. createTime: type: string format: date-time @@ -2118,9 +2429,33 @@ definitions: size: type: string format: int64 - memoId: - type: integer - format: int32 + memo: + type: string + title: 'Format: memos/{id}' + v2SearchMemosResponse: + type: object + properties: + memos: + type: array + items: + type: object + $ref: '#/definitions/v2Memo' + v2SearchResourcesResponse: + type: object + properties: + resources: + type: array + items: + type: object + $ref: '#/definitions/v2Resource' + v2SearchUsersResponse: + type: object + properties: + users: + type: array + items: + type: object + $ref: '#/definitions/v2User' v2SetMemoRelationsResponse: type: object v2SetMemoResourcesResponse: @@ -2156,7 +2491,13 @@ definitions: type: string title: |- The creator of tags. - Format: users/{username} + Format: users/{id} + v2UpdateIdentityProviderResponse: + type: object + properties: + identityProvider: + $ref: '#/definitions/v2IdentityProvider' + description: The updated identityProvider. v2UpdateInboxResponse: type: object properties: @@ -2209,10 +2550,11 @@ definitions: type: string title: |- The name of the user. - Format: users/{username} + Format: users/{id} id: type: integer format: int32 + description: The system generated uid of the user. role: $ref: '#/definitions/UserRole' username: @@ -2223,6 +2565,8 @@ definitions: type: string avatarUrl: type: string + description: + type: string password: type: string rowStatus: @@ -2257,18 +2601,23 @@ definitions: v2WorkspaceProfile: type: object properties: + owner: + type: string + title: |- + The name of intance owner. + Format: "users/{id}" version: type: string title: version is the current version of instance mode: type: string description: mode is the instance mode (e.g. "prod", "dev" or "demo"). - allowRegistration: + disallowSignup: type: boolean - description: allow_registration is whether the registration is allowed. + description: disallow_signup is whether the signup is disallowed. disablePasswordLogin: type: boolean - description: allow_password_login is whether the password login is allowed. + description: disable_password_login is whether the password login is disabled. additionalScript: type: string description: additional_script is the additional script. diff --git a/server/route/api/v2/auth_service.go b/server/route/api/v2/auth_service.go index ef4b139ff4b68..1cf681a9d1549 100644 --- a/server/route/api/v2/auth_service.go +++ b/server/route/api/v2/auth_service.go @@ -30,7 +30,7 @@ func (s *APIV2Service) GetAuthStatus(ctx context.Context, _ *apiv2pb.GetAuthStat if user == nil { // Set the cookie header to expire access token. if err := s.clearAccessTokenCookie(ctx); err != nil { - return nil, status.Errorf(codes.Internal, "failed to set grpc header") + return nil, status.Errorf(codes.Internal, "failed to set grpc header: %v", err) } return nil, status.Errorf(codes.Unauthenticated, "user not found") } @@ -189,6 +189,9 @@ func (s *APIV2Service) SignUp(ctx context.Context, request *apiv2pb.SignUpReques Nickname: request.Username, PasswordHash: string(passwordHash), } + if !util.UIDMatcher.MatchString(strings.ToLower(create.Username)) { + return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", create.Username) + } hostUserType := store.RoleHost existedHostUsers, err := s.Store.ListUsers(ctx, &store.FindUser{ diff --git a/server/route/api/v2/inbox_service.go b/server/route/api/v2/inbox_service.go index 51b170b2e1ba4..a3238e142e7b2 100644 --- a/server/route/api/v2/inbox_service.go +++ b/server/route/api/v2/inbox_service.go @@ -5,7 +5,6 @@ import ( "fmt" "time" - "github.com/pkg/errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" @@ -31,11 +30,7 @@ func (s *APIV2Service) ListInboxes(ctx context.Context, _ *apiv2pb.ListInboxesRe Inboxes: []*apiv2pb.Inbox{}, } for _, inbox := range inboxes { - inboxMessage, err := s.convertInboxFromStore(ctx, inbox) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to convert inbox from store: %v", err) - } - response.Inboxes = append(response.Inboxes, inboxMessage) + response.Inboxes = append(response.Inboxes, convertInboxFromStore(inbox)) } return response, nil @@ -67,12 +62,8 @@ func (s *APIV2Service) UpdateInbox(ctx context.Context, request *apiv2pb.UpdateI return nil, status.Errorf(codes.Internal, "failed to update inbox: %v", err) } - inboxMessage, err := s.convertInboxFromStore(ctx, inbox) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to convert inbox from store: %v", err) - } return &apiv2pb.UpdateInboxResponse{ - Inbox: inboxMessage, + Inbox: convertInboxFromStore(inbox), }, nil } @@ -90,29 +81,16 @@ func (s *APIV2Service) DeleteInbox(ctx context.Context, request *apiv2pb.DeleteI return &apiv2pb.DeleteInboxResponse{}, nil } -func (s *APIV2Service) convertInboxFromStore(ctx context.Context, inbox *store.Inbox) (*apiv2pb.Inbox, error) { - sender, err := s.Store.GetUser(ctx, &store.FindUser{ - ID: &inbox.SenderID, - }) - if err != nil { - return nil, errors.Wrap(err, "failed to get sender") - } - receiver, err := s.Store.GetUser(ctx, &store.FindUser{ - ID: &inbox.ReceiverID, - }) - if err != nil { - return nil, errors.Wrap(err, "failed to get receiver") - } - +func convertInboxFromStore(inbox *store.Inbox) *apiv2pb.Inbox { return &apiv2pb.Inbox{ - Name: fmt.Sprintf("inboxes/%d", inbox.ID), - Sender: fmt.Sprintf("users/%s", sender.Username), - Receiver: fmt.Sprintf("users/%s", receiver.Username), + Name: fmt.Sprintf("%s%d", InboxNamePrefix, inbox.ID), + Sender: fmt.Sprintf("%s%d", UserNamePrefix, inbox.SenderID), + Receiver: fmt.Sprintf("%s%d", UserNamePrefix, inbox.ReceiverID), Status: convertInboxStatusFromStore(inbox.Status), CreateTime: timestamppb.New(time.Unix(inbox.CreatedTs, 0)), Type: apiv2pb.Inbox_Type(inbox.Message.Type), ActivityId: inbox.Message.ActivityId, - }, nil + } } func convertInboxStatusFromStore(status store.InboxStatus) apiv2pb.Inbox_Status { diff --git a/server/route/api/v2/link_service.go b/server/route/api/v2/link_service.go index 5d8948393bbe9..2f23cf0994e56 100644 --- a/server/route/api/v2/link_service.go +++ b/server/route/api/v2/link_service.go @@ -14,7 +14,7 @@ func (*APIV2Service) GetLinkMetadata(_ context.Context, request *apiv2pb.GetLink } return &apiv2pb.GetLinkMetadataResponse{ - Metadata: &apiv2pb.LinkMetadata{ + LinkMetadata: &apiv2pb.LinkMetadata{ Title: htmlMeta.Title, Description: htmlMeta.Description, Image: htmlMeta.Image, diff --git a/server/route/api/v2/memo_relation_service.go b/server/route/api/v2/memo_relation_service.go index 3c20e43f11ccb..9e4967be690e7 100644 --- a/server/route/api/v2/memo_relation_service.go +++ b/server/route/api/v2/memo_relation_service.go @@ -2,6 +2,7 @@ package v2 import ( "context" + "fmt" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -11,10 +12,14 @@ import ( ) func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.SetMemoRelationsRequest) (*apiv2pb.SetMemoRelationsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } referenceType := store.MemoRelationReference // Delete all reference relations first. if err := s.Store.DeleteMemoRelation(ctx, &store.DeleteMemoRelation{ - MemoID: &request.Id, + MemoID: &id, Type: &referenceType, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete memo relation") @@ -22,7 +27,7 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se for _, relation := range request.Relations { // Ignore reflexive relations. - if request.Id == relation.RelatedMemoId { + if request.Name == relation.RelatedMemo { continue } // Ignore comment relations as there's no need to update a comment's relation. @@ -30,9 +35,13 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se if relation.Type == apiv2pb.MemoRelation_COMMENT { continue } + relatedMemoID, err := ExtractMemoIDFromName(relation.RelatedMemo) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid related memo name: %v", err) + } if _, err := s.Store.UpsertMemoRelation(ctx, &store.MemoRelation{ - MemoID: request.Id, - RelatedMemoID: relation.RelatedMemoId, + MemoID: id, + RelatedMemoID: relatedMemoID, Type: convertMemoRelationTypeToStore(relation.Type), }); err != nil { return nil, status.Errorf(codes.Internal, "failed to upsert memo relation") @@ -43,9 +52,13 @@ func (s *APIV2Service) SetMemoRelations(ctx context.Context, request *apiv2pb.Se } func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.ListMemoRelationsRequest) (*apiv2pb.ListMemoRelationsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } relationList := []*apiv2pb.MemoRelation{} tempList, err := s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - MemoID: &request.Id, + MemoID: &id, }) if err != nil { return nil, err @@ -54,7 +67,7 @@ func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.L relationList = append(relationList, convertMemoRelationFromStore(relation)) } tempList, err = s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - RelatedMemoID: &request.Id, + RelatedMemoID: &id, }) if err != nil { return nil, err @@ -71,9 +84,9 @@ func (s *APIV2Service) ListMemoRelations(ctx context.Context, request *apiv2pb.L func convertMemoRelationFromStore(memoRelation *store.MemoRelation) *apiv2pb.MemoRelation { return &apiv2pb.MemoRelation{ - MemoId: memoRelation.MemoID, - RelatedMemoId: memoRelation.RelatedMemoID, - Type: convertMemoRelationTypeFromStore(memoRelation.Type), + Memo: fmt.Sprintf("%s%d", MemoNamePrefix, memoRelation.MemoID), + RelatedMemo: fmt.Sprintf("%s%d", MemoNamePrefix, memoRelation.RelatedMemoID), + Type: convertMemoRelationTypeFromStore(memoRelation.Type), } } diff --git a/server/route/api/v2/memo_resource_service.go b/server/route/api/v2/memo_resource_service.go index 9071d115d7f48..fd7b518c4f5b7 100644 --- a/server/route/api/v2/memo_resource_service.go +++ b/server/route/api/v2/memo_resource_service.go @@ -13,8 +13,12 @@ import ( ) func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.SetMemoResourcesRequest) (*apiv2pb.SetMemoResourcesResponse, error) { + memoID, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } resources, err := s.Store.ListResources(ctx, &store.FindResource{ - MemoID: &request.Id, + MemoID: &memoID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list resources") @@ -24,7 +28,7 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se for _, resource := range resources { found := false for _, requestResource := range request.Resources { - if resource.ID == int32(requestResource.Id) { + if resource.UID == requestResource.Uid { found = true break } @@ -32,7 +36,7 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se if !found { if err = s.Store.DeleteResource(ctx, &store.DeleteResource{ ID: int32(resource.ID), - MemoID: &request.Id, + MemoID: &memoID, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete resource") } @@ -42,10 +46,14 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se slices.Reverse(request.Resources) // Update resources' memo_id in the request. for index, resource := range request.Resources { + id, err := ExtractResourceIDFromName(resource.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource name: %v", err) + } updatedTs := time.Now().Unix() + int64(index) if _, err := s.Store.UpdateResource(ctx, &store.UpdateResource{ - ID: resource.Id, - MemoID: &request.Id, + ID: id, + MemoID: &memoID, UpdatedTs: &updatedTs, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to update resource: %v", err) @@ -56,8 +64,12 @@ func (s *APIV2Service) SetMemoResources(ctx context.Context, request *apiv2pb.Se } func (s *APIV2Service) ListMemoResources(ctx context.Context, request *apiv2pb.ListMemoResourcesRequest) (*apiv2pb.ListMemoResourcesResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } resources, err := s.Store.ListResources(ctx, &store.FindResource{ - MemoID: &request.Id, + MemoID: &id, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list resources") diff --git a/server/route/api/v2/memo_service.go b/server/route/api/v2/memo_service.go index 8eb732fc694c5..339020f882e7b 100644 --- a/server/route/api/v2/memo_service.go +++ b/server/route/api/v2/memo_service.go @@ -44,10 +44,10 @@ func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMe } create := &store.Memo{ - ResourceName: shortuuid.New(), - CreatorID: user.ID, - Content: request.Content, - Visibility: convertVisibilityToStore(request.Visibility), + UID: shortuuid.New(), + CreatorID: user.ID, + Content: request.Content, + Visibility: convertVisibilityToStore(request.Visibility), } // Find disable public memos system setting. disablePublicMemosSystem, err := s.getDisablePublicMemosSystemSettingValue(ctx) @@ -106,7 +106,7 @@ func (s *APIV2Service) ListMemos(ctx context.Context, request *apiv2pb.ListMemos memoFind.Offset = &offset memos, err := s.Store.ListMemos(ctx, memoFind) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to list memos") + return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err) } memoMessages := []*apiv2pb.Memo{} @@ -133,42 +133,45 @@ func (s *APIV2Service) ListMemos(ctx context.Context, request *apiv2pb.ListMemos return response, nil } -func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequest) (*apiv2pb.GetMemoResponse, error) { - memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Id, - }) +func (s *APIV2Service) SearchMemos(ctx context.Context, request *apiv2pb.SearchMemosRequest) (*apiv2pb.SearchMemosResponse, error) { + defaultSearchLimit := 10 + memoFind := &store.FindMemo{ + // Exclude comments by default. + ExcludeComments: true, + Limit: &defaultSearchLimit, + } + err := s.buildMemoFindWithFilter(ctx, memoFind, request.Filter) if err != nil { - return nil, err + return nil, status.Errorf(codes.InvalidArgument, "failed to build find memos with filter") } - if memo == nil { - return nil, status.Errorf(codes.NotFound, "memo not found") + + memos, err := s.Store.ListMemos(ctx, memoFind) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to search memos") } - if memo.Visibility != store.Public { - user, err := getCurrentUser(ctx, s.Store) + + memoMessages := []*apiv2pb.Memo{} + for _, memo := range memos { + memoMessage, err := s.convertMemoFromStore(ctx, memo) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get user") - } - if user == nil { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") - } - if memo.Visibility == store.Private && memo.CreatorID != user.ID { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") + return nil, errors.Wrap(err, "failed to convert memo") } + memoMessages = append(memoMessages, memoMessage) } - memoMessage, err := s.convertMemoFromStore(ctx, memo) - if err != nil { - return nil, errors.Wrap(err, "failed to convert memo") - } - response := &apiv2pb.GetMemoResponse{ - Memo: memoMessage, + response := &apiv2pb.SearchMemosResponse{ + Memos: memoMessages, } return response, nil } -func (s *APIV2Service) GetMemoByName(ctx context.Context, request *apiv2pb.GetMemoByNameRequest) (*apiv2pb.GetMemoByNameResponse, error) { +func (s *APIV2Service) GetMemo(ctx context.Context, request *apiv2pb.GetMemoRequest) (*apiv2pb.GetMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ResourceName: &request.Name, + ID: &id, }) if err != nil { return nil, err @@ -193,20 +196,22 @@ func (s *APIV2Service) GetMemoByName(ctx context.Context, request *apiv2pb.GetMe if err != nil { return nil, errors.Wrap(err, "failed to convert memo") } - response := &apiv2pb.GetMemoByNameResponse{ + response := &apiv2pb.GetMemoResponse{ Memo: memoMessage, } return response, nil } func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMemoRequest) (*apiv2pb.UpdateMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Memo.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is required") } - memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Memo.Id, - }) + memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &id}) if err != nil { return nil, err } @@ -221,15 +226,15 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe currentTs := time.Now().Unix() update := &store.UpdateMemo{ - ID: request.Memo.Id, + ID: id, UpdatedTs: ¤tTs, } for _, path := range request.UpdateMask.Paths { if path == "content" { update.Content = &request.Memo.Content - } else if path == "resource_name" { - update.ResourceName = &request.Memo.Name - if !util.ResourceNameMatcher.MatchString(*update.ResourceName) { + } else if path == "uid" { + update.UID = &request.Memo.Name + if !util.UIDMatcher.MatchString(*update.UID) { return nil, status.Errorf(codes.InvalidArgument, "invalid resource name") } } else if path == "visibility" { @@ -251,7 +256,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe update.CreatedTs = &createdTs } else if path == "pinned" { if _, err := s.Store.UpsertMemoOrganizer(ctx, &store.MemoOrganizer{ - MemoID: request.Memo.Id, + MemoID: id, UserID: user.ID, Pinned: request.Memo.Pinned, }); err != nil { @@ -268,7 +273,7 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe } memo, err = s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Memo.Id, + ID: &id, }) if err != nil { return nil, errors.Wrap(err, "failed to get memo") @@ -288,8 +293,12 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe } func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMemoRequest) (*apiv2pb.DeleteMemoResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ID: &request.Id, + ID: &id, }) if err != nil { return nil, err @@ -310,9 +319,7 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe } } - if err = s.Store.DeleteMemo(ctx, &store.DeleteMemo{ - ID: request.Id, - }); err != nil { + if err = s.Store.DeleteMemo(ctx, &store.DeleteMemo{ID: id}); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete memo") } @@ -320,36 +327,48 @@ func (s *APIV2Service) DeleteMemo(ctx context.Context, request *apiv2pb.DeleteMe } func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.CreateMemoCommentRequest) (*apiv2pb.CreateMemoCommentResponse, error) { - relatedMemo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &request.Id}) + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } + relatedMemo, err := s.Store.GetMemo(ctx, &store.FindMemo{ID: &id}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get memo") } // Create the comment memo first. - createMemoResponse, err := s.CreateMemo(ctx, request.Create) + createMemoResponse, err := s.CreateMemo(ctx, request.Comment) if err != nil { return nil, status.Errorf(codes.Internal, "failed to create memo") } // Build the relation between the comment memo and the original memo. memo := createMemoResponse.Memo + memoID, err := ExtractMemoIDFromName(memo.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } _, err = s.Store.UpsertMemoRelation(ctx, &store.MemoRelation{ - MemoID: memo.Id, - RelatedMemoID: request.Id, + MemoID: memoID, + RelatedMemoID: relatedMemo.ID, Type: store.MemoRelationComment, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to create memo relation") } - if memo.Visibility != apiv2pb.Visibility_PRIVATE && memo.CreatorId != relatedMemo.CreatorID { + creatorID, err := ExtractUserIDFromName(memo.Creator) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo creator") + } + if memo.Visibility != apiv2pb.Visibility_PRIVATE && creatorID != relatedMemo.CreatorID { activity, err := s.Store.CreateActivity(ctx, &store.Activity{ - CreatorID: memo.CreatorId, + CreatorID: creatorID, Type: store.ActivityTypeMemoComment, Level: store.ActivityLevelInfo, Payload: &storepb.ActivityPayload{ MemoComment: &storepb.ActivityMemoCommentPayload{ - MemoId: memo.Id, - RelatedMemoId: request.Id, + MemoId: memoID, + RelatedMemoId: relatedMemo.ID, }, }, }) @@ -357,7 +376,7 @@ func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.C return nil, status.Errorf(codes.Internal, "failed to create activity") } if _, err := s.Store.CreateInbox(ctx, &store.Inbox{ - SenderID: memo.CreatorId, + SenderID: creatorID, ReceiverID: relatedMemo.CreatorID, Status: store.UNREAD, Message: &storepb.InboxMessage{ @@ -376,9 +395,13 @@ func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.C } func (s *APIV2Service) ListMemoComments(ctx context.Context, request *apiv2pb.ListMemoCommentsRequest) (*apiv2pb.ListMemoCommentsResponse, error) { + id, err := ExtractMemoIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo name: %v", err) + } memoRelationComment := store.MemoRelationComment memoRelations, err := s.Store.ListMemoRelations(ctx, &store.FindMemoRelation{ - RelatedMemoID: &request.Id, + RelatedMemoID: &id, Type: &memoRelationComment, }) if err != nil { @@ -409,12 +432,12 @@ func (s *APIV2Service) ListMemoComments(ctx context.Context, request *apiv2pb.Li } func (s *APIV2Service) GetUserMemosStats(ctx context.Context, request *apiv2pb.GetUserMemosStatsRequest) (*apiv2pb.GetUserMemosStatsResponse, error) { - username, err := ExtractUsernameFromName(request.Name) + userID, err := ExtractUserIDFromName(request.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username") + return nil, errors.Wrap(err, "invalid user name") } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user") @@ -436,7 +459,7 @@ func (s *APIV2Service) GetUserMemosStats(ctx context.Context, request *apiv2pb.G memos, err := s.Store.ListMemos(ctx, memoFind) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to list memos") + return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err) } location, err := time.LoadLocation(request.Timezone) @@ -471,12 +494,12 @@ func (s *APIV2Service) ExportMemos(ctx context.Context, request *apiv2pb.ExportM ExcludeComments: true, } if err := s.buildMemoFindWithFilter(ctx, memoFind, request.Filter); err != nil { - return nil, status.Errorf(codes.Internal, "failed to build find memos with filter") + return nil, status.Errorf(codes.Internal, "failed to build find memos with filter: %v", err) } memos, err := s.Store.ListMemos(ctx, memoFind) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to list memos") + return nil, status.Errorf(codes.Internal, "failed to list memos: %v", err) } buf := new(bytes.Buffer) @@ -515,27 +538,27 @@ func (s *APIV2Service) convertMemoFromStore(ctx context.Context, memo *store.Mem return nil, errors.Wrap(err, "failed to get creator") } - listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &apiv2pb.ListMemoRelationsRequest{Id: memo.ID}) + name := fmt.Sprintf("%s%d", MemoNamePrefix, memo.ID) + listMemoRelationsResponse, err := s.ListMemoRelations(ctx, &apiv2pb.ListMemoRelationsRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo relations") } - listMemoResourcesResponse, err := s.ListMemoResources(ctx, &apiv2pb.ListMemoResourcesRequest{Id: memo.ID}) + listMemoResourcesResponse, err := s.ListMemoResources(ctx, &apiv2pb.ListMemoResourcesRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo resources") } - listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &apiv2pb.ListMemoReactionsRequest{Id: memo.ID}) + listMemoReactionsResponse, err := s.ListMemoReactions(ctx, &apiv2pb.ListMemoReactionsRequest{Name: name}) if err != nil { return nil, errors.Wrap(err, "failed to list memo reactions") } return &apiv2pb.Memo{ - Id: int32(memo.ID), - Name: memo.ResourceName, + Name: name, + Uid: memo.UID, RowStatus: convertRowStatusFromStore(memo.RowStatus), - Creator: fmt.Sprintf("%s%s", UserNamePrefix, creator.Username), - CreatorId: int32(memo.CreatorID), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, creator.ID), CreateTime: timestamppb.New(time.Unix(memo.CreatedTs, 0)), UpdateTime: timestamppb.New(time.Unix(memo.UpdatedTs, 0)), DisplayTime: timestamppb.New(time.Unix(displayTs, 0)), @@ -617,7 +640,7 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. find = &store.FindMemo{} } if filter != "" { - filter, err := parseListMemosFilter(filter) + filter, err := parseSearchMemosFilter(filter) if err != nil { return status.Errorf(codes.InvalidArgument, "invalid filter: %v", err) } @@ -653,12 +676,12 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. } } if filter.Creator != nil { - username, err := ExtractUsernameFromName(*filter.Creator) + userID, err := ExtractUserIDFromName(*filter.Creator) if err != nil { - return status.Errorf(codes.InvalidArgument, "invalid creator name") + return errors.Wrap(err, "invalid user name") } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return status.Errorf(codes.Internal, "failed to get user") @@ -668,9 +691,18 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. } find.CreatorID = &user.ID } + if filter.UID != nil { + find.UID = filter.UID + } if filter.RowStatus != nil { find.RowStatus = filter.RowStatus } + if filter.Random { + find.Random = filter.Random + } + if filter.Limit != nil { + find.Limit = filter.Limit + } } // If the user is not authenticated, only public memos are visible. @@ -695,29 +727,35 @@ func (s *APIV2Service) buildMemoFindWithFilter(ctx context.Context, find *store. return nil } -// ListMemosFilterCELAttributes are the CEL attributes for ListMemosFilter. -var ListMemosFilterCELAttributes = []cel.EnvOption{ +// SearchMemosFilterCELAttributes are the CEL attributes. +var SearchMemosFilterCELAttributes = []cel.EnvOption{ cel.Variable("content_search", cel.ListType(cel.StringType)), cel.Variable("visibilities", cel.ListType(cel.StringType)), cel.Variable("order_by_pinned", cel.BoolType), cel.Variable("display_time_before", cel.IntType), cel.Variable("display_time_after", cel.IntType), cel.Variable("creator", cel.StringType), + cel.Variable("uid", cel.StringType), cel.Variable("row_status", cel.StringType), + cel.Variable("random", cel.BoolType), + cel.Variable("limit", cel.IntType), } -type ListMemosFilter struct { +type SearchMemosFilter struct { ContentSearch []string Visibilities []store.Visibility OrderByPinned bool DisplayTimeBefore *int64 DisplayTimeAfter *int64 Creator *string + UID *string RowStatus *store.RowStatus + Random bool + Limit *int } -func parseListMemosFilter(expression string) (*ListMemosFilter, error) { - e, err := cel.NewEnv(ListMemosFilterCELAttributes...) +func parseSearchMemosFilter(expression string) (*SearchMemosFilter, error) { + e, err := cel.NewEnv(SearchMemosFilterCELAttributes...) if err != nil { return nil, err } @@ -725,17 +763,17 @@ func parseListMemosFilter(expression string) (*ListMemosFilter, error) { if issues != nil { return nil, errors.Errorf("found issue %v", issues) } - filter := &ListMemosFilter{} + filter := &SearchMemosFilter{} expr, err := cel.AstToParsedExpr(ast) if err != nil { return nil, err } callExpr := expr.GetExpr().GetCallExpr() - findField(callExpr, filter) + findSearchMemosField(callExpr, filter) return filter, nil } -func findField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { +func findSearchMemosField(callExpr *expr.Expr_Call, filter *SearchMemosFilter) { if len(callExpr.Args) == 2 { idExpr := callExpr.Args[0].GetIdentExpr() if idExpr != nil { @@ -765,9 +803,18 @@ func findField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { } else if idExpr.Name == "creator" { creator := callExpr.Args[1].GetConstExpr().GetStringValue() filter.Creator = &creator + } else if idExpr.Name == "uid" { + uid := callExpr.Args[1].GetConstExpr().GetStringValue() + filter.UID = &uid } else if idExpr.Name == "row_status" { rowStatus := store.RowStatus(callExpr.Args[1].GetConstExpr().GetStringValue()) filter.RowStatus = &rowStatus + } else if idExpr.Name == "random" { + value := callExpr.Args[1].GetConstExpr().GetBoolValue() + filter.Random = value + } else if idExpr.Name == "limit" { + limit := int(callExpr.Args[1].GetConstExpr().GetInt64Value()) + filter.Limit = &limit } return } @@ -775,7 +822,7 @@ func findField(callExpr *expr.Expr_Call, filter *ListMemosFilter) { for _, arg := range callExpr.Args { callExpr := arg.GetCallExpr() if callExpr != nil { - findField(callExpr, filter) + findSearchMemosField(callExpr, filter) } } } @@ -796,31 +843,45 @@ func (s *APIV2Service) DispatchMemoDeletedWebhook(ctx context.Context, memo *api } func (s *APIV2Service) dispatchMemoRelatedWebhook(ctx context.Context, memo *apiv2pb.Memo, activityType string) error { + creatorID, err := ExtractUserIDFromName(memo.Creator) + if err != nil { + return status.Errorf(codes.InvalidArgument, "invalid memo creator") + } webhooks, err := s.Store.ListWebhooks(ctx, &store.FindWebhook{ - CreatorID: &memo.CreatorId, + CreatorID: &creatorID, }) if err != nil { return err } for _, hook := range webhooks { - payload := convertMemoToWebhookPayload(memo) + payload, err := convertMemoToWebhookPayload(memo) + if err != nil { + return errors.Wrap(err, "failed to convert memo to webhook payload") + } payload.ActivityType = activityType payload.URL = hook.Url - err := webhook.Post(*payload) - if err != nil { + if err := webhook.Post(*payload); err != nil { return errors.Wrap(err, "failed to post webhook") } } return nil } -func convertMemoToWebhookPayload(memo *apiv2pb.Memo) *webhook.WebhookPayload { +func convertMemoToWebhookPayload(memo *apiv2pb.Memo) (*webhook.WebhookPayload, error) { + creatorID, err := ExtractUserIDFromName(memo.Creator) + if err != nil { + return nil, errors.Wrap(err, "invalid memo creator") + } + id, err := ExtractMemoIDFromName(memo.Name) + if err != nil { + return nil, errors.Wrap(err, "invalid memo name") + } return &webhook.WebhookPayload{ - CreatorID: memo.CreatorId, + CreatorID: creatorID, CreatedTs: time.Now().Unix(), Memo: &webhook.Memo{ - ID: memo.Id, - CreatorID: memo.CreatorId, + ID: id, + CreatorID: creatorID, CreatedTs: memo.CreateTime.Seconds, UpdatedTs: memo.UpdateTime.Seconds, Content: memo.Content, @@ -830,7 +891,7 @@ func convertMemoToWebhookPayload(memo *apiv2pb.Memo) *webhook.WebhookPayload { resources := []*webhook.Resource{} for _, resource := range memo.Resources { resources = append(resources, &webhook.Resource{ - ID: resource.Id, + UID: resource.Uid, Filename: resource.Filename, ExternalLink: resource.ExternalLink, Type: resource.Type, @@ -839,17 +900,6 @@ func convertMemoToWebhookPayload(memo *apiv2pb.Memo) *webhook.WebhookPayload { } return resources }(), - RelationList: func() []*webhook.MemoRelation { - relations := []*webhook.MemoRelation{} - for _, relation := range memo.Relations { - relations = append(relations, &webhook.MemoRelation{ - MemoID: relation.MemoId, - RelatedMemoID: relation.RelatedMemoId, - Type: relation.Type.String(), - }) - } - return relations - }(), }, - } + }, nil } diff --git a/server/route/api/v2/reaction_service.go b/server/route/api/v2/reaction_service.go index 8a507bc2d2d84..94f27d50df001 100644 --- a/server/route/api/v2/reaction_service.go +++ b/server/route/api/v2/reaction_service.go @@ -13,9 +13,8 @@ import ( ) func (s *APIV2Service) ListMemoReactions(ctx context.Context, request *apiv2pb.ListMemoReactionsRequest) (*apiv2pb.ListMemoReactionsResponse, error) { - contentID := fmt.Sprintf("memos/%d", request.Id) reactions, err := s.Store.ListReactions(ctx, &store.FindReaction{ - ContentID: &contentID, + ContentID: &request.Name, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list reactions") @@ -59,7 +58,7 @@ func (s *APIV2Service) UpsertMemoReaction(ctx context.Context, request *apiv2pb. func (s *APIV2Service) DeleteMemoReaction(ctx context.Context, request *apiv2pb.DeleteMemoReactionRequest) (*apiv2pb.DeleteMemoReactionResponse, error) { if err := s.Store.DeleteReaction(ctx, &store.DeleteReaction{ - ID: request.Id, + ID: request.ReactionId, }); err != nil { return nil, status.Errorf(codes.Internal, "failed to delete reaction") } @@ -76,7 +75,7 @@ func (s *APIV2Service) convertReactionFromStore(ctx context.Context, reaction *s } return &apiv2pb.Reaction{ Id: reaction.Id, - Creator: fmt.Sprintf("%s%s", UserNamePrefix, creator.Username), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, creator.ID), ContentId: reaction.ContentId, ReactionType: apiv2pb.Reaction_Type(reaction.ReactionType), }, nil diff --git a/server/route/api/v2/resource_name.go b/server/route/api/v2/resource_name.go index a2987dfbd3bbb..0aebea390244b 100644 --- a/server/route/api/v2/resource_name.go +++ b/server/route/api/v2/resource_name.go @@ -12,6 +12,8 @@ import ( const ( WorkspaceSettingNamePrefix = "settings/" UserNamePrefix = "users/" + MemoNamePrefix = "memos/" + ResourceNamePrefix = "resources/" InboxNamePrefix = "inboxes/" ) @@ -43,13 +45,43 @@ func ExtractWorkspaceSettingKeyFromName(name string) (string, error) { return tokens[0], nil } -// ExtractUsernameFromName returns the username from a resource name. -func ExtractUsernameFromName(name string) (string, error) { +// ExtractUserIDFromName returns the uid from a resource name. +func ExtractUserIDFromName(name string) (int32, error) { tokens, err := GetNameParentTokens(name, UserNamePrefix) if err != nil { - return "", err + return 0, err } - return tokens[0], nil + id, err := util.ConvertStringToInt32(tokens[0]) + if err != nil { + return 0, errors.Errorf("invalid user ID %q", tokens[0]) + } + return id, nil +} + +// ExtractMemoIDFromName returns the memo ID from a resource name. +func ExtractMemoIDFromName(name string) (int32, error) { + tokens, err := GetNameParentTokens(name, MemoNamePrefix) + if err != nil { + return 0, err + } + id, err := util.ConvertStringToInt32(tokens[0]) + if err != nil { + return 0, errors.Errorf("invalid memo ID %q", tokens[0]) + } + return id, nil +} + +// ExtractResourceIDFromName returns the resource ID from a resource name. +func ExtractResourceIDFromName(name string) (int32, error) { + tokens, err := GetNameParentTokens(name, ResourceNamePrefix) + if err != nil { + return 0, err + } + id, err := util.ConvertStringToInt32(tokens[0]) + if err != nil { + return 0, errors.Errorf("invalid resource ID %q", tokens[0]) + } + return id, nil } // ExtractInboxIDFromName returns the inbox ID from a resource name. diff --git a/server/route/api/v2/resource_service.go b/server/route/api/v2/resource_service.go index 88c25690f59db..705f78c2068e8 100644 --- a/server/route/api/v2/resource_service.go +++ b/server/route/api/v2/resource_service.go @@ -2,10 +2,14 @@ package v2 import ( "context" + "fmt" "net/url" "time" + "github.com/google/cel-go/cel" "github.com/lithammer/shortuuid/v4" + "github.com/pkg/errors" + expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" @@ -31,14 +35,18 @@ func (s *APIV2Service) CreateResource(ctx context.Context, request *apiv2pb.Crea } create := &store.Resource{ - ResourceName: shortuuid.New(), + UID: shortuuid.New(), CreatorID: user.ID, Filename: request.Filename, ExternalLink: request.ExternalLink, Type: request.Type, } - if request.MemoId != nil { - create.MemoID = request.MemoId + if request.Memo != nil { + memoID, err := ExtractMemoIDFromName(*request.Memo) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo id: %v", err) + } + create.MemoID = &memoID } resource, err := s.Store.CreateResource(ctx, create) if err != nil { @@ -69,25 +77,42 @@ func (s *APIV2Service) ListResources(ctx context.Context, _ *apiv2pb.ListResourc return response, nil } -func (s *APIV2Service) GetResource(ctx context.Context, request *apiv2pb.GetResourceRequest) (*apiv2pb.GetResourceResponse, error) { - resource, err := s.Store.GetResource(ctx, &store.FindResource{ - ID: &request.Id, - }) +func (s *APIV2Service) SearchResources(ctx context.Context, request *apiv2pb.SearchResourcesRequest) (*apiv2pb.SearchResourcesResponse, error) { + if request.Filter == "" { + return nil, status.Errorf(codes.InvalidArgument, "filter is empty") + } + filter, err := parseSearchResourcesFilter(request.Filter) if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get resource: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "failed to parse filter: %v", err) } - if resource == nil { - return nil, status.Errorf(codes.NotFound, "resource not found") + resourceFind := &store.FindResource{} + if filter.UID != nil { + resourceFind.UID = filter.UID + } + user, err := getCurrentUser(ctx, s.Store) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) + } + resourceFind.CreatorID = &user.ID + resources, err := s.Store.ListResources(ctx, resourceFind) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to search resources: %v", err) } - return &apiv2pb.GetResourceResponse{ - Resource: s.convertResourceFromStore(ctx, resource), - }, nil + response := &apiv2pb.SearchResourcesResponse{} + for _, resource := range resources { + response.Resources = append(response.Resources, s.convertResourceFromStore(ctx, resource)) + } + return response, nil } -func (s *APIV2Service) GetResourceByName(ctx context.Context, request *apiv2pb.GetResourceByNameRequest) (*apiv2pb.GetResourceByNameResponse, error) { +func (s *APIV2Service) GetResource(ctx context.Context, request *apiv2pb.GetResourceRequest) (*apiv2pb.GetResourceResponse, error) { + id, err := ExtractResourceIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource id: %v", err) + } resource, err := s.Store.GetResource(ctx, &store.FindResource{ - ResourceName: &request.Name, + ID: &id, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get resource: %v", err) @@ -96,26 +121,37 @@ func (s *APIV2Service) GetResourceByName(ctx context.Context, request *apiv2pb.G return nil, status.Errorf(codes.NotFound, "resource not found") } - return &apiv2pb.GetResourceByNameResponse{ + return &apiv2pb.GetResourceResponse{ Resource: s.convertResourceFromStore(ctx, resource), }, nil } func (s *APIV2Service) UpdateResource(ctx context.Context, request *apiv2pb.UpdateResourceRequest) (*apiv2pb.UpdateResourceResponse, error) { + id, err := ExtractResourceIDFromName(request.Resource.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource id: %v", err) + } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is required") } currentTs := time.Now().Unix() update := &store.UpdateResource{ - ID: request.Resource.Id, + ID: id, UpdatedTs: ¤tTs, } for _, field := range request.UpdateMask.Paths { if field == "filename" { update.Filename = &request.Resource.Filename - } else if field == "memo_id" { - update.MemoID = request.Resource.MemoId + } else if field == "memo" { + if request.Resource.Memo == nil { + return nil, status.Errorf(codes.InvalidArgument, "memo is required") + } + memoID, err := ExtractMemoIDFromName(*request.Resource.Memo) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid memo id: %v", err) + } + update.MemoID = &memoID } } @@ -129,12 +165,16 @@ func (s *APIV2Service) UpdateResource(ctx context.Context, request *apiv2pb.Upda } func (s *APIV2Service) DeleteResource(ctx context.Context, request *apiv2pb.DeleteResourceRequest) (*apiv2pb.DeleteResourceResponse, error) { + id, err := ExtractResourceIDFromName(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "invalid resource id: %v", err) + } user, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } resource, err := s.Store.GetResource(ctx, &store.FindResource{ - ID: &request.Id, + ID: &id, CreatorID: &user.ID, }) if err != nil { @@ -153,24 +193,71 @@ func (s *APIV2Service) DeleteResource(ctx context.Context, request *apiv2pb.Dele } func (s *APIV2Service) convertResourceFromStore(ctx context.Context, resource *store.Resource) *apiv2pb.Resource { - var memoID *int32 + resourceMessage := &apiv2pb.Resource{ + Name: fmt.Sprintf("%s%d", ResourceNamePrefix, resource.ID), + Uid: resource.UID, + CreateTime: timestamppb.New(time.Unix(resource.CreatedTs, 0)), + Filename: resource.Filename, + ExternalLink: resource.ExternalLink, + Type: resource.Type, + Size: resource.Size, + } if resource.MemoID != nil { memo, _ := s.Store.GetMemo(ctx, &store.FindMemo{ ID: resource.MemoID, }) if memo != nil { - memoID = &memo.ID + memoName := fmt.Sprintf("%s%d", MemoNamePrefix, memo.ID) + resourceMessage.Memo = &memoName } } - return &apiv2pb.Resource{ - Id: resource.ID, - Name: resource.ResourceName, - CreateTime: timestamppb.New(time.Unix(resource.CreatedTs, 0)), - Filename: resource.Filename, - ExternalLink: resource.ExternalLink, - Type: resource.Type, - Size: resource.Size, - MemoId: memoID, + return resourceMessage +} + +// SearchResourcesFilterCELAttributes are the CEL attributes for SearchResourcesFilter. +var SearchResourcesFilterCELAttributes = []cel.EnvOption{ + cel.Variable("uid", cel.StringType), +} + +type SearchResourcesFilter struct { + UID *string +} + +func parseSearchResourcesFilter(expression string) (*SearchResourcesFilter, error) { + e, err := cel.NewEnv(SearchResourcesFilterCELAttributes...) + if err != nil { + return nil, err + } + ast, issues := e.Compile(expression) + if issues != nil { + return nil, errors.Errorf("found issue %v", issues) + } + filter := &SearchResourcesFilter{} + expr, err := cel.AstToParsedExpr(ast) + if err != nil { + return nil, err + } + callExpr := expr.GetExpr().GetCallExpr() + findSearchResourcesField(callExpr, filter) + return filter, nil +} + +func findSearchResourcesField(callExpr *expr.Expr_Call, filter *SearchResourcesFilter) { + if len(callExpr.Args) == 2 { + idExpr := callExpr.Args[0].GetIdentExpr() + if idExpr != nil { + if idExpr.Name == "uid" { + uid := callExpr.Args[1].GetConstExpr().GetStringValue() + filter.UID = &uid + } + return + } + } + for _, arg := range callExpr.Args { + callExpr := arg.GetCallExpr() + if callExpr != nil { + findSearchResourcesField(callExpr, filter) + } } } diff --git a/server/route/api/v2/tag_service.go b/server/route/api/v2/tag_service.go index 3e888a86a74c0..431c596d39961 100644 --- a/server/route/api/v2/tag_service.go +++ b/server/route/api/v2/tag_service.go @@ -51,22 +51,13 @@ func (s *APIV2Service) BatchUpsertTag(ctx context.Context, request *apiv2pb.Batc } func (s *APIV2Service) ListTags(ctx context.Context, request *apiv2pb.ListTagsRequest) (*apiv2pb.ListTagsResponse, error) { - username, err := ExtractUsernameFromName(request.User) + tagFind := &store.FindTag{} + userID, err := ExtractUserIDFromName(request.User) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } - user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, - }) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) - } - if user == nil { - return nil, status.Errorf(codes.NotFound, "user not found") - } - tags, err := s.Store.ListTags(ctx, &store.FindTag{ - CreatorID: user.ID, - }) + tagFind.CreatorID = userID + tags, err := s.Store.ListTags(ctx, tagFind) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list tags: %v", err) } @@ -83,12 +74,12 @@ func (s *APIV2Service) ListTags(ctx context.Context, request *apiv2pb.ListTagsRe } func (s *APIV2Service) RenameTag(ctx context.Context, request *apiv2pb.RenameTagRequest) (*apiv2pb.RenameTagResponse, error) { - username, err := ExtractUsernameFromName(request.User) + userID, err := ExtractUserIDFromName(request.User) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -148,12 +139,12 @@ func (s *APIV2Service) RenameTag(ctx context.Context, request *apiv2pb.RenameTag } func (s *APIV2Service) DeleteTag(ctx context.Context, request *apiv2pb.DeleteTagRequest) (*apiv2pb.DeleteTagResponse, error) { - username, err := ExtractUsernameFromName(request.Tag.Creator) + userID, err := ExtractUserIDFromName(request.Tag.Creator) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -172,12 +163,12 @@ func (s *APIV2Service) DeleteTag(ctx context.Context, request *apiv2pb.DeleteTag } func (s *APIV2Service) GetTagSuggestions(ctx context.Context, request *apiv2pb.GetTagSuggestionsRequest) (*apiv2pb.GetTagSuggestionsResponse, error) { - username, err := ExtractUsernameFromName(request.User) + userID, err := ExtractUserIDFromName(request.User) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %v", err) + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -244,7 +235,7 @@ func (s *APIV2Service) convertTagFromStore(ctx context.Context, tag *store.Tag) } return &apiv2pb.Tag{ Name: tag.Name, - Creator: fmt.Sprintf("%s%s", UserNamePrefix, user.Username), + Creator: fmt.Sprintf("%s%d", UserNamePrefix, user.ID), }, nil } diff --git a/server/route/api/v2/user_service.go b/server/route/api/v2/user_service.go index 16f3732798a83..6175dd92ce8cb 100644 --- a/server/route/api/v2/user_service.go +++ b/server/route/api/v2/user_service.go @@ -4,14 +4,16 @@ import ( "context" "fmt" "net/http" + "slices" "strings" "time" "github.com/golang-jwt/jwt/v5" + "github.com/google/cel-go/cel" "github.com/labstack/echo/v4" "github.com/pkg/errors" "golang.org/x/crypto/bcrypt" - "golang.org/x/exp/slices" + expr "google.golang.org/genproto/googleapis/api/expr/v1alpha1" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "google.golang.org/protobuf/types/known/timestamppb" @@ -46,13 +48,46 @@ func (s *APIV2Service) ListUsers(ctx context.Context, _ *apiv2pb.ListUsersReques return response, nil } +func (s *APIV2Service) SearchUsers(ctx context.Context, request *apiv2pb.SearchUsersRequest) (*apiv2pb.SearchUsersResponse, error) { + if request.Filter == "" { + return nil, status.Errorf(codes.InvalidArgument, "filter is empty") + } + filter, err := parseSearchUsersFilter(request.Filter) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "failed to parse filter: %v", err) + } + userFind := &store.FindUser{} + if filter.Username != nil { + userFind.Username = filter.Username + } + if filter.Random { + userFind.Random = true + } + if filter.Limit != nil { + userFind.Limit = filter.Limit + } + + users, err := s.Store.ListUsers(ctx, userFind) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to search users: %v", err) + } + + response := &apiv2pb.SearchUsersResponse{ + Users: []*apiv2pb.User{}, + } + for _, user := range users { + response.Users = append(response.Users, convertUserFromStore(user)) + } + return response, nil +} + func (s *APIV2Service) GetUser(ctx context.Context, request *apiv2pb.GetUserRequest) (*apiv2pb.GetUserResponse, error) { - username, err := ExtractUsernameFromName(request.Name) + userID, err := ExtractUserIDFromName(request.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &username, + ID: &userID, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -76,13 +111,8 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs if currentUser.Role != store.RoleHost { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - - username, err := ExtractUsernameFromName(request.User.Name) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") - } - if !util.ResourceNameMatcher.MatchString(strings.ToLower(username)) { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", username) + if !util.UIDMatcher.MatchString(strings.ToLower(request.User.Username)) { + return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", request.User.Username) } passwordHash, err := bcrypt.GenerateFromPassword([]byte(request.User.Password), bcrypt.DefaultCost) if err != nil { @@ -90,7 +120,7 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs } user, err := s.Store.CreateUser(ctx, &store.User{ - Username: username, + Username: request.User.Username, Role: convertUserRoleToStore(request.User.Role), Email: request.User.Email, Nickname: request.User.Nickname, @@ -107,22 +137,22 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs } func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUserRequest) (*apiv2pb.UpdateUserResponse, error) { - username, err := ExtractUsernameFromName(request.User.Name) + userID, err := ExtractUserIDFromName(request.User.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } - if currentUser.Username != username && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { + if currentUser.ID != userID && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { return nil, status.Errorf(codes.InvalidArgument, "update mask is empty") } - user, err := s.Store.GetUser(ctx, &store.FindUser{Username: &username}) + user, err := s.Store.GetUser(ctx, &store.FindUser{ID: &userID}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } @@ -130,10 +160,6 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs return nil, status.Errorf(codes.NotFound, "user not found") } - if s.Profile.Mode == "demo" && user.Username == "memos-demo" { - return nil, status.Errorf(codes.PermissionDenied, "unauthorized to update user in demo mode") - } - currentTs := time.Now().Unix() update := &store.UpdateUser{ ID: user.ID, @@ -141,7 +167,7 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs } for _, field := range request.UpdateMask.Paths { if field == "username" { - if !util.ResourceNameMatcher.MatchString(strings.ToLower(request.User.Username)) { + if !util.UIDMatcher.MatchString(strings.ToLower(request.User.Username)) { return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", request.User.Username) } update.Username = &request.User.Username @@ -151,6 +177,8 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs update.Email = &request.User.Email } else if field == "avatar_url" { update.AvatarURL = &request.User.AvatarUrl + } else if field == "description" { + update.Description = &request.User.Description } else if field == "role" { role := convertUserRoleToStore(request.User.Role) update.Role = &role @@ -181,19 +209,19 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs } func (s *APIV2Service) DeleteUser(ctx context.Context, request *apiv2pb.DeleteUserRequest) (*apiv2pb.DeleteUserResponse, error) { - username, err := ExtractUsernameFromName(request.Name) + userID, err := ExtractUserIDFromName(request.Name) if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") + return nil, status.Errorf(codes.InvalidArgument, "invalid user name: %v", err) } currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } - if currentUser.Username != username && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { + if currentUser.ID != userID && currentUser.Role != store.RoleAdmin && currentUser.Role != store.RoleHost { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - user, err := s.Store.GetUser(ctx, &store.FindUser{Username: &username}) + user, err := s.Store.GetUser(ctx, &store.FindUser{ID: &userID}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } @@ -201,10 +229,6 @@ func (s *APIV2Service) DeleteUser(ctx context.Context, request *apiv2pb.DeleteUs return nil, status.Errorf(codes.NotFound, "user not found") } - if s.Profile.Mode == "demo" && user.Username == "memos-demo" { - return nil, status.Errorf(codes.PermissionDenied, "unauthorized to delete this user in demo mode") - } - if err := s.Store.DeleteUser(ctx, &store.DeleteUser{ ID: user.ID, }); err != nil { @@ -316,36 +340,16 @@ func (s *APIV2Service) UpdateUserSetting(ctx context.Context, request *apiv2pb.U }, nil } -func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv2pb.ListUserAccessTokensRequest) (*apiv2pb.ListUserAccessTokensResponse, error) { - user, err := getCurrentUser(ctx, s.Store) +func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, _ *apiv2pb.ListUserAccessTokensRequest) (*apiv2pb.ListUserAccessTokensResponse, error) { + currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } - if user == nil { + if currentUser == nil { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - userID := user.ID - username, err := ExtractUsernameFromName(request.Name) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "name is required") - } - // List access token for other users need to be verified. - if user.Username != username { - // Normal users can only list their access tokens. - if user.Role == store.RoleUser { - return nil, status.Errorf(codes.PermissionDenied, "permission denied") - } - - // The request user must be exist. - requestUser, err := s.Store.GetUser(ctx, &store.FindUser{Username: &username}) - if requestUser == nil || err != nil { - return nil, status.Errorf(codes.NotFound, "fail to find user %s", username) - } - userID = requestUser.ID - } - - userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, userID) + userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, currentUser.ID) if err != nil { return nil, status.Errorf(codes.Internal, "failed to list access tokens: %v", err) } @@ -505,16 +509,17 @@ func (s *APIV2Service) UpsertAccessTokenToStore(ctx context.Context, user *store func convertUserFromStore(user *store.User) *apiv2pb.User { return &apiv2pb.User{ - Name: fmt.Sprintf("%s%s", UserNamePrefix, user.Username), - Id: user.ID, - RowStatus: convertRowStatusFromStore(user.RowStatus), - CreateTime: timestamppb.New(time.Unix(user.CreatedTs, 0)), - UpdateTime: timestamppb.New(time.Unix(user.UpdatedTs, 0)), - Role: convertUserRoleFromStore(user.Role), - Username: user.Username, - Email: user.Email, - Nickname: user.Nickname, - AvatarUrl: user.AvatarURL, + Name: fmt.Sprintf("%s%d", UserNamePrefix, user.ID), + Id: user.ID, + RowStatus: convertRowStatusFromStore(user.RowStatus), + CreateTime: timestamppb.New(time.Unix(user.CreatedTs, 0)), + UpdateTime: timestamppb.New(time.Unix(user.UpdatedTs, 0)), + Role: convertUserRoleFromStore(user.Role), + Username: user.Username, + Email: user.Email, + Nickname: user.Nickname, + AvatarUrl: user.AvatarURL, + Description: user.Description, } } @@ -543,3 +548,60 @@ func convertUserRoleToStore(role apiv2pb.User_Role) store.Role { return store.RoleUser } } + +// SearchUsersFilterCELAttributes are the CEL attributes for SearchUsersFilter. +var SearchUsersFilterCELAttributes = []cel.EnvOption{ + cel.Variable("username", cel.StringType), + cel.Variable("random", cel.BoolType), + cel.Variable("limit", cel.IntType), +} + +type SearchUsersFilter struct { + Username *string + Random bool + Limit *int +} + +func parseSearchUsersFilter(expression string) (*SearchUsersFilter, error) { + e, err := cel.NewEnv(SearchUsersFilterCELAttributes...) + if err != nil { + return nil, err + } + ast, issues := e.Compile(expression) + if issues != nil { + return nil, errors.Errorf("found issue %v", issues) + } + filter := &SearchUsersFilter{} + expr, err := cel.AstToParsedExpr(ast) + if err != nil { + return nil, err + } + callExpr := expr.GetExpr().GetCallExpr() + findSearchUsersField(callExpr, filter) + return filter, nil +} + +func findSearchUsersField(callExpr *expr.Expr_Call, filter *SearchUsersFilter) { + if len(callExpr.Args) == 2 { + idExpr := callExpr.Args[0].GetIdentExpr() + if idExpr != nil { + if idExpr.Name == "username" { + username := callExpr.Args[1].GetConstExpr().GetStringValue() + filter.Username = &username + } else if idExpr.Name == "random" { + random := callExpr.Args[1].GetConstExpr().GetBoolValue() + filter.Random = random + } else if idExpr.Name == "limit" { + limit := int(callExpr.Args[1].GetConstExpr().GetInt64Value()) + filter.Limit = &limit + } + return + } + } + for _, arg := range callExpr.Args { + callExpr := arg.GetCallExpr() + if callExpr != nil { + findSearchUsersField(callExpr, filter) + } + } +} diff --git a/server/route/api/v2/workspace_service.go b/server/route/api/v2/workspace_service.go index 78b31a7e2689b..e6251b2747b6b 100644 --- a/server/route/api/v2/workspace_service.go +++ b/server/route/api/v2/workspace_service.go @@ -3,15 +3,57 @@ package v2 import ( "context" + "github.com/pkg/errors" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + apiv2pb "github.com/usememos/memos/proto/gen/api/v2" + "github.com/usememos/memos/store" ) -func (s *APIV2Service) GetWorkspaceProfile(_ context.Context, _ *apiv2pb.GetWorkspaceProfileRequest) (*apiv2pb.GetWorkspaceProfileResponse, error) { +var ownerCache *apiv2pb.User + +func (s *APIV2Service) GetWorkspaceProfile(ctx context.Context, _ *apiv2pb.GetWorkspaceProfileRequest) (*apiv2pb.GetWorkspaceProfileResponse, error) { workspaceProfile := &apiv2pb.WorkspaceProfile{ Version: s.Profile.Version, Mode: s.Profile.Mode, } + owner, err := s.GetInstanceOwner(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get instance owner: %v", err) + } + if owner != nil { + workspaceProfile.Owner = owner.Name + } + generalSetting, err := s.Store.GetWorkspaceGeneralSetting(ctx) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get workspace general setting: %v", err) + } + workspaceProfile.DisallowSignup = generalSetting.DisallowSignup + workspaceProfile.DisablePasswordLogin = generalSetting.DisallowPasswordLogin + workspaceProfile.AdditionalStyle = generalSetting.AdditionalStyle + workspaceProfile.AdditionalScript = generalSetting.AdditionalScript return &apiv2pb.GetWorkspaceProfileResponse{ WorkspaceProfile: workspaceProfile, }, nil } + +func (s *APIV2Service) GetInstanceOwner(ctx context.Context) (*apiv2pb.User, error) { + if ownerCache != nil { + return ownerCache, nil + } + + hostUserType := store.RoleHost + user, err := s.Store.GetUser(ctx, &store.FindUser{ + Role: &hostUserType, + }) + if err != nil { + return nil, errors.Wrapf(err, "failed to find owner") + } + if user == nil { + return nil, nil + } + + ownerCache = convertUserFromStore(user) + return ownerCache, nil +} diff --git a/server/route/api/v2/workspace_setting_service.go b/server/route/api/v2/workspace_setting_service.go index 8b3941997d332..44a38d8dadf1b 100644 --- a/server/route/api/v2/workspace_setting_service.go +++ b/server/route/api/v2/workspace_setting_service.go @@ -34,6 +34,10 @@ func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, request *apiv2pb } func (s *APIV2Service) SetWorkspaceSetting(ctx context.Context, request *apiv2pb.SetWorkspaceSettingRequest) (*apiv2pb.SetWorkspaceSettingResponse, error) { + if s.Profile.Mode == "demo" { + return nil, status.Errorf(codes.InvalidArgument, "setting workspace setting is not allowed in demo mode") + } + user, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) diff --git a/server/route/frontend/frontend.go b/server/route/frontend/frontend.go index 02c56860d504c..ecc5607d30c21 100644 --- a/server/route/frontend/frontend.go +++ b/server/route/frontend/frontend.go @@ -53,11 +53,11 @@ func (s *FrontendService) Serve(ctx context.Context, e *echo.Echo) { func (s *FrontendService) registerRoutes(e *echo.Echo) { rawIndexHTML := getRawIndexHTML() - e.GET("/m/:name", func(c echo.Context) error { + e.GET("/m/:uid", func(c echo.Context) error { ctx := c.Request().Context() - resourceName := c.Param("name") + uid := c.Param("uid") memo, err := s.Store.GetMemo(ctx, &store.FindMemo{ - ResourceName: &resourceName, + UID: &uid, }) if err != nil { return c.HTML(http.StatusOK, rawIndexHTML) @@ -108,7 +108,7 @@ Sitemap: %s/sitemap.xml`, instanceURL, instanceURL) return err } for _, memo := range memoList { - urlsets = append(urlsets, fmt.Sprintf(`%s`, fmt.Sprintf("%s/m/%s", instanceURL, memo.ResourceName))) + urlsets = append(urlsets, fmt.Sprintf(`%s`, fmt.Sprintf("%s/m/%s", instanceURL, memo.UID))) } sitemap := fmt.Sprintf(`%s`, strings.Join(urlsets, "\n")) return c.XMLBlob(http.StatusOK, []byte(sitemap)) diff --git a/server/route/resource/resource.go b/server/route/resource/resource.go index 7e977f904f660..9c83a45387623 100644 --- a/server/route/resource/resource.go +++ b/server/route/resource/resource.go @@ -42,22 +42,22 @@ func NewResourceService(profile *profile.Profile, store *store.Store) *ResourceS } func (s *ResourceService) RegisterRoutes(g *echo.Group) { - g.GET("/r/:resourceName", s.streamResource) - g.GET("/r/:resourceName/*", s.streamResource) + g.GET("/r/:uid", s.streamResource) + g.GET("/r/:uid/*", s.streamResource) } func (s *ResourceService) streamResource(c echo.Context) error { ctx := c.Request().Context() - resourceName := c.Param("resourceName") + uid := c.Param("uid") resource, err := s.Store.GetResource(ctx, &store.FindResource{ - ResourceName: &resourceName, - GetBlob: true, + UID: &uid, + GetBlob: true, }) if err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to find resource by id: %s", resourceName)).SetInternal(err) + return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to find resource by uid: %s", uid)).SetInternal(err) } if resource == nil { - return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Resource not found: %s", resourceName)) + return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Resource not found: %s", uid)) } // Check the related memo visibility. if resource.MemoID != nil { diff --git a/server/route/rss/rss.go b/server/route/rss/rss.go index 9b1745ee35b4b..adebc0c03b035 100644 --- a/server/route/rss/rss.go +++ b/server/route/rss/rss.go @@ -112,7 +112,7 @@ func (s *RSSService) generateRSSFromMemoList(ctx context.Context, memoList []*st } feed.Items[i] = &feeds.Item{ Title: getRSSItemTitle(memo.Content), - Link: &feeds.Link{Href: baseURL + "/m/" + memo.ResourceName}, + Link: &feeds.Link{Href: baseURL + "/m/" + memo.UID}, Description: description, Created: time.Unix(memo.CreatedTs, 0), } @@ -128,7 +128,7 @@ func (s *RSSService) generateRSSFromMemoList(ctx context.Context, memoList []*st if resource.ExternalLink != "" { enclosure.Url = resource.ExternalLink } else { - enclosure.Url = baseURL + "/o/r/" + resource.ResourceName + enclosure.Url = baseURL + "/o/r/" + resource.UID } enclosure.Length = strconv.Itoa(int(resource.Size)) enclosure.Type = resource.Type diff --git a/server/server.go b/server/server.go index e153df882393e..1488b629dc4da 100644 --- a/server/server.go +++ b/server/server.go @@ -55,7 +55,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store } // Register CORS middleware. - e.Use(CORSMiddleware()) + e.Use(CORSMiddleware(s.Profile.Origins)) serverID, err := s.getSystemServerID(ctx) if err != nil { @@ -244,7 +244,7 @@ func grpcRequestSkipper(c echo.Context) bool { return strings.HasPrefix(c.Request().URL.Path, "/memos.api.v2.") } -func CORSMiddleware() echo.MiddlewareFunc { +func CORSMiddleware(origins []string) echo.MiddlewareFunc { return func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { if grpcRequestSkipper(c) { @@ -254,7 +254,18 @@ func CORSMiddleware() echo.MiddlewareFunc { r := c.Request() w := c.Response().Writer - w.Header().Set("Access-Control-Allow-Origin", r.Header.Get("Origin")) + requestOrigin := r.Header.Get("Origin") + if len(origins) == 0 { + w.Header().Set("Access-Control-Allow-Origin", requestOrigin) + } else { + for _, origin := range origins { + if origin == requestOrigin { + w.Header().Set("Access-Control-Allow-Origin", origin) + break + } + } + } + w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, PATCH, OPTIONS") w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization") w.Header().Set("Access-Control-Allow-Credentials", "true") diff --git a/server/version/version.go b/server/version/version.go index a5a30df4d97b1..6796588ceb2e8 100644 --- a/server/version/version.go +++ b/server/version/version.go @@ -9,10 +9,10 @@ import ( // Version is the service current released version. // Semantic versioning: https://semver.org/ -var Version = "0.20.1" +var Version = "0.21.0" // DevVersion is the service current development version. -var DevVersion = "0.20.1" +var DevVersion = "0.21.0" func GetCurrentVersion(mode string) string { if mode == "dev" || mode == "demo" { diff --git a/store/db/mysql/memo.go b/store/db/mysql/memo.go index 5b2e053554277..33b95b334b1a7 100644 --- a/store/db/mysql/memo.go +++ b/store/db/mysql/memo.go @@ -12,9 +12,9 @@ import ( ) func (d *DB) CreateMemo(ctx context.Context, create *store.Memo) (*store.Memo, error) { - fields := []string{"`resource_name`", "`creator_id`", "`content`", "`visibility`"} + fields := []string{"`uid`", "`creator_id`", "`content`", "`visibility`"} placeholder := []string{"?", "?", "?", "?"} - args := []any{create.ResourceName, create.CreatorID, create.Content, create.Visibility} + args := []any{create.UID, create.CreatorID, create.Content, create.Visibility} stmt := "INSERT INTO `memo` (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ")" result, err := d.db.ExecContext(ctx, stmt, args...) @@ -43,8 +43,8 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo if v := find.ID; v != nil { where, args = append(where, "`memo`.`id` = ?"), append(args, *v) } - if v := find.ResourceName; v != nil { - where, args = append(where, "`memo`.`resource_name` = ?"), append(args, *v) + if v := find.UID; v != nil { + where, args = append(where, "`memo`.`uid` = ?"), append(args, *v) } if v := find.CreatorID; v != nil { where, args = append(where, "`memo`.`creator_id` = ?"), append(args, *v) @@ -91,10 +91,13 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo orders = append(orders, "`created_ts` DESC") } orders = append(orders, "`id` DESC") + if find.Random { + orders = append(orders, "RAND()") + } fields := []string{ "`memo`.`id` AS `id`", - "`memo`.`resource_name` AS `resource_name`", + "`memo`.`uid` AS `uid`", "`memo`.`creator_id` AS `creator_id`", "UNIX_TIMESTAMP(`memo`.`created_ts`) AS `created_ts`", "UNIX_TIMESTAMP(`memo`.`updated_ts`) AS `updated_ts`", @@ -126,7 +129,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo var memo store.Memo dests := []any{ &memo.ID, - &memo.ResourceName, + &memo.UID, &memo.CreatorID, &memo.CreatedTs, &memo.UpdatedTs, @@ -166,8 +169,8 @@ func (d *DB) GetMemo(ctx context.Context, find *store.FindMemo) (*store.Memo, er func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error { set, args := []string{}, []any{} - if v := update.ResourceName; v != nil { - set, args = append(set, "`resource_name` = ?"), append(args, *v) + if v := update.UID; v != nil { + set, args = append(set, "`uid` = ?"), append(args, *v) } if v := update.CreatedTs; v != nil { set, args = append(set, "`created_ts` = FROM_UNIXTIME(?)"), append(args, *v) diff --git a/store/db/mysql/migration/dev/LATEST__SCHEMA.sql b/store/db/mysql/migration/dev/LATEST__SCHEMA.sql index f69bbe308b8a7..c25caa06ab435 100644 --- a/store/db/mysql/migration/dev/LATEST__SCHEMA.sql +++ b/store/db/mysql/migration/dev/LATEST__SCHEMA.sql @@ -22,7 +22,8 @@ CREATE TABLE `user` ( `email` VARCHAR(256) NOT NULL DEFAULT '', `nickname` VARCHAR(256) NOT NULL DEFAULT '', `password_hash` VARCHAR(256) NOT NULL, - `avatar_url` LONGTEXT NOT NULL + `avatar_url` LONGTEXT NOT NULL, + `description` VARCHAR(256) NOT NULL DEFAULT '' ); -- user_setting @@ -36,7 +37,7 @@ CREATE TABLE `user_setting` ( -- memo CREATE TABLE `memo` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `resource_name` VARCHAR(256) NOT NULL UNIQUE, + `uid` VARCHAR(256) NOT NULL UNIQUE, `creator_id` INT NOT NULL, `created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -64,7 +65,7 @@ CREATE TABLE `memo_relation` ( -- resource CREATE TABLE `resource` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `resource_name` VARCHAR(256) NOT NULL UNIQUE, + `uid` VARCHAR(256) NOT NULL UNIQUE, `creator_id` INT NOT NULL, `created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, diff --git a/store/db/mysql/migration/prod/0.21/00__user_description.sql b/store/db/mysql/migration/prod/0.21/00__user_description.sql new file mode 100644 index 0000000000000..44df868734ed0 --- /dev/null +++ b/store/db/mysql/migration/prod/0.21/00__user_description.sql @@ -0,0 +1 @@ +ALTER TABLE `user` ADD COLUMN `description` VARCHAR(256) NOT NULL DEFAULT ''; diff --git a/store/db/mysql/migration/prod/0.21/01__rename_uid.sql b/store/db/mysql/migration/prod/0.21/01__rename_uid.sql new file mode 100644 index 0000000000000..78ab079d3cb45 --- /dev/null +++ b/store/db/mysql/migration/prod/0.21/01__rename_uid.sql @@ -0,0 +1,3 @@ +ALTER TABLE `memo` RENAME COLUMN `resource_name` TO `uid`; + +ALTER TABLE `resource` RENAME COLUMN `resource_name` TO `uid`; diff --git a/store/db/mysql/migration/prod/LATEST__SCHEMA.sql b/store/db/mysql/migration/prod/LATEST__SCHEMA.sql index f69bbe308b8a7..c25caa06ab435 100644 --- a/store/db/mysql/migration/prod/LATEST__SCHEMA.sql +++ b/store/db/mysql/migration/prod/LATEST__SCHEMA.sql @@ -22,7 +22,8 @@ CREATE TABLE `user` ( `email` VARCHAR(256) NOT NULL DEFAULT '', `nickname` VARCHAR(256) NOT NULL DEFAULT '', `password_hash` VARCHAR(256) NOT NULL, - `avatar_url` LONGTEXT NOT NULL + `avatar_url` LONGTEXT NOT NULL, + `description` VARCHAR(256) NOT NULL DEFAULT '' ); -- user_setting @@ -36,7 +37,7 @@ CREATE TABLE `user_setting` ( -- memo CREATE TABLE `memo` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `resource_name` VARCHAR(256) NOT NULL UNIQUE, + `uid` VARCHAR(256) NOT NULL UNIQUE, `creator_id` INT NOT NULL, `created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -64,7 +65,7 @@ CREATE TABLE `memo_relation` ( -- resource CREATE TABLE `resource` ( `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY, - `resource_name` VARCHAR(256) NOT NULL UNIQUE, + `uid` VARCHAR(256) NOT NULL UNIQUE, `creator_id` INT NOT NULL, `created_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `updated_ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, diff --git a/store/db/mysql/resource.go b/store/db/mysql/resource.go index e2c570eae03d2..fffb7827f8793 100644 --- a/store/db/mysql/resource.go +++ b/store/db/mysql/resource.go @@ -10,9 +10,9 @@ import ( ) func (d *DB) CreateResource(ctx context.Context, create *store.Resource) (*store.Resource, error) { - fields := []string{"`resource_name`", "`filename`", "`blob`", "`external_link`", "`type`", "`size`", "`creator_id`", "`internal_path`", "`memo_id`"} + fields := []string{"`uid`", "`filename`", "`blob`", "`external_link`", "`type`", "`size`", "`creator_id`", "`internal_path`", "`memo_id`"} placeholder := []string{"?", "?", "?", "?", "?", "?", "?", "?", "?"} - args := []any{create.ResourceName, create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath, create.MemoID} + args := []any{create.UID, create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath, create.MemoID} stmt := "INSERT INTO `resource` (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ")" result, err := d.db.ExecContext(ctx, stmt, args...) @@ -35,8 +35,8 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st if v := find.ID; v != nil { where, args = append(where, "`id` = ?"), append(args, *v) } - if v := find.ResourceName; v != nil { - where, args = append(where, "`resource_name` = ?"), append(args, *v) + if v := find.UID; v != nil { + where, args = append(where, "`uid` = ?"), append(args, *v) } if v := find.CreatorID; v != nil { where, args = append(where, "`creator_id` = ?"), append(args, *v) @@ -51,7 +51,7 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st where = append(where, "`memo_id` IS NOT NULL") } - fields := []string{"`id`", "`resource_name`", "`filename`", "`external_link`", "`type`", "`size`", "`creator_id`", "UNIX_TIMESTAMP(`created_ts`)", "UNIX_TIMESTAMP(`updated_ts`)", "`internal_path`", "`memo_id`"} + fields := []string{"`id`", "`uid`", "`filename`", "`external_link`", "`type`", "`size`", "`creator_id`", "UNIX_TIMESTAMP(`created_ts`)", "UNIX_TIMESTAMP(`updated_ts`)", "`internal_path`", "`memo_id`"} if find.GetBlob { fields = append(fields, "`blob`") } @@ -76,7 +76,7 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st var memoID sql.NullInt32 dests := []any{ &resource.ID, - &resource.ResourceName, + &resource.UID, &resource.Filename, &resource.ExternalLink, &resource.Type, @@ -121,8 +121,8 @@ func (d *DB) GetResource(ctx context.Context, find *store.FindResource) (*store. func (d *DB) UpdateResource(ctx context.Context, update *store.UpdateResource) (*store.Resource, error) { set, args := []string{}, []any{} - if v := update.ResourceName; v != nil { - set, args = append(set, "`resource_name` = ?"), append(args, *v) + if v := update.UID; v != nil { + set, args = append(set, "`uid` = ?"), append(args, *v) } if v := update.UpdatedTs; v != nil { set, args = append(set, "`updated_ts` = FROM_UNIXTIME(?)"), append(args, *v) diff --git a/store/db/mysql/user.go b/store/db/mysql/user.go index 1926213548bcc..da57ea735bc81 100644 --- a/store/db/mysql/user.go +++ b/store/db/mysql/user.go @@ -2,6 +2,8 @@ package mysql import ( "context" + "fmt" + "slices" "strings" "github.com/pkg/errors" @@ -60,6 +62,9 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U if v := update.PasswordHash; v != nil { set, args = append(set, "`password_hash` = ?"), append(args, *v) } + if v := update.Description; v != nil { + set, args = append(set, "`description` = ?"), append(args, *v) + } args = append(args, update.ID) query := "UPDATE `user` SET " + strings.Join(set, ", ") + " WHERE `id` = ?" @@ -93,7 +98,15 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User where, args = append(where, "`nickname` = ?"), append(args, *v) } - query := "SELECT `id`, `username`, `role`, `email`, `nickname`, `password_hash`, `avatar_url`, UNIX_TIMESTAMP(`created_ts`), UNIX_TIMESTAMP(`updated_ts`), `row_status` FROM `user` WHERE " + strings.Join(where, " AND ") + " ORDER BY `created_ts` DESC, `row_status` DESC" + orderBy := []string{"`created_ts` DESC", "`row_status` DESC"} + if find.Random { + orderBy = slices.Concat([]string{"RAND()"}, orderBy) + } + + query := "SELECT `id`, `username`, `role`, `email`, `nickname`, `password_hash`, `avatar_url`, `description`, UNIX_TIMESTAMP(`created_ts`), UNIX_TIMESTAMP(`updated_ts`), `row_status` FROM `user` WHERE " + strings.Join(where, " AND ") + " ORDER BY " + strings.Join(orderBy, ", ") + if v := find.Limit; v != nil { + query += fmt.Sprintf(" LIMIT %d", *v) + } rows, err := d.db.QueryContext(ctx, query, args...) if err != nil { return nil, err @@ -111,6 +124,7 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User &user.Nickname, &user.PasswordHash, &user.AvatarURL, + &user.Description, &user.CreatedTs, &user.UpdatedTs, &user.RowStatus, diff --git a/store/db/postgres/memo.go b/store/db/postgres/memo.go index 7721912268936..a4284ae572582 100644 --- a/store/db/postgres/memo.go +++ b/store/db/postgres/memo.go @@ -12,8 +12,8 @@ import ( ) func (d *DB) CreateMemo(ctx context.Context, create *store.Memo) (*store.Memo, error) { - fields := []string{"resource_name", "creator_id", "content", "visibility"} - args := []any{create.ResourceName, create.CreatorID, create.Content, create.Visibility} + fields := []string{"uid", "creator_id", "content", "visibility"} + args := []any{create.UID, create.CreatorID, create.Content, create.Visibility} stmt := "INSERT INTO memo (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id, created_ts, updated_ts, row_status" if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( @@ -34,8 +34,8 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo if v := find.ID; v != nil { where, args = append(where, "memo.id = "+placeholder(len(args)+1)), append(args, *v) } - if v := find.ResourceName; v != nil { - where, args = append(where, "memo.resource_name = "+placeholder(len(args)+1)), append(args, *v) + if v := find.UID; v != nil { + where, args = append(where, "memo.uid = "+placeholder(len(args)+1)), append(args, *v) } if v := find.CreatorID; v != nil { where, args = append(where, "memo.creator_id = "+placeholder(len(args)+1)), append(args, *v) @@ -82,10 +82,13 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo orders = append(orders, "created_ts DESC") } orders = append(orders, "id DESC") + if find.Random { + orders = append(orders, "RAND()") + } fields := []string{ `memo.id AS id`, - `memo.resource_name AS resource_name`, + `memo.uid AS uid`, `memo.creator_id AS creator_id`, `memo.created_ts AS created_ts`, `memo.updated_ts AS updated_ts`, @@ -122,7 +125,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo var memo store.Memo dests := []any{ &memo.ID, - &memo.ResourceName, + &memo.UID, &memo.CreatorID, &memo.CreatedTs, &memo.UpdatedTs, @@ -162,8 +165,8 @@ func (d *DB) GetMemo(ctx context.Context, find *store.FindMemo) (*store.Memo, er func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error { set, args := []string{}, []any{} - if v := update.ResourceName; v != nil { - set, args = append(set, "resource_name = "+placeholder(len(args)+1)), append(args, *v) + if v := update.UID; v != nil { + set, args = append(set, "uid = "+placeholder(len(args)+1)), append(args, *v) } if v := update.CreatedTs; v != nil { set, args = append(set, "created_ts = "+placeholder(len(args)+1)), append(args, *v) diff --git a/store/db/postgres/migration/dev/LATEST__SCHEMA.sql b/store/db/postgres/migration/dev/LATEST__SCHEMA.sql index 1ab5f95e4458a..06c422b9f3133 100644 --- a/store/db/postgres/migration/dev/LATEST__SCHEMA.sql +++ b/store/db/postgres/migration/dev/LATEST__SCHEMA.sql @@ -22,7 +22,8 @@ CREATE TABLE "user" ( email TEXT NOT NULL DEFAULT '', nickname TEXT NOT NULL DEFAULT '', password_hash TEXT NOT NULL, - avatar_url TEXT NOT NULL + avatar_url TEXT NOT NULL, + description TEXT NOT NULL DEFAULT '' ); -- user_setting @@ -36,7 +37,7 @@ CREATE TABLE user_setting ( -- memo CREATE TABLE memo ( id SERIAL PRIMARY KEY, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), updated_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), @@ -64,7 +65,7 @@ CREATE TABLE memo_relation ( -- resource CREATE TABLE resource ( id SERIAL PRIMARY KEY, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), updated_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), diff --git a/store/db/postgres/migration/prod/0.21/00__user_description.sql b/store/db/postgres/migration/prod/0.21/00__user_description.sql new file mode 100644 index 0000000000000..b8f1aeaf328e2 --- /dev/null +++ b/store/db/postgres/migration/prod/0.21/00__user_description.sql @@ -0,0 +1 @@ +ALTER TABLE "user" ADD COLUMN description TEXT NOT NULL DEFAULT ''; diff --git a/store/db/postgres/migration/prod/0.21/01__rename_uid.sql b/store/db/postgres/migration/prod/0.21/01__rename_uid.sql new file mode 100644 index 0000000000000..12a0402254bb7 --- /dev/null +++ b/store/db/postgres/migration/prod/0.21/01__rename_uid.sql @@ -0,0 +1,3 @@ +ALTER TABLE memo RENAME COLUMN resource_name TO uid; + +ALTER TABLE resource RENAME COLUMN resource_name TO uid; diff --git a/store/db/postgres/migration/prod/LATEST__SCHEMA.sql b/store/db/postgres/migration/prod/LATEST__SCHEMA.sql index 1ab5f95e4458a..06c422b9f3133 100644 --- a/store/db/postgres/migration/prod/LATEST__SCHEMA.sql +++ b/store/db/postgres/migration/prod/LATEST__SCHEMA.sql @@ -22,7 +22,8 @@ CREATE TABLE "user" ( email TEXT NOT NULL DEFAULT '', nickname TEXT NOT NULL DEFAULT '', password_hash TEXT NOT NULL, - avatar_url TEXT NOT NULL + avatar_url TEXT NOT NULL, + description TEXT NOT NULL DEFAULT '' ); -- user_setting @@ -36,7 +37,7 @@ CREATE TABLE user_setting ( -- memo CREATE TABLE memo ( id SERIAL PRIMARY KEY, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), updated_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), @@ -64,7 +65,7 @@ CREATE TABLE memo_relation ( -- resource CREATE TABLE resource ( id SERIAL PRIMARY KEY, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), updated_ts BIGINT NOT NULL DEFAULT EXTRACT(EPOCH FROM NOW()), diff --git a/store/db/postgres/resource.go b/store/db/postgres/resource.go index 3ced746156bcc..63e7e267f92a2 100644 --- a/store/db/postgres/resource.go +++ b/store/db/postgres/resource.go @@ -10,8 +10,8 @@ import ( ) func (d *DB) CreateResource(ctx context.Context, create *store.Resource) (*store.Resource, error) { - fields := []string{"resource_name", "filename", "blob", "external_link", "type", "size", "creator_id", "internal_path", "memo_id"} - args := []any{create.ResourceName, create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath, create.MemoID} + fields := []string{"uid", "filename", "blob", "external_link", "type", "size", "creator_id", "internal_path", "memo_id"} + args := []any{create.UID, create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath, create.MemoID} stmt := "INSERT INTO resource (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id, created_ts, updated_ts" if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(&create.ID, &create.CreatedTs, &create.UpdatedTs); err != nil { @@ -26,8 +26,8 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st if v := find.ID; v != nil { where, args = append(where, "id = "+placeholder(len(args)+1)), append(args, *v) } - if v := find.ResourceName; v != nil { - where, args = append(where, "resource_name = "+placeholder(len(args)+1)), append(args, *v) + if v := find.UID; v != nil { + where, args = append(where, "uid = "+placeholder(len(args)+1)), append(args, *v) } if v := find.CreatorID; v != nil { where, args = append(where, "creator_id = "+placeholder(len(args)+1)), append(args, *v) @@ -42,7 +42,7 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st where = append(where, "memo_id IS NOT NULL") } - fields := []string{"id", "resource_name", "filename", "external_link", "type", "size", "creator_id", "created_ts", "updated_ts", "internal_path", "memo_id"} + fields := []string{"id", "uid", "filename", "external_link", "type", "size", "creator_id", "created_ts", "updated_ts", "internal_path", "memo_id"} if find.GetBlob { fields = append(fields, "blob") } @@ -73,7 +73,7 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st var memoID sql.NullInt32 dests := []any{ &resource.ID, - &resource.ResourceName, + &resource.UID, &resource.Filename, &resource.ExternalLink, &resource.Type, @@ -106,8 +106,8 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st func (d *DB) UpdateResource(ctx context.Context, update *store.UpdateResource) (*store.Resource, error) { set, args := []string{}, []any{} - if v := update.ResourceName; v != nil { - set, args = append(set, "resource_name = "+placeholder(len(args)+1)), append(args, *v) + if v := update.UID; v != nil { + set, args = append(set, "uid = "+placeholder(len(args)+1)), append(args, *v) } if v := update.UpdatedTs; v != nil { set, args = append(set, "updated_ts = "+placeholder(len(args)+1)), append(args, *v) @@ -128,13 +128,13 @@ func (d *DB) UpdateResource(ctx context.Context, update *store.UpdateResource) ( set, args = append(set, "blob = "+placeholder(len(args)+1)), append(args, v) } - fields := []string{"id", "resource_name", "filename", "external_link", "type", "size", "creator_id", "created_ts", "updated_ts", "internal_path"} + fields := []string{"id", "uid", "filename", "external_link", "type", "size", "creator_id", "created_ts", "updated_ts", "internal_path"} stmt := `UPDATE resource SET ` + strings.Join(set, ", ") + ` WHERE id = ` + placeholder(len(args)+1) + ` RETURNING ` + strings.Join(fields, ", ") args = append(args, update.ID) resource := store.Resource{} dests := []any{ &resource.ID, - &resource.ResourceName, + &resource.UID, &resource.Filename, &resource.ExternalLink, &resource.Type, diff --git a/store/db/postgres/user.go b/store/db/postgres/user.go index 588bbac376630..a192f02b82f1f 100644 --- a/store/db/postgres/user.go +++ b/store/db/postgres/user.go @@ -2,6 +2,8 @@ package postgres import ( "context" + "fmt" + "slices" "strings" "github.com/usememos/memos/store" @@ -10,10 +12,11 @@ import ( func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, error) { fields := []string{"username", "role", "email", "nickname", "password_hash", "avatar_url"} args := []any{create.Username, create.Role, create.Email, create.Nickname, create.PasswordHash, create.AvatarURL} - stmt := "INSERT INTO \"user\" (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id, avatar_url, created_ts, updated_ts, row_status" + stmt := "INSERT INTO \"user\" (" + strings.Join(fields, ", ") + ") VALUES (" + placeholders(len(args)) + ") RETURNING id, avatar_url, description, created_ts, updated_ts, row_status" if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &create.ID, &create.AvatarURL, + &create.Description, &create.CreatedTs, &create.UpdatedTs, &create.RowStatus, @@ -47,12 +50,15 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U if v := update.PasswordHash; v != nil { set, args = append(set, "password_hash = "+placeholder(len(args)+1)), append(args, *v) } + if v := update.Description; v != nil { + set, args = append(set, "description = "+placeholder(len(args)+1)), append(args, *v) + } query := ` UPDATE "user" SET ` + strings.Join(set, ", ") + ` WHERE id = ` + placeholder(len(args)+1) + ` - RETURNING id, username, role, email, nickname, password_hash, avatar_url, created_ts, updated_ts, row_status + RETURNING id, username, role, email, nickname, password_hash, avatar_url, description, created_ts, updated_ts, row_status ` args = append(args, update.ID) user := &store.User{} @@ -64,6 +70,7 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U &user.Nickname, &user.PasswordHash, &user.AvatarURL, + &user.Description, &user.CreatedTs, &user.UpdatedTs, &user.RowStatus, @@ -93,6 +100,11 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User where, args = append(where, "nickname = "+placeholder(len(args)+1)), append(args, *v) } + orderBy := []string{"created_ts DESC", "row_status DESC"} + if find.Random { + orderBy = slices.Concat([]string{"RANDOM()"}, orderBy) + } + query := ` SELECT id, @@ -102,13 +114,15 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User nickname, password_hash, avatar_url, + description, created_ts, updated_ts, row_status FROM "user" - WHERE ` + strings.Join(where, " AND ") + ` - ORDER BY created_ts DESC, row_status DESC - ` + WHERE ` + strings.Join(where, " AND ") + ` ORDER BY ` + strings.Join(orderBy, ", ") + if v := find.Limit; v != nil { + query += fmt.Sprintf(" LIMIT %d", *v) + } rows, err := d.db.QueryContext(ctx, query, args...) if err != nil { return nil, err @@ -126,6 +140,7 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User &user.Nickname, &user.PasswordHash, &user.AvatarURL, + &user.Description, &user.CreatedTs, &user.UpdatedTs, &user.RowStatus, @@ -143,9 +158,7 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User } func (d *DB) DeleteUser(ctx context.Context, delete *store.DeleteUser) error { - result, err := d.db.ExecContext(ctx, ` - DELETE FROM "user" WHERE id = $1 - `, delete.ID) + result, err := d.db.ExecContext(ctx, `DELETE FROM "user" WHERE id = $1`, delete.ID) if err != nil { return err } diff --git a/store/db/sqlite/memo.go b/store/db/sqlite/memo.go index 2257a0e583b8d..a00b941ca8931 100644 --- a/store/db/sqlite/memo.go +++ b/store/db/sqlite/memo.go @@ -10,9 +10,9 @@ import ( ) func (d *DB) CreateMemo(ctx context.Context, create *store.Memo) (*store.Memo, error) { - fields := []string{"`resource_name`", "`creator_id`", "`content`", "`visibility`"} + fields := []string{"`uid`", "`creator_id`", "`content`", "`visibility`"} placeholder := []string{"?", "?", "?", "?"} - args := []any{create.ResourceName, create.CreatorID, create.Content, create.Visibility} + args := []any{create.UID, create.CreatorID, create.Content, create.Visibility} stmt := "INSERT INTO `memo` (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING `id`, `created_ts`, `updated_ts`, `row_status`" if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( @@ -33,8 +33,8 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo if v := find.ID; v != nil { where, args = append(where, "`memo`.`id` = ?"), append(args, *v) } - if v := find.ResourceName; v != nil { - where, args = append(where, "`memo`.`resource_name` = ?"), append(args, *v) + if v := find.UID; v != nil { + where, args = append(where, "`memo`.`uid` = ?"), append(args, *v) } if v := find.CreatorID; v != nil { where, args = append(where, "`memo`.`creator_id` = ?"), append(args, *v) @@ -71,20 +71,23 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo where = append(where, "`parent_id` IS NULL") } - orders := []string{} + orderBy := []string{} if find.OrderByPinned { - orders = append(orders, "`pinned` DESC") + orderBy = append(orderBy, "`pinned` DESC") } if find.OrderByUpdatedTs { - orders = append(orders, "`updated_ts` DESC") + orderBy = append(orderBy, "`updated_ts` DESC") } else { - orders = append(orders, "`created_ts` DESC") + orderBy = append(orderBy, "`created_ts` DESC") + } + orderBy = append(orderBy, "`id` DESC") + if find.Random { + orderBy = []string{"RANDOM()"} } - orders = append(orders, "`id` DESC") fields := []string{ "`memo`.`id` AS `id`", - "`memo`.`resource_name` AS `resource_name`", + "`memo`.`uid` AS `uid`", "`memo`.`creator_id` AS `creator_id`", "`memo`.`created_ts` AS `created_ts`", "`memo`.`updated_ts` AS `updated_ts`", @@ -101,7 +104,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo "LEFT JOIN `memo_organizer` ON `memo`.`id` = `memo_organizer`.`memo_id` AND `memo`.`creator_id` = `memo_organizer`.`user_id` " + "LEFT JOIN `memo_relation` ON `memo`.`id` = `memo_relation`.`memo_id` AND `memo_relation`.`type` = \"COMMENT\" " + "WHERE " + strings.Join(where, " AND ") + " " + - "ORDER BY " + strings.Join(orders, ", ") + "ORDER BY " + strings.Join(orderBy, ", ") if find.Limit != nil { query = fmt.Sprintf("%s LIMIT %d", query, *find.Limit) if find.Offset != nil { @@ -120,7 +123,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo var memo store.Memo dests := []any{ &memo.ID, - &memo.ResourceName, + &memo.UID, &memo.CreatorID, &memo.CreatedTs, &memo.UpdatedTs, @@ -147,8 +150,8 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error { set, args := []string{}, []any{} - if v := update.ResourceName; v != nil { - set, args = append(set, "`resource_name` = ?"), append(args, *v) + if v := update.UID; v != nil { + set, args = append(set, "`uid` = ?"), append(args, *v) } if v := update.CreatedTs; v != nil { set, args = append(set, "`created_ts` = ?"), append(args, *v) diff --git a/store/db/sqlite/migration/dev/LATEST__SCHEMA.sql b/store/db/sqlite/migration/dev/LATEST__SCHEMA.sql index b2408ddccc78e..def1d7dcc8ece 100644 --- a/store/db/sqlite/migration/dev/LATEST__SCHEMA.sql +++ b/store/db/sqlite/migration/dev/LATEST__SCHEMA.sql @@ -23,7 +23,8 @@ CREATE TABLE user ( email TEXT NOT NULL DEFAULT '', nickname TEXT NOT NULL DEFAULT '', password_hash TEXT NOT NULL, - avatar_url TEXT NOT NULL DEFAULT '' + avatar_url TEXT NOT NULL DEFAULT '', + description TEXT NOT NULL DEFAULT '' ); CREATE INDEX idx_user_username ON user (username); @@ -39,7 +40,7 @@ CREATE TABLE user_setting ( -- memo CREATE TABLE memo ( id INTEGER PRIMARY KEY AUTOINCREMENT, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), @@ -71,7 +72,7 @@ CREATE TABLE memo_relation ( -- resource CREATE TABLE resource ( id INTEGER PRIMARY KEY AUTOINCREMENT, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), diff --git a/store/db/sqlite/migration/prod/0.21/00__user_description.sql b/store/db/sqlite/migration/prod/0.21/00__user_description.sql new file mode 100644 index 0000000000000..53408fe0d3172 --- /dev/null +++ b/store/db/sqlite/migration/prod/0.21/00__user_description.sql @@ -0,0 +1 @@ +ALTER TABLE user ADD COLUMN description TEXT NOT NULL DEFAULT ""; diff --git a/store/db/sqlite/migration/prod/0.21/01__rename_uid.sql b/store/db/sqlite/migration/prod/0.21/01__rename_uid.sql new file mode 100644 index 0000000000000..12a0402254bb7 --- /dev/null +++ b/store/db/sqlite/migration/prod/0.21/01__rename_uid.sql @@ -0,0 +1,3 @@ +ALTER TABLE memo RENAME COLUMN resource_name TO uid; + +ALTER TABLE resource RENAME COLUMN resource_name TO uid; diff --git a/store/db/sqlite/migration/prod/LATEST__SCHEMA.sql b/store/db/sqlite/migration/prod/LATEST__SCHEMA.sql index b2408ddccc78e..def1d7dcc8ece 100644 --- a/store/db/sqlite/migration/prod/LATEST__SCHEMA.sql +++ b/store/db/sqlite/migration/prod/LATEST__SCHEMA.sql @@ -23,7 +23,8 @@ CREATE TABLE user ( email TEXT NOT NULL DEFAULT '', nickname TEXT NOT NULL DEFAULT '', password_hash TEXT NOT NULL, - avatar_url TEXT NOT NULL DEFAULT '' + avatar_url TEXT NOT NULL DEFAULT '', + description TEXT NOT NULL DEFAULT '' ); CREATE INDEX idx_user_username ON user (username); @@ -39,7 +40,7 @@ CREATE TABLE user_setting ( -- memo CREATE TABLE memo ( id INTEGER PRIMARY KEY AUTOINCREMENT, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), @@ -71,7 +72,7 @@ CREATE TABLE memo_relation ( -- resource CREATE TABLE resource ( id INTEGER PRIMARY KEY AUTOINCREMENT, - resource_name TEXT NOT NULL UNIQUE, + uid TEXT NOT NULL UNIQUE, creator_id INTEGER NOT NULL, created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')), diff --git a/store/db/sqlite/resource.go b/store/db/sqlite/resource.go index bb0d6ee78d16a..c0a5b973b4fd2 100644 --- a/store/db/sqlite/resource.go +++ b/store/db/sqlite/resource.go @@ -10,9 +10,9 @@ import ( ) func (d *DB) CreateResource(ctx context.Context, create *store.Resource) (*store.Resource, error) { - fields := []string{"`resource_name`", "`filename`", "`blob`", "`external_link`", "`type`", "`size`", "`creator_id`", "`internal_path`", "`memo_id`"} + fields := []string{"`uid`", "`filename`", "`blob`", "`external_link`", "`type`", "`size`", "`creator_id`", "`internal_path`", "`memo_id`"} placeholder := []string{"?", "?", "?", "?", "?", "?", "?", "?", "?"} - args := []any{create.ResourceName, create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath, create.MemoID} + args := []any{create.UID, create.Filename, create.Blob, create.ExternalLink, create.Type, create.Size, create.CreatorID, create.InternalPath, create.MemoID} stmt := "INSERT INTO `resource` (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING `id`, `created_ts`, `updated_ts`" if err := d.db.QueryRowContext(ctx, stmt, args...).Scan(&create.ID, &create.CreatedTs, &create.UpdatedTs); err != nil { @@ -28,8 +28,8 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st if v := find.ID; v != nil { where, args = append(where, "`id` = ?"), append(args, *v) } - if v := find.ResourceName; v != nil { - where, args = append(where, "`resource_name` = ?"), append(args, *v) + if v := find.UID; v != nil { + where, args = append(where, "`uid` = ?"), append(args, *v) } if v := find.CreatorID; v != nil { where, args = append(where, "`creator_id` = ?"), append(args, *v) @@ -44,7 +44,7 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st where = append(where, "`memo_id` IS NOT NULL") } - fields := []string{"`id`", "`resource_name`", "`filename`", "`external_link`", "`type`", "`size`", "`creator_id`", "`created_ts`", "`updated_ts`", "`internal_path`", "`memo_id`"} + fields := []string{"`id`", "`uid`", "`filename`", "`external_link`", "`type`", "`size`", "`creator_id`", "`created_ts`", "`updated_ts`", "`internal_path`", "`memo_id`"} if find.GetBlob { fields = append(fields, "`blob`") } @@ -69,7 +69,7 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st var memoID sql.NullInt32 dests := []any{ &resource.ID, - &resource.ResourceName, + &resource.UID, &resource.Filename, &resource.ExternalLink, &resource.Type, @@ -102,8 +102,8 @@ func (d *DB) ListResources(ctx context.Context, find *store.FindResource) ([]*st func (d *DB) UpdateResource(ctx context.Context, update *store.UpdateResource) (*store.Resource, error) { set, args := []string{}, []any{} - if v := update.ResourceName; v != nil { - set, args = append(set, "`resource_name` = ?"), append(args, *v) + if v := update.UID; v != nil { + set, args = append(set, "`uid` = ?"), append(args, *v) } if v := update.UpdatedTs; v != nil { set, args = append(set, "`updated_ts` = ?"), append(args, *v) @@ -125,12 +125,12 @@ func (d *DB) UpdateResource(ctx context.Context, update *store.UpdateResource) ( } args = append(args, update.ID) - fields := []string{"`id`", "`resource_name`", "`filename`", "`external_link`", "`type`", "`size`", "`creator_id`", "`created_ts`", "`updated_ts`", "`internal_path`"} + fields := []string{"`id`", "`uid`", "`filename`", "`external_link`", "`type`", "`size`", "`creator_id`", "`created_ts`", "`updated_ts`", "`internal_path`"} stmt := "UPDATE `resource` SET " + strings.Join(set, ", ") + " WHERE `id` = ? RETURNING " + strings.Join(fields, ", ") resource := store.Resource{} dests := []any{ &resource.ID, - &resource.ResourceName, + &resource.UID, &resource.Filename, &resource.ExternalLink, &resource.Type, diff --git a/store/db/sqlite/seed/10001__user.sql b/store/db/sqlite/seed/10001__user.sql index 45e88716b3059..4f1644c729bf5 100644 --- a/store/db/sqlite/seed/10001__user.sql +++ b/store/db/sqlite/seed/10001__user.sql @@ -5,7 +5,8 @@ INSERT INTO `role`, `email`, `nickname`, - `password_hash` + `password_hash`, + `description` ) VALUES ( @@ -15,7 +16,8 @@ VALUES 'demo@usememos.com', 'Derobot', -- raw password: secret - '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK' + '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK', + '👋 Welcome to memos.' ); INSERT INTO @@ -25,7 +27,8 @@ INSERT INTO `role`, `email`, `nickname`, - `password_hash` + `password_hash`, + `description` ) VALUES ( @@ -35,7 +38,8 @@ VALUES 'jack@usememos.com', 'Jack', -- raw password: secret - '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK' + '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK', + 'The REAL Jack.' ); INSERT INTO @@ -46,7 +50,8 @@ INSERT INTO `role`, `email`, `nickname`, - `password_hash` + `password_hash`, + `description` ) VALUES ( @@ -57,5 +62,6 @@ VALUES 'bob@usememos.com', 'Bob', -- raw password: secret - '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK' + '$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK', + 'Sorry, I am busy right now.' ); \ No newline at end of file diff --git a/store/db/sqlite/seed/10002__memo.sql b/store/db/sqlite/seed/10002__memo.sql index f905eed4cbe02..ec05c6781e315 100644 --- a/store/db/sqlite/seed/10002__memo.sql +++ b/store/db/sqlite/seed/10002__memo.sql @@ -1,7 +1,7 @@ INSERT INTO memo ( `id`, - `resource_name`, + `uid`, `content`, `creator_id` ) @@ -16,7 +16,7 @@ VALUES INSERT INTO memo ( `id`, - `resource_name`, + `uid`, `content`, `creator_id`, `visibility` @@ -36,7 +36,7 @@ VALUES INSERT INTO memo ( `id`, - `resource_name`, + `uid`, `content`, `creator_id`, `visibility` @@ -54,7 +54,7 @@ VALUES INSERT INTO memo ( `id`, - `resource_name`, + `uid`, `content`, `creator_id`, `visibility` @@ -74,7 +74,7 @@ VALUES INSERT INTO memo ( `id`, - `resource_name`, + `uid`, `content`, `creator_id`, `visibility` diff --git a/store/db/sqlite/seed/10006__resource.sql b/store/db/sqlite/seed/10006__resource.sql index a810b75ffc531..255838f1bff07 100644 --- a/store/db/sqlite/seed/10006__resource.sql +++ b/store/db/sqlite/seed/10006__resource.sql @@ -1,4 +1,4 @@ INSERT INTO - resource (`resource_name`, `creator_id`, `filename`, `external_link`, `type`, `memo_id`) + resource (`uid`, `creator_id`, `filename`, `external_link`, `type`, `memo_id`) VALUES ("Pw2awZvxxLK4sPRtHmYuS7", 101, 'slash-demo.png', 'https://github.com/yourselfhosted/slash/blob/main/docs/assets/demo.png?raw=true', 'image/png', 3); diff --git a/store/db/sqlite/user.go b/store/db/sqlite/user.go index 216d1170c0821..02689fbc890c9 100644 --- a/store/db/sqlite/user.go +++ b/store/db/sqlite/user.go @@ -2,6 +2,8 @@ package sqlite import ( "context" + "fmt" + "slices" "strings" "github.com/usememos/memos/store" @@ -11,10 +13,11 @@ func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, e fields := []string{"`username`", "`role`", "`email`", "`nickname`", "`password_hash`"} placeholder := []string{"?", "?", "?", "?", "?"} args := []any{create.Username, create.Role, create.Email, create.Nickname, create.PasswordHash} - stmt := "INSERT INTO user (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING id, avatar_url, created_ts, updated_ts, row_status" + stmt := "INSERT INTO user (" + strings.Join(fields, ", ") + ") VALUES (" + strings.Join(placeholder, ", ") + ") RETURNING id, avatar_url, description, created_ts, updated_ts, row_status" if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &create.ID, &create.AvatarURL, + &create.Description, &create.CreatedTs, &create.UpdatedTs, &create.RowStatus, @@ -48,13 +51,16 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U if v := update.PasswordHash; v != nil { set, args = append(set, "password_hash = ?"), append(args, *v) } + if v := update.Description; v != nil { + set, args = append(set, "description = ?"), append(args, *v) + } args = append(args, update.ID) query := ` UPDATE user SET ` + strings.Join(set, ", ") + ` WHERE id = ? - RETURNING id, username, role, email, nickname, password_hash, avatar_url, created_ts, updated_ts, row_status + RETURNING id, username, role, email, nickname, password_hash, avatar_url, description, created_ts, updated_ts, row_status ` user := &store.User{} if err := d.db.QueryRowContext(ctx, query, args...).Scan( @@ -65,6 +71,7 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U &user.Nickname, &user.PasswordHash, &user.AvatarURL, + &user.Description, &user.CreatedTs, &user.UpdatedTs, &user.RowStatus, @@ -94,6 +101,11 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User where, args = append(where, "nickname = ?"), append(args, *v) } + orderBy := []string{"created_ts DESC", "row_status DESC"} + if find.Random { + orderBy = slices.Concat([]string{"RANDOM()"}, orderBy) + } + query := ` SELECT id, @@ -103,13 +115,16 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User nickname, password_hash, avatar_url, + description, created_ts, updated_ts, row_status FROM user - WHERE ` + strings.Join(where, " AND ") + ` - ORDER BY created_ts DESC, row_status DESC - ` + WHERE ` + strings.Join(where, " AND ") + ` ORDER BY ` + strings.Join(orderBy, ", ") + if v := find.Limit; v != nil { + query += fmt.Sprintf(" LIMIT %d", *v) + } + rows, err := d.db.QueryContext(ctx, query, args...) if err != nil { return nil, err @@ -127,6 +142,7 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User &user.Nickname, &user.PasswordHash, &user.AvatarURL, + &user.Description, &user.CreatedTs, &user.UpdatedTs, &user.RowStatus, diff --git a/store/memo.go b/store/memo.go index 4d0953ab588ff..5de413b9953c0 100644 --- a/store/memo.go +++ b/store/memo.go @@ -32,8 +32,10 @@ func (v Visibility) String() string { } type Memo struct { - ID int32 - ResourceName string + // ID is the system generated unique identifier for the memo. + ID int32 + // UID is the user defined unique identifier for the memo. + UID string // Standard fields RowStatus RowStatus @@ -51,8 +53,8 @@ type Memo struct { } type FindMemo struct { - ID *int32 - ResourceName *string + ID *int32 + UID *string // Standard fields RowStatus *RowStatus @@ -67,6 +69,7 @@ type FindMemo struct { VisibilityList []Visibility ExcludeContent bool ExcludeComments bool + Random bool // Pagination Limit *int @@ -76,13 +79,13 @@ type FindMemo struct { } type UpdateMemo struct { - ID int32 - ResourceName *string - CreatedTs *int64 - UpdatedTs *int64 - RowStatus *RowStatus - Content *string - Visibility *Visibility + ID int32 + UID *string + CreatedTs *int64 + UpdatedTs *int64 + RowStatus *RowStatus + Content *string + Visibility *Visibility } type DeleteMemo struct { @@ -90,8 +93,8 @@ type DeleteMemo struct { } func (s *Store) CreateMemo(ctx context.Context, create *Memo) (*Memo, error) { - if !util.ResourceNameMatcher.MatchString(create.ResourceName) { - return nil, errors.New("resource name is invalid") + if !util.UIDMatcher.MatchString(create.UID) { + return nil, errors.New("invalid uid") } return s.driver.CreateMemo(ctx, create) } @@ -114,8 +117,8 @@ func (s *Store) GetMemo(ctx context.Context, find *FindMemo) (*Memo, error) { } func (s *Store) UpdateMemo(ctx context.Context, update *UpdateMemo) error { - if update.ResourceName != nil && !util.ResourceNameMatcher.MatchString(*update.ResourceName) { - return errors.New("resource name is invalid") + if update.UID != nil && !util.UIDMatcher.MatchString(*update.UID) { + return errors.New("invalid uid") } return s.driver.UpdateMemo(ctx, update) } diff --git a/store/resource.go b/store/resource.go index fae1cd1b5b970..02cc9751906cf 100644 --- a/store/resource.go +++ b/store/resource.go @@ -17,8 +17,10 @@ const ( ) type Resource struct { - ID int32 - ResourceName string + // ID is the system generated unique identifier for the resource. + ID int32 + // UID is the user defined unique identifier for the resource. + UID string // Standard fields CreatorID int32 @@ -38,7 +40,7 @@ type Resource struct { type FindResource struct { GetBlob bool ID *int32 - ResourceName *string + UID *string CreatorID *int32 Filename *string MemoID *int32 @@ -49,7 +51,7 @@ type FindResource struct { type UpdateResource struct { ID int32 - ResourceName *string + UID *string UpdatedTs *int64 Filename *string InternalPath *string @@ -64,8 +66,8 @@ type DeleteResource struct { } func (s *Store) CreateResource(ctx context.Context, create *Resource) (*Resource, error) { - if !util.ResourceNameMatcher.MatchString(create.ResourceName) { - return nil, errors.New("invalid resource name") + if !util.UIDMatcher.MatchString(create.UID) { + return nil, errors.New("invalid uid") } return s.driver.CreateResource(ctx, create) } @@ -88,8 +90,8 @@ func (s *Store) GetResource(ctx context.Context, find *FindResource) (*Resource, } func (s *Store) UpdateResource(ctx context.Context, update *UpdateResource) (*Resource, error) { - if update.ResourceName != nil && !util.ResourceNameMatcher.MatchString(*update.ResourceName) { - return nil, errors.New("invalid resource name") + if update.UID != nil && !util.UIDMatcher.MatchString(*update.UID) { + return nil, errors.New("invalid uid") } return s.driver.UpdateResource(ctx, update) } diff --git a/store/user.go b/store/user.go index 4dcda4f6540ac..2457a64a4047d 100644 --- a/store/user.go +++ b/store/user.go @@ -57,6 +57,7 @@ type User struct { Nickname string PasswordHash string AvatarURL string + Description string } type UpdateUser struct { @@ -71,6 +72,7 @@ type UpdateUser struct { Password *string AvatarURL *string PasswordHash *string + Description *string } type FindUser struct { @@ -80,6 +82,12 @@ type FindUser struct { Role *Role Email *string Nickname *string + + // Random and limit are used in list users. + // Whether to return random users. + Random bool + // The maximum number of users to return. + Limit *int } type DeleteUser struct { diff --git a/test/store/memo_organizer_test.go b/test/store/memo_organizer_test.go index 4243a01a55d2b..8d942c787fd7d 100644 --- a/test/store/memo_organizer_test.go +++ b/test/store/memo_organizer_test.go @@ -15,10 +15,10 @@ func TestMemoOrganizerStore(t *testing.T) { user, err := createTestingHostUser(ctx, ts) require.NoError(t, err) memoCreate := &store.Memo{ - ResourceName: "main-memo", - CreatorID: user.ID, - Content: "main memo content", - Visibility: store.Public, + UID: "main-memo", + CreatorID: user.ID, + Content: "main memo content", + Visibility: store.Public, } memo, err := ts.CreateMemo(ctx, memoCreate) require.NoError(t, err) diff --git a/test/store/memo_relation_test.go b/test/store/memo_relation_test.go index bf825608bf96f..56565bf89515a 100644 --- a/test/store/memo_relation_test.go +++ b/test/store/memo_relation_test.go @@ -15,28 +15,28 @@ func TestMemoRelationStore(t *testing.T) { user, err := createTestingHostUser(ctx, ts) require.NoError(t, err) memoCreate := &store.Memo{ - ResourceName: "main-memo", - CreatorID: user.ID, - Content: "main memo content", - Visibility: store.Public, + UID: "main-memo", + CreatorID: user.ID, + Content: "main memo content", + Visibility: store.Public, } memo, err := ts.CreateMemo(ctx, memoCreate) require.NoError(t, err) require.Equal(t, memoCreate.Content, memo.Content) relatedMemoCreate := &store.Memo{ - ResourceName: "related-memo", - CreatorID: user.ID, - Content: "related memo content", - Visibility: store.Public, + UID: "related-memo", + CreatorID: user.ID, + Content: "related memo content", + Visibility: store.Public, } relatedMemo, err := ts.CreateMemo(ctx, relatedMemoCreate) require.NoError(t, err) require.Equal(t, relatedMemoCreate.Content, relatedMemo.Content) commentMemoCreate := &store.Memo{ - ResourceName: "comment-memo", - CreatorID: user.ID, - Content: "comment memo content", - Visibility: store.Public, + UID: "comment-memo", + CreatorID: user.ID, + Content: "comment memo content", + Visibility: store.Public, } commentMemo, err := ts.CreateMemo(ctx, commentMemoCreate) require.NoError(t, err) diff --git a/test/store/memo_test.go b/test/store/memo_test.go index c9a929ba66ec6..48f6f956981c7 100644 --- a/test/store/memo_test.go +++ b/test/store/memo_test.go @@ -15,10 +15,10 @@ func TestMemoStore(t *testing.T) { user, err := createTestingHostUser(ctx, ts) require.NoError(t, err) memoCreate := &store.Memo{ - ResourceName: "test-resource-name", - CreatorID: user.ID, - Content: "test_content", - Visibility: store.Public, + UID: "test-resource-name", + CreatorID: user.ID, + Content: "test_content", + Visibility: store.Public, } memo, err := ts.CreateMemo(ctx, memoCreate) require.NoError(t, err) @@ -68,10 +68,10 @@ func TestDeleteMemoStore(t *testing.T) { user, err := createTestingHostUser(ctx, ts) require.NoError(t, err) memoCreate := &store.Memo{ - ResourceName: "test-resource-name", - CreatorID: user.ID, - Content: "test_content", - Visibility: store.Public, + UID: "test-resource-name", + CreatorID: user.ID, + Content: "test_content", + Visibility: store.Public, } memo, err := ts.CreateMemo(ctx, memoCreate) require.NoError(t, err) diff --git a/test/store/resource_test.go b/test/store/resource_test.go index 90d66490a5c6e..2c759dfb964bc 100644 --- a/test/store/resource_test.go +++ b/test/store/resource_test.go @@ -14,7 +14,7 @@ func TestResourceStore(t *testing.T) { ctx := context.Background() ts := NewTestingStore(ctx, t) _, err := ts.CreateResource(ctx, &store.Resource{ - ResourceName: shortuuid.New(), + UID: shortuuid.New(), CreatorID: 101, Filename: "test.epub", Blob: []byte("test"), diff --git a/test/store/user_test.go b/test/store/user_test.go index dde7d156dd445..14131b4aecbdd 100644 --- a/test/store/user_test.go +++ b/test/store/user_test.go @@ -40,10 +40,11 @@ func TestUserStore(t *testing.T) { func createTestingHostUser(ctx context.Context, ts *store.Store) (*store.User, error) { userCreate := &store.User{ - Username: "test", - Role: store.RoleHost, - Email: "test@test.com", - Nickname: "test_nickname", + Username: "test", + Role: store.RoleHost, + Email: "test@test.com", + Nickname: "test_nickname", + Description: "test_description", } passwordHash, err := bcrypt.GenerateFromPassword([]byte("test_password"), bcrypt.DefaultCost) if err != nil { diff --git a/web/package.json b/web/package.json index c67f5e77dd3ad..707bb3cb9a340 100644 --- a/web/package.json +++ b/web/package.json @@ -4,23 +4,23 @@ "dev": "vite", "build": "tsc && vite build", "lint": "eslint --ext .js,.ts,.tsx, src", - "type-check": "tsc", + "type-check": "tsc --noEmit", "postinstall": "cd ../proto && buf generate" }, - "packageManager": "pnpm@8.7.0", "dependencies": { "@emotion/react": "^11.11.4", "@emotion/styled": "^11.11.0", + "@github/relative-time-element": "^4.3.1", "@matejmazur/react-katex": "^3.1.3", - "@mui/joy": "5.0.0-beta.30", + "@mui/joy": "5.0.0-beta.32", "@reduxjs/toolkit": "^1.9.7", - "axios": "^1.6.7", + "axios": "^1.6.8", "classnames": "^2.5.1", "copy-to-clipboard": "^3.3.3", "fuse.js": "^7.0.0", "highlight.js": "^11.9.0", "i18next": "^21.10.0", - "katex": "^0.16.9", + "katex": "^0.16.10", "lodash-es": "^4.17.21", "lucide-react": "^0.309.0", "mermaid": "^10.9.0", @@ -29,7 +29,7 @@ "react-hot-toast": "^2.4.1", "react-i18next": "^11.18.6", "react-redux": "^8.1.3", - "react-router-dom": "^6.22.2", + "react-router-dom": "^6.22.3", "react-use": "^17.5.0", "tailwindcss": "^3.4.1", "textarea-caret": "^3.1.0", @@ -37,36 +37,33 @@ "zustand": "^4.5.2" }, "devDependencies": { - "@bufbuild/buf": "^1.29.0", + "@bufbuild/buf": "^1.30.0", "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/d3": "^7.4.3", "@types/dompurify": "^3.0.5", "@types/katex": "^0.16.7", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.11.24", - "@types/qs": "^6.9.12", - "@types/react": "^18.2.63", - "@types/react-dom": "^18.2.20", + "@types/node": "^20.11.30", + "@types/qs": "^6.9.14", + "@types/react": "^18.2.71", + "@types/react-dom": "^18.2.22", "@types/textarea-caret": "^3.0.3", "@types/uuid": "^9.0.8", "@typescript-eslint/eslint-plugin": "^6.21.0", "@typescript-eslint/parser": "^6.21.0", "@vitejs/plugin-react": "^4.2.1", - "autoprefixer": "^10.4.18", + "autoprefixer": "^10.4.19", "eslint": "^8.57.0", "eslint-config-prettier": "^8.10.0", "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-react": "^7.34.0", + "eslint-plugin-react": "^7.34.1", "less": "^4.2.0", "long": "^5.2.3", - "nice-grpc-web": "^3.3.2", - "postcss": "^8.4.35", + "nice-grpc-web": "^3.3.3", + "postcss": "^8.4.38", "prettier": "^3.2.5", "protobufjs": "^7.2.6", - "typescript": "^5.3.3", - "vite": "^5.1.5" - }, - "resolutions": { - "csstype": "3.1.2" + "typescript": "^5.4.3", + "vite": "^5.2.6" } } diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index bf45dc0632ed7..f434cb6893ff2 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -4,28 +4,28 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false -overrides: - csstype: 3.1.2 - dependencies: '@emotion/react': specifier: ^11.11.4 - version: 11.11.4(@types/react@18.2.63)(react@18.2.0) + version: 11.11.4(@types/react@18.2.71)(react@18.2.0) '@emotion/styled': specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.63)(react@18.2.0) + version: 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.71)(react@18.2.0) + '@github/relative-time-element': + specifier: ^4.3.1 + version: 4.3.1 '@matejmazur/react-katex': specifier: ^3.1.3 - version: 3.1.3(katex@0.16.9)(react@18.2.0) + version: 3.1.3(katex@0.16.10)(react@18.2.0) '@mui/joy': - specifier: 5.0.0-beta.30 - version: 5.0.0-beta.30(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.63)(react-dom@18.2.0)(react@18.2.0) + specifier: 5.0.0-beta.32 + version: 5.0.0-beta.32(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.71)(react-dom@18.2.0)(react@18.2.0) '@reduxjs/toolkit': specifier: ^1.9.7 version: 1.9.7(react-redux@8.1.3)(react@18.2.0) axios: - specifier: ^1.6.7 - version: 1.6.7 + specifier: ^1.6.8 + version: 1.6.8 classnames: specifier: ^2.5.1 version: 2.5.1 @@ -42,8 +42,8 @@ dependencies: specifier: ^21.10.0 version: 21.10.0 katex: - specifier: ^0.16.9 - version: 0.16.9 + specifier: ^0.16.10 + version: 0.16.10 lodash-es: specifier: ^4.17.21 version: 4.17.21 @@ -61,16 +61,16 @@ dependencies: version: 18.2.0(react@18.2.0) react-hot-toast: specifier: ^2.4.1 - version: 2.4.1(csstype@3.1.2)(react-dom@18.2.0)(react@18.2.0) + version: 2.4.1(csstype@3.1.3)(react-dom@18.2.0)(react@18.2.0) react-i18next: specifier: ^11.18.6 version: 11.18.6(i18next@21.10.0)(react-dom@18.2.0)(react@18.2.0) react-redux: specifier: ^8.1.3 - version: 8.1.3(@types/react-dom@18.2.20)(@types/react@18.2.63)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + version: 8.1.3(@types/react-dom@18.2.22)(@types/react@18.2.71)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) react-router-dom: - specifier: ^6.22.2 - version: 6.22.2(react-dom@18.2.0)(react@18.2.0) + specifier: ^6.22.3 + version: 6.22.3(react-dom@18.2.0)(react@18.2.0) react-use: specifier: ^17.5.0 version: 17.5.0(react-dom@18.2.0)(react@18.2.0) @@ -85,12 +85,12 @@ dependencies: version: 9.0.1 zustand: specifier: ^4.5.2 - version: 4.5.2(@types/react@18.2.63)(react@18.2.0) + version: 4.5.2(@types/react@18.2.71)(react@18.2.0) devDependencies: '@bufbuild/buf': - specifier: ^1.29.0 - version: 1.29.0 + specifier: ^1.30.0 + version: 1.30.0 '@trivago/prettier-plugin-sort-imports': specifier: ^4.3.0 version: 4.3.0(prettier@3.2.5) @@ -107,17 +107,17 @@ devDependencies: specifier: ^4.17.12 version: 4.17.12 '@types/node': - specifier: ^20.11.24 - version: 20.11.24 + specifier: ^20.11.30 + version: 20.11.30 '@types/qs': - specifier: ^6.9.12 - version: 6.9.12 + specifier: ^6.9.14 + version: 6.9.14 '@types/react': - specifier: ^18.2.63 - version: 18.2.63 + specifier: ^18.2.71 + version: 18.2.71 '@types/react-dom': - specifier: ^18.2.20 - version: 18.2.20 + specifier: ^18.2.22 + version: 18.2.22 '@types/textarea-caret': specifier: ^3.0.3 version: 3.0.3 @@ -126,16 +126,16 @@ devDependencies: version: 9.0.8 '@typescript-eslint/eslint-plugin': specifier: ^6.21.0 - version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.3.3) + version: 6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.4.3) '@typescript-eslint/parser': specifier: ^6.21.0 - version: 6.21.0(eslint@8.57.0)(typescript@5.3.3) + version: 6.21.0(eslint@8.57.0)(typescript@5.4.3) '@vitejs/plugin-react': specifier: ^4.2.1 - version: 4.2.1(vite@5.1.5) + version: 4.2.1(vite@5.2.6) autoprefixer: - specifier: ^10.4.18 - version: 10.4.18(postcss@8.4.35) + specifier: ^10.4.19 + version: 10.4.19(postcss@8.4.38) eslint: specifier: ^8.57.0 version: 8.57.0 @@ -146,8 +146,8 @@ devDependencies: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@8.10.0)(eslint@8.57.0)(prettier@3.2.5) eslint-plugin-react: - specifier: ^7.34.0 - version: 7.34.0(eslint@8.57.0) + specifier: ^7.34.1 + version: 7.34.1(eslint@8.57.0) less: specifier: ^4.2.0 version: 4.2.0 @@ -155,11 +155,11 @@ devDependencies: specifier: ^5.2.3 version: 5.2.3 nice-grpc-web: - specifier: ^3.3.2 - version: 3.3.2(ws@8.16.0) + specifier: ^3.3.3 + version: 3.3.3(ws@8.16.0) postcss: - specifier: ^8.4.35 - version: 8.4.35 + specifier: ^8.4.38 + version: 8.4.38 prettier: specifier: ^3.2.5 version: 3.2.5 @@ -167,11 +167,11 @@ devDependencies: specifier: ^7.2.6 version: 7.2.6 typescript: - specifier: ^5.3.3 - version: 5.3.3 + specifier: ^5.4.3 + version: 5.4.3 vite: - specifier: ^5.1.5 - version: 5.1.5(@types/node@20.11.24)(less@4.2.0) + specifier: ^5.2.6 + version: 5.2.6(@types/node@20.11.30)(less@4.2.0) packages: @@ -193,31 +193,31 @@ packages: '@jridgewell/trace-mapping': 0.3.25 dev: true - /@babel/code-frame@7.23.5: - resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} + /@babel/code-frame@7.24.2: + resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.23.4 - chalk: 2.4.2 + '@babel/highlight': 7.24.2 + picocolors: 1.0.0 - /@babel/compat-data@7.23.5: - resolution: {integrity: sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw==} + /@babel/compat-data@7.24.1: + resolution: {integrity: sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==} engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.24.0: - resolution: {integrity: sha512-fQfkg0Gjkza3nf0c7/w6Xf34BW4YvzNfACRLmmb7XRLa6XHdR+K9AlJlxneFfWYf6uhOzuzZVTjF/8KfndZANw==} + /@babel/core@7.24.3: + resolution: {integrity: sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.6 + '@babel/code-frame': 7.24.2 + '@babel/generator': 7.24.1 '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.0) - '@babel/helpers': 7.24.0 - '@babel/parser': 7.24.0 + '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.3) + '@babel/helpers': 7.24.1 + '@babel/parser': 7.24.1 '@babel/template': 7.24.0 - '@babel/traverse': 7.24.0 + '@babel/traverse': 7.24.1 '@babel/types': 7.24.0 convert-source-map: 2.0.0 debug: 4.3.4 @@ -237,8 +237,8 @@ packages: source-map: 0.5.7 dev: true - /@babel/generator@7.23.6: - resolution: {integrity: sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw==} + /@babel/generator@7.24.1: + resolution: {integrity: sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 @@ -251,7 +251,7 @@ packages: resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/compat-data': 7.23.5 + '@babel/compat-data': 7.24.1 '@babel/helper-validator-option': 7.23.5 browserslist: 4.23.0 lru-cache: 5.1.1 @@ -278,21 +278,21 @@ packages: '@babel/types': 7.24.0 dev: true - /@babel/helper-module-imports@7.22.15: - resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} + /@babel/helper-module-imports@7.24.3: + resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.24.0 - /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.0): + /@babel/helper-module-transforms@7.23.3(@babel/core@7.24.3): resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.3 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.22.15 + '@babel/helper-module-imports': 7.24.3 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.22.20 @@ -317,8 +317,8 @@ packages: '@babel/types': 7.24.0 dev: true - /@babel/helper-string-parser@7.23.4: - resolution: {integrity: sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==} + /@babel/helper-string-parser@7.24.1: + resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} engines: {node: '>=6.9.0'} /@babel/helper-validator-identifier@7.22.20: @@ -330,55 +330,56 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.24.0: - resolution: {integrity: sha512-ulDZdc0Aj5uLc5nETsa7EPx2L7rM0YJM8r7ck7U73AXi7qOV44IHHRAYZHY6iU1rr3C5N4NtTmMRUJP6kwCWeA==} + /@babel/helpers@7.24.1: + resolution: {integrity: sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.24.0 - '@babel/traverse': 7.24.0 + '@babel/traverse': 7.24.1 '@babel/types': 7.24.0 transitivePeerDependencies: - supports-color dev: true - /@babel/highlight@7.23.4: - resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} + /@babel/highlight@7.24.2: + resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 + picocolors: 1.0.0 - /@babel/parser@7.24.0: - resolution: {integrity: sha512-QuP/FxEAzMSjXygs8v4N9dvdXzEHN4W1oF3PxuWAtPo08UdM17u89RDMgjLn/mlc56iM0HlLmVkO/wgR+rDgHg==} + /@babel/parser@7.24.1: + resolution: {integrity: sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==} engines: {node: '>=6.0.0'} hasBin: true dependencies: '@babel/types': 7.17.0 dev: true - /@babel/plugin-transform-react-jsx-self@7.23.3(@babel/core@7.24.0): - resolution: {integrity: sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==} + /@babel/plugin-transform-react-jsx-self@7.24.1(@babel/core@7.24.3): + resolution: {integrity: sha512-kDJgnPujTmAZ/9q2CN4m2/lRsUUPDvsG3+tSHWUJIzMGTt5U/b/fwWd3RO3n+5mjLrsBrVa5eKFRVSQbi3dF1w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/plugin-transform-react-jsx-source@7.23.3(@babel/core@7.24.0): - resolution: {integrity: sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==} + /@babel/plugin-transform-react-jsx-source@7.24.1(@babel/core@7.24.3): + resolution: {integrity: sha512-1v202n7aUq4uXAieRTKcwPzNyphlCuqHHDcdSNc+vdhoTEZcFMh+L5yZuCmGaIO7bs1nJUNfHB89TZyoL48xNA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.24.0 + '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 dev: true - /@babel/runtime@7.24.0: - resolution: {integrity: sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw==} + /@babel/runtime@7.24.1: + resolution: {integrity: sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.1 @@ -388,8 +389,8 @@ packages: resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.23.5 - '@babel/parser': 7.24.0 + '@babel/code-frame': 7.24.2 + '@babel/parser': 7.24.1 '@babel/types': 7.24.0 dev: true @@ -397,13 +398,13 @@ packages: resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.6 + '@babel/code-frame': 7.24.2 + '@babel/generator': 7.24.1 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.24.0 + '@babel/parser': 7.24.1 '@babel/types': 7.24.0 debug: 4.3.4 globals: 11.12.0 @@ -411,17 +412,17 @@ packages: - supports-color dev: true - /@babel/traverse@7.24.0: - resolution: {integrity: sha512-HfuJlI8qq3dEDmNU5ChzzpZRWq+oxCZQyMzIMEqLho+AQnhMnKQUzH6ydo3RBl/YjPCuk68Y6s0Gx0AeyULiWw==} + /@babel/traverse@7.24.1: + resolution: {integrity: sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.23.5 - '@babel/generator': 7.23.6 + '@babel/code-frame': 7.24.2 + '@babel/generator': 7.24.1 '@babel/helper-environment-visitor': 7.22.20 '@babel/helper-function-name': 7.23.0 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.24.0 + '@babel/parser': 7.24.1 '@babel/types': 7.24.0 debug: 4.3.4 globals: 11.12.0 @@ -441,7 +442,7 @@ packages: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.23.4 + '@babel/helper-string-parser': 7.24.1 '@babel/helper-validator-identifier': 7.22.20 to-fast-properties: 2.0.0 @@ -449,8 +450,8 @@ packages: resolution: {integrity: sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==} dev: false - /@bufbuild/buf-darwin-arm64@1.29.0: - resolution: {integrity: sha512-5hKxsARoY2WpWq1n5ONFqqGuauHb4yILKXCy37KRYCKiRLWmIP5yI3gWvWHKoH7sUJWTQmBqdJoCvYQr6ahQnw==} + /@bufbuild/buf-darwin-arm64@1.30.0: + resolution: {integrity: sha512-EUhh/hiazZPyf6I0HcQHf/ODZAq2js+PdIbemEWm8WQV29rqhY/stRxKDF755gG5xNr4xwhraQXYTizG3MZV5A==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -458,8 +459,8 @@ packages: dev: true optional: true - /@bufbuild/buf-darwin-x64@1.29.0: - resolution: {integrity: sha512-wOAPxbPLBns4AHiComWtdO1sx1J1p6mDYTbqmloHuI+B5U2rDbMsoHoe4nBcoMF8+RHxoqjypha29wVo6yzbZg==} + /@bufbuild/buf-darwin-x64@1.30.0: + resolution: {integrity: sha512-ID9G93hlpvy3KwYqu1UFZCFHaQ7KDESH3OmL33ASpdCojtQbD7EtKCQe8vwIW2raim7lSocSHLyZuLCUAvWoUw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -467,8 +468,8 @@ packages: dev: true optional: true - /@bufbuild/buf-linux-aarch64@1.29.0: - resolution: {integrity: sha512-jLk2J/wyyM7KNJ/DkLfhy3eS2/Bdb70e/56adMkapSoLJmghnpgxW+oFznMxxQUX5I9BU5hTn1UhDFxgLwhP7g==} + /@bufbuild/buf-linux-aarch64@1.30.0: + resolution: {integrity: sha512-VTp5YnfsHtCmRNqGAgzSm18fCTVw8ErK0Lk506CWtqqGhPJ+lWuVkxgAAzG+qoK4LZXIpX9dXxkoqdb+L1NTkg==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -476,8 +477,8 @@ packages: dev: true optional: true - /@bufbuild/buf-linux-x64@1.29.0: - resolution: {integrity: sha512-heLOywj3Oaoh69RnTx7tHsuz6rEnvz77bghLEOghsrjBR6Jcpcwc137EZR4kRTIWJNrE8Kmo3RVeXlv144qQIQ==} + /@bufbuild/buf-linux-x64@1.30.0: + resolution: {integrity: sha512-XBasj1Baf/lJIiJbX40RDjM8OLS3eVIiilnDqQ7ZL3WOCn6gROYr9lLjlUg9GYox9On5LCFp3536zfr3hNqQwg==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -485,8 +486,8 @@ packages: dev: true optional: true - /@bufbuild/buf-win32-arm64@1.29.0: - resolution: {integrity: sha512-Eglyvr3PLqVucuHBcQ61conyBgH9BRaoLpKWcce1gYBVlxMQM1NxjVjGOWihxQ1dXXw5qZXmYfVODf3gSwPMuQ==} + /@bufbuild/buf-win32-arm64@1.30.0: + resolution: {integrity: sha512-1C18Abq2GpBeGP54VOr9ABzSobynH/q8pUkbY6ftp7JIYdrCvKfJmianEpvTHJWl5kwe3UP9xYYgr5Yt+Y/8Yw==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -494,8 +495,8 @@ packages: dev: true optional: true - /@bufbuild/buf-win32-x64@1.29.0: - resolution: {integrity: sha512-wRk6co+nqHqEq4iLolXgej0jUVlWlTtGHjKaq54lTbKZrwxrBgql6qS06abgNPRASX0++XT9m3QRZ97qEIC/HQ==} + /@bufbuild/buf-win32-x64@1.30.0: + resolution: {integrity: sha512-uRc05jpbvdUxKSHpUj6RfNR3yJTIdSYccgtupgc6qPoDXE+KveyqjbA0CqIqXhgJmgyggBcYLEbX+tdtz5LRhA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -503,25 +504,25 @@ packages: dev: true optional: true - /@bufbuild/buf@1.29.0: - resolution: {integrity: sha512-euksXeFtvlvAV5j94LqXb69qQcJvFfo8vN1d3cx+IzhOKoipykuQQTq7mOWVo2R0kdk6yIMBLBofOYOsh0Df8g==} + /@bufbuild/buf@1.30.0: + resolution: {integrity: sha512-SImlJJA+9uDccWzt6SFXJwRQE/6fGv2cIKyXqDJCWthYMMYw9/QOdM/pXg5JZx1XJrHiEvzZ0y+ump7Q08/FPw==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@bufbuild/buf-darwin-arm64': 1.29.0 - '@bufbuild/buf-darwin-x64': 1.29.0 - '@bufbuild/buf-linux-aarch64': 1.29.0 - '@bufbuild/buf-linux-x64': 1.29.0 - '@bufbuild/buf-win32-arm64': 1.29.0 - '@bufbuild/buf-win32-x64': 1.29.0 + '@bufbuild/buf-darwin-arm64': 1.30.0 + '@bufbuild/buf-darwin-x64': 1.30.0 + '@bufbuild/buf-linux-aarch64': 1.30.0 + '@bufbuild/buf-linux-x64': 1.30.0 + '@bufbuild/buf-win32-arm64': 1.30.0 + '@bufbuild/buf-win32-x64': 1.30.0 dev: true /@emotion/babel-plugin@11.11.0: resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} dependencies: - '@babel/helper-module-imports': 7.22.15 - '@babel/runtime': 7.24.0 + '@babel/helper-module-imports': 7.24.3 + '@babel/runtime': 7.24.1 '@emotion/hash': 0.9.1 '@emotion/memoize': 0.8.1 '@emotion/serialize': 1.1.3 @@ -557,7 +558,7 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.4(@types/react@18.2.63)(react@18.2.0): + /@emotion/react@11.11.4(@types/react@18.2.71)(react@18.2.0): resolution: {integrity: sha512-t8AjMlF0gHpvvxk5mAtCqR4vmxiGHCeJBaQO6gncUSdklELOgtwjerNY2yuJNfwnc6vi16U/+uMF+afIawJ9iw==} peerDependencies: '@types/react': '*' @@ -566,14 +567,14 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.3 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 - '@types/react': 18.2.63 + '@types/react': 18.2.71 hoist-non-react-statics: 3.3.2 react: 18.2.0 dev: false @@ -585,14 +586,14 @@ packages: '@emotion/memoize': 0.8.1 '@emotion/unitless': 0.8.1 '@emotion/utils': 1.2.1 - csstype: 3.1.2 + csstype: 3.1.3 dev: false /@emotion/sheet@1.2.2: resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.4)(@types/react@18.2.63)(react@18.2.0): + /@emotion/styled@11.11.0(@emotion/react@11.11.4)(@types/react@18.2.71)(react@18.2.0): resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 @@ -602,14 +603,14 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 '@emotion/babel-plugin': 11.11.0 '@emotion/is-prop-valid': 1.2.2 - '@emotion/react': 11.11.4(@types/react@18.2.63)(react@18.2.0) + '@emotion/react': 11.11.4(@types/react@18.2.71)(react@18.2.0) '@emotion/serialize': 1.1.3 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 - '@types/react': 18.2.63 + '@types/react': 18.2.71 react: 18.2.0 dev: false @@ -633,8 +634,8 @@ packages: resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} dev: false - /@esbuild/aix-ppc64@0.19.12: - resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} + /@esbuild/aix-ppc64@0.20.2: + resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==} engines: {node: '>=12'} cpu: [ppc64] os: [aix] @@ -642,8 +643,8 @@ packages: dev: true optional: true - /@esbuild/android-arm64@0.19.12: - resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} + /@esbuild/android-arm64@0.20.2: + resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -651,8 +652,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.19.12: - resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} + /@esbuild/android-arm@0.20.2: + resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -660,8 +661,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.19.12: - resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} + /@esbuild/android-x64@0.20.2: + resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -669,8 +670,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.19.12: - resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} + /@esbuild/darwin-arm64@0.20.2: + resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -678,8 +679,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.19.12: - resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} + /@esbuild/darwin-x64@0.20.2: + resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -687,8 +688,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.19.12: - resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} + /@esbuild/freebsd-arm64@0.20.2: + resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -696,8 +697,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.19.12: - resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} + /@esbuild/freebsd-x64@0.20.2: + resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -705,8 +706,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.19.12: - resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} + /@esbuild/linux-arm64@0.20.2: + resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -714,8 +715,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.19.12: - resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} + /@esbuild/linux-arm@0.20.2: + resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -723,8 +724,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.19.12: - resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} + /@esbuild/linux-ia32@0.20.2: + resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -732,8 +733,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.19.12: - resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} + /@esbuild/linux-loong64@0.20.2: + resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -741,8 +742,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.19.12: - resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} + /@esbuild/linux-mips64el@0.20.2: + resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -750,8 +751,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.19.12: - resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} + /@esbuild/linux-ppc64@0.20.2: + resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -759,8 +760,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.19.12: - resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} + /@esbuild/linux-riscv64@0.20.2: + resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -768,8 +769,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.19.12: - resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} + /@esbuild/linux-s390x@0.20.2: + resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -777,8 +778,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.19.12: - resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} + /@esbuild/linux-x64@0.20.2: + resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -786,8 +787,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.19.12: - resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} + /@esbuild/netbsd-x64@0.20.2: + resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -795,8 +796,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.19.12: - resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} + /@esbuild/openbsd-x64@0.20.2: + resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -804,8 +805,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.19.12: - resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} + /@esbuild/sunos-x64@0.20.2: + resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -813,8 +814,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.19.12: - resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} + /@esbuild/win32-arm64@0.20.2: + resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -822,8 +823,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.19.12: - resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} + /@esbuild/win32-ia32@0.20.2: + resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -831,8 +832,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.19.12: - resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} + /@esbuild/win32-x64@0.20.2: + resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -905,6 +906,10 @@ packages: resolution: {integrity: sha512-9TANp6GPoMtYzQdt54kfAyMmz1+osLlXdg2ENroU7zzrtflTLrrC/lgrIfaSe+Wu0b89GKccT7vxXA0MoAIO+Q==} dev: false + /@github/relative-time-element@4.3.1: + resolution: {integrity: sha512-zL79nlhZVCg7x2Pf/HT5MB0mowmErE71VXpF10/3Wy8dQwkninNO1M9aOizh2wKC5LkSpDXqNYjDZwbH0/bcSg==} + dev: false + /@humanwhocodes/config-array@0.11.14: resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -962,19 +967,19 @@ packages: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.4.15 - /@matejmazur/react-katex@3.1.3(katex@0.16.9)(react@18.2.0): + /@matejmazur/react-katex@3.1.3(katex@0.16.10)(react@18.2.0): resolution: {integrity: sha512-rBp7mJ9An7ktNoU653BWOYdO4FoR4YNwofHZi+vaytX/nWbIlmHVIF+X8VFOn6c3WYmrLT5FFBjKqCZ1sjR5uQ==} engines: {node: '>=12', yarn: '>=1.1'} peerDependencies: katex: '>=0.9' react: '>=16' dependencies: - katex: 0.16.9 + katex: 0.16.10 react: 18.2.0 dev: false - /@mui/base@5.0.0-beta.38(@types/react@18.2.63)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-AsjD6Y1X5A1qndxz8xCcR8LDqv31aiwlgWMPxFAX/kCKiIGKlK65yMeVZ62iQr/6LBz+9hSKLiD1i4TZdAHKcQ==} + /@mui/base@5.0.0-beta.40(@types/react@18.2.71)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-I/lGHztkCzvwlXpjD2+SNmvNQvB4227xBXhISPjEaJUXGImOQ9f3D2Yj/T3KasSI/h0MLWy74X0J6clhPmsRbQ==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -984,24 +989,24 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 '@floating-ui/react-dom': 2.0.8(react-dom@18.2.0)(react@18.2.0) - '@mui/types': 7.2.13(@types/react@18.2.63) - '@mui/utils': 5.15.12(@types/react@18.2.63)(react@18.2.0) + '@mui/types': 7.2.14(@types/react@18.2.71) + '@mui/utils': 5.15.14(@types/react@18.2.71)(react@18.2.0) '@popperjs/core': 2.11.8 - '@types/react': 18.2.63 + '@types/react': 18.2.71 clsx: 2.1.0 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/core-downloads-tracker@5.15.12: - resolution: {integrity: sha512-brRO+tMFLpGyjEYHrX97bzqeF6jZmKpqqe1rY0LyIHAwP6xRVzh++zSecOQorDOCaZJg4XkGT9xfD+RWOWxZBA==} + /@mui/core-downloads-tracker@5.15.14: + resolution: {integrity: sha512-on75VMd0XqZfaQW+9pGjSNiqW+ghc5E2ZSLRBXwcXl/C4YzjfyjrLPhrEpKnR9Uym9KXBvxrhoHfPcczYHweyA==} dev: false - /@mui/joy@5.0.0-beta.30(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.63)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-m8f/sYarTohCqZOy3i1q/MYNmAshoccoRbOrWQ7+At1ReaJPz2D2LUYzYjJxxaK7sOjhDtY9etK7WfsrJhqGLA==} + /@mui/joy@5.0.0-beta.32(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.71)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-QJW5Mu2GTJUX4sXjxt4nQBugpJAiSkUT49S/bwoKCCWx8bCfsEyplTzZPK+FraweiGhGgZWExWOTAPpxH83RUQ==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -1017,23 +1022,23 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.24.0 - '@emotion/react': 11.11.4(@types/react@18.2.63)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.63)(react@18.2.0) - '@mui/base': 5.0.0-beta.38(@types/react@18.2.63)(react-dom@18.2.0)(react@18.2.0) - '@mui/core-downloads-tracker': 5.15.12 - '@mui/system': 5.15.12(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.63)(react@18.2.0) - '@mui/types': 7.2.13(@types/react@18.2.63) - '@mui/utils': 5.15.12(@types/react@18.2.63)(react@18.2.0) - '@types/react': 18.2.63 + '@babel/runtime': 7.24.1 + '@emotion/react': 11.11.4(@types/react@18.2.71)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.71)(react@18.2.0) + '@mui/base': 5.0.0-beta.40(@types/react@18.2.71)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.15.14 + '@mui/system': 5.15.14(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.71)(react@18.2.0) + '@mui/types': 7.2.14(@types/react@18.2.71) + '@mui/utils': 5.15.14(@types/react@18.2.71)(react@18.2.0) + '@types/react': 18.2.71 clsx: 2.1.0 prop-types: 15.8.1 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/private-theming@5.15.12(@types/react@18.2.63)(react@18.2.0): - resolution: {integrity: sha512-cqoSo9sgA5HE+8vZClbLrq9EkyOnYysooepi5eKaKvJ41lReT2c5wOZAeDDM1+xknrMDos+0mT2zr3sZmUiRRA==} + /@mui/private-theming@5.15.14(@types/react@18.2.71)(react@18.2.0): + resolution: {integrity: sha512-UH0EiZckOWcxiXLX3Jbb0K7rC8mxTr9L9l6QhOZxYc4r8FHUkefltV9VDGLrzCaWh30SQiJvAEd7djX3XXY6Xw==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -1042,15 +1047,15 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.24.0 - '@mui/utils': 5.15.12(@types/react@18.2.63)(react@18.2.0) - '@types/react': 18.2.63 + '@babel/runtime': 7.24.1 + '@mui/utils': 5.15.14(@types/react@18.2.71)(react@18.2.0) + '@types/react': 18.2.71 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/styled-engine@5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(react@18.2.0): - resolution: {integrity: sha512-So21AhAngqo07ces4S/JpX5UaMU2RHXpEA6hNzI6IQjd/1usMPxpgK8wkGgTe3JKmC2KDmH8cvoycq5H3Ii7/w==} + /@mui/styled-engine@5.15.14(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(react@18.2.0): + resolution: {integrity: sha512-RILkuVD8gY6PvjZjqnWhz8fu68dVkqhM5+jYWfB5yhlSQKg+2rHkmEwm75XIeAqI3qwOndK6zELK5H6Zxn4NHw==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.4.1 @@ -1062,17 +1067,17 @@ packages: '@emotion/styled': optional: true dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.4(@types/react@18.2.63)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.63)(react@18.2.0) - csstype: 3.1.2 + '@emotion/react': 11.11.4(@types/react@18.2.71)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.71)(react@18.2.0) + csstype: 3.1.3 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/system@5.15.12(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.63)(react@18.2.0): - resolution: {integrity: sha512-/pq+GO6yN3X7r3hAwFTrzkAh7K1bTF5r8IzS79B9eyKJg7v6B/t4/zZYMR6OT9qEPtwf6rYN2Utg1e6Z7F1OgQ==} + /@mui/system@5.15.14(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(@types/react@18.2.71)(react@18.2.0): + resolution: {integrity: sha512-auXLXzUaCSSOLqJXmsAaq7P96VPRXg2Rrz6OHNV7lr+kB8lobUF+/N84Vd9C4G/wvCXYPs5TYuuGBRhcGbiBGg==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -1087,33 +1092,33 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.24.0 - '@emotion/react': 11.11.4(@types/react@18.2.63)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.63)(react@18.2.0) - '@mui/private-theming': 5.15.12(@types/react@18.2.63)(react@18.2.0) - '@mui/styled-engine': 5.15.11(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(react@18.2.0) - '@mui/types': 7.2.13(@types/react@18.2.63) - '@mui/utils': 5.15.12(@types/react@18.2.63)(react@18.2.0) - '@types/react': 18.2.63 + '@babel/runtime': 7.24.1 + '@emotion/react': 11.11.4(@types/react@18.2.71)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.4)(@types/react@18.2.71)(react@18.2.0) + '@mui/private-theming': 5.15.14(@types/react@18.2.71)(react@18.2.0) + '@mui/styled-engine': 5.15.14(@emotion/react@11.11.4)(@emotion/styled@11.11.0)(react@18.2.0) + '@mui/types': 7.2.14(@types/react@18.2.71) + '@mui/utils': 5.15.14(@types/react@18.2.71)(react@18.2.0) + '@types/react': 18.2.71 clsx: 2.1.0 - csstype: 3.1.2 + csstype: 3.1.3 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/types@7.2.13(@types/react@18.2.63): - resolution: {integrity: sha512-qP9OgacN62s+l8rdDhSFRe05HWtLLJ5TGclC9I1+tQngbssu0m2dmFZs+Px53AcOs9fD7TbYd4gc9AXzVqO/+g==} + /@mui/types@7.2.14(@types/react@18.2.71): + resolution: {integrity: sha512-MZsBZ4q4HfzBsywtXgM1Ksj6HDThtiwmOKUXH1pKYISI9gAVXCNHNpo7TlGoGrBaYWZTdNoirIN7JsQcQUjmQQ==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 peerDependenciesMeta: '@types/react': optional: true dependencies: - '@types/react': 18.2.63 + '@types/react': 18.2.71 dev: false - /@mui/utils@5.15.12(@types/react@18.2.63)(react@18.2.0): - resolution: {integrity: sha512-8SDGCnO2DY9Yy+5bGzu00NZowSDtuyHP4H8gunhHGQoIlhlY2Z3w64wBzAOLpYw/ZhJNzksDTnS/i8qdJvxuow==} + /@mui/utils@5.15.14(@types/react@18.2.71)(react@18.2.0): + resolution: {integrity: sha512-0lF/7Hh/ezDv5X7Pry6enMsbYyGKjADzvHyo3Qrc/SSlTsQ1VkbDMbH0m2t3OR5iIVLwMoxwM7yGd+6FCMtTFA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -1122,9 +1127,9 @@ packages: '@types/react': optional: true dependencies: - '@babel/runtime': 7.24.0 - '@types/prop-types': 15.7.11 - '@types/react': 18.2.63 + '@babel/runtime': 7.24.1 + '@types/prop-types': 15.7.12 + '@types/react': 18.2.71 prop-types: 15.8.1 react: 18.2.0 react-is: 18.2.0 @@ -1220,115 +1225,115 @@ packages: dependencies: immer: 9.0.21 react: 18.2.0 - react-redux: 8.1.3(@types/react-dom@18.2.20)(@types/react@18.2.63)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + react-redux: 8.1.3(@types/react-dom@18.2.22)(@types/react@18.2.71)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) redux: 4.2.1 redux-thunk: 2.4.2(redux@4.2.1) reselect: 4.1.8 dev: false - /@remix-run/router@1.15.2: - resolution: {integrity: sha512-+Rnav+CaoTE5QJc4Jcwh5toUpnVLKYbpU6Ys0zqbakqbaLQHeglLVHPfxOiQqdNmUy5C2lXz5dwC6tQNX2JW2Q==} + /@remix-run/router@1.15.3: + resolution: {integrity: sha512-Oy8rmScVrVxWZVOpEF57ovlnhpZ8CCPlnIIumVcV9nFdiSIrus99+Lw78ekXyGvVDlIsFJbSfmSovJUhCWYV3w==} engines: {node: '>=14.0.0'} dev: false - /@rollup/rollup-android-arm-eabi@4.12.1: - resolution: {integrity: sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==} + /@rollup/rollup-android-arm-eabi@4.13.0: + resolution: {integrity: sha512-5ZYPOuaAqEH/W3gYsRkxQATBW3Ii1MfaT4EQstTnLKViLi2gLSQmlmtTpGucNP3sXEpOiI5tdGhjdE111ekyEg==} cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-android-arm64@4.12.1: - resolution: {integrity: sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==} + /@rollup/rollup-android-arm64@4.13.0: + resolution: {integrity: sha512-BSbaCmn8ZadK3UAQdlauSvtaJjhlDEjS5hEVVIN3A4bbl3X+otyf/kOJV08bYiRxfejP3DXFzO2jz3G20107+Q==} cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-arm64@4.12.1: - resolution: {integrity: sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==} + /@rollup/rollup-darwin-arm64@4.13.0: + resolution: {integrity: sha512-Ovf2evVaP6sW5Ut0GHyUSOqA6tVKfrTHddtmxGQc1CTQa1Cw3/KMCDEEICZBbyppcwnhMwcDce9ZRxdWRpVd6g==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-darwin-x64@4.12.1: - resolution: {integrity: sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==} + /@rollup/rollup-darwin-x64@4.13.0: + resolution: {integrity: sha512-U+Jcxm89UTK592vZ2J9st9ajRv/hrwHdnvyuJpa5A2ngGSVHypigidkQJP+YiGL6JODiUeMzkqQzbCG3At81Gg==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm-gnueabihf@4.12.1: - resolution: {integrity: sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==} + /@rollup/rollup-linux-arm-gnueabihf@4.13.0: + resolution: {integrity: sha512-8wZidaUJUTIR5T4vRS22VkSMOVooG0F4N+JSwQXWSRiC6yfEsFMLTYRFHvby5mFFuExHa/yAp9juSphQQJAijQ==} cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-gnu@4.12.1: - resolution: {integrity: sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==} + /@rollup/rollup-linux-arm64-gnu@4.13.0: + resolution: {integrity: sha512-Iu0Kno1vrD7zHQDxOmvweqLkAzjxEVqNhUIXBsZ8hu8Oak7/5VTPrxOEZXYC1nmrBVJp0ZcL2E7lSuuOVaE3+w==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-arm64-musl@4.12.1: - resolution: {integrity: sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==} + /@rollup/rollup-linux-arm64-musl@4.13.0: + resolution: {integrity: sha512-C31QrW47llgVyrRjIwiOwsHFcaIwmkKi3PCroQY5aVq4H0A5v/vVVAtFsI1nfBngtoRpeREvZOkIhmRwUKkAdw==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-riscv64-gnu@4.12.1: - resolution: {integrity: sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==} + /@rollup/rollup-linux-riscv64-gnu@4.13.0: + resolution: {integrity: sha512-Oq90dtMHvthFOPMl7pt7KmxzX7E71AfyIhh+cPhLY9oko97Zf2C9tt/XJD4RgxhaGeAraAXDtqxvKE1y/j35lA==} cpu: [riscv64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-gnu@4.12.1: - resolution: {integrity: sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==} + /@rollup/rollup-linux-x64-gnu@4.13.0: + resolution: {integrity: sha512-yUD/8wMffnTKuiIsl6xU+4IA8UNhQ/f1sAnQebmE/lyQ8abjsVyDkyRkWop0kdMhKMprpNIhPmYlCxgHrPoXoA==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-linux-x64-musl@4.12.1: - resolution: {integrity: sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==} + /@rollup/rollup-linux-x64-musl@4.13.0: + resolution: {integrity: sha512-9RyNqoFNdF0vu/qqX63fKotBh43fJQeYC98hCaf89DYQpv+xu0D8QFSOS0biA7cGuqJFOc1bJ+m2rhhsKcw1hw==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-arm64-msvc@4.12.1: - resolution: {integrity: sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==} + /@rollup/rollup-win32-arm64-msvc@4.13.0: + resolution: {integrity: sha512-46ue8ymtm/5PUU6pCvjlic0z82qWkxv54GTJZgHrQUuZnVH+tvvSP0LsozIDsCBFO4VjJ13N68wqrKSeScUKdA==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-ia32-msvc@4.12.1: - resolution: {integrity: sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==} + /@rollup/rollup-win32-ia32-msvc@4.13.0: + resolution: {integrity: sha512-P5/MqLdLSlqxbeuJ3YDeX37srC8mCflSyTrUsgbU1c/U9j6l2g2GiIdYaGD9QjdMQPMSgYm7hgg0551wHyIluw==} cpu: [ia32] os: [win32] requiresBuild: true dev: true optional: true - /@rollup/rollup-win32-x64-msvc@4.12.1: - resolution: {integrity: sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==} + /@rollup/rollup-win32-x64-msvc@4.13.0: + resolution: {integrity: sha512-UKXUQNbO3DOhzLRwHSpa0HnhhCgNODvfoPWv2FCXme8N/ANFfhIPMGuOT+QuKd16+B5yxZ0HdpNlqPvTMS1qfw==} cpu: [x64] os: [win32] requiresBuild: true @@ -1345,7 +1350,7 @@ packages: optional: true dependencies: '@babel/generator': 7.17.7 - '@babel/parser': 7.24.0 + '@babel/parser': 7.24.1 '@babel/traverse': 7.23.2 '@babel/types': 7.17.0 javascript-natural-sort: 0.7.1 @@ -1358,7 +1363,7 @@ packages: /@types/babel__core@7.20.5: resolution: {integrity: sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==} dependencies: - '@babel/parser': 7.24.0 + '@babel/parser': 7.24.1 '@babel/types': 7.24.0 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 @@ -1374,7 +1379,7 @@ packages: /@types/babel__template@7.4.4: resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} dependencies: - '@babel/parser': 7.24.0 + '@babel/parser': 7.24.1 '@babel/types': 7.24.0 dev: true @@ -1457,8 +1462,8 @@ packages: '@types/geojson': 7946.0.14 dev: true - /@types/d3-hierarchy@3.1.6: - resolution: {integrity: sha512-qlmD/8aMk5xGorUvTUWHCiumvgaUXYldYjNVOWtYoTYY/L+WwIEAmJxUmTgr9LoGNG0PPAOmqMDJVDPc7DOpPw==} + /@types/d3-hierarchy@3.1.7: + resolution: {integrity: sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==} dev: true /@types/d3-interpolate@3.0.4: @@ -1543,7 +1548,7 @@ packages: '@types/d3-force': 3.0.9 '@types/d3-format': 3.0.4 '@types/d3-geo': 3.1.0 - '@types/d3-hierarchy': 3.1.6 + '@types/d3-hierarchy': 3.1.7 '@types/d3-interpolate': 3.0.4 '@types/d3-path': 3.1.0 '@types/d3-polygon': 3.0.2 @@ -1583,7 +1588,7 @@ packages: /@types/hoist-non-react-statics@3.3.5: resolution: {integrity: sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==} dependencies: - '@types/react': 18.2.63 + '@types/react': 18.2.71 hoist-non-react-statics: 3.3.2 dev: false @@ -1602,11 +1607,11 @@ packages: /@types/lodash-es@4.17.12: resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} dependencies: - '@types/lodash': 4.14.202 + '@types/lodash': 4.17.0 dev: true - /@types/lodash@4.14.202: - resolution: {integrity: sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==} + /@types/lodash@4.17.0: + resolution: {integrity: sha512-t7dhREVv6dbNj0q17X12j7yDG4bD/DHYX7o5/DbDxobP0HnGPgpRz2Ej77aL7TZT3DSw13fqUTj8J4mMnqa7WA==} dev: true /@types/mdast@3.0.15: @@ -1619,8 +1624,8 @@ packages: resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} dev: false - /@types/node@20.11.24: - resolution: {integrity: sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==} + /@types/node@20.11.30: + resolution: {integrity: sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==} dependencies: undici-types: 5.26.5 dev: true @@ -1629,27 +1634,27 @@ packages: resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} dev: false - /@types/prop-types@15.7.11: - resolution: {integrity: sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==} + /@types/prop-types@15.7.12: + resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} - /@types/qs@6.9.12: - resolution: {integrity: sha512-bZcOkJ6uWrL0Qb2NAWKa7TBU+mJHPzhx9jjLL1KHF+XpzEcR7EXHvjbHlGtR/IsP1vyPrehuS6XqkmaePy//mg==} + /@types/qs@6.9.14: + resolution: {integrity: sha512-5khscbd3SwWMhFqylJBLQ0zIu7c1K6Vz0uBIt915BI3zV0q1nfjRQD3RqSBcPaO6PHEF4ov/t9y89fSiyThlPA==} dev: true - /@types/react-dom@18.2.20: - resolution: {integrity: sha512-HXN/biJY8nv20Cn9ZbCFq3liERd4CozVZmKbaiZ9KiKTrWqsP7eoGDO6OOGvJQwoVFuiXaiJ7nBBjiFFbRmQMQ==} + /@types/react-dom@18.2.22: + resolution: {integrity: sha512-fHkBXPeNtfvri6gdsMYyW+dW7RXFo6Ad09nLFK0VQWR7yGLai/Cyvyj696gbwYvBnhGtevUG9cET0pmUbMtoPQ==} dependencies: - '@types/react': 18.2.63 + '@types/react': 18.2.71 - /@types/react@18.2.63: - resolution: {integrity: sha512-ppaqODhs15PYL2nGUOaOu2RSCCB4Difu4UFrP4I3NHLloXC/ESQzQMi9nvjfT1+rudd0d2L3fQPJxRSey+rGlQ==} + /@types/react@18.2.71: + resolution: {integrity: sha512-PxEsB9OjmQeYGffoWnYAd/r5FiJuUw2niFQHPc2v2idwh8wGPkkYzOHuinNJJY6NZqfoTCiOIizDOz38gYNsyw==} dependencies: - '@types/prop-types': 15.7.11 - '@types/scheduler': 0.16.8 - csstype: 3.1.2 + '@types/prop-types': 15.7.12 + '@types/scheduler': 0.23.0 + csstype: 3.1.3 - /@types/scheduler@0.16.8: - resolution: {integrity: sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==} + /@types/scheduler@0.23.0: + resolution: {integrity: sha512-YIoDCTH3Af6XM5VuwGG/QL/CJqga1Zm3NkU3HZ4ZHK2fRMPYP1VczsTUqtsf43PH/iJNVlPHAo2oWX7BSdB2Hw==} /@types/semver@7.5.8: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} @@ -1675,7 +1680,7 @@ packages: resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==} dev: true - /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/eslint-plugin@6.21.0(@typescript-eslint/parser@6.21.0)(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1687,10 +1692,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/parser': 6.21.0(eslint@8.57.0)(typescript@5.4.3) '@typescript-eslint/scope-manager': 6.21.0 - '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/type-utils': 6.21.0(eslint@8.57.0)(typescript@5.4.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.3) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 eslint: 8.57.0 @@ -1698,13 +1703,13 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.2.1(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.3.0(typescript@5.4.3) + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/parser@6.21.0(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1716,11 +1721,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.3) '@typescript-eslint/visitor-keys': 6.21.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.3.3 + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true @@ -1733,7 +1738,7 @@ packages: '@typescript-eslint/visitor-keys': 6.21.0 dev: true - /@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/type-utils@6.21.0(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1743,12 +1748,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.3) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.3) debug: 4.3.4 eslint: 8.57.0 - ts-api-utils: 1.2.1(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.3.0(typescript@5.4.3) + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true @@ -1758,7 +1763,7 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.3.3): + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.3): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1774,13 +1779,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.2.1(typescript@5.3.3) - typescript: 5.3.3 + ts-api-utils: 1.3.0(typescript@5.4.3) + typescript: 5.4.3 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.3.3): + /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.3): resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1791,7 +1796,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.3) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -1811,18 +1816,18 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-react@4.2.1(vite@5.1.5): + /@vitejs/plugin-react@4.2.1(vite@5.2.6): resolution: {integrity: sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: vite: ^4.2.0 || ^5.0.0 dependencies: - '@babel/core': 7.24.0 - '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.24.0) - '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.24.0) + '@babel/core': 7.24.3 + '@babel/plugin-transform-react-jsx-self': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-transform-react-jsx-source': 7.24.1(@babel/core@7.24.3) '@types/babel__core': 7.20.5 react-refresh: 0.14.0 - vite: 5.1.5(@types/node@20.11.24)(less@4.2.0) + vite: 5.2.6(@types/node@20.11.30)(less@4.2.0) transitivePeerDependencies: - supports-color dev: true @@ -1912,13 +1917,14 @@ packages: is-array-buffer: 3.0.4 dev: true - /array-includes@3.1.7: - resolution: {integrity: sha512-dlcsNBIiWhPkHdOEEKnehA+RNUWDc4UqFtnIXU4uuYDPtA4LDkr7qip2p0VvFAEXNDr0yWZ9PJyIRiGjRLQzwQ==} + /array-includes@3.1.8: + resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 + es-object-atoms: 1.0.0 get-intrinsic: 1.2.4 is-string: 1.0.7 dev: true @@ -1928,14 +1934,15 @@ packages: engines: {node: '>=8'} dev: true - /array.prototype.findlast@1.2.4: - resolution: {integrity: sha512-BMtLxpV+8BD+6ZPFIWmnUBpQoy+A+ujcg4rhp2iwCRJYA7PEh2MS4NL3lz8EiDlLrJPp2hg9qWihr5pd//jcGw==} + /array.prototype.findlast@1.2.5: + resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-errors: 1.3.0 + es-object-atoms: 1.0.0 es-shim-unscopables: 1.0.2 dev: true @@ -1945,7 +1952,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-shim-unscopables: 1.0.2 dev: true @@ -1955,7 +1962,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-shim-unscopables: 1.0.2 dev: true @@ -1964,7 +1971,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-shim-unscopables: 1.0.2 dev: true @@ -1973,7 +1980,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-errors: 1.3.0 es-shim-unscopables: 1.0.2 dev: true @@ -1985,36 +1992,30 @@ packages: array-buffer-byte-length: 1.0.1 call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-errors: 1.3.0 get-intrinsic: 1.2.4 is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 dev: true - /asynciterator.prototype@1.0.0: - resolution: {integrity: sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg==} - dependencies: - has-symbols: 1.0.3 - dev: true - /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: false - /autoprefixer@10.4.18(postcss@8.4.35): - resolution: {integrity: sha512-1DKbDfsr6KUElM6wg+0zRNkB/Q7WcKYAaK+pzXn+Xqmszm/5Xa9coeNdtP88Vi+dPzZnMjhge8GIV49ZQkDa+g==} + /autoprefixer@10.4.19(postcss@8.4.38): + resolution: {integrity: sha512-BaENR2+zBZ8xXhM4pUaKUxlVdxZ0EZhjvbopwnXmxRUfqDmwSpC2lAi/QXvx7NRdPCo1WKEcEF6mV64si1z4Ew==} engines: {node: ^10 || ^12 || >=14} hasBin: true peerDependencies: postcss: ^8.1.0 dependencies: browserslist: 4.23.0 - caniuse-lite: 1.0.30001594 + caniuse-lite: 1.0.30001600 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 - postcss: 8.4.35 + postcss: 8.4.38 postcss-value-parser: 4.2.0 dev: true @@ -2025,10 +2026,10 @@ packages: possible-typed-array-names: 1.0.0 dev: true - /axios@1.6.7: - resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} + /axios@1.6.8: + resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} dependencies: - follow-redirects: 1.15.5 + follow-redirects: 1.15.6 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -2039,7 +2040,7 @@ packages: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} engines: {node: '>=10', npm: '>=6'} dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 cosmiconfig: 7.1.0 resolve: 1.22.8 dev: false @@ -2047,8 +2048,8 @@ packages: /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} - /binary-extensions@2.2.0: - resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + /binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} dev: false @@ -2075,8 +2076,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001594 - electron-to-chromium: 1.4.693 + caniuse-lite: 1.0.30001600 + electron-to-chromium: 1.4.717 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.23.0) dev: true @@ -2089,7 +2090,7 @@ packages: es-errors: 1.3.0 function-bind: 1.1.2 get-intrinsic: 1.2.4 - set-function-length: 1.2.1 + set-function-length: 1.2.2 dev: true /callsites@3.1.0: @@ -2101,8 +2102,8 @@ packages: engines: {node: '>= 6'} dev: false - /caniuse-lite@1.0.30001594: - resolution: {integrity: sha512-VblSX6nYqyJVs8DKFMldE2IVCJjZ225LW00ydtUWwh5hk9IfkTOffO6r8gJNsH0qqqeAF8KrbMYA2VEwTlGW5g==} + /caniuse-lite@1.0.30001600: + resolution: {integrity: sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==} dev: true /chalk@2.4.2: @@ -2257,8 +2258,8 @@ packages: hasBin: true dev: false - /csstype@3.1.2: - resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} + /csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} /cytoscape-cose-bilkent@4.1.0(cytoscape@3.28.1): resolution: {integrity: sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ==} @@ -2381,8 +2382,8 @@ packages: engines: {node: '>=12'} dev: false - /d3-geo@3.1.0: - resolution: {integrity: sha512-JEo5HxXDdDYXCaWdwLRt79y7giK8SbhZJbFWXqbRTolCHFI5jRqteLzCsq51NKbUoX0PjBVSohxrx+NoOUujYA==} + /d3-geo@3.1.1: + resolution: {integrity: sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q==} engines: {node: '>=12'} dependencies: d3-array: 3.2.4 @@ -2431,8 +2432,8 @@ packages: d3-shape: 1.3.7 dev: false - /d3-scale-chromatic@3.0.0: - resolution: {integrity: sha512-Lx9thtxAKrO2Pq6OO2Ua474opeziKr279P/TKZsMAhYyNDD3EnCffdbgeSYN5O7m2ByQsxtuP2CSDczNUIZ22g==} + /d3-scale-chromatic@3.1.0: + resolution: {integrity: sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ==} engines: {node: '>=12'} dependencies: d3-color: 3.1.0 @@ -2512,8 +2513,8 @@ packages: d3-transition: 3.0.1(d3-selection@3.0.0) dev: false - /d3@7.8.5: - resolution: {integrity: sha512-JgoahDG51ncUfJu6wX/1vWQEqOflgXyl4MaHqlcSruTez7yhaRKR9i8VjjcQGeS2en/jnFivXuaIMnseMMt0XA==} + /d3@7.9.0: + resolution: {integrity: sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA==} engines: {node: '>=12'} dependencies: d3-array: 3.2.4 @@ -2530,7 +2531,7 @@ packages: d3-fetch: 3.0.1 d3-force: 3.0.0 d3-format: 3.1.0 - d3-geo: 3.1.0 + d3-geo: 3.1.1 d3-hierarchy: 3.1.2 d3-interpolate: 3.0.1 d3-path: 3.1.0 @@ -2538,7 +2539,7 @@ packages: d3-quadtree: 3.0.1 d3-random: 3.0.1 d3-scale: 4.0.2 - d3-scale-chromatic: 3.0.0 + d3-scale-chromatic: 3.1.0 d3-selection: 3.0.0 d3-shape: 3.2.0 d3-time: 3.1.0 @@ -2551,10 +2552,37 @@ packages: /dagre-d3-es@7.0.10: resolution: {integrity: sha512-qTCQmEhcynucuaZgY5/+ti3X/rnszKZhEQH/ZdWdtP1tA/y3VoHJzcVrO9pjjJCNpigfscAtoUB5ONcd2wNn0A==} dependencies: - d3: 7.8.5 + d3: 7.9.0 lodash-es: 4.17.21 dev: false + /data-view-buffer@1.0.1: + resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + + /data-view-byte-length@1.0.1: + resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + + /data-view-byte-offset@1.0.0: + resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + es-errors: 1.3.0 + is-data-view: 1.0.1 + dev: true + /dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} dev: false @@ -2648,16 +2676,16 @@ packages: esutils: 2.0.3 dev: true - /dompurify@3.0.9: - resolution: {integrity: sha512-uyb4NDIvQ3hRn6NiC+SIFaP4mJ/MdXlvtunaqK9Bn6dD3RuB/1S/gasEjDHD8eiaqdSael2vBv+hOs7Y+jhYOQ==} + /dompurify@3.0.11: + resolution: {integrity: sha512-Fan4uMuyB26gFV3ovPoEoQbxRRPfTu3CvImyZnhGq5fsIEO+gEFLp45ISFt+kQBWsK5ulDdT0oV28jS1UrwQLg==} dev: false /eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: false - /electron-to-chromium@1.4.693: - resolution: {integrity: sha512-/if4Ueg0GUQlhCrW2ZlXwDAm40ipuKo+OgeHInlL8sbjt+hzISxZK949fZeJaVsheamrzANXvw1zQTvbxTvSHw==} + /electron-to-chromium@1.4.717: + resolution: {integrity: sha512-6Fmg8QkkumNOwuZ/5mIbMU9WI3H2fmn5ajcVya64I5Yr5CcNmO7vcLt0Y7c96DCiMO5/9G+4sI2r6eEvdg1F7A==} dev: true /elkjs@0.9.2: @@ -2693,16 +2721,20 @@ packages: stackframe: 1.3.4 dev: false - /es-abstract@1.22.5: - resolution: {integrity: sha512-oW69R+4q2wG+Hc3KZePPZxOiisRIqfKBVo/HLx94QcJeWGU/8sZhCvc829rd1kS366vlJbzBfXf9yWwf0+Ko7w==} + /es-abstract@1.23.2: + resolution: {integrity: sha512-60s3Xv2T2p1ICykc7c+DNDPLDMm9t4QxCOUU0K9JxiLjM3C1zB9YVdN7tjxrFd4+AkZ8CdX1ovUga4P2+1e+/w==} engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.1 arraybuffer.prototype.slice: 1.0.3 available-typed-arrays: 1.0.7 call-bind: 1.0.7 + data-view-buffer: 1.0.1 + data-view-byte-length: 1.0.1 + data-view-byte-offset: 1.0.0 es-define-property: 1.0.0 es-errors: 1.3.0 + es-object-atoms: 1.0.0 es-set-tostringtag: 2.0.3 es-to-primitive: 1.2.1 function.prototype.name: 1.1.6 @@ -2713,10 +2745,11 @@ packages: has-property-descriptors: 1.0.2 has-proto: 1.0.3 has-symbols: 1.0.3 - hasown: 2.0.1 + hasown: 2.0.2 internal-slot: 1.0.7 is-array-buffer: 3.0.4 is-callable: 1.2.7 + is-data-view: 1.0.1 is-negative-zero: 2.0.3 is-regex: 1.1.4 is-shared-array-buffer: 1.0.3 @@ -2727,17 +2760,17 @@ packages: object-keys: 1.1.1 object.assign: 4.1.5 regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.0 + safe-array-concat: 1.1.2 safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.8 - string.prototype.trimend: 1.0.7 - string.prototype.trimstart: 1.0.7 + string.prototype.trim: 1.2.9 + string.prototype.trimend: 1.0.8 + string.prototype.trimstart: 1.0.8 typed-array-buffer: 1.0.2 typed-array-byte-length: 1.0.1 typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.5 + typed-array-length: 1.0.6 unbox-primitive: 1.0.2 - which-typed-array: 1.1.14 + which-typed-array: 1.1.15 dev: true /es-define-property@1.0.0: @@ -2752,14 +2785,13 @@ packages: engines: {node: '>= 0.4'} dev: true - /es-iterator-helpers@1.0.17: - resolution: {integrity: sha512-lh7BsUqelv4KUbR5a/ZTaGGIMLCjPGPqJ6q+Oq24YP0RdyptX1uzm4vvaqzk7Zx3bpl/76YLTTDj9L7uYQ92oQ==} + /es-iterator-helpers@1.0.18: + resolution: {integrity: sha512-scxAJaewsahbqTYrGKJihhViaM6DDZDDoucfvzNbK0pOren1g/daDQ3IAhzn+1G14rBG7w+i5N+qul60++zlKA==} engines: {node: '>= 0.4'} dependencies: - asynciterator.prototype: 1.0.0 call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-errors: 1.3.0 es-set-tostringtag: 2.0.3 function-bind: 1.1.2 @@ -2770,7 +2802,14 @@ packages: has-symbols: 1.0.3 internal-slot: 1.0.7 iterator.prototype: 1.1.2 - safe-array-concat: 1.1.0 + safe-array-concat: 1.1.2 + dev: true + + /es-object-atoms@1.0.0: + resolution: {integrity: sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 dev: true /es-set-tostringtag@2.0.3: @@ -2779,13 +2818,13 @@ packages: dependencies: get-intrinsic: 1.2.4 has-tostringtag: 1.0.2 - hasown: 2.0.1 + hasown: 2.0.2 dev: true /es-shim-unscopables@1.0.2: resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} dependencies: - hasown: 2.0.1 + hasown: 2.0.2 dev: true /es-to-primitive@1.2.1: @@ -2797,35 +2836,35 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild@0.19.12: - resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} + /esbuild@0.20.2: + resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/aix-ppc64': 0.19.12 - '@esbuild/android-arm': 0.19.12 - '@esbuild/android-arm64': 0.19.12 - '@esbuild/android-x64': 0.19.12 - '@esbuild/darwin-arm64': 0.19.12 - '@esbuild/darwin-x64': 0.19.12 - '@esbuild/freebsd-arm64': 0.19.12 - '@esbuild/freebsd-x64': 0.19.12 - '@esbuild/linux-arm': 0.19.12 - '@esbuild/linux-arm64': 0.19.12 - '@esbuild/linux-ia32': 0.19.12 - '@esbuild/linux-loong64': 0.19.12 - '@esbuild/linux-mips64el': 0.19.12 - '@esbuild/linux-ppc64': 0.19.12 - '@esbuild/linux-riscv64': 0.19.12 - '@esbuild/linux-s390x': 0.19.12 - '@esbuild/linux-x64': 0.19.12 - '@esbuild/netbsd-x64': 0.19.12 - '@esbuild/openbsd-x64': 0.19.12 - '@esbuild/sunos-x64': 0.19.12 - '@esbuild/win32-arm64': 0.19.12 - '@esbuild/win32-ia32': 0.19.12 - '@esbuild/win32-x64': 0.19.12 + '@esbuild/aix-ppc64': 0.20.2 + '@esbuild/android-arm': 0.20.2 + '@esbuild/android-arm64': 0.20.2 + '@esbuild/android-x64': 0.20.2 + '@esbuild/darwin-arm64': 0.20.2 + '@esbuild/darwin-x64': 0.20.2 + '@esbuild/freebsd-arm64': 0.20.2 + '@esbuild/freebsd-x64': 0.20.2 + '@esbuild/linux-arm': 0.20.2 + '@esbuild/linux-arm64': 0.20.2 + '@esbuild/linux-ia32': 0.20.2 + '@esbuild/linux-loong64': 0.20.2 + '@esbuild/linux-mips64el': 0.20.2 + '@esbuild/linux-ppc64': 0.20.2 + '@esbuild/linux-riscv64': 0.20.2 + '@esbuild/linux-s390x': 0.20.2 + '@esbuild/linux-x64': 0.20.2 + '@esbuild/netbsd-x64': 0.20.2 + '@esbuild/openbsd-x64': 0.20.2 + '@esbuild/sunos-x64': 0.20.2 + '@esbuild/win32-arm64': 0.20.2 + '@esbuild/win32-ia32': 0.20.2 + '@esbuild/win32-x64': 0.20.2 dev: true /escalade@3.1.2: @@ -2871,31 +2910,31 @@ packages: synckit: 0.8.8 dev: true - /eslint-plugin-react@7.34.0(eslint@8.57.0): - resolution: {integrity: sha512-MeVXdReleBTdkz/bvcQMSnCXGi+c9kvy51IpinjnJgutl3YTHWsDdke7Z1ufZpGfDG8xduBDKyjtB9JH1eBKIQ==} + /eslint-plugin-react@7.34.1(eslint@8.57.0): + resolution: {integrity: sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==} engines: {node: '>=4'} peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: - array-includes: 3.1.7 - array.prototype.findlast: 1.2.4 + array-includes: 3.1.8 + array.prototype.findlast: 1.2.5 array.prototype.flatmap: 1.3.2 array.prototype.toreversed: 1.1.2 array.prototype.tosorted: 1.1.3 doctrine: 2.1.0 - es-iterator-helpers: 1.0.17 + es-iterator-helpers: 1.0.18 eslint: 8.57.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 - object.entries: 1.1.7 - object.fromentries: 2.0.7 - object.hasown: 1.1.3 - object.values: 1.1.7 + object.entries: 1.1.8 + object.fromentries: 2.0.8 + object.hasown: 1.1.4 + object.values: 1.2.0 prop-types: 15.8.1 resolve: 2.0.0-next.5 semver: 6.3.1 - string.prototype.matchall: 4.0.10 + string.prototype.matchall: 4.0.11 dev: true /eslint-scope@7.2.2: @@ -3071,8 +3110,8 @@ packages: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} dev: true - /follow-redirects@1.15.5: - resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} + /follow-redirects@1.15.6: + resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -3128,7 +3167,7 @@ packages: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 functions-have-names: 1.2.3 dev: true @@ -3154,7 +3193,7 @@ packages: function-bind: 1.1.2 has-proto: 1.0.3 has-symbols: 1.0.3 - hasown: 2.0.1 + hasown: 2.0.2 dev: true /get-symbol-description@1.0.2: @@ -3232,12 +3271,12 @@ packages: slash: 3.0.0 dev: true - /goober@2.1.14(csstype@3.1.2): + /goober@2.1.14(csstype@3.1.3): resolution: {integrity: sha512-4UpC0NdGyAFqLNPnhCT2iHpza2q+RAY3GV85a/mRPdzyPQMsj0KmMMuetdIkzWRbJ+Hgau1EZztq8ImmiMGhsg==} peerDependencies: - csstype: 3.1.2 + csstype: ^3.0.10 dependencies: - csstype: 3.1.2 + csstype: 3.1.3 dev: false /gopd@1.0.1: @@ -3292,8 +3331,8 @@ packages: has-symbols: 1.0.3 dev: true - /hasown@2.0.1: - resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} + /hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 @@ -3326,7 +3365,7 @@ packages: /i18next@21.10.0: resolution: {integrity: sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==} dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 dev: false /iconv-lite@0.6.3: @@ -3388,7 +3427,7 @@ packages: engines: {node: '>= 0.4'} dependencies: es-errors: 1.3.0 - hasown: 2.0.1 + hasown: 2.0.2 side-channel: 1.0.6 dev: true @@ -3430,7 +3469,7 @@ packages: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} dependencies: - binary-extensions: 2.2.0 + binary-extensions: 2.3.0 dev: false /is-boolean-object@1.1.2: @@ -3449,7 +3488,14 @@ packages: /is-core-module@2.13.1: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: - hasown: 2.0.1 + hasown: 2.0.2 + + /is-data-view@1.0.1: + resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} + engines: {node: '>= 0.4'} + dependencies: + is-typed-array: 1.1.13 + dev: true /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} @@ -3486,8 +3532,9 @@ packages: dependencies: is-extglob: 2.1.1 - /is-map@2.0.2: - resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} + /is-map@2.0.3: + resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} + engines: {node: '>= 0.4'} dev: true /is-negative-zero@2.0.3: @@ -3519,8 +3566,9 @@ packages: has-tostringtag: 1.0.2 dev: true - /is-set@2.0.2: - resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} + /is-set@2.0.3: + resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} + engines: {node: '>= 0.4'} dev: true /is-shared-array-buffer@1.0.3: @@ -3548,11 +3596,12 @@ packages: resolution: {integrity: sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==} engines: {node: '>= 0.4'} dependencies: - which-typed-array: 1.1.14 + which-typed-array: 1.1.15 dev: true - /is-weakmap@2.0.1: - resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} + /is-weakmap@2.0.2: + resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} + engines: {node: '>= 0.4'} dev: true /is-weakref@1.0.2: @@ -3561,8 +3610,9 @@ packages: call-bind: 1.0.7 dev: true - /is-weakset@2.0.2: - resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} + /is-weakset@2.0.3: + resolution: {integrity: sha512-LvIm3/KWzS9oRFHugab7d+M/GcBXuXX5xZkzPmN+NxihdQlZUQ4dWuSV1xR/sq6upL1TJEDrfBgRepHFdBtSNQ==} + engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 get-intrinsic: 1.2.4 @@ -3593,7 +3643,7 @@ packages: define-properties: 1.2.1 get-intrinsic: 1.2.4 has-symbols: 1.0.3 - reflect.getprototypeof: 1.0.5 + reflect.getprototypeof: 1.0.6 set-function-name: 2.0.2 dev: true @@ -3665,14 +3715,14 @@ packages: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} engines: {node: '>=4.0'} dependencies: - array-includes: 3.1.7 + array-includes: 3.1.8 array.prototype.flat: 1.3.2 object.assign: 4.1.5 - object.values: 1.1.7 + object.values: 1.2.0 dev: true - /katex@0.16.9: - resolution: {integrity: sha512-fsSYjWS0EEOwvy81j3vRA8TEAhQhKiqO+FQaKWp0m39qwOzHVBgAUBIXWj1pB+O2W3fIpNa6Y9KSKCVbfPhyAQ==} + /katex@0.16.10: + resolution: {integrity: sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==} hasBin: true dependencies: commander: 8.3.0 @@ -3842,13 +3892,13 @@ packages: '@types/d3-scale-chromatic': 3.0.3 cytoscape: 3.28.1 cytoscape-cose-bilkent: 4.1.0(cytoscape@3.28.1) - d3: 7.8.5 + d3: 7.9.0 d3-sankey: 0.12.3 dagre-d3-es: 7.0.10 dayjs: 1.11.10 - dompurify: 3.0.9 + dompurify: 3.0.11 elkjs: 0.9.2 - katex: 0.16.9 + katex: 0.16.10 khroma: 2.1.0 lodash-es: 4.17.21 mdast-util-from-markdown: 1.3.1 @@ -4104,7 +4154,7 @@ packages: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 css-tree: 1.1.3 - csstype: 3.1.2 + csstype: 3.1.3 fastest-stable-stringify: 2.0.2 inline-style-prefixer: 7.0.0 react: 18.2.0 @@ -4140,8 +4190,8 @@ packages: ts-error: 1.0.6 dev: true - /nice-grpc-web@3.3.2(ws@8.16.0): - resolution: {integrity: sha512-qetU+H6y6jVvI5NZdtTls9UdqdCNwhr4UxqL5SfH6v8ISxucxDVPRYxnZaoZyWjMRvRgAKiQDIMu0bB0oedD0A==} + /nice-grpc-web@3.3.3(ws@8.16.0): + resolution: {integrity: sha512-sVz8n3tRwk8Iy8Lppek0qD1HFGexvy0915/uiXfQvOTUDHCsTJqcIEjmSQWLO6FZtZMwVMtPXrs9WZMNDrkcyQ==} dependencies: abort-controller-x: 0.4.3 isomorphic-ws: 5.0.0(ws@8.16.0) @@ -4197,38 +4247,41 @@ packages: object-keys: 1.1.1 dev: true - /object.entries@1.1.7: - resolution: {integrity: sha512-jCBs/0plmPsOnrKAfFQXRG2NFjlhZgjjcBLSmTnEhU8U6vVTsVe8ANeQJCHTl3gSsI4J+0emOoCgoKlmQPMgmA==} + /object.entries@1.1.8: + resolution: {integrity: sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-object-atoms: 1.0.0 dev: true - /object.fromentries@2.0.7: - resolution: {integrity: sha512-UPbPHML6sL8PI/mOqPwsH4G6iyXcCGzLin8KvEPenOZN5lpCNBZZQ+V62vdjB1mQHrmqGQt5/OJzemUA+KJmEA==} + /object.fromentries@2.0.8: + resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 + es-object-atoms: 1.0.0 dev: true - /object.hasown@1.1.3: - resolution: {integrity: sha512-fFI4VcYpRHvSLXxP7yiZOMAd331cPfd2p7PFDVbgUsYOfCT3tICVqXWngbjr4m49OvsBwUBQ6O2uQoJvy3RexA==} + /object.hasown@1.1.4: + resolution: {integrity: sha512-FZ9LZt9/RHzGySlBARE3VF+gE26TxR38SdmqOqliuTnl9wrKulaQs+4dee1V+Io8VfxqzAfHu6YuRgUy8OHoTg==} + engines: {node: '>= 0.4'} dependencies: define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 + es-object-atoms: 1.0.0 dev: true - /object.values@1.1.7: - resolution: {integrity: sha512-aU6xnDFYT3x17e/f0IiiwlGPTy2jzMySGfUB4fq6z7CV8l85CWHDk5ErhyhpfDHhrOMwGFhSQkhMGHaIotA6Ng==} + /object.values@1.2.0: + resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-object-atoms: 1.0.0 dev: true /once@1.4.0: @@ -4273,7 +4326,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.23.5 + '@babel/code-frame': 7.24.2 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -4342,29 +4395,29 @@ packages: engines: {node: '>= 0.4'} dev: true - /postcss-import@15.1.0(postcss@8.4.35): + /postcss-import@15.1.0(postcss@8.4.38): resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} peerDependencies: postcss: ^8.0.0 dependencies: - postcss: 8.4.35 + postcss: 8.4.38 postcss-value-parser: 4.2.0 read-cache: 1.0.0 resolve: 1.22.8 dev: false - /postcss-js@4.0.1(postcss@8.4.35): + /postcss-js@4.0.1(postcss@8.4.38): resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} engines: {node: ^12 || ^14 || >= 16} peerDependencies: postcss: ^8.4.21 dependencies: camelcase-css: 2.0.1 - postcss: 8.4.35 + postcss: 8.4.38 dev: false - /postcss-load-config@4.0.2(postcss@8.4.35): + /postcss-load-config@4.0.2(postcss@8.4.38): resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} engines: {node: '>= 14'} peerDependencies: @@ -4377,22 +4430,22 @@ packages: optional: true dependencies: lilconfig: 3.1.1 - postcss: 8.4.35 + postcss: 8.4.38 yaml: 2.4.1 dev: false - /postcss-nested@6.0.1(postcss@8.4.35): + /postcss-nested@6.0.1(postcss@8.4.38): resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.2.14 dependencies: - postcss: 8.4.35 - postcss-selector-parser: 6.0.15 + postcss: 8.4.38 + postcss-selector-parser: 6.0.16 dev: false - /postcss-selector-parser@6.0.15: - resolution: {integrity: sha512-rEYkQOMUCEMhsKbK66tbEU9QVIxbhN18YiniAwA7XQYTVBqrBy+P2p5JcdqsHgKM2zWylp8d7J6eszocfds5Sw==} + /postcss-selector-parser@6.0.16: + resolution: {integrity: sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==} engines: {node: '>=4'} dependencies: cssesc: 3.0.0 @@ -4402,13 +4455,13 @@ packages: /postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - /postcss@8.4.35: - resolution: {integrity: sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==} + /postcss@8.4.38: + resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} dependencies: nanoid: 3.3.7 picocolors: 1.0.0 - source-map-js: 1.0.2 + source-map-js: 1.2.0 /prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} @@ -4450,7 +4503,7 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 20.11.24 + '@types/node': 20.11.30 long: 5.2.3 dev: true @@ -4482,14 +4535,14 @@ packages: scheduler: 0.23.0 dev: false - /react-hot-toast@2.4.1(csstype@3.1.2)(react-dom@18.2.0)(react@18.2.0): + /react-hot-toast@2.4.1(csstype@3.1.3)(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-j8z+cQbWIM5LY37pR6uZR6D4LfseplqnuAO4co4u8917hBUvXlEqyP1ZzqVLcqoyUesZZv/ImreoCeHVDpE5pQ==} engines: {node: '>=10'} peerDependencies: react: '>=16' react-dom: '>=16' dependencies: - goober: 2.1.14(csstype@3.1.2) + goober: 2.1.14(csstype@3.1.3) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) transitivePeerDependencies: @@ -4509,7 +4562,7 @@ packages: react-native: optional: true dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 html-parse-stringify: 3.0.1 i18next: 21.10.0 react: 18.2.0 @@ -4523,7 +4576,7 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: false - /react-redux@8.1.3(@types/react-dom@18.2.20)(@types/react@18.2.63)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1): + /react-redux@8.1.3(@types/react-dom@18.2.22)(@types/react@18.2.71)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1): resolution: {integrity: sha512-n0ZrutD7DaX/j9VscF+uTALI3oUPa/pO4Z3soOBIjuRn/FzVu6aehhysxZCLi6y7duMf52WNZGMl7CtuK5EnRw==} peerDependencies: '@types/react': ^16.8 || ^17.0 || ^18.0 @@ -4544,10 +4597,10 @@ packages: redux: optional: true dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 '@types/hoist-non-react-statics': 3.3.5 - '@types/react': 18.2.63 - '@types/react-dom': 18.2.20 + '@types/react': 18.2.71 + '@types/react-dom': 18.2.22 '@types/use-sync-external-store': 0.0.3 hoist-non-react-statics: 3.3.2 react: 18.2.0 @@ -4562,26 +4615,26 @@ packages: engines: {node: '>=0.10.0'} dev: true - /react-router-dom@6.22.2(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-WgqxD2qySEIBPZ3w0sHH+PUAiamDeszls9tzqMPBDA1YYVucTBXLU7+gtRfcSnhe92A3glPnvSxK2dhNoAVOIQ==} + /react-router-dom@6.22.3(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-7ZILI7HjcE+p31oQvwbokjk6OA/bnFxrhJ19n82Ex9Ph8fNAq+Hm/7KchpMGlTgWhUxRHMMCut+vEtNpWpowKw==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' dependencies: - '@remix-run/router': 1.15.2 + '@remix-run/router': 1.15.3 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-router: 6.22.2(react@18.2.0) + react-router: 6.22.3(react@18.2.0) dev: false - /react-router@6.22.2(react@18.2.0): - resolution: {integrity: sha512-YD3Dzprzpcq+tBMHBS822tCjnWD3iIZbTeSXMY9LPSG541EfoBGyZ3bS25KEnaZjLcmQpw2AVLkFyfgXY8uvcw==} + /react-router@6.22.3(react@18.2.0): + resolution: {integrity: sha512-dr2eb3Mj5zK2YISHK++foM9w4eBnO23eKnZEDs7c880P6oKbrjz/Svg9+nxqtHQK+oMW4OtjZca0RqPglXxguQ==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' dependencies: - '@remix-run/router': 1.15.2 + '@remix-run/router': 1.15.3 react: 18.2.0 dev: false @@ -4650,16 +4703,16 @@ packages: /redux@4.2.1: resolution: {integrity: sha512-LAUYz4lc+Do8/g7aeRa8JkyDErK6ekstQaqWQrNRW//MY1TvCEpMtpTWvlQ+FPbWCx+Xixu/6SHt5N0HR+SB4w==} dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 dev: false - /reflect.getprototypeof@1.0.5: - resolution: {integrity: sha512-62wgfC8dJWrmxv44CA36pLDnP6KKl3Vhxb7PL+8+qrrFMMoJij4vgiMP8zV4O8+CBMXY1mHxI5fITGHXFHVmQQ==} + /reflect.getprototypeof@1.0.6: + resolution: {integrity: sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 es-errors: 1.3.0 get-intrinsic: 1.2.4 globalthis: 1.0.3 @@ -4725,33 +4778,33 @@ packages: resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==} dev: false - /rollup@4.12.1: - resolution: {integrity: sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==} + /rollup@4.13.0: + resolution: {integrity: sha512-3YegKemjoQnYKmsBlOHfMLVPPA5xLkQ8MHLLSw/fBrFaVkEayL51DilPpNNLq1exr98F2B1TzrV0FUlN3gWRPg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.12.1 - '@rollup/rollup-android-arm64': 4.12.1 - '@rollup/rollup-darwin-arm64': 4.12.1 - '@rollup/rollup-darwin-x64': 4.12.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.12.1 - '@rollup/rollup-linux-arm64-gnu': 4.12.1 - '@rollup/rollup-linux-arm64-musl': 4.12.1 - '@rollup/rollup-linux-riscv64-gnu': 4.12.1 - '@rollup/rollup-linux-x64-gnu': 4.12.1 - '@rollup/rollup-linux-x64-musl': 4.12.1 - '@rollup/rollup-win32-arm64-msvc': 4.12.1 - '@rollup/rollup-win32-ia32-msvc': 4.12.1 - '@rollup/rollup-win32-x64-msvc': 4.12.1 + '@rollup/rollup-android-arm-eabi': 4.13.0 + '@rollup/rollup-android-arm64': 4.13.0 + '@rollup/rollup-darwin-arm64': 4.13.0 + '@rollup/rollup-darwin-x64': 4.13.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.13.0 + '@rollup/rollup-linux-arm64-gnu': 4.13.0 + '@rollup/rollup-linux-arm64-musl': 4.13.0 + '@rollup/rollup-linux-riscv64-gnu': 4.13.0 + '@rollup/rollup-linux-x64-gnu': 4.13.0 + '@rollup/rollup-linux-x64-musl': 4.13.0 + '@rollup/rollup-win32-arm64-msvc': 4.13.0 + '@rollup/rollup-win32-ia32-msvc': 4.13.0 + '@rollup/rollup-win32-x64-msvc': 4.13.0 fsevents: 2.3.3 dev: true /rtl-css-js@1.16.1: resolution: {integrity: sha512-lRQgou1mu19e+Ya0LsTvKrVJ5TYUbqCVPAiImX3UfLTenarvPUl1QFdvu5Z3PYmHT9RCcwIfbjRQBntExyj3Zg==} dependencies: - '@babel/runtime': 7.24.0 + '@babel/runtime': 7.24.1 dev: false /run-parallel@1.2.0: @@ -4770,8 +4823,8 @@ packages: mri: 1.2.0 dev: false - /safe-array-concat@1.1.0: - resolution: {integrity: sha512-ZdQ0Jeb9Ofti4hbt5lX3T2JcAamT9hfzYU1MNB+z/jaEbB6wfFfPIR/zEORmZqobkCCJhSjodobH6WHNmJ97dg==} + /safe-array-concat@1.1.2: + resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} engines: {node: '>=0.4'} dependencies: call-bind: 1.0.7 @@ -4830,8 +4883,8 @@ packages: lru-cache: 6.0.0 dev: true - /set-function-length@1.2.1: - resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} + /set-function-length@1.2.2: + resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} engines: {node: '>= 0.4'} dependencies: define-data-property: 1.1.4 @@ -4887,8 +4940,8 @@ packages: engines: {node: '>=8'} dev: true - /source-map-js@1.0.2: - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + /source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} /source-map@0.5.6: @@ -4947,13 +5000,17 @@ packages: strip-ansi: 7.1.0 dev: false - /string.prototype.matchall@4.0.10: - resolution: {integrity: sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==} + /string.prototype.matchall@4.0.11: + resolution: {integrity: sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==} + engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 + es-errors: 1.3.0 + es-object-atoms: 1.0.0 get-intrinsic: 1.2.4 + gopd: 1.0.1 has-symbols: 1.0.3 internal-slot: 1.0.7 regexp.prototype.flags: 1.5.2 @@ -4961,29 +5018,31 @@ packages: side-channel: 1.0.6 dev: true - /string.prototype.trim@1.2.8: - resolution: {integrity: sha512-lfjY4HcixfQXOfaqCvcBuOIapyaroTXhbkfJN3gcB1OtyupngWK4sEET9Knd0cXd28kTUqu/kHoV4HKSJdnjiQ==} + /string.prototype.trim@1.2.9: + resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-abstract: 1.23.2 + es-object-atoms: 1.0.0 dev: true - /string.prototype.trimend@1.0.7: - resolution: {integrity: sha512-Ni79DqeB72ZFq1uH/L6zJ+DKZTkOtPIHovb3YZHQViE+HDouuU4mBrLOLDn5Dde3RF8qw5qVETEjhu9locMLvA==} + /string.prototype.trimend@1.0.8: + resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-object-atoms: 1.0.0 dev: true - /string.prototype.trimstart@1.0.7: - resolution: {integrity: sha512-NGhtDFu3jCEm7B4Fy0DpLewdJQOZcQ0rGbwQ/+stjnrp2i+rlKeCvos9hOIeCmqwratM47OBxY7uFZzjxHXmrg==} + /string.prototype.trimstart@1.0.8: + resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} + engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-abstract: 1.22.5 + es-object-atoms: 1.0.0 dev: true /strip-ansi@6.0.1: @@ -5070,12 +5129,12 @@ packages: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.0 - postcss: 8.4.35 - postcss-import: 15.1.0(postcss@8.4.35) - postcss-js: 4.0.1(postcss@8.4.35) - postcss-load-config: 4.0.2(postcss@8.4.35) - postcss-nested: 6.0.1(postcss@8.4.35) - postcss-selector-parser: 6.0.15 + postcss: 8.4.38 + postcss-import: 15.1.0(postcss@8.4.38) + postcss-js: 4.0.1(postcss@8.4.38) + postcss-load-config: 4.0.2(postcss@8.4.38) + postcss-nested: 6.0.1(postcss@8.4.38) + postcss-selector-parser: 6.0.16 resolve: 1.22.8 sucrase: 3.35.0 transitivePeerDependencies: @@ -5122,13 +5181,13 @@ packages: resolution: {integrity: sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==} dev: false - /ts-api-utils@1.2.1(typescript@5.3.3): - resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} + /ts-api-utils@1.3.0(typescript@5.4.3): + resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.3.3 + typescript: 5.4.3 dev: true /ts-dedent@2.2.0: @@ -5195,8 +5254,8 @@ packages: is-typed-array: 1.1.13 dev: true - /typed-array-length@1.0.5: - resolution: {integrity: sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA==} + /typed-array-length@1.0.6: + resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 @@ -5207,8 +5266,8 @@ packages: possible-typed-array-names: 1.0.0 dev: true - /typescript@5.3.3: - resolution: {integrity: sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==} + /typescript@5.4.3: + resolution: {integrity: sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==} engines: {node: '>=14.17'} hasBin: true dev: true @@ -5277,8 +5336,8 @@ packages: sade: 1.8.1 dev: false - /vite@5.1.5(@types/node@20.11.24)(less@4.2.0): - resolution: {integrity: sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==} + /vite@5.2.6(@types/node@20.11.30)(less@4.2.0): + resolution: {integrity: sha512-FPtnxFlSIKYjZ2eosBQamz4CbyrTizbZ3hnGJlh/wMtCrlp1Hah6AzBLjGI5I2urTfNnpovpHdrL6YRuBOPnCA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -5305,11 +5364,11 @@ packages: terser: optional: true dependencies: - '@types/node': 20.11.24 - esbuild: 0.19.12 + '@types/node': 20.11.30 + esbuild: 0.20.2 less: 4.2.0 - postcss: 8.4.35 - rollup: 4.12.1 + postcss: 8.4.38 + rollup: 4.13.0 optionalDependencies: fsevents: 2.3.3 dev: true @@ -5347,21 +5406,22 @@ packages: is-weakref: 1.0.2 isarray: 2.0.5 which-boxed-primitive: 1.0.2 - which-collection: 1.0.1 - which-typed-array: 1.1.14 + which-collection: 1.0.2 + which-typed-array: 1.1.15 dev: true - /which-collection@1.0.1: - resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} + /which-collection@1.0.2: + resolution: {integrity: sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw==} + engines: {node: '>= 0.4'} dependencies: - is-map: 2.0.2 - is-set: 2.0.2 - is-weakmap: 2.0.1 - is-weakset: 2.0.2 + is-map: 2.0.3 + is-set: 2.0.3 + is-weakmap: 2.0.2 + is-weakset: 2.0.3 dev: true - /which-typed-array@1.1.14: - resolution: {integrity: sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==} + /which-typed-array@1.1.15: + resolution: {integrity: sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==} engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 @@ -5437,7 +5497,7 @@ packages: engines: {node: '>=10'} dev: true - /zustand@4.5.2(@types/react@18.2.63)(react@18.2.0): + /zustand@4.5.2(@types/react@18.2.71)(react@18.2.0): resolution: {integrity: sha512-2cN1tPkDVkwCy5ickKrI7vijSjPksFRfqS6237NzT0vqSsztTNnQdHw9mmN7uBdk3gceVXU0a+21jFzFzAc9+g==} engines: {node: '>=12.7.0'} peerDependencies: @@ -5452,7 +5512,7 @@ packages: react: optional: true dependencies: - '@types/react': 18.2.63 + '@types/react': 18.2.71 react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) dev: false diff --git a/web/public/full-logo.webp b/web/public/full-logo.webp new file mode 100644 index 0000000000000..f654aae8acb94 Binary files /dev/null and b/web/public/full-logo.webp differ diff --git a/web/src/App.tsx b/web/src/App.tsx index 01c4a1e791751..5c76b7007da02 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -16,7 +16,7 @@ const App = () => { const globalStore = useGlobalStore(); const workspaceSettingStore = useWorkspaceSettingStore(); const userStore = useUserStore(); - const { appearance, locale, systemStatus } = globalStore.state; + const { appearance, locale, systemStatus, workspaceProfile } = globalStore.state; const userSetting = userStore.userSetting; const workspaceGeneralSetting = workspaceSettingStore.getWorkspaceSettingByKey(WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL).generalSetting || @@ -24,10 +24,10 @@ const App = () => { // Redirect to sign up page if no host. useEffect(() => { - if (!systemStatus.host) { + if (!workspaceProfile.owner) { navigateTo("/auth/signup"); } - }, [systemStatus.host]); + }, [workspaceProfile.owner]); useEffect(() => { const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)"); diff --git a/web/src/components/BetaBadge.tsx b/web/src/components/BetaBadge.tsx deleted file mode 100644 index 26822674f39b4..0000000000000 --- a/web/src/components/BetaBadge.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useTranslate } from "@/utils/i18n"; - -interface Props { - className?: string; -} - -const BetaBadge: React.FC = (props: Props) => { - const { className } = props; - const t = useTranslate(); - - return ( - - {t("common.beta")} - - ); -}; - -export default BetaBadge; diff --git a/web/src/components/ChangeMemoCreatedTsDialog.tsx b/web/src/components/ChangeMemoCreatedTsDialog.tsx index a07c1c867b1b3..3bc78ea75f43c 100644 --- a/web/src/components/ChangeMemoCreatedTsDialog.tsx +++ b/web/src/components/ChangeMemoCreatedTsDialog.tsx @@ -2,7 +2,7 @@ import { Button, IconButton, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { getNormalizedTimeString } from "@/helpers/datetime"; -import { useMemoStore } from "@/store/v1"; +import { MemoNamePrefix, useMemoStore } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; import Icon from "./Icon"; @@ -19,7 +19,7 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { const maxDatetimeValue = getNormalizedTimeString(); useEffect(() => { - memoStore.getOrFetchMemoById(memoId).then((memo) => { + memoStore.getOrFetchMemoByName(`${MemoNamePrefix}${memoId}`).then((memo) => { if (memo) { const datetime = getNormalizedTimeString(memo.createTime); setCreatedAt(datetime); @@ -43,7 +43,7 @@ const ChangeMemoCreatedTsDialog: React.FC = (props: Props) => { try { await memoStore.updateMemo( { - id: memoId, + name: `${MemoNamePrefix}${memoId}`, createTime: new Date(createdAt), }, ["created_ts"], diff --git a/web/src/components/ChangePasswordDialog.tsx b/web/src/components/ChangePasswordDialog.tsx index 1139662acb38e..f38b1edca6fed 100644 --- a/web/src/components/ChangePasswordDialog.tsx +++ b/web/src/components/ChangePasswordDialog.tsx @@ -15,7 +15,7 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { const currentUser = useCurrentUser(); const userStore = useUserStore(); const globalStore = useGlobalStore(); - const profile = globalStore.state.systemStatus.profile; + const profile = globalStore.state.workspaceProfile; const [newPassword, setNewPassword] = useState(""); const [newPasswordAgain, setNewPasswordAgain] = useState(""); diff --git a/web/src/components/CreateIdentityProviderDialog.tsx b/web/src/components/CreateIdentityProviderDialog.tsx index 25712223884de..788c7e154f27d 100644 --- a/web/src/components/CreateIdentityProviderDialog.tsx +++ b/web/src/components/CreateIdentityProviderDialog.tsx @@ -236,7 +236,7 @@ const CreateIdentityProviderDialog: React.FC = (props: Props) => { return ( <>
-

{t(isCreating ? "setting.sso-section.create-sso" : "setting.sso-section.update-sso")}

+

{t(isCreating ? "setting.sso-section.create-sso" : "setting.sso-section.update-sso")}

diff --git a/web/src/components/CreateMemoRelationDialog.tsx b/web/src/components/CreateMemoRelationDialog.tsx index dcc6aad59f5b0..0fb68b6efb5d9 100644 --- a/web/src/components/CreateMemoRelationDialog.tsx +++ b/web/src/components/CreateMemoRelationDialog.tsx @@ -85,7 +85,7 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => { return ( <>
-

{"Add references"}

+

{t("reference.add-references")}

destroy()}> @@ -96,8 +96,8 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => { size="md" clearOnBlur disableClearable - placeholder={"Search content"} - noOptionsText={"No memos found"} + placeholder={t("reference.search-bar-placeholder")} + noOptionsText={t("reference.no-memos-found")} options={filteredMemos} loading={isFetching} inputValue={searchText} @@ -106,7 +106,7 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => { onInputChange={(_, value) => setSearchText(value.trim())} getOptionKey={(option) => option.name} getOptionLabel={(option) => option.content} - isOptionEqualToValue={(option, value) => option.id === value.id} + isOptionEqualToValue={(option, value) => option.name === value.name} renderOption={(props, option) => (
@@ -130,7 +130,7 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => { onChange={(_, value) => setSelectedMemos(value)} />
- setEmbedded(e.target.checked)} /> + setEmbedded(e.target.checked)} />
-
-
- {tags.map((t, idx) => ( - - ))} + showCreateTagDialog()}> + {t("common.tags")} +
+ {tags.length > 0 ? ( +
+ {tags.map((t, idx) => ( + + ))} +
+ ) : ( +
+ +

+ You can create tags by inputting `#tag`. +

+
+ )}
); }; @@ -133,7 +142,7 @@ const TagItemContainer: React.FC = (props: TagItemContain return ( <> -
+
= (props: TagItemContain > -
- +
+ +
- + showRenameTagDialog({ tag: tag.text })}> {t("common.rename")} @@ -156,7 +166,7 @@ const TagItemContainer: React.FC = (props: TagItemContain - + {tag.key}
@@ -166,7 +176,7 @@ const TagItemContainer: React.FC = (props: TagItemContain className={`flex flex-row justify-center items-center w-6 h-6 shrink-0 transition-all rotate-0 ${showSubTags && "rotate-90"}`} onClick={handleToggleBtnClick} > - + ) : null}
@@ -186,4 +196,4 @@ const TagItemContainer: React.FC = (props: TagItemContain ); }; -export default TagList; +export default TagsSection; diff --git a/web/src/components/HomeSidebar/index.ts b/web/src/components/HomeSidebar/index.ts new file mode 100644 index 0000000000000..f66cde32c6288 --- /dev/null +++ b/web/src/components/HomeSidebar/index.ts @@ -0,0 +1,4 @@ +import HomeSidebar from "./HomeSidebar"; +import HomeSidebarDrawer from "./HomeSidebarDrawer"; + +export { HomeSidebar, HomeSidebarDrawer }; diff --git a/web/src/components/Inbox/MemoCommentMessage.tsx b/web/src/components/Inbox/MemoCommentMessage.tsx index e6cfbf13a659b..759e31a748cfb 100644 --- a/web/src/components/Inbox/MemoCommentMessage.tsx +++ b/web/src/components/Inbox/MemoCommentMessage.tsx @@ -4,9 +4,10 @@ import { useEffect, useState } from "react"; import toast from "react-hot-toast"; import { activityServiceClient } from "@/grpcweb"; import useNavigateTo from "@/hooks/useNavigateTo"; -import { useInboxStore, extractUsernameFromName, useMemoStore } from "@/store/v1"; +import { MemoNamePrefix, useInboxStore, useMemoStore, useUserStore } from "@/store/v1"; import { Inbox, Inbox_Status } from "@/types/proto/api/v2/inbox_service"; import { Memo } from "@/types/proto/api/v2/memo_service"; +import { User } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import Icon from "../Icon"; @@ -19,7 +20,9 @@ const MemoCommentMessage = ({ inbox }: Props) => { const navigateTo = useNavigateTo(); const inboxStore = useInboxStore(); const memoStore = useMemoStore(); + const userStore = useUserStore(); const [relatedMemo, setRelatedMemo] = useState(undefined); + const [sender, setSender] = useState(undefined); useEffect(() => { if (!inbox.activityId) { @@ -33,11 +36,15 @@ const MemoCommentMessage = ({ inbox }: Props) => { if (!activity) { return; } - if (activity.payload?.memoComment?.relatedMemoId) { - const memo = await memoStore.getOrFetchMemoById(activity.payload?.memoComment?.relatedMemoId, { + if (activity.payload?.memoComment) { + const memoCommentPayload = activity.payload.memoComment; + const relatedMemoId = memoCommentPayload.relatedMemoId; + const memo = await memoStore.getOrFetchMemoByName(`${MemoNamePrefix}${relatedMemoId}`, { skipStore: true, }); setRelatedMemo(memo); + const sender = await userStore.getOrFetchUserByName(inbox.sender); + setSender(sender); } })(); }, [inbox.activityId]); @@ -47,7 +54,7 @@ const MemoCommentMessage = ({ inbox }: Props) => { return; } - navigateTo(`/m/${relatedMemo.name}`); + navigateTo(`/m/${relatedMemo.uid}`); if (inbox.status === Inbox_Status.UNREAD) { handleArchiveMessage(true); } @@ -104,8 +111,9 @@ const MemoCommentMessage = ({ inbox }: Props) => { onClick={handleNavigateToMemo} > {t("inbox.memo-comment", { - user: extractUsernameFromName(inbox.sender), - memo: `memos#${relatedMemo?.name}`, + user: sender?.nickname || sender?.username, + memo: `memos/${relatedMemo?.uid}`, + interpolation: { escapeValue: false }, })}

diff --git a/web/src/components/MemoActionMenu.tsx b/web/src/components/MemoActionMenu.tsx index c91e8f0501fdc..b728d376cadfd 100644 --- a/web/src/components/MemoActionMenu.tsx +++ b/web/src/components/MemoActionMenu.tsx @@ -1,9 +1,10 @@ -import { Divider, Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy"; +import { Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy"; import classNames from "classnames"; -import copy from "copy-to-clipboard"; import toast from "react-hot-toast"; +import { useLocation } from "react-router-dom"; import Icon from "@/components/Icon"; -import { useMemoStore } from "@/store/v1"; +import useNavigateTo from "@/hooks/useNavigateTo"; +import { extractMemoIdFromName, useMemoStore } from "@/store/v1"; import { RowStatus } from "@/types/proto/api/v2/common"; import { Memo } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; @@ -15,21 +16,22 @@ interface Props { memo: Memo; className?: string; hiddenActions?: ("edit" | "archive" | "delete" | "share" | "pin")[]; - onArchived?: () => void; - onDeleted?: () => void; } const MemoActionMenu = (props: Props) => { const { memo, hiddenActions } = props; const t = useTranslate(); + const location = useLocation(); + const navigateTo = useNavigateTo(); const memoStore = useMemoStore(); + const isInMemoDetailPage = location.pathname.startsWith(`/m/${memo.uid}`); const handleTogglePinMemoBtnClick = async () => { try { if (memo.pinned) { await memoStore.updateMemo( { - id: memo.id, + name: memo.name, pinned: false, }, ["pinned"], @@ -37,7 +39,7 @@ const MemoActionMenu = (props: Props) => { } else { await memoStore.updateMemo( { - id: memo.id, + name: memo.name, pinned: true, }, ["pinned"], @@ -50,26 +52,40 @@ const MemoActionMenu = (props: Props) => { const handleEditMemoClick = () => { showMemoEditorDialog({ - memoId: memo.id, - cacheKey: `${memo.id}-${memo.updateTime}`, + memoName: memo.name, + cacheKey: `${memo.name}-${memo.displayTime}`, }); }; - const handleArchiveMemoClick = async () => { + const handleToggleMemoStatusClick = async () => { try { - await memoStore.updateMemo( - { - id: memo.id, - rowStatus: RowStatus.ARCHIVED, - }, - ["row_status"], - ); + if (memo.rowStatus === RowStatus.ARCHIVED) { + await memoStore.updateMemo( + { + name: memo.name, + rowStatus: RowStatus.ACTIVE, + }, + ["row_status"], + ); + toast(t("message.restored-successfully")); + } else { + await memoStore.updateMemo( + { + name: memo.name, + rowStatus: RowStatus.ARCHIVED, + }, + ["row_status"], + ); + toast.success(t("message.archived-successfully")); + } } catch (error: any) { console.error(error); toast.error(error.response.data.message); + return; } - if (props.onArchived) { - props.onArchived(); + + if (isInMemoDetailPage) { + memo.rowStatus === RowStatus.ARCHIVED ? navigateTo("/") : navigateTo("/archived"); } }; @@ -80,19 +96,15 @@ const MemoActionMenu = (props: Props) => { style: "danger", dialogName: "delete-memo-dialog", onConfirm: async () => { - await memoStore.deleteMemo(memo.id); - if (props.onDeleted) { - props.onDeleted(); + await memoStore.deleteMemo(memo.name); + toast.success("Deleted successfully"); + if (isInMemoDetailPage) { + navigateTo("/"); } }, }); }; - const handleCopyMemoId = () => { - copy(memo.name); - toast.success("Copied to clipboard!"); - }; - return ( @@ -114,25 +126,19 @@ const MemoActionMenu = (props: Props) => { )} {!hiddenActions?.includes("share") && ( - showShareMemoDialog(memo.id)}> + showShareMemoDialog(extractMemoIdFromName(memo.name))}> {t("common.share")} )} - - - {t("common.archive")} + + {memo.rowStatus === RowStatus.ARCHIVED ? : } + {memo.rowStatus === RowStatus.ARCHIVED ? t("common.restore") : t("common.archive")} {t("common.delete")} - -
-
- ID: {memo.name} -
-
); diff --git a/web/src/components/MemoContent/Code.tsx b/web/src/components/MemoContent/Code.tsx index 19f0a39a2c988..b974d9edaed08 100644 --- a/web/src/components/MemoContent/Code.tsx +++ b/web/src/components/MemoContent/Code.tsx @@ -3,7 +3,7 @@ interface Props { } const Code: React.FC = ({ content }: Props) => { - return {content}; + return {content}; }; export default Code; diff --git a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx index a3cc4a9a6633b..0f1ea0a18e806 100644 --- a/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx +++ b/web/src/components/MemoContent/EmbeddedContent/EmbeddedMemo.tsx @@ -2,7 +2,6 @@ import { useContext, useEffect } from "react"; import { Link } from "react-router-dom"; import Icon from "@/components/Icon"; import MemoResourceListView from "@/components/MemoResourceListView"; -import { getDateTimeString } from "@/helpers/datetime"; import useLoading from "@/hooks/useLoading"; import { useMemoStore } from "@/store/v1"; import MemoContent from ".."; @@ -18,11 +17,11 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => { const context = useContext(RendererContext); const loadingState = useLoading(); const memoStore = useMemoStore(); - const memo = memoStore.getMemoByName(resourceId); + const memo = memoStore.getMemoByUid(resourceId); const resourceName = `memos/${resourceId}`; useEffect(() => { - memoStore.getOrFetchMemoByName(resourceId).finally(() => loadingState.setFinish()); + memoStore.searchMemos(`uid == "${resourceId}"`).finally(() => loadingState.setFinish()); }, [resourceId]); if (loadingState.isLoading) { @@ -31,7 +30,7 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => { if (!memo) { return ; } - if (memo.id === context.memoId || context.embeddedMemos.has(resourceName)) { + if (memo.name === context.memoName || context.embeddedMemos.has(resourceName)) { return ; } @@ -42,21 +41,33 @@ const EmbeddedMemo = ({ resourceId, params: paramsStr }: Props) => { if (inlineMode) { return (
- +
); } return ( -
+
- {getDateTimeString(memo.displayTime)} - +
+ +
+
- +
); diff --git a/web/src/components/MemoContent/EmbeddedContent/EmbeddedResource.tsx b/web/src/components/MemoContent/EmbeddedContent/EmbeddedResource.tsx index fe5ba648b01d4..e6c6db6de4794 100644 --- a/web/src/components/MemoContent/EmbeddedContent/EmbeddedResource.tsx +++ b/web/src/components/MemoContent/EmbeddedContent/EmbeddedResource.tsx @@ -42,7 +42,7 @@ const EmbeddedResource = ({ resourceId, params: paramsStr }: Props) => { const params = new URLSearchParams(paramsStr); useEffect(() => { - resourceStore.getOrFetchResourceByName(resourceId).finally(() => loadingState.setFinish()); + resourceStore.searchResources(`uid == ${resourceId}`).finally(() => loadingState.setFinish()); }, [resourceId]); if (loadingState.isLoading) { diff --git a/web/src/components/MemoContent/Link.tsx b/web/src/components/MemoContent/Link.tsx index 1acd8726b159a..a373df7d03f81 100644 --- a/web/src/components/MemoContent/Link.tsx +++ b/web/src/components/MemoContent/Link.tsx @@ -1,18 +1,60 @@ +import { Link as MLink, Tooltip } from "@mui/joy"; +import { useEffect, useState } from "react"; +import { linkServiceClient } from "@/grpcweb"; +import { LinkMetadata } from "@/types/proto/api/v2/link_service"; + interface Props { url: string; text?: string; } +const getFaviconWithGoogleS2 = (url: string) => { + try { + const urlObject = new URL(url); + return `https://www.google.com/s2/favicons?sz=128&domain=${urlObject.hostname}`; + } catch (error) { + return undefined; + } +}; + const Link: React.FC = ({ text, url }: Props) => { - return ( - (); + + useEffect(() => { + (async () => { + try { + const { linkMetadata } = await linkServiceClient.getLinkMetadata({ link: url }, {}); + setLinkMetadata(linkMetadata); + } catch (error) { + console.error("Error fetching URL metadata:", error); + } + })(); + }, [url]); + + return linkMetadata ? ( + + + {linkMetadata?.title} +

{linkMetadata?.title}

+
+ {linkMetadata.description && ( +

{linkMetadata.description}

+ )} +
+ } + arrow > + + {text || url} + + + ) : ( + {text || url} - + ); }; diff --git a/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx b/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx index 5112ef5936a1a..e9dd66683cde1 100644 --- a/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx +++ b/web/src/components/MemoContent/ReferencedContent/ReferencedMemo.tsx @@ -13,11 +13,11 @@ const ReferencedMemo = ({ resourceId, params: paramsStr }: Props) => { const navigateTo = useNavigateTo(); const loadingState = useLoading(); const memoStore = useMemoStore(); - const memo = memoStore.getMemoByName(resourceId); + const memo = memoStore.getMemoByUid(resourceId); const params = new URLSearchParams(paramsStr); useEffect(() => { - memoStore.getOrFetchMemoByName(resourceId).finally(() => loadingState.setFinish()); + memoStore.searchMemos(`uid == "${resourceId}"`).finally(() => loadingState.setFinish()); }, [resourceId]); if (loadingState.isLoading) { @@ -31,7 +31,7 @@ const ReferencedMemo = ({ resourceId, params: paramsStr }: Props) => { const displayContent = paramsText || (memo.content.length > 12 ? `${memo.content.slice(0, 12)}...` : memo.content); const handleGotoMemoDetailPage = () => { - navigateTo(`/m/${memo.name}`); + navigateTo(`/m/${memo.uid}`); }; return ( diff --git a/web/src/components/MemoContent/TaskList.tsx b/web/src/components/MemoContent/TaskList.tsx index 90d8f11d23026..884e5e6ddd127 100644 --- a/web/src/components/MemoContent/TaskList.tsx +++ b/web/src/components/MemoContent/TaskList.tsx @@ -21,7 +21,7 @@ const TaskList: React.FC = ({ index, indent, complete, children }: Props) const [checked] = useState(complete); const handleCheckboxChange = async (on: boolean) => { - if (context.readonly || !context.memoId) { + if (context.readonly || !context.memoName) { return; } @@ -39,7 +39,7 @@ const TaskList: React.FC = ({ index, indent, complete, children }: Props) const content = window.restore(context.nodes); await memoStore.updateMemo( { - id: context.memoId, + name: context.memoName, content, }, ["content"], diff --git a/web/src/components/MemoContent/index.tsx b/web/src/components/MemoContent/index.tsx index 09ed45b9add0d..c98ea90e9125f 100644 --- a/web/src/components/MemoContent/index.tsx +++ b/web/src/components/MemoContent/index.tsx @@ -1,11 +1,9 @@ import classNames from "classnames"; import { memo, useEffect, useRef, useState } from "react"; -import { Link } from "react-router-dom"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useMemoStore } from "@/store/v1"; import { Node, NodeType } from "@/types/node"; import { useTranslate } from "@/utils/i18n"; -import Icon from "../Icon"; import Renderer from "./Renderer"; import { RendererContext } from "./types"; @@ -14,7 +12,7 @@ const MAX_DISPLAY_HEIGHT = 256; interface Props { content: string; - memoId?: number; + memoName?: string; compact?: boolean; readonly?: boolean; disableFilter?: boolean; @@ -26,15 +24,15 @@ interface Props { } const MemoContent: React.FC = (props: Props) => { - const { className, content, memoId, embeddedMemos, onClick } = props; + const { className, content, memoName, embeddedMemos, onClick } = props; const t = useTranslate(); const currentUser = useCurrentUser(); const memoStore = useMemoStore(); const memoContentContainerRef = useRef(null); const [showCompactMode, setShowCompactMode] = useState(false); - const memo = memoId ? memoStore.getMemoById(memoId) : null; + const memo = memoName ? memoStore.getMemoByName(memoName) : null; const nodes = window.parse(content); - const allowEdit = !props.readonly && memo && currentUser?.id === memo.creatorId; + const allowEdit = !props.readonly && memo && currentUser?.name === memo.creator; // Initial compact mode. useEffect(() => { @@ -64,17 +62,17 @@ const MemoContent: React.FC = (props: Props) => { -
+
= (props: Props) => { return ; })}
+ {showCompactMode && ( +
+ setShowCompactMode(false)} + > + {t("memo.show-more")} + +
+ )}
- {memo && showCompactMode && ( -
- - {t("memo.show-more")} - - -
- )} ); }; diff --git a/web/src/components/MemoContent/types/context.ts b/web/src/components/MemoContent/types/context.ts index b885df28e30d1..3ed174b9a5785 100644 --- a/web/src/components/MemoContent/types/context.ts +++ b/web/src/components/MemoContent/types/context.ts @@ -6,7 +6,7 @@ interface Context { // embeddedMemos is a set of memo resource names that are embedded in the current memo. // This is used to prevent infinite loops when a memo embeds itself. embeddedMemos: Set; - memoId?: number; + memoName?: string; readonly?: boolean; disableFilter?: boolean; } diff --git a/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx b/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx index 0ee434391e6a3..95b8c3b8529de 100644 --- a/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx +++ b/web/src/components/MemoEditor/ActionButton/AddMemoRelationButton.tsx @@ -4,7 +4,6 @@ import { useContext } from "react"; import toast from "react-hot-toast"; import showCreateMemoRelationDialog from "@/components/CreateMemoRelationDialog"; import Icon from "@/components/Icon"; -import { UNKNOWN_ID } from "@/helpers/consts"; import { MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service"; import { EditorRefActions } from "../Editor"; import { MemoEditorContext } from "../types"; @@ -33,7 +32,7 @@ const AddMemoRelationButton = (props: Props) => { editorRef.current.insertText("\n"); } for (const memo of memos) { - editorRef.current.insertText(`![[memos/${memo.name}]]\n`); + editorRef.current.insertText(`![[memos/${memo.uid}]]\n`); } setTimeout(() => { editorRef.current?.scrollToCursor(); @@ -45,9 +44,13 @@ const AddMemoRelationButton = (props: Props) => { context.setRelationList( uniqBy( [ - ...memos.map((memo) => ({ memoId: context.memoId || UNKNOWN_ID, relatedMemoId: memo.id, type: MemoRelation_Type.REFERENCE })), + ...memos.map((memo) => ({ + memo: context.memoName || "", + relatedMemo: memo.name, + type: MemoRelation_Type.REFERENCE, + })), ...context.relationList, - ].filter((relation) => relation.relatedMemoId !== (context.memoId || UNKNOWN_ID)), + ].filter((relation) => relation.relatedMemo !== context.memoName), "relatedMemoId", ), ); diff --git a/web/src/components/MemoEditor/Editor/index.tsx b/web/src/components/MemoEditor/Editor/index.tsx index 0b82591ffe095..1ebfcc527685d 100644 --- a/web/src/components/MemoEditor/Editor/index.tsx +++ b/web/src/components/MemoEditor/Editor/index.tsx @@ -1,8 +1,10 @@ import classNames from "classnames"; import { forwardRef, ReactNode, useCallback, useEffect, useImperativeHandle, useRef } from "react"; +import { useAutoComplete } from "../hooks"; import TagSuggestions from "./TagSuggestions"; export interface EditorRefActions { + getEditor: () => HTMLTextAreaElement | null; focus: FunctionType; scrollToCursor: FunctionType; insertText: (text: string, prefix?: string, suffix?: string) => void; @@ -43,101 +45,104 @@ const Editor = forwardRef(function Editor(props: Props, ref: React.ForwardedRef< } }, [editorRef.current?.value]); - const updateEditorHeight = () => { - if (editorRef.current) { - editorRef.current.style.height = "auto"; - editorRef.current.style.height = (editorRef.current.scrollHeight ?? 0) + "px"; - } - }; + const editorActions = { + getEditor: () => { + return editorRef.current; + }, + focus: () => { + editorRef.current?.focus(); + }, + scrollToCursor: () => { + if (editorRef.current) { + editorRef.current.scrollTop = editorRef.current.scrollHeight; + } + }, + insertText: (content = "", prefix = "", suffix = "") => { + if (!editorRef.current) { + return; + } - useImperativeHandle( - ref, - () => ({ - focus: () => { - editorRef.current?.focus(); - }, - scrollToCursor: () => { - if (editorRef.current) { - editorRef.current.scrollTop = editorRef.current.scrollHeight; - } - }, - insertText: (content = "", prefix = "", suffix = "") => { - if (!editorRef.current) { - return; - } + const cursorPosition = editorRef.current.selectionStart; + const endPosition = editorRef.current.selectionEnd; + const prevValue = editorRef.current.value; + const value = + prevValue.slice(0, cursorPosition) + + prefix + + (content || prevValue.slice(cursorPosition, endPosition)) + + suffix + + prevValue.slice(endPosition); - const cursorPosition = editorRef.current.selectionStart; - const endPosition = editorRef.current.selectionEnd; - const prevValue = editorRef.current.value; - const value = - prevValue.slice(0, cursorPosition) + - prefix + - (content || prevValue.slice(cursorPosition, endPosition)) + - suffix + - prevValue.slice(endPosition); + editorRef.current.value = value; + editorRef.current.focus(); + editorRef.current.selectionEnd = endPosition + prefix.length + content.length; + handleContentChangeCallback(editorRef.current.value); + updateEditorHeight(); + }, + removeText: (start: number, length: number) => { + if (!editorRef.current) { + return; + } - editorRef.current.value = value; - editorRef.current.focus(); - editorRef.current.selectionEnd = endPosition + prefix.length + content.length; + const prevValue = editorRef.current.value; + const value = prevValue.slice(0, start) + prevValue.slice(start + length); + editorRef.current.value = value; + editorRef.current.focus(); + editorRef.current.selectionEnd = start; + handleContentChangeCallback(editorRef.current.value); + updateEditorHeight(); + }, + setContent: (text: string) => { + if (editorRef.current) { + editorRef.current.value = text; handleContentChangeCallback(editorRef.current.value); updateEditorHeight(); - }, - removeText: (start: number, length: number) => { - if (!editorRef.current) { - return; - } - - const prevValue = editorRef.current.value; - const value = prevValue.slice(0, start) + prevValue.slice(start + length); - editorRef.current.value = value; + } + }, + getContent: (): string => { + return editorRef.current?.value ?? ""; + }, + getCursorPosition: (): number => { + return editorRef.current?.selectionStart ?? 0; + }, + getSelectedContent: () => { + const start = editorRef.current?.selectionStart; + const end = editorRef.current?.selectionEnd; + return editorRef.current?.value.slice(start, end) ?? ""; + }, + setCursorPosition: (startPos: number, endPos?: number) => { + const _endPos = isNaN(endPos as number) ? startPos : (endPos as number); + editorRef.current?.setSelectionRange(startPos, _endPos); + }, + getCursorLineNumber: () => { + const cursorPosition = editorRef.current?.selectionStart ?? 0; + const lines = editorRef.current?.value.slice(0, cursorPosition).split("\n") ?? []; + return lines.length - 1; + }, + getLine: (lineNumber: number) => { + return editorRef.current?.value.split("\n")[lineNumber] ?? ""; + }, + setLine: (lineNumber: number, text: string) => { + const lines = editorRef.current?.value.split("\n") ?? []; + lines[lineNumber] = text; + if (editorRef.current) { + editorRef.current.value = lines.join("\n"); editorRef.current.focus(); - editorRef.current.selectionEnd = start; handleContentChangeCallback(editorRef.current.value); updateEditorHeight(); - }, - setContent: (text: string) => { - if (editorRef.current) { - editorRef.current.value = text; - handleContentChangeCallback(editorRef.current.value); - updateEditorHeight(); - } - }, - getContent: (): string => { - return editorRef.current?.value ?? ""; - }, - getCursorPosition: (): number => { - return editorRef.current?.selectionStart ?? 0; - }, - getSelectedContent: () => { - const start = editorRef.current?.selectionStart; - const end = editorRef.current?.selectionEnd; - return editorRef.current?.value.slice(start, end) ?? ""; - }, - setCursorPosition: (startPos: number, endPos?: number) => { - const _endPos = isNaN(endPos as number) ? startPos : (endPos as number); - editorRef.current?.setSelectionRange(startPos, _endPos); - }, - getCursorLineNumber: () => { - const cursorPosition = editorRef.current?.selectionStart ?? 0; - const lines = editorRef.current?.value.slice(0, cursorPosition).split("\n") ?? []; - return lines.length - 1; - }, - getLine: (lineNumber: number) => { - return editorRef.current?.value.split("\n")[lineNumber] ?? ""; - }, - setLine: (lineNumber: number, text: string) => { - const lines = editorRef.current?.value.split("\n") ?? []; - lines[lineNumber] = text; - if (editorRef.current) { - editorRef.current.value = lines.join("\n"); - editorRef.current.focus(); - handleContentChangeCallback(editorRef.current.value); - updateEditorHeight(); - } - }, - }), - [], - ); + } + }, + }; + + useAutoComplete(editorActions); + + useImperativeHandle(ref, () => editorActions, []); + + const updateEditorHeight = () => { + if (editorRef.current) { + editorRef.current.style.height = "auto"; + editorRef.current.style.height = (editorRef.current.scrollHeight ?? 0) + "px"; + } + }; const handleEditorInput = useCallback(() => { handleContentChangeCallback(editorRef.current?.value ?? ""); diff --git a/web/src/components/MemoEditor/MemoEditorDialog.tsx b/web/src/components/MemoEditor/MemoEditorDialog.tsx index 95a9426523afd..01441828a9ca7 100644 --- a/web/src/components/MemoEditor/MemoEditorDialog.tsx +++ b/web/src/components/MemoEditor/MemoEditorDialog.tsx @@ -2,17 +2,17 @@ import { IconButton } from "@mui/joy"; import { useEffect } from "react"; import { useGlobalStore, useTagStore } from "@/store/module"; import { MemoRelation } from "@/types/proto/api/v2/memo_relation_service"; -import MemoEditorV1 from "."; +import MemoEditor from "."; import { generateDialog } from "../Dialog"; import Icon from "../Icon"; interface Props extends DialogProps { - memoId?: number; + memoName?: string; cacheKey?: string; relationList?: MemoRelation[]; } -const MemoEditorDialog: React.FC = ({ memoId, cacheKey, relationList, destroy }: Props) => { +const MemoEditorDialog: React.FC = ({ memoName: memo, cacheKey, relationList, destroy }: Props) => { const globalStore = useGlobalStore(); const tagStore = useTagStore(); const { systemStatus } = globalStore.state; @@ -29,7 +29,7 @@ const MemoEditorDialog: React.FC = ({ memoId, cacheKey, relationList, des <>
- +

{systemStatus.customizedProfile.name}

@@ -37,10 +37,10 @@ const MemoEditorDialog: React.FC = ({ memoId, cacheKey, relationList, des
- = ({ memoId, cacheKey, relationList, des ); }; -export default function showMemoEditorDialog(props: Pick = {}): void { +export default function showMemoEditorDialog(props: Pick = {}): void { generateDialog( { className: "memo-editor-dialog", dialogName: "memo-editor-dialog", - containerClassName: "dark:!bg-zinc-800", }, MemoEditorDialog, props, diff --git a/web/src/components/MemoEditor/RelationListView.tsx b/web/src/components/MemoEditor/RelationListView.tsx index 187ce87c2b4da..7805dbfd21e7c 100644 --- a/web/src/components/MemoEditor/RelationListView.tsx +++ b/web/src/components/MemoEditor/RelationListView.tsx @@ -19,7 +19,7 @@ const RelationListView = (props: Props) => { const requests = relationList .filter((relation) => relation.type === MemoRelation_Type.REFERENCE) .map(async (relation) => { - return await memoStore.getOrFetchMemoById(relation.relatedMemoId, { skipStore: true }); + return await memoStore.getOrFetchMemoByName(relation.relatedMemo, { skipStore: true }); }); const list = await Promise.all(requests); setReferencingMemoList(list); @@ -27,7 +27,7 @@ const RelationListView = (props: Props) => { }, [relationList]); const handleDeleteRelation = async (memo: Memo) => { - setRelationList(relationList.filter((relation) => relation.relatedMemoId !== memo.id)); + setRelationList(relationList.filter((relation) => relation.relatedMemo !== memo.name)); }; return ( diff --git a/web/src/components/MemoEditor/ResourceListView.tsx b/web/src/components/MemoEditor/ResourceListView.tsx index 092f4b2b22e19..b6abde5bac68b 100644 --- a/web/src/components/MemoEditor/ResourceListView.tsx +++ b/web/src/components/MemoEditor/ResourceListView.tsx @@ -10,8 +10,8 @@ interface Props { const ResourceListView = (props: Props) => { const { resourceList, setResourceList } = props; - const handleDeleteResource = async (resourceId: ResourceId) => { - setResourceList(resourceList.filter((resource) => resource.id !== resourceId)); + const handleDeleteResource = async (name: string) => { + setResourceList(resourceList.filter((resource) => resource.name !== name)); }; return ( @@ -21,14 +21,14 @@ const ResourceListView = (props: Props) => { {resourceList.map((resource) => { return (
{resource.filename} handleDeleteResource(resource.id)} + onClick={() => handleDeleteResource(resource.name)} />
); diff --git a/web/src/components/MemoEditor/handlers.tsx b/web/src/components/MemoEditor/handlers.ts similarity index 100% rename from web/src/components/MemoEditor/handlers.tsx rename to web/src/components/MemoEditor/handlers.ts diff --git a/web/src/components/MemoEditor/hooks/index.ts b/web/src/components/MemoEditor/hooks/index.ts new file mode 100644 index 0000000000000..d1293f1ad0e26 --- /dev/null +++ b/web/src/components/MemoEditor/hooks/index.ts @@ -0,0 +1,3 @@ +import useAutoComplete from "./useAutoComplete"; + +export { useAutoComplete }; diff --git a/web/src/components/MemoEditor/hooks/useAutoComplete.ts b/web/src/components/MemoEditor/hooks/useAutoComplete.ts new file mode 100644 index 0000000000000..eb104e461167d --- /dev/null +++ b/web/src/components/MemoEditor/hooks/useAutoComplete.ts @@ -0,0 +1,40 @@ +import { last } from "lodash-es"; +import { useEffect } from "react"; +import { NodeType, OrderedListNode, TaskListNode, UnorderedListNode } from "@/types/node"; +import { EditorRefActions } from "../Editor"; + +const useAutoComplete = (actions: EditorRefActions) => { + useEffect(() => { + const editor = actions.getEditor(); + if (!editor) return; + + editor.addEventListener("keydown", (event) => { + if (event.key === "Enter") { + const cursorPosition = actions.getCursorPosition(); + const prevContent = actions.getContent().substring(0, cursorPosition); + const lastNode = last(window.parse(prevContent)); + if (!lastNode) { + return; + } + + let insertText = ""; + if (lastNode.type === NodeType.TASK_LIST) { + const { complete } = lastNode.value as TaskListNode; + insertText = complete ? "- [x] " : "- [ ] "; + } else if (lastNode.type === NodeType.UNORDERED_LIST) { + const { symbol } = lastNode.value as UnorderedListNode; + insertText = `${symbol} `; + } else if (lastNode.type === NodeType.ORDERED_LIST) { + const { number } = lastNode.value as OrderedListNode; + insertText = `${Number(number) + 1}. `; + } + if (insertText) { + actions.insertText(`\n${insertText}`); + event.preventDefault(); + } + } + }); + }, []); +}; + +export default useAutoComplete; diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index ceb3059362386..2235c0de06b91 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -4,7 +4,7 @@ import { toast } from "react-hot-toast"; import { useTranslation } from "react-i18next"; import useLocalStorage from "react-use/lib/useLocalStorage"; import { memoServiceClient } from "@/grpcweb"; -import { TAB_SPACE_WIDTH, UNKNOWN_ID } from "@/helpers/consts"; +import { TAB_SPACE_WIDTH } from "@/helpers/consts"; import { isValidUrl } from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useGlobalStore, useResourceStore, useTagStore } from "@/store/module"; @@ -30,13 +30,14 @@ import { MemoEditorContext } from "./types"; interface Props { className?: string; - editorClassName?: string; cacheKey?: string; - memoId?: number; - parentMemoId?: number; + placeholder?: string; + memoName?: string; + parentMemoName?: string; relationList?: MemoRelation[]; autoFocus?: boolean; - onConfirm?: (memoId: number) => void; + onConfirm?: (memoName: string) => void; + onEditPrevious?: () => void; } interface State { @@ -49,7 +50,7 @@ interface State { } const MemoEditor = (props: Props) => { - const { className, editorClassName, cacheKey, memoId, parentMemoId, autoFocus, onConfirm } = props; + const { className, cacheKey, memoName, parentMemoName, autoFocus, onConfirm } = props; const { i18n } = useTranslation(); const t = useTranslate(); const { @@ -73,9 +74,9 @@ const MemoEditor = (props: Props) => { const userSetting = userStore.userSetting as UserSetting; const contentCacheKey = `${currentUser.name}-${cacheKey || ""}`; const [contentCache, setContentCache] = useLocalStorage(contentCacheKey, ""); - const referenceRelations = memoId + const referenceRelations = memoName ? state.relationList.filter( - (relation) => relation.memoId === memoId && relation.relatedMemoId !== memoId && relation.type === MemoRelation_Type.REFERENCE, + (relation) => relation.memo === memoName && relation.relatedMemo !== memoName && relation.type === MemoRelation_Type.REFERENCE, ) : state.relationList.filter((relation) => relation.type === MemoRelation_Type.REFERENCE); @@ -101,8 +102,8 @@ const MemoEditor = (props: Props) => { }, [userSetting.memoVisibility, systemStatus.disablePublicMemos]); useEffect(() => { - if (memoId) { - memoStore.getOrFetchMemoById(memoId ?? UNKNOWN_ID).then((memo) => { + if (memoName) { + memoStore.getOrFetchMemoByName(memoName).then((memo) => { if (memo) { handleEditorFocus(); setState((prevState) => ({ @@ -117,7 +118,7 @@ const MemoEditor = (props: Props) => { } }); } - }, [memoId]); + }, [memoName]); const handleCompositionStart = () => { setState((prevState) => ({ @@ -141,7 +142,7 @@ const MemoEditor = (props: Props) => { const isMetaKey = event.ctrlKey || event.metaKey; if (isMetaKey) { if (event.key === "Enter") { - handleSaveBtnClick(); + void handleSaveBtnClick(); return; } @@ -158,6 +159,12 @@ const MemoEditor = (props: Props) => { } return; } + + if (!!props.onEditPrevious && event.key === "ArrowDown" && !state.isComposing && editorRef.current.getContent() === "") { + event.preventDefault(); + props.onEditPrevious(); + return; + } }; const handleMemoVisibilityChange = (visibility: Visibility) => { @@ -223,13 +230,13 @@ const MemoEditor = (props: Props) => { const resource = await handleUploadResource(file); if (resource) { uploadedResourceList.push(resource); - if (memoId) { + if (memoName) { await resourceStore.updateResource({ resource: Resource.fromPartial({ - id: resource.id, - memoId, + name: resource.name, + memo: memoName, }), - updateMask: ["memo_id"], + updateMask: ["memo"], }); } } @@ -286,41 +293,41 @@ const MemoEditor = (props: Props) => { const content = editorRef.current?.getContent() ?? ""; try { // Update memo. - if (memoId && memoId !== UNKNOWN_ID) { - const prevMemo = await memoStore.getOrFetchMemoById(memoId ?? UNKNOWN_ID); + if (memoName) { + const prevMemo = await memoStore.getOrFetchMemoByName(memoName); if (prevMemo) { const memo = await memoStore.updateMemo( { - id: prevMemo.id, + name: prevMemo.name, content, visibility: state.memoVisibility, }, ["content", "visibility"], ); await memoServiceClient.setMemoResources({ - id: memo.id, + name: memo.name, resources: state.resourceList, }); await memoServiceClient.setMemoRelations({ - id: memo.id, + name: memo.name, relations: state.relationList, }); - await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); + await memoStore.getOrFetchMemoByName(memo.name, { skipCache: true }); if (onConfirm) { - onConfirm(memo.id); + onConfirm(memo.name); } } } else { // Create memo or memo comment. - const request = !parentMemoId + const request = !parentMemoName ? memoStore.createMemo({ content, visibility: state.memoVisibility, }) : memoServiceClient .createMemoComment({ - id: parentMemoId, - create: { + name: parentMemoName, + comment: { content, visibility: state.memoVisibility, }, @@ -328,16 +335,16 @@ const MemoEditor = (props: Props) => { .then(({ memo }) => memo as Memo); const memo = await request; await memoServiceClient.setMemoResources({ - id: memo.id, + name: memo.name, resources: state.resourceList, }); await memoServiceClient.setMemoRelations({ - id: memo.id, + name: memo.name, relations: state.relationList, }); - await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); + await memoStore.getOrFetchMemoByName(memo.name, { skipCache: true }); if (onConfirm) { - onConfirm(memo.id); + onConfirm(memo.name); } } editorRef.current?.setContent(""); @@ -366,9 +373,9 @@ const MemoEditor = (props: Props) => { const editorConfig = useMemo( () => ({ - className: editorClassName ?? "", + className: "", initialContent: "", - placeholder: t("editor.placeholder"), + placeholder: props.placeholder ?? t("editor.any-thoughts"), onContentChange: handleContentChange, onPaste: handlePasteEvent, }), @@ -387,7 +394,7 @@ const MemoEditor = (props: Props) => { relationList, })); }, - memoId, + memoName, }} >
void; - // memoId is the id of the memo that is being edited. - memoId?: number; + memoName?: string; } export const MemoEditorContext = createContext({ diff --git a/web/src/components/MemoFilter.tsx b/web/src/components/MemoFilter.tsx index b963c69f18522..dff13d5ad0e4b 100644 --- a/web/src/components/MemoFilter.tsx +++ b/web/src/components/MemoFilter.tsx @@ -45,7 +45,7 @@ const MemoFilter = (props: Props) => { filterStore.setTagFilter(undefined); }} > - {tagQuery} + {tagQuery}
{ (async () => { const reactionGroup = new Map(); for (const reaction of reactions) { - const user = await userStore.getOrFetchUserByUsername(extractUsernameFromName(reaction.creator)); + const user = await userStore.getOrFetchUserByName(reaction.creator); const users = reactionGroup.get(reaction.reactionType) || []; users.push(user); reactionGroup.set(reaction.reactionType, uniq(users)); @@ -34,7 +34,7 @@ const MemoReactionListView = (props: Props) => { return ( reactions.length > 0 && ( -
+
{Array.from(reactionGroup).map(([reactionType, users]) => { return ; })} diff --git a/web/src/components/MemoRelationListView.tsx b/web/src/components/MemoRelationListView.tsx index 22f962278e130..56a7d3b0fc221 100644 --- a/web/src/components/MemoRelationListView.tsx +++ b/web/src/components/MemoRelationListView.tsx @@ -21,14 +21,14 @@ const MemoRelationListView = (props: Props) => { (async () => { const referencingMemoList = await Promise.all( relationList - .filter((relation) => relation.memoId === memo.id && relation.relatedMemoId !== memo.id) - .map((relation) => memoStore.getOrFetchMemoById(relation.relatedMemoId, { skipStore: true })), + .filter((relation) => relation.memo === memo.name && relation.relatedMemo !== memo.name) + .map((relation) => memoStore.getOrFetchMemoByName(relation.relatedMemo, { skipStore: true })), ); setReferencingMemoList(referencingMemoList); const referencedMemoList = await Promise.all( relationList - .filter((relation) => relation.memoId !== memo.id && relation.relatedMemoId === memo.id) - .map((relation) => memoStore.getOrFetchMemoById(relation.memoId, { skipStore: true })), + .filter((relation) => relation.memo !== memo.name && relation.relatedMemo === memo.name) + .map((relation) => memoStore.getOrFetchMemoByName(relation.memo, { skipStore: true })), ); setReferencedMemoList(referencedMemoList); })(); @@ -37,13 +37,13 @@ const MemoRelationListView = (props: Props) => { return ( <> {referencingMemoList.length > 0 && ( -
+
{referencingMemoList.map((memo) => { return (
@@ -57,13 +57,13 @@ const MemoRelationListView = (props: Props) => {
)} {referencedMemoList.length > 0 && ( -
+
{referencedMemoList.map((memo) => { return (
diff --git a/web/src/components/MemoResourceListView.tsx b/web/src/components/MemoResourceListView.tsx index e7c65fab74aab..9482325e252da 100644 --- a/web/src/components/MemoResourceListView.tsx +++ b/web/src/components/MemoResourceListView.tsx @@ -62,7 +62,7 @@ const MemoResourceListView = ({ resources = [] }: { resources: Resource[] }) => if (resources.length === 1) { return ( -
+
); @@ -70,7 +70,7 @@ const MemoResourceListView = ({ resources = [] }: { resources: Resource[] }) => const cards = resources.map((resource) => ( @@ -78,19 +78,19 @@ const MemoResourceListView = ({ resources = [] }: { resources: Resource[] }) => )); if (resources.length === 2 || resources.length === 4) { - return
{cards}
; + return
{cards}
; } - return
{cards}
; + return
{cards}
; }; const OtherList = ({ resources = [] }: { resources: Resource[] }) => { if (resources.length === 0) return <>; return ( -
+
{otherResources.map((resource) => ( - + ))}
); diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx index fc61df269b16b..008c4ec5607ae 100644 --- a/web/src/components/MemoView.tsx +++ b/web/src/components/MemoView.tsx @@ -1,12 +1,10 @@ import { Tooltip } from "@mui/joy"; import classNames from "classnames"; import { memo, useCallback, useEffect, useRef, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { Link } from "react-router-dom"; -import { getRelativeTimeString, getTimeStampByDate } from "@/helpers/datetime"; +import { Link, useLocation } from "react-router-dom"; import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; -import { useUserStore, extractUsernameFromName } from "@/store/v1"; +import { extractMemoIdFromName, useUserStore } from "@/store/v1"; import { MemoRelation_Type } from "@/types/proto/api/v2/memo_relation_service"; import { Memo, Visibility } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; @@ -25,6 +23,7 @@ import VisibilityIcon from "./VisibilityIcon"; interface Props { memo: Memo; + compact?: boolean; showCreator?: boolean; showVisibility?: boolean; showPinned?: boolean; @@ -34,47 +33,34 @@ interface Props { const MemoView: React.FC = (props: Props) => { const { memo, className } = props; const t = useTranslate(); + const location = useLocation(); const navigateTo = useNavigateTo(); - const { i18n } = useTranslation(); const currentUser = useCurrentUser(); const userStore = useUserStore(); const user = useCurrentUser(); - const [displayTime, setDisplayTime] = useState(getRelativeTimeString(getTimeStampByDate(memo.displayTime))); - const [creator, setCreator] = useState(userStore.getUserByUsername(extractUsernameFromName(memo.creator))); + const [creator, setCreator] = useState(userStore.getUserByName(memo.creator)); const memoContainerRef = useRef(null); const referencedMemos = memo.relations.filter((relation) => relation.type === MemoRelation_Type.REFERENCE); const commentAmount = memo.relations.filter( - (relation) => relation.type === MemoRelation_Type.COMMENT && relation.relatedMemoId === memo.id, + (relation) => relation.type === MemoRelation_Type.COMMENT && relation.relatedMemo === memo.name, ).length; + const relativeTimeFormat = Date.now() - memo.displayTime!.getTime() > 1000 * 60 * 60 * 24 ? "datetime" : "auto"; const readonly = memo.creator !== user?.name; + const isInMemoDetailPage = location.pathname.startsWith(`/m/${memo.uid}`); // Initial related data: creator. useEffect(() => { (async () => { - const user = await userStore.getOrFetchUserByUsername(extractUsernameFromName(memo.creator)); + const user = await userStore.getOrFetchUserByName(memo.creator); setCreator(user); })(); }, []); - // Update display time string. - useEffect(() => { - let intervalFlag: any = -1; - if (Date.now() - getTimeStampByDate(memo.displayTime) < 1000 * 60 * 60 * 24) { - intervalFlag = setInterval(() => { - setDisplayTime(getRelativeTimeString(getTimeStampByDate(memo.displayTime))); - }, 1000 * 1); - } - - return () => { - clearInterval(intervalFlag); - }; - }, [i18n.language]); - const handleGotoMemoDetailPage = (event: React.MouseEvent) => { if (event.altKey) { - showChangeMemoCreatedTsDialog(memo.id); + showChangeMemoCreatedTsDialog(extractMemoIdFromName(memo.name)); } else { - navigateTo(`/m/${memo.name}`); + navigateTo(`/m/${memo.uid}`); } }; @@ -92,44 +78,43 @@ const MemoView: React.FC = (props: Props) => { return (
-
-
- {props.showCreator && creator && ( - <> - - - - - - {creator.nickname || creator.username} - - - +
+
+ {props.showCreator && creator ? ( +
+ + - - - )} - - {displayTime} - - {props.showPinned && memo.pinned && ( - <> - - - - - +
+ + {creator.nickname || creator.username} + +
+ +
+
+
+ ) : ( +
+ +
)}
-
-
+
+
{props.showVisibility && memo.visibility !== Visibility.PRIVATE && ( @@ -137,29 +122,36 @@ const MemoView: React.FC = (props: Props) => { )} - {currentUser && } + {currentUser && }
- - - {commentAmount > 0 && {commentAmount}} - - {!readonly && } + {!isInMemoDetailPage && ( + + + {commentAmount > 0 && {commentAmount}} + + )} + {props.showPinned && memo.pinned && ( + + + + )} + {!readonly && }
diff --git a/web/src/components/Navigation.tsx b/web/src/components/Navigation.tsx index 27bc14aebdb6a..6fcf8f301c025 100644 --- a/web/src/components/Navigation.tsx +++ b/web/src/components/Navigation.tsx @@ -3,6 +3,7 @@ import classNames from "classnames"; import { useEffect } from "react"; import { NavLink } from "react-router-dom"; import useCurrentUser from "@/hooks/useCurrentUser"; +import { Routes } from "@/router"; import { useInboxStore } from "@/store/v1"; import { Inbox_Status } from "@/types/proto/api/v2/inbox_service"; import { useTranslate } from "@/utils/i18n"; @@ -49,42 +50,42 @@ const Navigation = (props: Props) => { const homeNavLink: NavLinkItem = { id: "header-home", - path: "/", + path: Routes.HOME, title: t("common.home"), - icon: , + icon: , }; const timelineNavLink: NavLinkItem = { id: "header-timeline", - path: "/timeline", + path: Routes.TIMELINE, title: t("timeline.title"), - icon: , + icon: , }; const resourcesNavLink: NavLinkItem = { id: "header-resources", - path: "/resources", + path: Routes.RESOURCES, title: t("common.resources"), - icon: , + icon: , }; const exploreNavLink: NavLinkItem = { id: "header-explore", - path: "/explore", + path: Routes.EXPLORE, title: t("common.explore"), - icon: , + icon: , }; const profileNavLink: NavLinkItem = { id: "header-profile", path: user ? `/u/${encodeURIComponent(user.username)}` : "", title: t("common.profile"), - icon: , + icon: , }; const inboxNavLink: NavLinkItem = { id: "header-inbox", - path: "/inbox", + path: Routes.INBOX, title: t("common.inbox"), icon: ( <>
- + {hasUnreadInbox &&
}
@@ -92,27 +93,27 @@ const Navigation = (props: Props) => { }; const archivedNavLink: NavLinkItem = { id: "header-archived", - path: "/archived", + path: Routes.ARCHIVED, title: t("common.archived"), - icon: , + icon: , }; const settingNavLink: NavLinkItem = { id: "header-setting", - path: "/setting", + path: Routes.SETTING, title: t("common.settings"), - icon: , + icon: , }; const signInNavLink: NavLinkItem = { id: "header-auth", - path: "/auth", + path: Routes.AUTH, title: t("common.sign-in"), - icon: , + icon: , }; const aboutNavLink: NavLinkItem = { id: "header-about", - path: "/about", + path: Routes.ABOUT, title: t("common.about"), - icon: , + icon: , }; const navLinks: NavLinkItem[] = user @@ -132,7 +133,7 @@ const Navigation = (props: Props) => { classNames( - "px-2 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-300 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-700 dark:hover:bg-zinc-800", + "px-2 py-2 rounded-2xl border flex flex-row items-center text-lg text-gray-800 dark:text-gray-400 hover:bg-white hover:border-gray-200 dark:hover:border-zinc-700 dark:hover:bg-zinc-800", collapsed ? "" : "w-full px-4", isActive ? "bg-white drop-shadow-sm dark:bg-zinc-800 border-gray-200 dark:border-zinc-700" : "border-transparent", ) @@ -149,7 +150,7 @@ const Navigation = (props: Props) => { ) : ( navLink.icon )} - {!props.collapsed && {navLink.title}} + {!props.collapsed && {navLink.title}} ))}
diff --git a/web/src/components/PreviewMarkdownDialog.tsx b/web/src/components/PreviewMarkdownDialog.tsx index 77644e5428556..447c6236636af 100644 --- a/web/src/components/PreviewMarkdownDialog.tsx +++ b/web/src/components/PreviewMarkdownDialog.tsx @@ -34,7 +34,6 @@ export default function showPreviewMarkdownDialog(content: string): void { { className: "preview-markdown-dialog", dialogName: "preview-markdown-dialog", - containerClassName: "dark:!bg-zinc-800", }, PreviewMarkdownDialog, { diff --git a/web/src/components/ReactionSelector.tsx b/web/src/components/ReactionSelector.tsx index abd4640403f74..338d889d25f0f 100644 --- a/web/src/components/ReactionSelector.tsx +++ b/web/src/components/ReactionSelector.tsx @@ -5,7 +5,7 @@ import useClickAway from "react-use/lib/useClickAway"; import Icon from "@/components/Icon"; import { memoServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { MemoNamePrefix, useMemoStore } from "@/store/v1"; +import { useMemoStore } from "@/store/v1"; import { Memo } from "@/types/proto/api/v2/memo_service"; import { Reaction_Type } from "@/types/proto/api/v2/reaction_service"; import { stringifyReactionType } from "./ReactionView"; @@ -52,20 +52,18 @@ const ReactionSelector = (props: Props) => { (reaction) => reaction.reactionType === reactionType && reaction.creator === currentUser.name, ); for (const reaction of reactions) { - await memoServiceClient.deleteMemoReaction({ id: reaction.id }); + await memoServiceClient.deleteMemoReaction({ reactionId: reaction.id }); } } else { await memoServiceClient.upsertMemoReaction({ - id: memo.id, + name: memo.name, reaction: { - contentId: `${MemoNamePrefix}${memo.id}`, + contentId: memo.name, reactionType: reactionType, }, }); } - await memoStore.getOrFetchMemoById(memo.id, { - skipCache: true, - }); + await memoStore.getOrFetchMemoByName(memo.name, { skipCache: true }); } catch (error) { // skip error. } diff --git a/web/src/components/ReactionView.tsx b/web/src/components/ReactionView.tsx index 143d99ddea5e9..8df51dc5e09d5 100644 --- a/web/src/components/ReactionView.tsx +++ b/web/src/components/ReactionView.tsx @@ -2,7 +2,7 @@ import { Tooltip } from "@mui/joy"; import classNames from "classnames"; import { memoServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { MemoNamePrefix, useMemoStore } from "@/store/v1"; +import { useMemoStore } from "@/store/v1"; import { Memo } from "@/types/proto/api/v2/memo_service"; import { Reaction_Type } from "@/types/proto/api/v2/reaction_service"; import { User } from "@/types/proto/api/v2/user_service"; @@ -74,9 +74,9 @@ const ReactionView = (props: Props) => { try { if (index === -1) { await memoServiceClient.upsertMemoReaction({ - id: memo.id, + name: memo.name, reaction: { - contentId: `${MemoNamePrefix}${memo.id}`, + contentId: memo.name, reactionType, }, }); @@ -85,13 +85,13 @@ const ReactionView = (props: Props) => { (reaction) => reaction.reactionType === reactionType && reaction.creator === currentUser.name, ); for (const reaction of reactions) { - await memoServiceClient.deleteMemoReaction({ id: reaction.id }); + await memoServiceClient.deleteMemoReaction({ reactionId: reaction.id }); } } } catch (error) { // Skip error. } - await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); + await memoStore.getOrFetchMemoByName(memo.name, { skipCache: true }); }; return ( diff --git a/web/src/components/RenameTagDialog.tsx b/web/src/components/RenameTagDialog.tsx index 4d86846109734..5d72273360d39 100644 --- a/web/src/components/RenameTagDialog.tsx +++ b/web/src/components/RenameTagDialog.tsx @@ -75,12 +75,13 @@ const RenameTagDialog: React.FC = (props: Props) => { onChange={handleTagNameInputChange} />
- - All your memos with this tag will be updated. - If the number of related memos is large, it will take longer and the server load will become higher. + + +

All your memos with this tag will be updated.

+
-
+
diff --git a/web/src/components/Settings/AccessTokenSection.tsx b/web/src/components/Settings/AccessTokenSection.tsx index 1d877f97d59ca..c61b0eb3e2b69 100644 --- a/web/src/components/Settings/AccessTokenSection.tsx +++ b/web/src/components/Settings/AccessTokenSection.tsx @@ -55,97 +55,90 @@ const AccessTokenSection = () => { }; return ( - <> -
-
-
-
-

- Access Tokens - -

-

A list of all access tokens for your account.

-
-
- -
+
+
+
+
+

+ Access Tokens + +

+

A list of all access tokens for your account.

-
-
-
- - - - - - - - +
+ +
+ +
+
+
+
- Token - - Description - - Created At - - Expires At - - {t("common.delete")} -
+ + + + + + + + + + + {userAccessTokens.map((userAccessToken) => ( + + + + + + - - - {userAccessTokens.map((userAccessToken) => ( - - - - - - - - ))} - -
+ Token + + Description + + Created At + + Expires At + + {t("common.delete")} +
+ {getFormatedAccessToken(userAccessToken.accessToken)} + copyAccessToken(userAccessToken.accessToken)}> + + + + {userAccessToken.description} + + {userAccessToken.issuedAt?.toLocaleString()} + + {userAccessToken.expiresAt?.toLocaleString() ?? "Never"} + + { + handleDeleteAccessToken(userAccessToken.accessToken); + }} + > + + +
- {getFormatedAccessToken(userAccessToken.accessToken)} - copyAccessToken(userAccessToken.accessToken)} - > - - - - {userAccessToken.description} - - {userAccessToken.issuedAt?.toLocaleString()} - - {userAccessToken.expiresAt?.toLocaleString() ?? "Never"} - - { - handleDeleteAccessToken(userAccessToken.accessToken); - }} - > - - -
-
+ ))} + +
- +
); }; diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx index c513ef08f1e30..9f9012acbb548 100644 --- a/web/src/components/Settings/MemberSection.tsx +++ b/web/src/components/Settings/MemberSection.tsx @@ -4,7 +4,7 @@ import React, { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { userServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { UserNamePrefix, stringifyUserRole, useUserStore } from "@/store/v1"; +import { stringifyUserRole, useUserStore } from "@/store/v1"; import { RowStatus } from "@/types/proto/api/v2/common"; import { User, User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; @@ -78,7 +78,7 @@ const MemberSection = () => { try { await userServiceClient.createUser({ user: { - name: `${UserNamePrefix}${state.creatingUser.username}`, + username: state.creatingUser.username, password: state.creatingUser.password, role: state.creatingUser.role, }, diff --git a/web/src/components/Settings/MyAccountSection.tsx b/web/src/components/Settings/MyAccountSection.tsx index 5dc4efafc4835..21532c5f1b37a 100644 --- a/web/src/components/Settings/MyAccountSection.tsx +++ b/web/src/components/Settings/MyAccountSection.tsx @@ -1,9 +1,10 @@ -import { Button } from "@mui/joy"; +import { Button, Dropdown, Menu, MenuButton, MenuItem } from "@mui/joy"; import { memoServiceClient } from "@/grpcweb"; import { downloadFileFromUrl } from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useTranslate } from "@/utils/i18n"; import showChangePasswordDialog from "../ChangePasswordDialog"; +import Icon from "../Icon"; import showUpdateAccountDialog from "../UpdateAccountDialog"; import UserAvatar from "../UserAvatar"; import AccessTokenSection from "./AccessTokenSection"; @@ -22,23 +23,32 @@ const MyAccountSection = () => { return (

{t("setting.account-section.title")}

-
- -
- {user.nickname} - ({user.username}) +
+ +
+

+ {user.nickname} + ({user.username}) +

+

{user.description}

- - - + + + + + + {t("setting.account-section.change-password")} + downloadExportedMemos(user)}>{t("setting.account-section.export-memos")} + +
diff --git a/web/src/components/Settings/SSOSection.tsx b/web/src/components/Settings/SSOSection.tsx index a04d29b521fa1..ac88c0d59c965 100644 --- a/web/src/components/Settings/SSOSection.tsx +++ b/web/src/components/Settings/SSOSection.tsx @@ -3,24 +3,14 @@ import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { Link } from "react-router-dom"; import * as api from "@/helpers/api"; -import { useGlobalStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; import showCreateIdentityProviderDialog from "../CreateIdentityProviderDialog"; import { showCommonDialog } from "../Dialog/CommonDialog"; import Icon from "../Icon"; import LearnMore from "../LearnMore"; -interface State { - disablePasswordLogin: boolean; -} - const SSOSection = () => { const t = useTranslate(); - const globalStore = useGlobalStore(); - const systemStatus = globalStore.state.systemStatus; - const [state] = useState({ - disablePasswordLogin: systemStatus.disablePasswordLogin, - }); const [identityProviderList, setIdentityProviderList] = useState([]); useEffect(() => { @@ -33,11 +23,7 @@ const SSOSection = () => { }; const handleDeleteIdentityProvider = async (identityProvider: IdentityProvider) => { - let content = t("setting.sso-section.confirm-delete", { name: identityProvider.name }); - - if (state.disablePasswordLogin) { - content += "\n\n" + t("setting.sso-section.disabled-password-login-warning"); - } + const content = t("setting.sso-section.confirm-delete", { name: identityProvider.name }); showCommonDialog({ title: t("setting.sso-section.delete-sso"), diff --git a/web/src/components/Settings/SectionMenuItem.tsx b/web/src/components/Settings/SectionMenuItem.tsx index da2c6b2b35411..f6b2f9cbc24e9 100644 --- a/web/src/components/Settings/SectionMenuItem.tsx +++ b/web/src/components/Settings/SectionMenuItem.tsx @@ -10,14 +10,15 @@ interface SettingMenuItemProps { const SectionMenuItem: React.FC = ({ text, icon: IconComponent, isSelected, onClick }) => { return ( - - {text} - + + {text} +
); }; diff --git a/web/src/components/Settings/SystemSection.tsx b/web/src/components/Settings/SystemSection.tsx index db7d15f092371..5517779d2c8dd 100644 --- a/web/src/components/Settings/SystemSection.tsx +++ b/web/src/components/Settings/SystemSection.tsx @@ -9,6 +9,7 @@ import { WorkspaceSettingPrefix } from "@/store/v1"; import { WorkspaceGeneralSetting } from "@/types/proto/api/v2/workspace_setting_service"; import { WorkspaceSettingKey } from "@/types/proto/store/workspace_setting"; import { useTranslate } from "@/utils/i18n"; +import { showCommonDialog } from "../Dialog/CommonDialog"; import Icon from "../Icon"; import showUpdateCustomizedProfileDialog from "../UpdateCustomizedProfileDialog"; @@ -72,14 +73,29 @@ const SystemSection = () => { }; const handleDisablePasswordLoginChanged = async (value: boolean) => { - const setting = { ...workspaceGeneralSetting, disallowPasswordLogin: value }; - await workspaceSettingServiceClient.setWorkspaceSetting({ - setting: { - name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`, - generalSetting: setting, - }, - }); - setWorkspaceGeneralSetting(setting); + const updateSetting = async () => { + const setting = { ...workspaceGeneralSetting, disallowPasswordLogin: value }; + await workspaceSettingServiceClient.setWorkspaceSetting({ + setting: { + name: `${WorkspaceSettingPrefix}${WorkspaceSettingKey.WORKSPACE_SETTING_GENERAL}`, + generalSetting: setting, + }, + }); + setWorkspaceGeneralSetting(setting); + }; + if (value) { + showCommonDialog({ + title: "Confirm", + content: "Are you sure to disable password login?", + style: "danger", + dialogName: "disable-password-login-dialog", + onConfirm: async () => { + await updateSetting(); + }, + }); + } else { + await updateSetting(); + } }; const handleUpdateCustomizedProfileButtonClick = () => { diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index f86a8040fbf91..be9acb215747e 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -7,7 +7,7 @@ import { downloadFileFromUrl } from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; import useLoading from "@/hooks/useLoading"; import toImage from "@/labs/html2image"; -import { useUserStore, extractUsernameFromName, useMemoStore } from "@/store/v1"; +import { useUserStore, useMemoStore, MemoNamePrefix } from "@/store/v1"; import { Visibility } from "@/types/proto/api/v2/memo_service"; import { useTranslate } from "@/utils/i18n"; import { convertVisibilityToString } from "@/utils/memo"; @@ -26,19 +26,19 @@ interface Props extends DialogProps { const ShareMemoDialog: React.FC = (props: Props) => { const { memoId, destroy } = props; const t = useTranslate(); + const currentUser = useCurrentUser(); const userStore = useUserStore(); + const memoStore = useMemoStore(); const downloadingImageState = useLoading(false); const loadingState = useLoading(); - const memoElRef = useRef(null); - const memoStore = useMemoStore(); - const memo = memoStore.getMemoById(memoId); - const user = userStore.getUserByUsername(extractUsernameFromName(memo.creator)); - const currentUser = useCurrentUser(); - const readonly = memo?.creatorId !== currentUser?.id; + const memoContainerRef = useRef(null); + const memo = memoStore.getMemoByName(`${MemoNamePrefix}${memoId}`); + const user = userStore.getUserByName(memo.creator); + const readonly = memo?.creator !== currentUser?.name; useEffect(() => { (async () => { - await userStore.getOrFetchUserByUsername(extractUsernameFromName(memo.creator)); + await userStore.getOrFetchUserByName(memo.creator); loadingState.setFinish(); })(); }, []); @@ -48,12 +48,12 @@ const ShareMemoDialog: React.FC = (props: Props) => { }; const handleDownloadImageBtnClick = () => { - if (!memoElRef.current) { + if (!memoContainerRef.current) { return; } downloadingImageState.setLoading(); - toImage(memoElRef.current, { + toImage(memoContainerRef.current, { pixelRatio: window.devicePixelRatio * 2, }) .then((url) => { @@ -74,7 +74,7 @@ const ShareMemoDialog: React.FC = (props: Props) => { }; const handleCopyLinkBtnClick = () => { - copy(`${window.location.origin}/m/${memo.name}`); + copy(`${window.location.origin}/m/${memo.uid}`); if (memo.visibility !== Visibility.PUBLIC) { toast.success(t("message.succeed-copy-link-not-public")); } else { @@ -85,7 +85,7 @@ const ShareMemoDialog: React.FC = (props: Props) => { const handleMemoVisibilityOptionChanged = async (visibility: Visibility) => { const updatedMemo = await memoStore.updateMemo( { - id: memo.id, + name: memo.name, visibility: visibility, }, ["visibility"], @@ -151,11 +151,11 @@ const ShareMemoDialog: React.FC = (props: Props) => {
{getDateTimeString(memo.displayTime)} -
- +
+
diff --git a/web/src/components/TimelineSidebar.tsx b/web/src/components/TimelineSidebar/TimelineSidebar.tsx similarity index 78% rename from web/src/components/TimelineSidebar.tsx rename to web/src/components/TimelineSidebar/TimelineSidebar.tsx index 483e12d6bc9ea..bd670d8e02847 100644 --- a/web/src/components/TimelineSidebar.tsx +++ b/web/src/components/TimelineSidebar/TimelineSidebar.tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; -import SearchBar from "./SearchBar"; -import TagList from "./TagList"; +import TagsSection from "../HomeSidebar/TagsSection"; +import SearchBar from "../SearchBar"; interface Props { className?: string; @@ -15,7 +15,7 @@ const TimelineSidebar = (props: Props) => { )} > - + ); }; diff --git a/web/src/components/TimelineSidebarDrawer.tsx b/web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx similarity index 97% rename from web/src/components/TimelineSidebarDrawer.tsx rename to web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx index a281f99ffee9d..175c102ac67df 100644 --- a/web/src/components/TimelineSidebarDrawer.tsx +++ b/web/src/components/TimelineSidebar/TimelineSidebarDrawer.tsx @@ -1,7 +1,7 @@ import { Drawer, IconButton } from "@mui/joy"; import { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; -import Icon from "./Icon"; +import Icon from "../Icon"; import TimelineSidebar from "./TimelineSidebar"; const TimelineSidebarDrawer = () => { diff --git a/web/src/components/TimelineSidebar/index.ts b/web/src/components/TimelineSidebar/index.ts new file mode 100644 index 0000000000000..b5dbfcf585101 --- /dev/null +++ b/web/src/components/TimelineSidebar/index.ts @@ -0,0 +1,4 @@ +import TimelineSidebar from "./TimelineSidebar"; +import TimelineSidebarDrawer from "./TimelineSidebarDrawer"; + +export { TimelineSidebar, TimelineSidebarDrawer }; diff --git a/web/src/components/UpdateAccountDialog.tsx b/web/src/components/UpdateAccountDialog.tsx index 5101fbc5b0aea..07e14bb3265d2 100644 --- a/web/src/components/UpdateAccountDialog.tsx +++ b/web/src/components/UpdateAccountDialog.tsx @@ -1,4 +1,4 @@ -import { Button, IconButton, Input } from "@mui/joy"; +import { Button, IconButton, Input, Textarea } from "@mui/joy"; import { isEqual } from "lodash-es"; import { useState } from "react"; import { toast } from "react-hot-toast"; @@ -18,6 +18,7 @@ interface State { username: string; nickname: string; email: string; + description: string; } const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { @@ -26,9 +27,10 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { const userStore = useUserStore(); const [state, setState] = useState({ avatarUrl: currentUser.avatarUrl, - username: currentUser.name.replace(UserNamePrefix, ""), + username: currentUser.username, nickname: currentUser.nickname, email: currentUser.email, + description: currentUser.description, }); const handleCloseBtnClick = () => { @@ -85,6 +87,15 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { }); }; + const handleDescriptionChanged = (e: React.ChangeEvent) => { + setState((state) => { + return { + ...state, + description: e.target.value as string, + }; + }); + }; + const handleSaveBtnClick = async () => { if (state.username === "") { toast.error(t("message.fill-all")); @@ -105,6 +116,9 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { if (!isEqual(currentUser.avatarUrl, state.avatarUrl)) { updateMask.push("avatar_url"); } + if (!isEqual(currentUser.description, state.description)) { + updateMask.push("description"); + } await userStore.updateUser( UserPb.fromPartial({ name: currentUser.name, @@ -112,6 +126,7 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { nickname: state.nickname, email: state.email, avatarUrl: state.avatarUrl, + description: state.description, }), updateMask, ); @@ -164,6 +179,15 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { ({t("setting.account-section.email-note")})

+

{t("common.description")}

+