From a9ab2ce0d7439cd1d4a929fc69df2239f53847f9 Mon Sep 17 00:00:00 2001 From: Zero Date: Sun, 15 Oct 2023 02:07:15 +0800 Subject: [PATCH 001/650] feat: add connect --- api/v1/auth.go | 6 +-- go.mod | 13 ++++++ go.sum | 69 +++++++++++++++++++++++++++---- server/server.go | 77 +++++++++++++++++++++++++++++++++++ web/src/components/Header.tsx | 16 ++++---- web/src/layouts/Root.tsx | 4 +- 6 files changed, 165 insertions(+), 20 deletions(-) diff --git a/api/v1/auth.go b/api/v1/auth.go index 521026056671b..918882cb94da2 100644 --- a/api/v1/auth.go +++ b/api/v1/auth.go @@ -111,7 +111,7 @@ func (s *APIV1Service) SignIn(c echo.Context) error { if err := s.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err) } - if err := s.createAuthSignInActivity(c, user); err != nil { + if err := s.CreateAuthSignInActivity(c, user); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err) } cookieExp := time.Now().Add(auth.CookieExpDuration) @@ -235,7 +235,7 @@ func (s *APIV1Service) SignInSSO(c echo.Context) error { if err := s.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err) } - if err := s.createAuthSignInActivity(c, user); err != nil { + if err := s.CreateAuthSignInActivity(c, user); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err) } cookieExp := time.Now().Add(auth.CookieExpDuration) @@ -393,7 +393,7 @@ func (s *APIV1Service) UpsertAccessTokenToStore(ctx context.Context, user *store return nil } -func (s *APIV1Service) createAuthSignInActivity(c echo.Context, user *store.User) error { +func (s *APIV1Service) CreateAuthSignInActivity(c echo.Context, user *store.User) error { ctx := c.Request().Context() payload := ActivityUserAuthSignInPayload{ UserID: user.ID, diff --git a/go.mod b/go.mod index e78657c6f11ca..e8cde97f053de 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,9 @@ require ( github.com/aws/aws-sdk-go-v2/service/s3 v1.40.1 github.com/disintegration/imaging v1.6.2 github.com/go-sql-driver/mysql v1.7.1 + github.com/go-zoox/connect-middleware-for-echo v1.0.0 + github.com/go-zoox/logger v1.4.6 + github.com/go-zoox/random v1.0.4 github.com/google/cel-go v0.18.1 github.com/google/uuid v1.3.1 github.com/gorilla/feeds v1.1.1 @@ -39,18 +42,27 @@ 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/bytedance/sonic v1.10.2 // 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/ghodss/yaml v1.0.0 // indirect + github.com/gin-gonic/gin v1.9.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-zoox/chalk v1.0.2 // indirect + github.com/go-zoox/connect v1.12.0 // indirect + github.com/go-zoox/core-utils v1.2.14 // indirect + github.com/go-zoox/crypto v1.1.8 // indirect + github.com/go-zoox/datetime v1.2.2 // indirect + github.com/go-zoox/jwt v1.3.0 // indirect github.com/gorilla/css v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/klauspost/compress v1.17.0 // indirect + github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rs/cors v1.10.1 // indirect @@ -59,6 +71,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/swaggo/files/v2 v2.0.0 // indirect + golang.org/x/arch v0.5.0 // indirect golang.org/x/image v0.13.0 // indirect golang.org/x/tools v0.14.0 // indirect google.golang.org/genproto v0.0.0-20231009173412-8bfb1ae86b6c // indirect diff --git a/go.sum b/go.sum index a9413987d9e11..f87a7cfc8ee93 100644 --- a/go.sum +++ b/go.sum @@ -105,6 +105,10 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 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= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= +github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE= +github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -112,6 +116,12 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= +github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= +github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= +github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -160,12 +170,15 @@ github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -191,22 +204,47 @@ github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ 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-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= -github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= -github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= +github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-zoox/chalk v1.0.2 h1:DCWft37fogmvqF37JdbGSLg28L/tQeA8u0lMvb62KOg= +github.com/go-zoox/chalk v1.0.2/go.mod h1:z5+qvE9nEJI5uT4px2tyoFa/xxkqf3CUo22KmXLKbNI= +github.com/go-zoox/connect v1.12.0 h1:OENU6U8Wm520jMHZhKCzE7nh7onhtgVpxfgg7QLApp4= +github.com/go-zoox/connect v1.12.0/go.mod h1:l3eAEMPki4UcaNUy/gMvoXijP38GAtkL8j78rUAQeSk= +github.com/go-zoox/connect-middleware-for-echo v1.0.0 h1:HvmjDcHCK7HK/Uo662cZqV2BEwu3i6+gBku0w/jDp3s= +github.com/go-zoox/connect-middleware-for-echo v1.0.0/go.mod h1:AKaSiwACHD9tTGbLXgRHuSNQBWmNwjmApGuQqVe2U38= +github.com/go-zoox/core-utils v1.2.14 h1:Z6x9QTgfBfhbSOOPEDLqLs9UGBWkXgBpVPlJ4pI68yk= +github.com/go-zoox/core-utils v1.2.14/go.mod h1:raOOwr2l2sJQyjR0Dg33sg0ry4U1/L2eNTuLFRpUXWs= +github.com/go-zoox/crypto v1.1.8 h1:oI2KPLy+SsGeb+h5A99n9MTQVp4jBhwJWkqjStUzz9I= +github.com/go-zoox/crypto v1.1.8/go.mod h1:JqgNr9HcFFGQkMCGLJ9djtfg/RWVLxtunG01HD3lUXM= +github.com/go-zoox/datetime v1.2.2 h1:JrI4ekdsvpsenGzrNQAOmobBTYyotaXD3YDXngvCbM4= +github.com/go-zoox/datetime v1.2.2/go.mod h1:qvaCrzjhq/g/gstx4sx06Nl4ll2pLSrkRa9ueLjrZ9A= +github.com/go-zoox/jwt v1.3.0 h1:beyPOdiiNrNK8dqFijt5kdtaeh1dZKtM7/kaCMGbV0U= +github.com/go-zoox/jwt v1.3.0/go.mod h1:Cfc+t0XhNCgDjXLR5sK6ao7qz1GSIq896gZ1usNb7t8= +github.com/go-zoox/logger v1.4.6 h1:zHUaB6KQ9rD/N3hM0JJ3/JCNdgtedf4mVBBNNSyWCOg= +github.com/go-zoox/logger v1.4.6/go.mod h1:o7ddvv/gMoMa0TomPhHoIz11ZWRbQ92pF6rwYbOY3iQ= +github.com/go-zoox/random v1.0.4 h1:icckpkCowQ0eGiiMkHFOJz9Qc9noOcinP+ggqWUIBH4= +github.com/go-zoox/random v1.0.4/go.mod h1:W+PTQiInxaCngiXpSvycucAKvu1tE/tKlZ9kaMp2/Ys= +github.com/go-zoox/testify v1.0.2 h1:G5sQ3xm0uwCuytnMhgnqZ5BItCt2DN3n2wLBqlIJEWA= +github.com/go-zoox/testify v1.0.2/go.mod h1:L35iVL6xDKDL/TQOTRWyNL4H4nm8bzs6nde5XA7PYnY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee h1:s+21KNqlpePfkah2I+gwHF8xmJWRjooY+5248k6m4A0= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -298,8 +336,9 @@ github.com/gorilla/feeds v1.1.1/go.mod h1:Nk0jZrvPFZX1OBe5NPiddPw7CfwF6Q9eqzaBba github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= +github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -367,6 +406,10 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM= github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg= +github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= +github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -383,8 +426,9 @@ github.com/labstack/echo/v4 v4.11.2 h1:T+cTLQxWCDfqDEoydYm5kCobjmHwOwcv4OJAPHilm github.com/labstack/echo/v4 v4.11.2/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrPqiEBfPYws= github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= -github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -567,10 +611,15 @@ github.com/swaggo/files/v2 v2.0.0/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0J github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 h1:OXcKh35JaYsGMRzpvFkLv/MEyPuL49CThT1pZ8aSml4= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= @@ -610,6 +659,9 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y= +golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -793,6 +845,7 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1057,7 +1110,9 @@ modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= +nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/server/server.go b/server/server.go index 326c27708ba04..2071ab50ed0bf 100644 --- a/server/server.go +++ b/server/server.go @@ -6,9 +6,11 @@ import ( "fmt" "net" "net/http" + "os" "strings" "time" + "github.com/go-zoox/logger" "github.com/google/uuid" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" @@ -16,6 +18,9 @@ import ( echoSwagger "github.com/swaggo/echo-swagger" "go.uber.org/zap" + "github.com/go-zoox/connect-middleware-for-echo" + "github.com/go-zoox/random" + "github.com/usememos/memos/api/auth" apiv1 "github.com/usememos/memos/api/v1" apiv2 "github.com/usememos/memos/api/v2" "github.com/usememos/memos/common/log" @@ -24,6 +29,7 @@ import ( "github.com/usememos/memos/server/profile" "github.com/usememos/memos/server/service" "github.com/usememos/memos/store" + storeX "github.com/usememos/memos/store" ) type Server struct { @@ -35,6 +41,7 @@ type Server struct { Store *store.Store // API services. + apiV1Service *apiv1.APIV1Service apiV2Service *apiv2.APIV2Service // Asynchronous runners. @@ -77,6 +84,74 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store Timeout: 30 * time.Second, })) + // ######## CONNECT START + e.Use(connect.Create(os.Getenv("SECRET_KEY"))) + e.Use(func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + if connectUser, err := connect.GetUser(c); err == nil { + ctx := c.Request().Context() + user, err := s.Store.GetUser(ctx, &storeX.FindUser{ + Email: &connectUser.Email, + }) + if user == nil || err != nil { + role := storeX.RoleUser + // if connectUser.Role == "ADMIN" { + // role = storeX.RoleHost + // } + if os.Getenv("ADMIN_EMAIL") == connectUser.Email { + role = storeX.RoleHost + } + + user, err = s.Store.CreateUser(ctx, &storeX.User{ + Nickname: connectUser.Nickname, + AvatarURL: connectUser.Avatar, + Email: connectUser.Email, + Username: connectUser.Email, + Role: role, + PasswordHash: random.String(32), + }) + + logger.Infof("[connect] create user: %s(email: %s)", connectUser.Nickname, connectUser.Email) + } + + logger.Infof("[connect] login user: %s(email: %s)", connectUser.Nickname, connectUser.Email) + accessToken, err := auth.GenerateAccessToken(user.Username, user.ID, time.Now().Add(auth.AccessTokenDuration), []byte(s.Secret)) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to generate tokens, err: %s", err)).SetInternal(err) + } + + if err := s.apiV1Service.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err) + } + if err := s.apiV1Service.CreateAuthSignInActivity(c, user); err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err) + } + cookieExp := time.Now().Add(auth.CookieExpDuration) + + // setTokenCookie sets the token to the cookie. + setTokenCookie := func(name, token string, expiration time.Time) { + cookie := new(http.Cookie) + cookie.Name = name + cookie.Value = token + cookie.Expires = expiration + cookie.Path = "/" + // Http-only helps mitigate the risk of client side script accessing the protected cookie. + cookie.HttpOnly = true + cookie.SameSite = http.SameSiteStrictMode + c.SetCookie(cookie) + } + + setTokenCookie(auth.AccessTokenCookieName, accessToken, cookieExp) + + // @TODO api.userIDContextKey not exported. + // c.Set("user-id", user.ID) + } + + return next(c) + } + }) + // ######## CONNECT END + serverID, err := s.getSystemServerID(ctx) if err != nil { return nil, errors.Wrap(err, "failed to retrieve system server ID") @@ -104,6 +179,8 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store apiV1Service := apiv1.NewAPIV1Service(s.Secret, profile, store, s.telegramBot) apiV1Service.Register(rootGroup) + s.apiV1Service = apiV1Service + s.apiV2Service = apiv2.NewAPIV2Service(s.Secret, profile, store, s.Profile.Port+1) // Register gRPC gateway as api v2. if err := s.apiV2Service.RegisterGateway(ctx, e); err != nil { diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index c71a4fe285ca6..ee5ff6af88454 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -70,16 +70,16 @@ const Header = () => { title: t("common.settings"), icon: , }; - const signInNavLink: NavLinkItem = { - id: "header-auth", - path: "/auth", - title: t("common.sign-in"), - icon: , - }; + // const signInNavLink: NavLinkItem = { + // id: "header-auth", + // path: "/auth", + // title: t("common.sign-in"), + // icon: , + // }; const navLinks: NavLinkItem[] = user ? [homeNavLink, dailyReviewNavLink, resourcesNavLink, exploreNavLink, archivedNavLink, settingNavLink] - : [exploreNavLink, signInNavLink]; + : [exploreNavLink/*, signInNavLink */]; return (
{ showHeader && "translate-x-0 shadow-2xl" }`} > - + {/* */}
{navLinks.map((navLink) => (
- + {/* */}
From 40ef26f2376ad212af2596de57715327220d3e50 Mon Sep 17 00:00:00 2001 From: Zero Date: Sun, 15 Oct 2023 02:16:46 +0800 Subject: [PATCH 002/650] ci: add ci and version --- .github/workflows/backend-tests.yml | 44 ---------- .../build-and-push-release-image.yml | 69 ---------------- .../workflows/build-and-push-test-image.yml | 60 -------------- .github/workflows/docker.yml | 80 +++++++++++++++++++ .github/workflows/frontend-tests.yml | 52 ------------ .github/workflows/issue-translator.yml | 18 ----- .github/workflows/proto-linter.yml | 32 -------- Dockerfile | 4 +- version.go | 4 + 9 files changed, 86 insertions(+), 277 deletions(-) delete mode 100644 .github/workflows/backend-tests.yml delete mode 100644 .github/workflows/build-and-push-release-image.yml delete mode 100644 .github/workflows/build-and-push-test-image.yml create mode 100644 .github/workflows/docker.yml delete mode 100644 .github/workflows/frontend-tests.yml delete mode 100644 .github/workflows/issue-translator.yml delete mode 100644 .github/workflows/proto-linter.yml create mode 100644 version.go diff --git a/.github/workflows/backend-tests.yml b/.github/workflows/backend-tests.yml deleted file mode 100644 index 658aa9d706c6d..0000000000000 --- a/.github/workflows/backend-tests.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Backend Test - -on: - push: - branches: [main] - pull_request: - branches: - - main - - "release/*.*.*" - -jobs: - go-static-checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 - with: - go-version: 1.21 - check-latest: true - cache: true - - name: Verify go.mod is tidy - run: | - go mod tidy -go=1.21 - git diff --exit-code - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.54.1 - args: --verbose --timeout=3m - skip-cache: true - - go-tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 - with: - go-version: 1.21 - check-latest: true - cache: true - - name: Run all tests - run: go test -v ./... | tee test.log; exit ${PIPESTATUS[0]} - - name: Pretty print tests running time - run: grep --color=never -e '--- PASS:' -e '--- FAIL:' test.log | sed 's/[:()]//g' | awk '{print $2,$3,$4}' | sort -t' ' -nk3 -r | awk '{sum += $3; print $1,$2,$3,sum"s"}' diff --git a/.github/workflows/build-and-push-release-image.yml b/.github/workflows/build-and-push-release-image.yml deleted file mode 100644 index a8d0c675b58ee..0000000000000 --- a/.github/workflows/build-and-push-release-image.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: build-and-push-release-image - -on: - push: - branches: - # Run on pushing branches like `release/1.0.0` - - "release/*.*.*" - -jobs: - build-and-push-release-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Extract build args - # Extract version from branch name - # Example: branch name `release/1.0.0` sets up env.VERSION=1.0.0 - run: | - echo "VERSION=${GITHUB_REF_NAME#release/}" >> $GITHUB_ENV - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: neosmemo - password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - install: true - version: v0.9.1 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - neosmemo/memos - ghcr.io/usememos/memos - tags: | - type=raw,value=latest - type=semver,pattern={{version}},value=${{ env.VERSION }} - type=semver,pattern={{major}}.{{minor}},value=${{ env.VERSION }} - type=semver,pattern={{major}},value=${{ env.VERSION }} - - - name: Build and Push - id: docker_build - uses: docker/build-push-action@v3 - with: - context: ./ - file: ./Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/build-and-push-test-image.yml b/.github/workflows/build-and-push-test-image.yml deleted file mode 100644 index 23c0e9e106de1..0000000000000 --- a/.github/workflows/build-and-push-test-image.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: build-and-push-test-image - -on: - push: - branches: [main] - -jobs: - build-and-push-test-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Login to Docker Hub - uses: docker/login-action@v2 - with: - username: neosmemo - password: ${{ secrets.DOCKER_NEOSMEMO_TOKEN }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ github.token }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v2 - with: - install: true - version: v0.9.1 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - images: | - neosmemo/memos - ghcr.io/usememos/memos - flavor: | - latest=false - tags: | - type=raw,value=test - - - name: Build and Push - id: docker_build - uses: docker/build-push-action@v3 - with: - context: ./ - file: ./Dockerfile - platforms: linux/amd64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000000000..5d4267891c272 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,80 @@ +name: Release Docker Image + +on: + push: + tags: + - 'v*' + +jobs: + on-success: + needs: publish + runs-on: ubuntu-latest + container: whatwewant/zmicro:v1 + if: ${{ always() && needs.publish.result == 'success' }} + steps: + - name: Notification Feishu + uses: whatwewant/action-robot-feishu@v0.0.13 + with: + url: ${{ secrets.DOCKER_VERSION_FEISHU_BOT_WEBHOOK_URL }} + title: '✅ Docker 发布:${{ github.repository }}' + text: | + 分支: ${{ github.ref }} + 提交信息: ${{ github.event.head_commit.message }} + 提交人: ${{ github.actor }} + 状态: 构建成功(https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + on-failure: + needs: publish + runs-on: ubuntu-latest + container: whatwewant/zmicro:v1 + if: ${{ always() && needs.publish.result == 'failure' }} + steps: + - name: Notification Feishu + uses: whatwewant/action-robot-feishu@v0.0.13 + with: + url: ${{ secrets.DOCKER_VERSION_FEISHU_BOT_WEBHOOK_URL }} + title: '❌ Docker 发布:${{ github.repository }}' + text: | + 分支: ${{ github.ref }} + 提交信息: ${{ github.event.head_commit.message }} + 提交人: ${{ github.actor }} + 状态: 构建失败(https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}) + + publish: + runs-on: ubuntu-latest + container: whatwewant/zmicro:v1 + + steps: + - name: Get Current Date + id: date + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" + + - uses: actions/checkout@v2 + with: + fetch-depth: '0' + + - name: Docker Meta + id: meta + uses: zmicro-design/action-docker-image-meta@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + + - name: Show Docker Tags + run: | + echo "Docker Tags: ${{ steps.meta.outputs.tags }}" + + - name: Build and push + uses: zmicro-design/action-docker-build@v1 + with: + build-args: | + VERSION=${{ steps.meta.outputs.version }} + context: . + push: ${{ github.event_name != 'pull_request' }} + cache-from: type=registry,ref=${{ steps.meta.outputs.name }}:buildcache + cache-to: type=registry,ref=${{ steps.meta.outputs.name }}:buildcache,mode=max + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64 + # + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/frontend-tests.yml b/.github/workflows/frontend-tests.yml deleted file mode 100644 index 3b42dd860980e..0000000000000 --- a/.github/workflows/frontend-tests.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Frontend Test - -on: - push: - branches: [main] - pull_request: - branches: - - main - - "release/*.*.*" - paths: - - "web/**" - -jobs: - eslint-checks: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2.2.4 - with: - version: 8 - - uses: actions/setup-node@v3 - with: - node-version: "18" - cache: pnpm - cache-dependency-path: "web/pnpm-lock.yaml" - - run: pnpm install - working-directory: web - - run: pnpm type-gen - working-directory: web - - name: Run eslint check - run: pnpm lint - working-directory: web - - frontend-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: pnpm/action-setup@v2.2.4 - with: - version: 8 - - uses: actions/setup-node@v3 - with: - node-version: "18" - cache: pnpm - cache-dependency-path: "web/pnpm-lock.yaml" - - run: pnpm install - working-directory: web - - run: pnpm type-gen - working-directory: web - - name: Run frontend build - run: pnpm build - working-directory: web diff --git a/.github/workflows/issue-translator.yml b/.github/workflows/issue-translator.yml deleted file mode 100644 index f458c5268b7a5..0000000000000 --- a/.github/workflows/issue-translator.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: 'issue-translator' -on: - issue_comment: - types: [created] - issues: - types: [opened] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: usthe/issues-translate-action@v2.7 - with: - IS_MODIFY_TITLE: false - # not require, default false, . Decide whether to modify the issue title - # if true, the robot account @Issues-translate-bot must have modification permissions, invite @Issues-translate-bot to your project or use your custom bot. - CUSTOM_BOT_NOTE: Issue is not in English. It has been translated automatically. - # not require. Customize the translation robot prefix message. diff --git a/.github/workflows/proto-linter.yml b/.github/workflows/proto-linter.yml deleted file mode 100644 index 8f3d0d36d4e7d..0000000000000 --- a/.github/workflows/proto-linter.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Proto linter - -on: - push: - branches: [main] - pull_request: - branches: - - main - - "release/*.*.*" - paths: - - "proto/**" - -jobs: - lint-protos: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Setup buf - uses: bufbuild/buf-setup-action@v1 - - name: buf lint - uses: bufbuild/buf-lint-action@v1 - with: - input: "proto" - - name: buf format - run: | - if [[ $(buf format -d) ]]; then - echo "Run 'buf format -w'" - exit 1 - fi diff --git a/Dockerfile b/Dockerfile index 8286ca0f67d30..6627a42eac0ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build frontend dist. -FROM node:18-alpine AS frontend +FROM whatwewant/node:v18-1 AS frontend WORKDIR /frontend-build COPY . . @@ -20,7 +20,7 @@ COPY --from=frontend /frontend-build/web/dist ./server/dist RUN CGO_ENABLED=0 go build -o memos ./main.go # Make workspace with above generated files. -FROM alpine:latest AS monolithic +FROM whatwewant/alpine:v3.17-1 AS monolithic WORKDIR /usr/local/memos RUN apk add --no-cache tzdata diff --git a/version.go b/version.go new file mode 100644 index 0000000000000..10bea9db84908 --- /dev/null +++ b/version.go @@ -0,0 +1,4 @@ +package main + +// Version is the version of ingress +var Version = "0.16-0.0.0" From 3860f5b1770902129fed913a6d1f12bc563d5090 Mon Sep 17 00:00:00 2001 From: Zero Date: Sun, 15 Oct 2023 02:20:33 +0800 Subject: [PATCH 003/650] fix: ci --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6627a42eac0ec..0a5e3d34cc624 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build frontend dist. -FROM whatwewant/node:v18-1 AS frontend +FROM whatwewant/builder-node:v18-1 AS frontend WORKDIR /frontend-build COPY . . From d6fc0be4c3d8700202c6d54d98a545c4324c43e0 Mon Sep 17 00:00:00 2001 From: Zero Date: Sun, 15 Oct 2023 03:03:24 +0800 Subject: [PATCH 004/650] chore: host user can be update on connect --- server/dist/index.html | 21 +++++++++++++++++---- server/server.go | 6 ++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/server/dist/index.html b/server/dist/index.html index 041977322e520..729b52b913c67 100644 --- a/server/dist/index.html +++ b/server/dist/index.html @@ -1,13 +1,26 @@ - - - + + + + + Memos + + -

No frontend embeded.

+
+ + diff --git a/server/server.go b/server/server.go index 2071ab50ed0bf..f52133440e7d3 100644 --- a/server/server.go +++ b/server/server.go @@ -112,6 +112,12 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store }) logger.Infof("[connect] create user: %s(email: %s)", connectUser.Nickname, connectUser.Email) + } else if user.Role != storeX.RoleHost && os.Getenv("ADMIN_EMAIL") == connectUser.Email { + user.Role = storeX.RoleHost + user, err = s.Store.UpdateUser(ctx, &storeX.UpdateUser{ + ID: user.ID, + Role: &user.Role, + }) } logger.Infof("[connect] login user: %s(email: %s)", connectUser.Nickname, connectUser.Email) From 4b015e92530411d159330551e30761d13706f52f Mon Sep 17 00:00:00 2001 From: Zero Date: Sun, 15 Oct 2023 03:09:34 +0800 Subject: [PATCH 005/650] fix: user banner --- web/src/components/Header.tsx | 2 +- web/src/components/UserBanner.tsx | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index ee5ff6af88454..b7fcb5d2cc860 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -98,7 +98,7 @@ const Header = () => { showHeader && "translate-x-0 shadow-2xl" }`} > - {/* */} +
{navLinks.map((navLink) => ( { return (
- @@ -80,7 +80,14 @@ const UserBanner = () => { )} } - /> + /> */} +
+ + {title} + {user?.role === User_Role.HOST ? ( + MOD + ) : null} +
); }; From 17e3e7c817e7fa54578d99ddf6c823373fec66cb Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 31 Oct 2023 12:52:28 +0800 Subject: [PATCH 006/650] chore(release): bumped version to v0.17-1.0.2 --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index 10bea9db84908..aa2a23e780d45 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package main // Version is the version of ingress -var Version = "0.16-0.0.0" +var Version = "0.17-1.0.2" From 087face0854cd9caccf27adfb6c25259f87b3190 Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 31 Oct 2023 13:33:06 +0800 Subject: [PATCH 007/650] chore: go mod tidy --- go.mod | 5 ----- go.sum | 48 ++++++++++++++++++++++-------------------------- 2 files changed, 22 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index 2949bc660383a..62a1ec3ce6aac 100644 --- a/go.mod +++ b/go.mod @@ -42,12 +42,10 @@ 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/bytedance/sonic v1.10.2 // 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/ghodss/yaml v1.0.0 // indirect - github.com/gin-gonic/gin v1.9.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 @@ -61,8 +59,6 @@ require ( github.com/gorilla/css v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/klauspost/compress v1.17.0 // indirect - github.com/klauspost/cpuid/v2 v2.2.5 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rs/cors v1.10.1 // indirect @@ -71,7 +67,6 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect github.com/swaggo/files/v2 v2.0.0 // indirect - golang.org/x/arch v0.5.0 // indirect golang.org/x/image v0.13.0 // indirect golang.org/x/tools v0.14.0 // indirect google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect diff --git a/go.sum b/go.sum index e8df2df8c431c..f049036267918 100644 --- a/go.sum +++ b/go.sum @@ -105,10 +105,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 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= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= -github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM= -github.com/bytedance/sonic v1.10.2 h1:GQebETVBxYB7JGWJtLBi07OVzWwt+8dWA00gEVW2ZFE= -github.com/bytedance/sonic v1.10.2/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -116,12 +112,6 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= -github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0= -github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA= -github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo= -github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -174,8 +164,6 @@ github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= -github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -204,17 +192,33 @@ github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvSc 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= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.15.5 h1:LEBecTWb/1j5TNY1YYG2RcOUN3R7NLylN+x8TTueE24= -github.com/go-playground/validator/v10 v10.15.5/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-zoox/chalk v1.0.2 h1:DCWft37fogmvqF37JdbGSLg28L/tQeA8u0lMvb62KOg= +github.com/go-zoox/chalk v1.0.2/go.mod h1:z5+qvE9nEJI5uT4px2tyoFa/xxkqf3CUo22KmXLKbNI= +github.com/go-zoox/connect v1.12.0 h1:OENU6U8Wm520jMHZhKCzE7nh7onhtgVpxfgg7QLApp4= +github.com/go-zoox/connect v1.12.0/go.mod h1:l3eAEMPki4UcaNUy/gMvoXijP38GAtkL8j78rUAQeSk= +github.com/go-zoox/connect-middleware-for-echo v1.0.0 h1:HvmjDcHCK7HK/Uo662cZqV2BEwu3i6+gBku0w/jDp3s= +github.com/go-zoox/connect-middleware-for-echo v1.0.0/go.mod h1:AKaSiwACHD9tTGbLXgRHuSNQBWmNwjmApGuQqVe2U38= +github.com/go-zoox/core-utils v1.2.14 h1:Z6x9QTgfBfhbSOOPEDLqLs9UGBWkXgBpVPlJ4pI68yk= +github.com/go-zoox/core-utils v1.2.14/go.mod h1:raOOwr2l2sJQyjR0Dg33sg0ry4U1/L2eNTuLFRpUXWs= +github.com/go-zoox/crypto v1.1.8 h1:oI2KPLy+SsGeb+h5A99n9MTQVp4jBhwJWkqjStUzz9I= +github.com/go-zoox/crypto v1.1.8/go.mod h1:JqgNr9HcFFGQkMCGLJ9djtfg/RWVLxtunG01HD3lUXM= +github.com/go-zoox/datetime v1.2.2 h1:JrI4ekdsvpsenGzrNQAOmobBTYyotaXD3YDXngvCbM4= +github.com/go-zoox/datetime v1.2.2/go.mod h1:qvaCrzjhq/g/gstx4sx06Nl4ll2pLSrkRa9ueLjrZ9A= +github.com/go-zoox/jwt v1.3.0 h1:beyPOdiiNrNK8dqFijt5kdtaeh1dZKtM7/kaCMGbV0U= +github.com/go-zoox/jwt v1.3.0/go.mod h1:Cfc+t0XhNCgDjXLR5sK6ao7qz1GSIq896gZ1usNb7t8= +github.com/go-zoox/logger v1.4.6 h1:zHUaB6KQ9rD/N3hM0JJ3/JCNdgtedf4mVBBNNSyWCOg= +github.com/go-zoox/logger v1.4.6/go.mod h1:o7ddvv/gMoMa0TomPhHoIz11ZWRbQ92pF6rwYbOY3iQ= +github.com/go-zoox/random v1.0.4 h1:icckpkCowQ0eGiiMkHFOJz9Qc9noOcinP+ggqWUIBH4= +github.com/go-zoox/random v1.0.4/go.mod h1:W+PTQiInxaCngiXpSvycucAKvu1tE/tKlZ9kaMp2/Ys= +github.com/go-zoox/testify v1.0.2 h1:G5sQ3xm0uwCuytnMhgnqZ5BItCt2DN3n2wLBqlIJEWA= +github.com/go-zoox/testify v1.0.2/go.mod h1:L35iVL6xDKDL/TQOTRWyNL4H4nm8bzs6nde5XA7PYnY= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -308,8 +312,6 @@ github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2z github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de4/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= @@ -390,8 +392,6 @@ github.com/labstack/echo/v4 v4.11.2/go.mod h1:UcGuQ8V6ZNRmSweBIJkPvGfwCMIlFmiqrP github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8= github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= -github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= @@ -573,10 +573,10 @@ github.com/swaggo/files/v2 v2.0.0/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0J github.com/swaggo/swag v1.16.2 h1:28Pp+8DkQoV+HLzLx8RGJZXNGKbFqnuvSbAAtoxiY04= github.com/swaggo/swag v1.16.2/go.mod h1:6YzXnDcpr0767iOejs318CwYkCQqyGer6BizOg03f+E= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 h1:OXcKh35JaYsGMRzpvFkLv/MEyPuL49CThT1pZ8aSml4= +github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= -github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= @@ -617,9 +617,6 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= go.uber.org/zap v1.26.0/go.mod h1:dtElttAiwGvoJ/vj4IwHBS/gXsEu/pZ50mUIRWuG0so= -golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= -golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y= -golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -1067,7 +1064,6 @@ nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0 nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= From 8d263c853f42ed9619925bde11b5b0d5842ccadf Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 31 Oct 2023 13:33:20 +0800 Subject: [PATCH 008/650] chore(release): bumped version to v0.17-1.0.3 --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index aa2a23e780d45..b11b406c1ae7a 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package main // Version is the version of ingress -var Version = "0.17-1.0.2" +var Version = "0.17-1.0.3" From 1c0774361c91a92e048094fb04183336cd95b466 Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 31 Oct 2023 14:00:54 +0800 Subject: [PATCH 009/650] fix: remove fired codes --- api/v1/auth.go | 50 ------------------------------------------------ server/server.go | 3 --- 2 files changed, 53 deletions(-) diff --git a/api/v1/auth.go b/api/v1/auth.go index 9699251be6496..ae15300b2b0a6 100644 --- a/api/v1/auth.go +++ b/api/v1/auth.go @@ -117,9 +117,6 @@ func (s *APIV1Service) SignIn(c echo.Context) error { if err := s.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err) } - if err := s.CreateAuthSignInActivity(c, user); err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err) - } cookieExp := time.Now().Add(auth.CookieExpDuration) setTokenCookie(c, auth.AccessTokenCookieName, accessToken, cookieExp) userMessage := convertUserFromStore(user) @@ -241,9 +238,6 @@ func (s *APIV1Service) SignInSSO(c echo.Context) error { if err := s.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err) } - if err := s.CreateAuthSignInActivity(c, user); err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err) - } cookieExp := time.Now().Add(auth.CookieExpDuration) setTokenCookie(c, auth.AccessTokenCookieName, accessToken, cookieExp) userMessage := convertUserFromStore(user) @@ -396,50 +390,6 @@ func (s *APIV1Service) UpsertAccessTokenToStore(ctx context.Context, user *store return nil } -func (s *APIV1Service) CreateAuthSignInActivity(c echo.Context, user *store.User) error { - ctx := c.Request().Context() - payload := ActivityUserAuthSignInPayload{ - UserID: user.ID, - IP: echo.ExtractIPFromRealIPHeader()(c.Request()), - } - payloadBytes, err := json.Marshal(payload) - if err != nil { - return errors.Wrap(err, "failed to marshal activity payload") - } - activity, err := s.Store.CreateActivity(ctx, &store.Activity{ - CreatorID: user.ID, - Type: string(ActivityUserAuthSignIn), - Level: string(ActivityInfo), - Payload: string(payloadBytes), - }) - if err != nil || activity == nil { - return errors.Wrap(err, "failed to create activity") - } - return err -} - -func (s *APIV1Service) createAuthSignUpActivity(c echo.Context, user *store.User) error { - ctx := c.Request().Context() - payload := ActivityUserAuthSignUpPayload{ - Username: user.Username, - IP: echo.ExtractIPFromRealIPHeader()(c.Request()), - } - payloadBytes, err := json.Marshal(payload) - if err != nil { - return errors.Wrap(err, "failed to marshal activity payload") - } - activity, err := s.Store.CreateActivity(ctx, &store.Activity{ - CreatorID: user.ID, - Type: string(ActivityUserAuthSignUp), - Level: string(ActivityInfo), - Payload: string(payloadBytes), - }) - if err != nil || activity == nil { - return errors.Wrap(err, "failed to create activity") - } - return err -} - // removeAccessTokenAndCookies removes the jwt token from the cookies. func removeAccessTokenAndCookies(c echo.Context) { cookieExp := time.Now().Add(-1 * time.Hour) diff --git a/server/server.go b/server/server.go index 33b408b278131..e17cb99c5804b 100644 --- a/server/server.go +++ b/server/server.go @@ -126,9 +126,6 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store if err := s.apiV1Service.UpsertAccessTokenToStore(ctx, user, accessToken); err != nil { return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to upsert access token, err: %s", err)).SetInternal(err) } - if err := s.apiV1Service.CreateAuthSignInActivity(c, user); err != nil { - return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err) - } cookieExp := time.Now().Add(auth.CookieExpDuration) // setTokenCookie sets the token to the cookie. From 3c998b1bb1e6111ea480ebbc14d495fea5f4fcb6 Mon Sep 17 00:00:00 2001 From: Zero Date: Tue, 31 Oct 2023 14:01:12 +0800 Subject: [PATCH 010/650] chore(release): bumped version to v0.17-1.0.4 --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index b11b406c1ae7a..fddae2b1afda0 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package main // Version is the version of ingress -var Version = "0.17-1.0.3" +var Version = "0.17-1.0.4" From 8b0083ffc5ffa8ad8748f6a565099eaa15dbdbec Mon Sep 17 00:00:00 2001 From: Zexi Date: Fri, 3 Nov 2023 05:16:55 +0800 Subject: [PATCH 011/650] fix: auto fetch more (#2472) * fix: auto fetch more * feat: use union type --- web/src/components/Memo.tsx | 44 ++++++++-------- web/src/components/MemoList.tsx | 79 ++++++++++------------------ web/src/pages/Explore.tsx | 92 ++++++++++++++++----------------- web/src/pages/Home.tsx | 6 +-- web/src/store/module/memo.ts | 10 +++- web/src/store/reducer/memo.ts | 12 ++++- 6 files changed, 114 insertions(+), 129 deletions(-) diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index b0f74ef3f2677..7e90ac567d441 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -43,13 +43,20 @@ const Memo: React.FC = (props: Props) => { const [displayTime, setDisplayTime] = useState(getRelativeTimeString(memo.displayTs)); const memoContainerRef = useRef(null); const readonly = memo.creatorUsername !== user?.username; - const creator = userV1Store.getUserByUsername(memo.creatorUsername); + const [creator, setCreator] = useState(userV1Store.getUserByUsername(memo.creatorUsername)); const referenceRelations = memo.relationList.filter((relation) => relation.type === "REFERENCE"); const commentRelations = memo.relationList.filter((relation) => relation.relatedMemoId === memo.id && relation.type === "COMMENT"); // Prepare memo creator. useEffect(() => { - userV1Store.getOrFetchUserByUsername(memo.creatorUsername); + if (creator) return; + + const fn = async () => { + const user = await userV1Store.getOrFetchUserByUsername(memo.creatorUsername); + setCreator(user); + }; + + fn(); }, [memo.creatorUsername]); // Update display time string. @@ -68,30 +75,23 @@ const Memo: React.FC = (props: Props) => { // Lazy rendering. useEffect(() => { - if (shouldRender) { - return; - } + if (shouldRender) return; + if (!memoContainerRef.current) return; - const root = document.body.querySelector("#root"); - if (root) { - const checkShouldRender = () => { - if (root.scrollTop + window.innerHeight > (memoContainerRef.current?.offsetTop || 0)) { - setShouldRender(true); - root.removeEventListener("scroll", checkShouldRender); - return true; - } - }; + const observer = new IntersectionObserver(([entry]) => { + if (!entry.isIntersecting) return; + observer.disconnect(); - if (checkShouldRender()) { - return; - } - root.addEventListener("scroll", checkShouldRender); - } + setShouldRender(true); + }); + observer.observe(memoContainerRef.current); + + return () => observer.disconnect(); }, [lazyRendering, filterStore.state]); if (!shouldRender) { // Render a placeholder to occupy the space. - return
; + return
; } const handleGotoMemoDetailPage = (event: React.MouseEvent) => { @@ -299,7 +299,9 @@ const Memo: React.FC = (props: Props) => { - {creator.nickname} + + {creator.nickname || creator.username} + diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx index 9d487a46d9e68..c99fc0b460a30 100644 --- a/web/src/components/MemoList.tsx +++ b/web/src/components/MemoList.tsx @@ -1,6 +1,7 @@ -import { useEffect, useState } from "react"; +import { useEffect, useRef } from "react"; import { toast } from "react-hot-toast"; import { useParams } from "react-router-dom"; +import MemoFilter from "@/components/MemoFilter"; import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts"; import { getTimeStampByDate } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; @@ -16,14 +17,14 @@ const MemoList: React.FC = () => { const memoStore = useMemoStore(); const filterStore = useFilterStore(); const filter = filterStore.state; - const { memos } = memoStore.state; - const [isFetching, setIsFetching] = useState(true); - const [isComplete, setIsComplete] = useState(false); + const { loadingStatus, memos } = memoStore.state; const user = useCurrentUser(); const { tag: tagQuery, duration, text: textQuery, visibility } = filter; const showMemoFilter = Boolean(tagQuery || (duration && duration.from < duration.to) || textQuery || visibility); const username = params.username || user?.username || ""; + const fetchMoreRef = useRef(null); + const shownMemos = ( showMemoFilter ? memos.filter((memo) => { @@ -74,74 +75,48 @@ const MemoList: React.FC = () => { const sortedMemos = pinnedMemos.concat(unpinnedMemos).filter((m) => m.rowStatus === "NORMAL"); useEffect(() => { - memoStore - .fetchMemos(username) - .then((fetchedMemos) => { - if (fetchedMemos.length < DEFAULT_MEMO_LIMIT) { - setIsComplete(true); - } else { - setIsComplete(false); - } - setIsFetching(false); - }) - .catch((error) => { - console.error(error); - toast.error(error.response.data.message); - }); - }, [user?.username]); - - useEffect(() => { - const pageWrapper = document.body.querySelector(".page-wrapper"); - if (pageWrapper) { - pageWrapper.scrollTo(0, 0); + const root = document.body.querySelector("#root"); + if (root) { + root.scrollTo(0, 0); } }, [filter]); useEffect(() => { - if (isFetching || isComplete) { - return; - } - if (sortedMemos.length < DEFAULT_MEMO_LIMIT) { - handleFetchMoreClick(); - return; - } + if (!fetchMoreRef.current) return; + const observer = new IntersectionObserver(([entry]) => { - if (entry.isIntersecting) { - handleFetchMoreClick(); - observer.unobserve(entry.target); - } + if (!entry.isIntersecting) return; + observer.disconnect(); + handleFetchMoreClick(); }); - }, [isFetching, isComplete, filter, sortedMemos.length]); + observer.observe(fetchMoreRef.current); + + return () => observer.disconnect(); + }, [loadingStatus]); const handleFetchMoreClick = async () => { try { - setIsFetching(true); - const fetchedMemos = await memoStore.fetchMemos(username, DEFAULT_MEMO_LIMIT, memos.length); - if (fetchedMemos.length < DEFAULT_MEMO_LIMIT) { - setIsComplete(true); - } else { - setIsComplete(false); - } - setIsFetching(false); + await memoStore.fetchMemos(username, DEFAULT_MEMO_LIMIT, memos.length); } catch (error: any) { - console.error(error); toast.error(error.response.data.message); } }; return (
+ {sortedMemos.map((memo) => ( - + ))} - {isFetching ? ( + + {loadingStatus === "fetching" ? (

{t("memo.fetching-data")}

) : (
- {isComplete ? ( + {loadingStatus === "complete" ? ( sortedMemos.length === 0 && (
@@ -149,11 +124,9 @@ const MemoList: React.FC = () => {
) ) : ( - <> - - {t("memo.fetch-more")} - - + + {t("memo.fetch-more")} + )}
diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsx index 22d15ffe157bd..5efe822a8b680 100644 --- a/web/src/pages/Explore.tsx +++ b/web/src/pages/Explore.tsx @@ -1,28 +1,23 @@ -import { useEffect, useState } from "react"; +import { useEffect, useRef } from "react"; import { toast } from "react-hot-toast"; -import { useLocation } from "react-router-dom"; import Empty from "@/components/Empty"; import Memo from "@/components/Memo"; import MemoFilter from "@/components/MemoFilter"; import MobileHeader from "@/components/MobileHeader"; import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts"; -import useLoading from "@/hooks/useLoading"; import { TAG_REG } from "@/labs/marked/parser"; import { useFilterStore, useMemoStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; const Explore = () => { const t = useTranslate(); - const location = useLocation(); const filterStore = useFilterStore(); const memoStore = useMemoStore(); const filter = filterStore.state; - const { memos } = memoStore.state; - const [isComplete, setIsComplete] = useState(false); - const loadingState = useLoading(); - + const { loadingStatus, memos } = memoStore.state; const { tag: tagQuery, text: textQuery } = filter; const showMemoFilter = Boolean(tagQuery || textQuery); + const fetchMoreRef = useRef(null); const fetchedMemos = showMemoFilter ? memos.filter((memo) => { @@ -58,30 +53,22 @@ const Explore = () => { .sort((mi, mj) => mj.displayTs - mi.displayTs); useEffect(() => { - memoStore - .fetchAllMemos(DEFAULT_MEMO_LIMIT, 0) - .then((fetchedMemos) => { - if (fetchedMemos.length < DEFAULT_MEMO_LIMIT) { - setIsComplete(true); - } - loadingState.setFinish(); - }) - .catch((error) => { - console.error(error); - toast.error(error.response.data.message); - }); - }, [location]); + if (!fetchMoreRef.current) return; + + const observer = new IntersectionObserver(([entry]) => { + if (!entry.isIntersecting) return; + observer.disconnect(); + handleFetchMoreClick(); + }); + observer.observe(fetchMoreRef.current); + + return () => observer.disconnect(); + }, [loadingStatus]); const handleFetchMoreClick = async () => { try { - const fetchedMemos = await memoStore.fetchAllMemos(DEFAULT_MEMO_LIMIT, memos.length); - if (fetchedMemos.length < DEFAULT_MEMO_LIMIT) { - setIsComplete(true); - } else { - setIsComplete(false); - } + await memoStore.fetchAllMemos(DEFAULT_MEMO_LIMIT, memos.length); } catch (error: any) { - console.error(error); toast.error(error.response.data.message); } }; @@ -89,26 +76,35 @@ const Explore = () => { return (
- {!loadingState.isLoading && ( -
- - {sortedMemos.map((memo) => { - return ; - })} - {isComplete ? ( - sortedMemos.length === 0 && ( -
- -

{t("message.no-data")}

-
- ) - ) : ( -

- {t("memo.fetch-more")} -

- )} -
- )} +
+ + {sortedMemos.map((memo) => ( + + ))} + + {loadingStatus === "fetching" ? ( +
+

{t("memo.fetching-data")}

+
+ ) : ( +
+
+ {loadingStatus === "complete" ? ( + sortedMemos.length === 0 && ( +
+ +

{t("message.no-data")}

+
+ ) + ) : ( + + {t("memo.fetch-more")} + + )} +
+
+ )} +
); }; diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index 1d8c29dfa9f76..1547e695614a5 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -1,6 +1,5 @@ import HomeSidebar from "@/components/HomeSidebar"; import MemoEditor from "@/components/MemoEditor"; -import MemoFilter from "@/components/MemoFilter"; import MemoList from "@/components/MemoList"; import MobileHeader from "@/components/MobileHeader"; @@ -9,10 +8,7 @@ const Home = () => {
-
- - -
+
diff --git a/web/src/store/module/memo.ts b/web/src/store/module/memo.ts index 664b0b623cf1e..19fa77fbe2b9d 100644 --- a/web/src/store/module/memo.ts +++ b/web/src/store/module/memo.ts @@ -2,7 +2,7 @@ import { omit } from "lodash-es"; import * as api from "@/helpers/api"; import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts"; import store, { useAppSelector } from "../"; -import { createMemo, deleteMemo, patchMemo, upsertMemos } from "../reducer/memo"; +import { updateLoadingStatus, createMemo, deleteMemo, patchMemo, upsertMemos } from "../reducer/memo"; import { useMemoCacheStore } from "../v1"; export const convertResponseModelMemo = (memo: Memo): Memo => { @@ -40,12 +40,17 @@ export const useMemoStore = () => { if (username) { memoFind.creatorUsername = username; } + + store.dispatch(updateLoadingStatus("fetching")); const { data } = await api.getMemoList(memoFind); const fetchedMemos = data.map((m) => convertResponseModelMemo(m)); store.dispatch(upsertMemos(fetchedMemos)); + store.dispatch(updateLoadingStatus(fetchedMemos.length === limit ? "incomplete" : "complete")); + for (const m of fetchedMemos) { memoCacheStore.setMemoCache(m); } + return fetchedMemos; }, fetchAllMemos: async (limit = DEFAULT_MEMO_LIMIT, offset?: number) => { @@ -54,9 +59,12 @@ export const useMemoStore = () => { limit, offset, }; + + store.dispatch(updateLoadingStatus("fetching")); const { data } = await api.getAllMemos(memoFind); const fetchedMemos = data.map((m) => convertResponseModelMemo(m)); store.dispatch(upsertMemos(fetchedMemos)); + store.dispatch(updateLoadingStatus(fetchedMemos.length === limit ? "incomplete" : "complete")); for (const m of fetchedMemos) { memoCacheStore.setMemoCache(m); diff --git a/web/src/store/reducer/memo.ts b/web/src/store/reducer/memo.ts index 3f8718f032c99..2c9ef6a924ca0 100644 --- a/web/src/store/reducer/memo.ts +++ b/web/src/store/reducer/memo.ts @@ -1,16 +1,26 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { uniqBy } from "lodash-es"; +type LoadingStatus = "incomplete" | "fetching" | "complete"; + interface State { + loadingStatus: LoadingStatus; memos: Memo[]; } const memoSlice = createSlice({ name: "memo", initialState: { + loadingStatus: "incomplete", memos: [], } as State, reducers: { + updateLoadingStatus: (state, action: PayloadAction) => { + return { + ...state, + loadingStatus: action.payload, + }; + }, upsertMemos: (state, action: PayloadAction) => { return { ...state, @@ -51,6 +61,6 @@ const memoSlice = createSlice({ }, }); -export const { upsertMemos, createMemo, patchMemo, deleteMemo } = memoSlice.actions; +export const { updateLoadingStatus, upsertMemos, createMemo, patchMemo, deleteMemo } = memoSlice.actions; export default memoSlice.reducer; From a62f1e15a658e52d68ad55586a8a894f7feccd04 Mon Sep 17 00:00:00 2001 From: Christopher Date: Sat, 4 Nov 2023 18:19:54 +0100 Subject: [PATCH 012/650] fix: private memos being public (#2480) * fix(web/memo): filter out public option Filter out the public option if we have disabled public memos * feat(api/memo): sanity check for disabled public memos In case something goes wrong, we check the system setting on the backend in order to valdiate if we can create a public memo * refactor(web/memo): disable public option Seems like a better option than removing it, as it looks werid if you are looking at a memo that is previously public * fix(web/memo): use translation keys * chore(web/editor): remove unsused tooltip * revert(api/memo): sanity check * fix(web/memo): allow admins to create public memos * chore(web/memo): remove unused import * fix(web/memo): check for both host and admin * fix(web/memo): remove warning text from MemoDetail --- web/src/components/MemoEditor/index.tsx | 14 +++++++++++++- web/src/pages/MemoDetail.tsx | 13 +++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index 0a4801d24e042..cfce3f59d6118 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -6,9 +6,11 @@ import { useTranslation } from "react-i18next"; import useLocalStorage from "react-use/lib/useLocalStorage"; import { TAB_SPACE_WIDTH, UNKNOWN_ID, VISIBILITY_SELECTOR_ITEMS } from "@/helpers/consts"; import { clearContentQueryParam } from "@/helpers/utils"; +import useCurrentUser from "@/hooks/useCurrentUser"; import { getMatchedNodes } from "@/labs/marked"; import { useFilterStore, useGlobalStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "@/store/module"; import { Resource } from "@/types/proto/api/v2/resource_service"; +import { User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import showCreateMemoRelationDialog from "../CreateMemoRelationDialog"; import showCreateResourceDialog from "../CreateResourceDialog"; @@ -52,6 +54,7 @@ const MemoEditor = (props: Props) => { const memoStore = useMemoStore(); const tagStore = useTagStore(); const resourceStore = useResourceStore(); + const currentUser = useCurrentUser(); const [state, setState] = useState({ memoVisibility: "PRIVATE", resourceList: [], @@ -407,6 +410,15 @@ const MemoEditor = (props: Props) => { const allowSave = (hasContent || state.resourceList.length > 0) && !state.isUploadingResource && !state.isRequesting; + const disableOption = (v: string) => { + const isAdminOrHost = currentUser.role === User_Role.ADMIN || currentUser.role === User_Role.HOST; + + if (v === "PUBLIC" && !isAdminOrHost) { + return systemStatus.disablePublicMemos; + } + return false; + }; + return (
{ }} > {VISIBILITY_SELECTOR_ITEMS.map((item) => ( - ))} diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx index 933f1216dcc1a..204e0ecb07e01 100644 --- a/web/src/pages/MemoDetail.tsx +++ b/web/src/pages/MemoDetail.tsx @@ -20,7 +20,7 @@ import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; import { useGlobalStore, useMemoStore } from "@/store/module"; import { useUserV1Store } from "@/store/v1"; -import { User } from "@/types/proto/api/v2/user_service"; +import { User, User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; const MemoDetail = () => { @@ -100,6 +100,15 @@ const MemoDetail = () => { await memoStore.fetchMemoById(memoId); }; + const disableOption = (v: string) => { + const isAdminOrHost = currentUser.role === User_Role.ADMIN || currentUser.role === User_Role.HOST; + + if (v === "PUBLIC" && !isAdminOrHost) { + return systemStatus.disablePublicMemos; + } + return false; + }; + return ( <>
@@ -156,7 +165,7 @@ const MemoDetail = () => { }} > {VISIBILITY_SELECTOR_ITEMS.map((item) => ( - ))} From eacd3e1c17c0caad6340864eb9e447fc89071bcc Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 15:38:45 +0800 Subject: [PATCH 013/650] chore: fix mysql latest schema --- store/db/mysql/migration/dev/LATEST__SCHEMA.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/db/mysql/migration/dev/LATEST__SCHEMA.sql b/store/db/mysql/migration/dev/LATEST__SCHEMA.sql index e9f9551a2fc08..005595bcece0c 100644 --- a/store/db/mysql/migration/dev/LATEST__SCHEMA.sql +++ b/store/db/mysql/migration/dev/LATEST__SCHEMA.sql @@ -131,5 +131,5 @@ CREATE TABLE `inbox` ( `sender_id` INT NOT NULL, `receiver_id` INT NOT NULL, `status` TEXT NOT NULL, - `message` TEXT NOT NULL DEFAULT '{}' + `message` TEXT NOT NULL ); From 405fc2b4d2e4768e0b9a950767c9c1007fc53c36 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 15:49:57 +0800 Subject: [PATCH 014/650] chore: simplify find migration history --- store/db/mysql/migration_history.go | 14 +++----------- store/db/sqlite/migration_history.go | 22 +++------------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/store/db/mysql/migration_history.go b/store/db/mysql/migration_history.go index 8eca1768d60d3..4dc79c1329742 100644 --- a/store/db/mysql/migration_history.go +++ b/store/db/mysql/migration_history.go @@ -2,7 +2,6 @@ package mysql import ( "context" - "strings" ) type MigrationHistory struct { @@ -15,18 +14,11 @@ type MigrationHistoryUpsert struct { } type MigrationHistoryFind struct { - Version *string } -func (d *DB) FindMigrationHistoryList(ctx context.Context, find *MigrationHistoryFind) ([]*MigrationHistory, error) { - where, args := []string{"1 = 1"}, []any{} - - if v := find.Version; v != nil { - where, args = append(where, "`version` = ?"), append(args, *v) - } - - query := "SELECT `version`, UNIX_TIMESTAMP(`created_ts`) FROM `migration_history` WHERE " + strings.Join(where, " AND ") + " ORDER BY `created_ts` DESC" - rows, err := d.db.QueryContext(ctx, query, args...) +func (d *DB) FindMigrationHistoryList(ctx context.Context, _ *MigrationHistoryFind) ([]*MigrationHistory, error) { + query := "SELECT `version`, UNIX_TIMESTAMP(`created_ts`) FROM `migration_history` ORDER BY `created_ts` DESC" + rows, err := d.db.QueryContext(ctx, query) if err != nil { return nil, err } diff --git a/store/db/sqlite/migration_history.go b/store/db/sqlite/migration_history.go index 0c5224e7b4fcf..922500d703828 100644 --- a/store/db/sqlite/migration_history.go +++ b/store/db/sqlite/migration_history.go @@ -2,7 +2,6 @@ package sqlite import ( "context" - "strings" ) type MigrationHistory struct { @@ -15,26 +14,11 @@ type MigrationHistoryUpsert struct { } type MigrationHistoryFind struct { - Version *string } -func (d *DB) FindMigrationHistoryList(ctx context.Context, find *MigrationHistoryFind) ([]*MigrationHistory, error) { - where, args := []string{"1 = 1"}, []any{} - - if v := find.Version; v != nil { - where, args = append(where, "version = ?"), append(args, *v) - } - - query := ` - SELECT - version, - created_ts - FROM - migration_history - WHERE ` + strings.Join(where, " AND ") + ` - ORDER BY created_ts DESC - ` - rows, err := d.db.QueryContext(ctx, query, args...) +func (d *DB) FindMigrationHistoryList(ctx context.Context, _ *MigrationHistoryFind) ([]*MigrationHistory, error) { + query := "SELECT `version`, `created_ts` FROM `migration_history` ORDER BY `created_ts` DESC" + rows, err := d.db.QueryContext(ctx, query) if err != nil { return nil, err } From 982b0285c9376c0883ad4f3b4b66a4894b054fcc Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 16:02:51 +0800 Subject: [PATCH 015/650] chore: fix date picker --- web/src/components/kit/DatePicker.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/web/src/components/kit/DatePicker.tsx b/web/src/components/kit/DatePicker.tsx index 5964e7d49233b..69ef1b289b293 100644 --- a/web/src/components/kit/DatePicker.tsx +++ b/web/src/components/kit/DatePicker.tsx @@ -39,9 +39,8 @@ const DatePicker: React.FC = (props: DatePickerProps) => { }, [user.username]); const firstDate = new Date(currentDateStamp); - const firstDateDay = firstDate.getDay() === 0 ? 7 : firstDate.getDay(); const dayList = []; - for (let i = 1; i < firstDateDay; i++) { + for (let i = 0; i < firstDate.getDay(); i++) { dayList.push({ date: 0, datestamp: firstDate.getTime() - DAILY_TIMESTAMP * (7 - i), From 137e64b0ddd0b02a14bf30187933659129a29129 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 21:41:47 +0800 Subject: [PATCH 016/650] chore: update metrics --- api/v1/memo.go | 1 + api/v1/resource.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/api/v1/memo.go b/api/v1/memo.go index db3ecc2fd9d05..3269129afaf0b 100644 --- a/api/v1/memo.go +++ b/api/v1/memo.go @@ -360,6 +360,7 @@ func (s *APIV1Service) CreateMemo(c echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create activity").SetInternal(err) } + metric.Enqueue("memo comment create") if _, err := s.Store.CreateInbox(ctx, &store.Inbox{ SenderID: memo.CreatorID, ReceiverID: relatedMemo.CreatorID, diff --git a/api/v1/resource.go b/api/v1/resource.go index 959fb8fc5e943..1abb295e57d1d 100644 --- a/api/v1/resource.go +++ b/api/v1/resource.go @@ -21,6 +21,7 @@ import ( "github.com/usememos/memos/internal/log" "github.com/usememos/memos/internal/util" "github.com/usememos/memos/plugin/storage/s3" + "github.com/usememos/memos/server/service/metric" "github.com/usememos/memos/store" ) @@ -158,6 +159,7 @@ func (s *APIV1Service) CreateResource(c echo.Context) error { if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to create resource").SetInternal(err) } + metric.Enqueue("resource create") return c.JSON(http.StatusOK, convertResourceFromStore(resource)) } From ef820a11388ad66627c6bf55ea53116777b38b82 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 21:42:02 +0800 Subject: [PATCH 017/650] chore: fix memo editor padding in daily review --- web/src/pages/DailyReview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/DailyReview.tsx index 2df1f36fb1c15..879c301cc90f8 100644 --- a/web/src/pages/DailyReview.tsx +++ b/web/src/pages/DailyReview.tsx @@ -127,7 +127,7 @@ const DailyReview = () => { ))} {selectedDateStamp === currentDateStamp && ( -
+
)} From 3266c3a58a9ea2df25d78dda9a39c696b76edb73 Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 22:26:09 +0800 Subject: [PATCH 018/650] chore: update link styles --- web/src/components/BetaBadge.tsx | 4 +++- web/src/components/CreateMemoRelationDialog.tsx | 2 +- web/src/components/MemoEditor/RelationListView.tsx | 2 +- web/src/components/MemoRelationListView.tsx | 4 ++-- web/src/components/Settings/SSOSection.tsx | 4 ++-- web/src/components/Settings/StorageSection.tsx | 12 +++--------- 6 files changed, 12 insertions(+), 16 deletions(-) diff --git a/web/src/components/BetaBadge.tsx b/web/src/components/BetaBadge.tsx index 917af1eceacf0..26822674f39b4 100644 --- a/web/src/components/BetaBadge.tsx +++ b/web/src/components/BetaBadge.tsx @@ -10,7 +10,9 @@ const BetaBadge: React.FC = (props: Props) => { return ( {t("common.beta")} diff --git a/web/src/components/CreateMemoRelationDialog.tsx b/web/src/components/CreateMemoRelationDialog.tsx index cc78d4a17b4bd..a491dfedc59c5 100644 --- a/web/src/components/CreateMemoRelationDialog.tsx +++ b/web/src/components/CreateMemoRelationDialog.tsx @@ -96,7 +96,7 @@ const CreateMemoRelationDialog: React.FC = (props: Props) => {
{memoList.map((memo) => (
handleDeleteMemoRelation(memo)} > diff --git a/web/src/components/MemoEditor/RelationListView.tsx b/web/src/components/MemoEditor/RelationListView.tsx index 5dc9e78c43e84..7915a7b45a493 100644 --- a/web/src/components/MemoEditor/RelationListView.tsx +++ b/web/src/components/MemoEditor/RelationListView.tsx @@ -38,7 +38,7 @@ const RelationListView = (props: Props) => { return (
handleDeleteRelation(memo)} > diff --git a/web/src/components/MemoRelationListView.tsx b/web/src/components/MemoRelationListView.tsx index 9b33086fc3304..a7f186b0f65e6 100644 --- a/web/src/components/MemoRelationListView.tsx +++ b/web/src/components/MemoRelationListView.tsx @@ -40,7 +40,7 @@ const MemoRelationListView = (props: Props) => { return (
@@ -60,7 +60,7 @@ const MemoRelationListView = (props: Props) => { return (
diff --git a/web/src/components/Settings/SSOSection.tsx b/web/src/components/Settings/SSOSection.tsx index 4b709d3520930..5c67b34f56103 100644 --- a/web/src/components/Settings/SSOSection.tsx +++ b/web/src/components/Settings/SSOSection.tsx @@ -107,10 +107,10 @@ const SSOSection = () => { ))}
-

{t("common.learn-more")}

+

{t("common.learn-more")}:

- + Configuring Keycloak for Authentication diff --git a/web/src/components/Settings/StorageSection.tsx b/web/src/components/Settings/StorageSection.tsx index 2f970838f0eb9..9367da889b9b4 100644 --- a/web/src/components/Settings/StorageSection.tsx +++ b/web/src/components/Settings/StorageSection.tsx @@ -124,21 +124,15 @@ const StorageSection = () => { ))}
-

{t("common.learn-more")}

+

{t("common.learn-more")}:

- + Docs - Local storage - + Choosing a Storage for Your Resource: Database, S3 or Local Storage? From e67820cabe0eaa7db576829dfd15fc059a8b014b Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 22:35:09 +0800 Subject: [PATCH 019/650] chore: update list user api permission --- api/v1/user.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api/v1/user.go b/api/v1/user.go index dbb69739c7ca0..67359f56efa4d 100644 --- a/api/v1/user.go +++ b/api/v1/user.go @@ -88,6 +88,23 @@ func (s *APIV1Service) registerUserRoutes(g *echo.Group) { // @Router /api/v1/user [GET] func (s *APIV1Service) GetUserList(c echo.Context) error { ctx := c.Request().Context() + userID, ok := c.Get(userIDContextKey).(int32) + if !ok { + return echo.NewHTTPError(http.StatusUnauthorized, "Missing auth session") + } + currentUser, err := s.Store.GetUser(ctx, &store.FindUser{ + ID: &userID, + }) + if err != nil { + return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find user by id").SetInternal(err) + } + if currentUser == nil { + return echo.NewHTTPError(http.StatusUnauthorized, "Missing auth session") + } + if currentUser.Role != store.RoleHost && currentUser.Role != store.RoleAdmin { + return echo.NewHTTPError(http.StatusUnauthorized, "Unauthorized to list users") + } + list, err := s.Store.ListUsers(ctx, &store.FindUser{}) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, "Failed to fetch user list").SetInternal(err) From e60e47f76fe26a40e5060f1027b75f2d110f80fc Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 23:03:43 +0800 Subject: [PATCH 020/650] chore: update user definition --- api/v2/resource_name.go | 10 + api/v2/user_service.go | 59 ++-- proto/api/v2/user_service.proto | 40 ++- proto/gen/api/v2/README.md | 10 +- proto/gen/api/v2/user_service.pb.go | 302 +++++++++--------- proto/gen/api/v2/user_service.pb.gw.go | 112 +++---- web/src/components/ChangePasswordDialog.tsx | 3 +- .../components/CreateAccessTokenDialog.tsx | 2 +- .../components/Inbox/MemoCommentMessage.tsx | 2 +- web/src/components/Memo.tsx | 5 +- web/src/components/MemoList.tsx | 3 +- .../Settings/AccessTokenSection.tsx | 9 +- .../components/Settings/MyAccountSection.tsx | 3 +- web/src/components/ShareMemoDialog.tsx | 3 +- web/src/components/UsageHeatMap.tsx | 9 +- web/src/components/UserBanner.tsx | 3 +- web/src/components/kit/DatePicker.tsx | 5 +- web/src/pages/DailyReview.tsx | 3 +- web/src/pages/MemoDetail.tsx | 3 +- web/src/store/v1/resourceName.ts | 5 + web/src/store/v1/user.ts | 10 +- 21 files changed, 322 insertions(+), 279 deletions(-) create mode 100644 web/src/store/v1/resourceName.ts diff --git a/api/v2/resource_name.go b/api/v2/resource_name.go index a12231f58bb7d..a9f285229c62a 100644 --- a/api/v2/resource_name.go +++ b/api/v2/resource_name.go @@ -10,6 +10,7 @@ import ( ) const ( + UserNamePrefix = "users/" InboxNamePrefix = "inboxes/" ) @@ -33,6 +34,15 @@ func GetNameParentTokens(name string, tokenPrefixes ...string) ([]string, error) return tokens, nil } +// GetUsername returns the username from a resource name. +func GetUsername(name string) (string, error) { + tokens, err := GetNameParentTokens(name, UserNamePrefix) + if err != nil { + return "", err + } + return tokens[0], nil +} + // GetInboxID returns the inbox ID from a resource name. func GetInboxID(name string) (int32, error) { tokens, err := GetNameParentTokens(name, InboxNamePrefix) diff --git a/api/v2/user_service.go b/api/v2/user_service.go index 7ec9ff26c4420..a393aab882c3a 100644 --- a/api/v2/user_service.go +++ b/api/v2/user_service.go @@ -2,6 +2,7 @@ package v2 import ( "context" + "fmt" "net/http" "regexp" "strings" @@ -27,8 +28,12 @@ var ( ) func (s *APIV2Service) GetUser(ctx context.Context, request *apiv2pb.GetUserRequest) (*apiv2pb.GetUserResponse, error) { + username, err := GetUsername(request.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "name is required") + } user, err := s.Store.GetUser(ctx, &store.FindUser{ - Username: &request.Username, + Username: &username, }) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) @@ -53,8 +58,12 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - if !usernameMatcher.MatchString(strings.ToLower(request.User.Username)) { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", request.User.Username) + username, err := GetUsername(request.User.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "name is required") + } + if !usernameMatcher.MatchString(strings.ToLower(username)) { + return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", username) } passwordHash, err := bcrypt.GenerateFromPassword([]byte(request.User.Password), bcrypt.DefaultCost) if err != nil { @@ -62,7 +71,7 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs } user, err := s.Store.CreateUser(ctx, &store.User{ - Username: request.User.Username, + Username: username, Role: convertUserRoleToStore(request.User.Role), Email: request.User.Email, Nickname: request.User.Nickname, @@ -79,11 +88,15 @@ 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 := GetUsername(request.User.Name) + if err != nil { + return nil, status.Errorf(codes.InvalidArgument, "name is required") + } currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get user: %v", err) } - if currentUser.Username != request.User.Username && currentUser.Role != store.RoleAdmin { + if currentUser.Username != username && currentUser.Role != store.RoleAdmin { return nil, status.Errorf(codes.PermissionDenied, "permission denied") } if request.UpdateMask == nil || len(request.UpdateMask.Paths) == 0 { @@ -97,10 +110,10 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs } for _, field := range request.UpdateMask.Paths { if field == "username" { - if !usernameMatcher.MatchString(strings.ToLower(request.User.Username)) { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", request.User.Username) + if !usernameMatcher.MatchString(strings.ToLower(username)) { + return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", username) } - update.Username = &request.User.Username + update.Username = &username } else if field == "nickname" { update.Nickname = &request.User.Nickname } else if field == "email" { @@ -146,17 +159,21 @@ func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv2p } userID := user.ID + username, err := GetUsername(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 != request.Username { + 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: &request.Username}) + 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", request.Username) + return nil, status.Errorf(codes.NotFound, "fail to find user %s", username) } userID = requestUser.ID } @@ -217,21 +234,7 @@ func (s *APIV2Service) CreateUserAccessToken(ctx context.Context, request *apiv2 expiresAt = request.ExpiresAt.AsTime() } - // Create access token for other users need to be verified. - if user.Username != request.Username { - // Normal users can only create access tokens for others. - 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: &request.Username}) - if requestUser == nil || err != nil { - return nil, status.Errorf(codes.NotFound, "fail to find user %s", request.Username) - } - } - - accessToken, err := auth.GenerateAccessToken(request.Username, user.ID, expiresAt, []byte(s.Secret)) + accessToken, err := auth.GenerateAccessToken(user.Username, user.ID, expiresAt, []byte(s.Secret)) if err != nil { return nil, status.Errorf(codes.Internal, "failed to generate access token: %v", err) } @@ -329,11 +332,11 @@ func (s *APIV2Service) UpsertAccessTokenToStore(ctx context.Context, user *store func convertUserFromStore(user *store.User) *apiv2pb.User { return &apiv2pb.User{ - Id: int32(user.ID), + 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)), - Username: user.Username, Role: convertUserRoleFromStore(user.Role), Email: user.Email, Nickname: user.Nickname, diff --git a/proto/api/v2/user_service.proto b/proto/api/v2/user_service.proto index fbce9267c9e9d..a54937c203106 100644 --- a/proto/api/v2/user_service.proto +++ b/proto/api/v2/user_service.proto @@ -13,8 +13,8 @@ option go_package = "gen/api/v2"; service UserService { rpc GetUser(GetUserRequest) returns (GetUserResponse) { - option (google.api.http) = {get: "/api/v2/users/{username}"}; - option (google.api.method_signature) = "username"; + option (google.api.http) = {get: "/api/v2/{name=users/*}"}; + option (google.api.method_signature) = "name"; } rpc CreateUser(CreateUserRequest) returns (CreateUserResponse) { option (google.api.http) = { @@ -25,35 +25,37 @@ service UserService { } rpc UpdateUser(UpdateUserRequest) returns (UpdateUserResponse) { option (google.api.http) = { - patch: "/api/v2/users/{user.username}" + patch: "/api/v2/{user.name=users/*}" body: "user" }; option (google.api.method_signature) = "user,update_mask"; } // ListUserAccessTokens returns a list of access tokens for a user. rpc ListUserAccessTokens(ListUserAccessTokensRequest) returns (ListUserAccessTokensResponse) { - option (google.api.http) = {get: "/api/v2/users/{username}/access_tokens"}; - option (google.api.method_signature) = "username"; + 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) = { - post: "/api/v2/users/{username}/access_tokens" + post: "/api/v2/{name=users/*}/access_tokens" body: "*" }; - option (google.api.method_signature) = "username"; + 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/users/{username}/access_tokens/{access_token}"}; - option (google.api.method_signature) = "username,access_token"; + option (google.api.http) = {delete: "/api/v2/{name=users/*}/access_tokens/{access_token}"}; + option (google.api.method_signature) = "name,access_token"; } } message User { - int32 id = 1; + // The name of the user. + // Format: users/{username} + string name = 1; - string username = 2; + int32 id = 2; enum Role { ROLE_UNSPECIFIED = 0; @@ -79,7 +81,9 @@ message User { } message GetUserRequest { - string username = 1; + // The name of the user. + // Format: users/{username} + string name = 1; } message GetUserResponse { @@ -105,7 +109,9 @@ message UpdateUserResponse { } message ListUserAccessTokensRequest { - string username = 1; + // The name of the user. + // Format: users/{username} + string name = 1; } message ListUserAccessTokensResponse { @@ -113,7 +119,9 @@ message ListUserAccessTokensResponse { } message CreateUserAccessTokenRequest { - string username = 1; + // The name of the user. + // Format: users/{username} + string name = 1; string description = 2; @@ -125,7 +133,9 @@ message CreateUserAccessTokenResponse { } message DeleteUserAccessTokenRequest { - string username = 1; + // The name of the user. + // Format: users/{username} + string name = 1; // access_token is the access token to delete. string access_token = 2; } diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index e2d55fc6914c0..042318227e78f 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -1032,7 +1032,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| username | [string](#string) | | | +| name | [string](#string) | | The name of the user. Format: users/{username} | | description | [string](#string) | | | | expires_at | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | optional | | @@ -1094,7 +1094,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| username | [string](#string) | | | +| name | [string](#string) | | The name of the user. Format: users/{username} | | access_token | [string](#string) | | access_token is the access token to delete. | @@ -1120,7 +1120,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| username | [string](#string) | | | +| name | [string](#string) | | The name of the user. Format: users/{username} | @@ -1150,7 +1150,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| username | [string](#string) | | | +| name | [string](#string) | | The name of the user. Format: users/{username} | @@ -1211,8 +1211,8 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| name | [string](#string) | | The name of the user. Format: users/{username} | | id | [int32](#int32) | | | -| username | [string](#string) | | | | role | [User.Role](#memos-api-v2-User-Role) | | | | email | [string](#string) | | | | nickname | [string](#string) | | | diff --git a/proto/gen/api/v2/user_service.pb.go b/proto/gen/api/v2/user_service.pb.go index d53fa1d7ffcd3..c35a688677255 100644 --- a/proto/gen/api/v2/user_service.pb.go +++ b/proto/gen/api/v2/user_service.pb.go @@ -80,8 +80,10 @@ type User struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + // 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"` Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname,omitempty"` @@ -124,18 +126,18 @@ func (*User) Descriptor() ([]byte, []int) { return file_api_v2_user_service_proto_rawDescGZIP(), []int{0} } -func (x *User) GetId() int32 { +func (x *User) GetName() string { if x != nil { - return x.Id + return x.Name } - return 0 + return "" } -func (x *User) GetUsername() string { +func (x *User) GetId() int32 { if x != nil { - return x.Username + return x.Id } - return "" + return 0 } func (x *User) GetRole() User_Role { @@ -199,7 +201,9 @@ type GetUserRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // The name of the user. + // Format: users/{username} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *GetUserRequest) Reset() { @@ -234,9 +238,9 @@ func (*GetUserRequest) Descriptor() ([]byte, []int) { return file_api_v2_user_service_proto_rawDescGZIP(), []int{1} } -func (x *GetUserRequest) GetUsername() string { +func (x *GetUserRequest) GetName() string { if x != nil { - return x.Username + return x.Name } return "" } @@ -489,7 +493,9 @@ type ListUserAccessTokensRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // The name of the user. + // Format: users/{username} + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (x *ListUserAccessTokensRequest) Reset() { @@ -524,9 +530,9 @@ func (*ListUserAccessTokensRequest) Descriptor() ([]byte, []int) { return file_api_v2_user_service_proto_rawDescGZIP(), []int{7} } -func (x *ListUserAccessTokensRequest) GetUsername() string { +func (x *ListUserAccessTokensRequest) GetName() string { if x != nil { - return x.Username + return x.Name } return "" } @@ -583,7 +589,9 @@ type CreateUserAccessTokenRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // The name of the user. + // Format: users/{username} + 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"` } @@ -620,9 +628,9 @@ func (*CreateUserAccessTokenRequest) Descriptor() ([]byte, []int) { return file_api_v2_user_service_proto_rawDescGZIP(), []int{9} } -func (x *CreateUserAccessTokenRequest) GetUsername() string { +func (x *CreateUserAccessTokenRequest) GetName() string { if x != nil { - return x.Username + return x.Name } return "" } @@ -693,7 +701,9 @@ type DeleteUserAccessTokenRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + // The name of the user. + // Format: users/{username} + 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"` } @@ -730,9 +740,9 @@ func (*DeleteUserAccessTokenRequest) Descriptor() ([]byte, []int) { return file_api_v2_user_service_proto_rawDescGZIP(), []int{11} } -func (x *DeleteUserAccessTokenRequest) GetUsername() string { +func (x *DeleteUserAccessTokenRequest) GetName() string { if x != nil { - return x.Username + return x.Name } return "" } @@ -869,38 +879,37 @@ 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, 0xc0, 0x03, 0x0a, 0x04, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, - 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, - 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, - 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, - 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 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, 0x06, 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, 0x07, 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, 0x08, 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, 0x09, 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, 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, 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, 0x2c, 0x0a, 0x0e, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0f, 0x47, 0x65, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb8, 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, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, + 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, + 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 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, 0x06, 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, 0x07, 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, 0x08, 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, 0x09, 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, 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, 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, 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, @@ -923,21 +932,20 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 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, 0x39, 0x0a, + 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 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, 0x1a, 0x0a, 0x08, - 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x75, 0x73, 0x65, 0x72, 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, 0xab, 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, 0x1a, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, + 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, @@ -950,98 +958,96 @@ var file_api_v2_user_service_proto_rawDesc = []byte{ 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, 0x5d, 0x0a, + 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, 0x1a, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x72, 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, 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, 0x32, 0xab, 0x07, 0x0a, 0x0b, 0x55, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 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, 0x2b, 0xda, 0x41, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, - 0x6f, 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, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x12, 0x8f, 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, + 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, 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, 0x32, 0x91, 0x07, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 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, 0x6f, 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, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x3e, 0xda, 0x41, 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x32, 0x1d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x11, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, 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, 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, 0x39, 0xda, 0x41, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x2f, - 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xae, 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, 0x3c, 0xda, 0x41, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x2b, 0x3a, 0x01, 0x2a, 0x22, 0x26, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x7d, - 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xc7, - 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, + 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, 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, 0x55, 0xda, 0x41, 0x15, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x2c, 0x61, + 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, - 0x37, 0x2a, 0x35, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 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, + 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 ( diff --git a/proto/gen/api/v2/user_service.pb.gw.go b/proto/gen/api/v2/user_service.pb.gw.go index 8076647ba9d88..8b2fd30486cd4 100644 --- a/proto/gen/api/v2/user_service.pb.gw.go +++ b/proto/gen/api/v2/user_service.pb.gw.go @@ -42,14 +42,14 @@ func request_UserService_GetUser_0(ctx context.Context, marshaler runtime.Marsha _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -68,14 +68,14 @@ func local_request_UserService_GetUser_0(ctx context.Context, marshaler runtime. _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.GetUser(ctx, &protoReq) @@ -118,7 +118,7 @@ func local_request_UserService_CreateUser_0(ctx context.Context, marshaler runti } var ( - filter_UserService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "username": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}} + filter_UserService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 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_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -147,14 +147,14 @@ func request_UserService_UpdateUser_0(ctx context.Context, marshaler runtime.Mar _ = err ) - val, ok = pathParams["user.username"] + val, ok = pathParams["user.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user.username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "user.username", val) + err = runtime.PopulateFieldFromPath(&protoReq, "user.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user.username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user.name", err) } if err := req.ParseForm(); err != nil { @@ -195,14 +195,14 @@ func local_request_UserService_UpdateUser_0(ctx context.Context, marshaler runti _ = err ) - val, ok = pathParams["user.username"] + val, ok = pathParams["user.name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user.username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user.name") } - err = runtime.PopulateFieldFromPath(&protoReq, "user.username", val) + err = runtime.PopulateFieldFromPath(&protoReq, "user.name", val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user.username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user.name", err) } if err := req.ParseForm(); err != nil { @@ -228,14 +228,14 @@ func request_UserService_ListUserAccessTokens_0(ctx context.Context, marshaler r _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.ListUserAccessTokens(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -254,14 +254,14 @@ func local_request_UserService_ListUserAccessTokens_0(ctx context.Context, marsh _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.ListUserAccessTokens(ctx, &protoReq) @@ -288,14 +288,14 @@ func request_UserService_CreateUserAccessToken_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := client.CreateUserAccessToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) @@ -322,14 +322,14 @@ func local_request_UserService_CreateUserAccessToken_0(ctx context.Context, mars _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } msg, err := server.CreateUserAccessToken(ctx, &protoReq) @@ -348,14 +348,14 @@ func request_UserService_DeleteUserAccessToken_0(ctx context.Context, marshaler _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } val, ok = pathParams["access_token"] @@ -384,14 +384,14 @@ func local_request_UserService_DeleteUserAccessToken_0(ctx context.Context, mars _ = err ) - val, ok = pathParams["username"] + val, ok = pathParams["name"] if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "username") + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") } - protoReq.Username, err = runtime.String(val) + protoReq.Name, err = runtime.String(val) if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "username", err) + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } val, ok = pathParams["access_token"] @@ -423,7 +423,7 @@ func RegisterUserServiceHandlerServer(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.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v2/users/{username}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -473,7 +473,7 @@ func RegisterUserServiceHandlerServer(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.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/users/{user.username}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/{user.name=users/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -498,7 +498,7 @@ func RegisterUserServiceHandlerServer(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.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v2/users/{username}/access_tokens")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}/access_tokens")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -523,7 +523,7 @@ func RegisterUserServiceHandlerServer(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.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{username}/access_tokens")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}/access_tokens")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -548,7 +548,7 @@ func RegisterUserServiceHandlerServer(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.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{username}/access_tokens/{access_token}")) + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/memos.api.v2.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}/access_tokens/{access_token}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -612,7 +612,7 @@ func RegisterUserServiceHandlerClient(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.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v2/users/{username}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/GetUser", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -656,7 +656,7 @@ func RegisterUserServiceHandlerClient(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.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/users/{user.username}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/UpdateUser", runtime.WithHTTPPathPattern("/api/v2/{user.name=users/*}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -678,7 +678,7 @@ func RegisterUserServiceHandlerClient(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.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v2/users/{username}/access_tokens")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/ListUserAccessTokens", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}/access_tokens")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -700,7 +700,7 @@ func RegisterUserServiceHandlerClient(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.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{username}/access_tokens")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/CreateUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}/access_tokens")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -722,7 +722,7 @@ func RegisterUserServiceHandlerClient(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.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/users/{username}/access_tokens/{access_token}")) + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/memos.api.v2.UserService/DeleteUserAccessToken", runtime.WithHTTPPathPattern("/api/v2/{name=users/*}/access_tokens/{access_token}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -742,17 +742,17 @@ func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux } var ( - pattern_UserService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "users", "username"}, "")) + 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}, []string{"v1", "users"}, "")) - pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "users", "user.username"}, "")) + pattern_UserService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3}, []string{"api", "v2", "users", "user.name"}, "")) - pattern_UserService_ListUserAccessTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "username", "access_tokens"}, "")) + pattern_UserService_ListUserAccessTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "users", "name", "access_tokens"}, "")) - pattern_UserService_CreateUserAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "username", "access_tokens"}, "")) + pattern_UserService_CreateUserAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4}, []string{"api", "v2", "users", "name", "access_tokens"}, "")) - pattern_UserService_DeleteUserAccessToken_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", "users", "username", "access_tokens", "access_token"}, "")) + pattern_UserService_DeleteUserAccessToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 2, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"api", "v2", "users", "name", "access_tokens", "access_token"}, "")) ) var ( diff --git a/web/src/components/ChangePasswordDialog.tsx b/web/src/components/ChangePasswordDialog.tsx index fe894c3a5ba19..4bb4a8f32a7a1 100644 --- a/web/src/components/ChangePasswordDialog.tsx +++ b/web/src/components/ChangePasswordDialog.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { useGlobalStore, useUserStore } from "@/store/module"; import { useUserV1Store } from "@/store/v1"; +import { UserNamePrefix } from "@/store/v1/resourceName"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; import Icon from "./Icon"; @@ -54,7 +55,7 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { const user = userStore.getState().user as User; await userV1Store.updateUser( { - username: user.username, + name: `${UserNamePrefix}${user.username}`, password: newPassword, }, ["password"] diff --git a/web/src/components/CreateAccessTokenDialog.tsx b/web/src/components/CreateAccessTokenDialog.tsx index 463ac1f53e8ec..cae2749fc1ef7 100644 --- a/web/src/components/CreateAccessTokenDialog.tsx +++ b/web/src/components/CreateAccessTokenDialog.tsx @@ -69,7 +69,7 @@ const CreateAccessTokenDialog: React.FC = (props: Props) => { try { await userServiceClient.createUserAccessToken({ - username: currentUser.username, + name: currentUser.name, description: state.description, expiresAt: state.expiration ? new Date(Date.now() + state.expiration * 1000) : undefined, }); diff --git a/web/src/components/Inbox/MemoCommentMessage.tsx b/web/src/components/Inbox/MemoCommentMessage.tsx index a43009b691b59..ccbca9e28b0e4 100644 --- a/web/src/components/Inbox/MemoCommentMessage.tsx +++ b/web/src/components/Inbox/MemoCommentMessage.tsx @@ -5,7 +5,7 @@ import toast from "react-hot-toast"; import { activityServiceClient } from "@/grpcweb"; import useNavigateTo from "@/hooks/useNavigateTo"; import useInboxStore from "@/store/v1/inbox"; -import { extractUsernameFromName } from "@/store/v1/user"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { Activity } from "@/types/proto/api/v2/activity_service"; import { Inbox, Inbox_Status } from "@/types/proto/api/v2/inbox_service"; import { useTranslate } from "@/utils/i18n"; diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 7e90ac567d441..aa54b9a4f4b1e 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -9,6 +9,7 @@ import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; import { useFilterStore, useMemoStore, useUserStore } from "@/store/module"; import { useUserV1Store } from "@/store/v1"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { useTranslate } from "@/utils/i18n"; import showChangeMemoCreatedTsDialog from "./ChangeMemoCreatedTsDialog"; import { showCommonDialog } from "./Dialog/CommonDialog"; @@ -42,7 +43,7 @@ const Memo: React.FC = (props: Props) => { const [shouldRender, setShouldRender] = useState(lazyRendering ? false : true); const [displayTime, setDisplayTime] = useState(getRelativeTimeString(memo.displayTs)); const memoContainerRef = useRef(null); - const readonly = memo.creatorUsername !== user?.username; + const readonly = memo.creatorUsername !== extractUsernameFromName(user?.name); const [creator, setCreator] = useState(userV1Store.getUserByUsername(memo.creatorUsername)); const referenceRelations = memo.relationList.filter((relation) => relation.type === "REFERENCE"); const commentRelations = memo.relationList.filter((relation) => relation.relatedMemoId === memo.id && relation.type === "COMMENT"); @@ -300,7 +301,7 @@ const Memo: React.FC = (props: Props) => { - {creator.nickname || creator.username} + {creator.nickname || extractUsernameFromName(creator.name)} diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx index c99fc0b460a30..6af94e3d01493 100644 --- a/web/src/components/MemoList.tsx +++ b/web/src/components/MemoList.tsx @@ -7,6 +7,7 @@ import { getTimeStampByDate } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; import { TAG_REG } from "@/labs/marked/parser"; import { useFilterStore, useMemoStore } from "@/store/module"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { useTranslate } from "@/utils/i18n"; import Empty from "./Empty"; import Memo from "./Memo"; @@ -21,7 +22,7 @@ const MemoList: React.FC = () => { const user = useCurrentUser(); const { tag: tagQuery, duration, text: textQuery, visibility } = filter; const showMemoFilter = Boolean(tagQuery || (duration && duration.from < duration.to) || textQuery || visibility); - const username = params.username || user?.username || ""; + const username = params.username || extractUsernameFromName(user.name) || ""; const fetchMoreRef = useRef(null); diff --git a/web/src/components/Settings/AccessTokenSection.tsx b/web/src/components/Settings/AccessTokenSection.tsx index 9b87ba6cdeb56..90ddb40fc54c6 100644 --- a/web/src/components/Settings/AccessTokenSection.tsx +++ b/web/src/components/Settings/AccessTokenSection.tsx @@ -4,6 +4,7 @@ import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { userServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { UserAccessToken } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import showCreateAccessTokenDialog from "../CreateAccessTokenDialog"; @@ -12,7 +13,7 @@ import Icon from "../Icon"; import LearnMore from "../LearnMore"; const listAccessTokens = async (username: string) => { - const { accessTokens } = await userServiceClient.listUserAccessTokens({ username: username }); + const { accessTokens } = await userServiceClient.listUserAccessTokens({ name: `${UserAccessToken}${username}` }); return accessTokens; }; @@ -22,13 +23,13 @@ const AccessTokenSection = () => { const [userAccessTokens, setUserAccessTokens] = useState([]); useEffect(() => { - listAccessTokens(currentUser.username).then((accessTokens) => { + listAccessTokens(extractUsernameFromName(currentUser.name)).then((accessTokens) => { setUserAccessTokens(accessTokens); }); }, []); const handleCreateAccessTokenDialogConfirm = async () => { - const accessTokens = await listAccessTokens(currentUser.username); + const accessTokens = await listAccessTokens(extractUsernameFromName(currentUser.name)); setUserAccessTokens(accessTokens); }; @@ -44,7 +45,7 @@ const AccessTokenSection = () => { style: "danger", dialogName: "delete-access-token-dialog", onConfirm: async () => { - await userServiceClient.deleteUserAccessToken({ username: currentUser.username, accessToken: accessToken }); + await userServiceClient.deleteUserAccessToken({ name: currentUser.name, accessToken: accessToken }); setUserAccessTokens(userAccessTokens.filter((token) => token.accessToken !== accessToken)); }, }); diff --git a/web/src/components/Settings/MyAccountSection.tsx b/web/src/components/Settings/MyAccountSection.tsx index 31b9ae91bb6d4..2f42670e3622c 100644 --- a/web/src/components/Settings/MyAccountSection.tsx +++ b/web/src/components/Settings/MyAccountSection.tsx @@ -1,5 +1,6 @@ import { Button } from "@mui/joy"; import useCurrentUser from "@/hooks/useCurrentUser"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { useTranslate } from "@/utils/i18n"; import showChangePasswordDialog from "../ChangePasswordDialog"; import showUpdateAccountDialog from "../UpdateAccountDialog"; @@ -18,7 +19,7 @@ const MyAccountSection = () => {
{user.nickname} - ({user.username}) + ({extractUsernameFromName(user.name)})
diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index c01b29395efcc..851dd46690907 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -6,6 +6,7 @@ import { getDateTimeString } from "@/helpers/datetime"; import useLoading from "@/hooks/useLoading"; import toImage from "@/labs/html2image"; import { useUserV1Store } from "@/store/v1"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; import showEmbedMemoDialog from "./EmbedMemoDialog"; @@ -120,7 +121,7 @@ const ShareMemoDialog: React.FC = (props: Props) => {
- {user.nickname || user.username} + {user.nickname || extractUsernameFromName(user.name)}
diff --git a/web/src/components/UsageHeatMap.tsx b/web/src/components/UsageHeatMap.tsx index 7e6b9691b204a..6854f8e406df7 100644 --- a/web/src/components/UsageHeatMap.tsx +++ b/web/src/components/UsageHeatMap.tsx @@ -6,6 +6,7 @@ import * as utils from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useGlobalStore } from "@/store/module"; import { useUserV1Store } from "@/store/v1"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { useTranslate, Translations } from "@/utils/i18n"; import { useFilterStore, useMemoStore } from "../store/module"; import "@/less/usage-heat-map.less"; @@ -53,20 +54,20 @@ const UsageHeatMap = () => { const containerElRef = useRef(null); useEffect(() => { - userV1Store.getOrFetchUserByUsername(user.username).then((user) => { + userV1Store.getOrFetchUserByUsername(extractUsernameFromName(user.name)).then((user) => { if (!user) { return; } setCreatedDays(Math.ceil((Date.now() - getTimeStampByDate(user.createTime)) / 1000 / 3600 / 24)); }); - }, [user.username]); + }, [user.name]); useEffect(() => { if (memos.length === 0) { return; } - getMemoStats(user.username) + getMemoStats(extractUsernameFromName(user.name)) .then(({ data }) => { setMemoAmount(data.length); const newStat: DailyUsageStat[] = getInitialUsageStat(usedDaysAmount, beginDayTimestamp); @@ -85,7 +86,7 @@ const UsageHeatMap = () => { .catch((error) => { console.error(error); }); - }, [memos.length, user.username]); + }, [memos.length, user.name]); const handleUsageStatItemMouseEnter = useCallback((event: React.MouseEvent, item: DailyUsageStat) => { const tempDiv = document.createElement("div"); diff --git a/web/src/components/UserBanner.tsx b/web/src/components/UserBanner.tsx index 223f51c39d94c..5f4df67a0ed3d 100644 --- a/web/src/components/UserBanner.tsx +++ b/web/src/components/UserBanner.tsx @@ -1,6 +1,7 @@ import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; import { useGlobalStore, useUserStore } from "@/store/module"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import showAboutSiteDialog from "./AboutSiteDialog"; @@ -18,7 +19,7 @@ const UserBanner = () => { const title = user ? user.nickname : systemStatus.customizedProfile.name || "memos"; const handleMyAccountClick = () => { - navigateTo(`/u/${encodeURIComponent(user.username)}`); + navigateTo(`/u/${encodeURIComponent(extractUsernameFromName(user.name))}`); }; const handleAboutBtnClick = () => { diff --git a/web/src/components/kit/DatePicker.tsx b/web/src/components/kit/DatePicker.tsx index 69ef1b289b293..d46df5ee7a5c7 100644 --- a/web/src/components/kit/DatePicker.tsx +++ b/web/src/components/kit/DatePicker.tsx @@ -5,6 +5,7 @@ import { getMemoStats } from "@/helpers/api"; import { DAILY_TIMESTAMP } from "@/helpers/consts"; import { getDateStampByDate, isFutureDate } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { useTranslate } from "@/utils/i18n"; import Icon from "../Icon"; import "@/less/common/date-picker.less"; @@ -28,7 +29,7 @@ const DatePicker: React.FC = (props: DatePickerProps) => { }, [datestamp]); useEffect(() => { - getMemoStats(user.username).then(({ data }) => { + getMemoStats(extractUsernameFromName(user.name)).then(({ data }) => { const m = new Map(); for (const record of data) { const date = getDateStampByDate(record * 1000); @@ -36,7 +37,7 @@ const DatePicker: React.FC = (props: DatePickerProps) => { } setCountByDate(m); }); - }, [user.username]); + }, [user.name]); const firstDate = new Date(currentDateStamp); const dayList = []; diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/DailyReview.tsx index 879c301cc90f8..c5893c23b85f4 100644 --- a/web/src/pages/DailyReview.tsx +++ b/web/src/pages/DailyReview.tsx @@ -15,6 +15,7 @@ import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "@/helpers/consts"; import { getDateStampByDate, getNormalizedDateString, getTimeStampByDate, getTimeString } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; import { useMemoStore, useUserStore } from "@/store/module"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { useTranslate } from "@/utils/i18n"; const DailyReview = () => { @@ -32,7 +33,7 @@ const DailyReview = () => { const selectedDateStampWithOffset = selectedDateStamp + localSetting.dailyReviewTimeOffset * 60 * 60 * 1000; return ( m.rowStatus === "NORMAL" && - m.creatorUsername === user.username && + m.creatorUsername === extractUsernameFromName(user.name) && displayTimestamp >= selectedDateStampWithOffset && displayTimestamp < selectedDateStampWithOffset + DAILY_TIMESTAMP ); diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx index 204e0ecb07e01..7be780c6d17d1 100644 --- a/web/src/pages/MemoDetail.tsx +++ b/web/src/pages/MemoDetail.tsx @@ -20,6 +20,7 @@ import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; import { useGlobalStore, useMemoStore } from "@/store/module"; import { useUserV1Store } from "@/store/v1"; +import { extractUsernameFromName } from "@/store/v1/resourceName"; import { User, User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; @@ -35,7 +36,7 @@ const MemoDetail = () => { const { systemStatus } = globalStore.state; const memoId = Number(params.memoId); const memo = memoStore.state.memos.find((memo) => memo.id === memoId); - const allowEdit = memo?.creatorUsername === currentUser?.username; + const allowEdit = memo?.creatorUsername === extractUsernameFromName(currentUser.name); const referenceRelations = memo?.relationList.filter((relation) => relation.type === "REFERENCE") || []; const commentRelations = memo?.relationList.filter((relation) => relation.relatedMemoId === memo.id && relation.type === "COMMENT") || []; const comments = commentRelations diff --git a/web/src/store/v1/resourceName.ts b/web/src/store/v1/resourceName.ts new file mode 100644 index 0000000000000..7fc71ce2f1dbd --- /dev/null +++ b/web/src/store/v1/resourceName.ts @@ -0,0 +1,5 @@ +export const UserNamePrefix = "users/"; + +export const extractUsernameFromName = (name: string) => { + return name.split("/")[1]; +}; diff --git a/web/src/store/v1/user.ts b/web/src/store/v1/user.ts index 6e04a555cafee..f25d67b6bde17 100644 --- a/web/src/store/v1/user.ts +++ b/web/src/store/v1/user.ts @@ -1,6 +1,7 @@ import { create } from "zustand"; import { userServiceClient } from "@/grpcweb"; import { User } from "@/types/proto/api/v2/user_service"; +import { UserNamePrefix, extractUsernameFromName } from "./resourceName"; interface UserV1Store { userMapByUsername: Record; @@ -25,7 +26,7 @@ const useUserV1Store = create()((set, get) => ({ const promisedUser = userServiceClient .getUser({ - username: username, + name: `${UserNamePrefix}${username}`, }) .then(({ user }) => user); requestCache.set(username, promisedUser); @@ -50,15 +51,12 @@ const useUserV1Store = create()((set, get) => ({ if (!updatedUser) { throw new Error("User not found"); } + const username = extractUsernameFromName(updatedUser.name); const userMap = get().userMapByUsername; - userMap[updatedUser.username] = updatedUser; + userMap[username] = updatedUser; set(userMap); return updatedUser; }, })); -export const extractUsernameFromName = (name: string) => { - return name.split("/")[1]; -}; - export default useUserV1Store; From 39a0e69b04456f0f060bc3797e517ccba0c779dd Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 5 Nov 2023 23:28:09 +0800 Subject: [PATCH 021/650] chore: update function name --- api/v2/inbox_service .go | 4 ++-- api/v2/resource_name.go | 8 ++++---- api/v2/user_service.go | 8 ++++---- .../components/ChangeMemberPasswordDialog.tsx | 19 +++++++++++-------- web/src/components/ChangePasswordDialog.tsx | 3 +-- web/src/components/Header.tsx | 2 +- .../components/Inbox/MemoCommentMessage.tsx | 3 +-- web/src/components/Memo.tsx | 3 +-- web/src/components/MemoList.tsx | 2 +- .../Settings/AccessTokenSection.tsx | 2 +- .../components/Settings/MyAccountSection.tsx | 2 +- web/src/components/ShareMemoDialog.tsx | 3 +-- web/src/components/UsageHeatMap.tsx | 3 +-- web/src/components/UserBanner.tsx | 2 +- web/src/components/kit/DatePicker.tsx | 2 +- web/src/pages/DailyReview.tsx | 2 +- web/src/pages/Inboxes.tsx | 2 +- web/src/pages/MemoDetail.tsx | 3 +-- web/src/store/v1/inbox.ts | 4 +--- web/src/store/v1/index.ts | 8 ++++---- web/src/store/v1/memo.ts | 4 +--- web/src/store/v1/user.ts | 4 +--- 22 files changed, 42 insertions(+), 51 deletions(-) diff --git a/api/v2/inbox_service .go b/api/v2/inbox_service .go index 75df3a75937c3..faaf625c9d5fa 100644 --- a/api/v2/inbox_service .go +++ b/api/v2/inbox_service .go @@ -46,7 +46,7 @@ func (s *APIV2Service) UpdateInbox(ctx context.Context, request *apiv2pb.UpdateI return nil, status.Errorf(codes.InvalidArgument, "update mask is required") } - inboxID, err := GetInboxID(request.Inbox.Name) + inboxID, err := ExtractInboxIDFromName(request.Inbox.Name) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid inbox name: %v", err) } @@ -77,7 +77,7 @@ func (s *APIV2Service) UpdateInbox(ctx context.Context, request *apiv2pb.UpdateI } func (s *APIV2Service) DeleteInbox(ctx context.Context, request *apiv2pb.DeleteInboxRequest) (*apiv2pb.DeleteInboxResponse, error) { - inboxID, err := GetInboxID(request.Name) + inboxID, err := ExtractInboxIDFromName(request.Name) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "invalid inbox name: %v", err) } diff --git a/api/v2/resource_name.go b/api/v2/resource_name.go index a9f285229c62a..fea44cfff57ab 100644 --- a/api/v2/resource_name.go +++ b/api/v2/resource_name.go @@ -34,8 +34,8 @@ func GetNameParentTokens(name string, tokenPrefixes ...string) ([]string, error) return tokens, nil } -// GetUsername returns the username from a resource name. -func GetUsername(name string) (string, error) { +// ExtractUsernameFromName returns the username from a resource name. +func ExtractUsernameFromName(name string) (string, error) { tokens, err := GetNameParentTokens(name, UserNamePrefix) if err != nil { return "", err @@ -43,8 +43,8 @@ func GetUsername(name string) (string, error) { return tokens[0], nil } -// GetInboxID returns the inbox ID from a resource name. -func GetInboxID(name string) (int32, error) { +// ExtractInboxIDFromName returns the inbox ID from a resource name. +func ExtractInboxIDFromName(name string) (int32, error) { tokens, err := GetNameParentTokens(name, InboxNamePrefix) if err != nil { return 0, err diff --git a/api/v2/user_service.go b/api/v2/user_service.go index a393aab882c3a..161ca5ad1a24f 100644 --- a/api/v2/user_service.go +++ b/api/v2/user_service.go @@ -28,7 +28,7 @@ var ( ) func (s *APIV2Service) GetUser(ctx context.Context, request *apiv2pb.GetUserRequest) (*apiv2pb.GetUserResponse, error) { - username, err := GetUsername(request.Name) + username, err := ExtractUsernameFromName(request.Name) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "name is required") } @@ -58,7 +58,7 @@ func (s *APIV2Service) CreateUser(ctx context.Context, request *apiv2pb.CreateUs return nil, status.Errorf(codes.PermissionDenied, "permission denied") } - username, err := GetUsername(request.User.Name) + username, err := ExtractUsernameFromName(request.User.Name) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "name is required") } @@ -88,7 +88,7 @@ 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 := GetUsername(request.User.Name) + username, err := ExtractUsernameFromName(request.User.Name) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "name is required") } @@ -159,7 +159,7 @@ func (s *APIV2Service) ListUserAccessTokens(ctx context.Context, request *apiv2p } userID := user.ID - username, err := GetUsername(request.Name) + username, err := ExtractUsernameFromName(request.Name) if err != nil { return nil, status.Errorf(codes.InvalidArgument, "name is required") } diff --git a/web/src/components/ChangeMemberPasswordDialog.tsx b/web/src/components/ChangeMemberPasswordDialog.tsx index a9477790eefd0..3eb98166a8e16 100644 --- a/web/src/components/ChangeMemberPasswordDialog.tsx +++ b/web/src/components/ChangeMemberPasswordDialog.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; -import { useUserStore } from "@/store/module"; +import { useUserV1Store, UserNamePrefix } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; import Icon from "./Icon"; @@ -10,9 +10,9 @@ interface Props extends DialogProps { } const ChangeMemberPasswordDialog: React.FC = (props: Props) => { - const { user: propsUser, destroy } = props; + const { user, destroy } = props; const t = useTranslate(); - const userStore = useUserStore(); + const userStore = useUserV1Store(); const [newPassword, setNewPassword] = useState(""); const [newPasswordAgain, setNewPasswordAgain] = useState(""); @@ -47,10 +47,13 @@ const ChangeMemberPasswordDialog: React.FC = (props: Props) => { } try { - await userStore.patchUser({ - id: propsUser.id, - password: newPassword, - }); + await userStore.updateUser( + { + name: `${UserNamePrefix}${user.username}`, + password: newPassword, + }, + ["password"] + ); toast(t("message.password-changed")); handleCloseBtnClick(); } catch (error: any) { @@ -63,7 +66,7 @@ const ChangeMemberPasswordDialog: React.FC = (props: Props) => { <>

- {t("setting.account-section.change-password")} ({propsUser.username}) + {t("setting.account-section.change-password")} ({user.username})

-
- ); -}; - -export default UpgradeVersionView; diff --git a/web/src/helpers/api.ts b/web/src/helpers/api.ts index 9d44194d58234..c307cdcd9b6cf 100644 --- a/web/src/helpers/api.ts +++ b/web/src/helpers/api.ts @@ -179,13 +179,3 @@ export function patchIdentityProvider(identityProviderPatch: IdentityProviderPat export function deleteIdentityProvider(id: IdentityProviderId) { return axios.delete(`/api/v1/idp/${id}`); } - -export async function getRepoLatestTag() { - const { data } = await axios.get(`https://api.github.com/repos/usememos/memos/tags`, { - headers: { - Accept: "application/vnd.github.v3.star+json", - Authorization: "", - }, - }); - return data[0].name as string; -} diff --git a/web/src/locales/de.json b/web/src/locales/de.json index 6fb5ceeb9617e..b11a7b1479b8b 100644 --- a/web/src/locales/de.json +++ b/web/src/locales/de.json @@ -349,7 +349,6 @@ "display-with-updated-time": "Anzeige mit aktualisierter Zeit", "enable-password-login": "Anmeldung mit Passwort aktivieren", "enable-password-login-warning": "Dadurch wird die Passwortanmeldung für alle Benutzer aktiviert. Fahre nur fort, wenn du möchtest, dass sich Benutzer sowohl mit SSO als auch mit einem Passwort anmelden können", - "ignore-version-upgrade": "Versions-Upgrade ignorieren", "max-upload-size": "Maximale Uploadgröße (MiB)", "max-upload-size-hint": "Empfohlene Wert ist 32 MiB.", "server-name": "Servername", diff --git a/web/src/locales/en.json b/web/src/locales/en.json index a6656eca17442..75c1f18f8b3c7 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -252,7 +252,6 @@ "disable-password-login-final-warning": "Please type \"CONFIRM\" if you know what you are doing.", "enable-password-login": "Enable password login", "enable-password-login-warning": "This will enable password login for all users. Continue only if you want to users to be able to log in using both SSO and password", - "ignore-version-upgrade": "Ignore version upgrade", "disable-public-memos": "Disable public memos", "max-upload-size": "Maximum upload size (MiB)", "max-upload-size-hint": "Recommended value is 32 MiB.", diff --git a/web/src/locales/hr.json b/web/src/locales/hr.json index 46e8dd4529e1e..24f72d1a74b79 100644 --- a/web/src/locales/hr.json +++ b/web/src/locales/hr.json @@ -346,7 +346,6 @@ "disable-public-memos": "Onemogući javne memoe", "display-with-updated-time": "Prikaži sa obnovljenim vremenom", "enable-password-login": "Omogući prijavu lozinkom", - "ignore-version-upgrade": "Ignoriraj nadogradnju", "max-upload-size": "Maximalna veličina uploada (MiB)", "max-upload-size-hint": "Preporučena vrijednost je 32 MiB.", "server-name": "Ime servera", diff --git a/web/src/locales/it.json b/web/src/locales/it.json index e73093bf3b496..8a93f0bf36661 100644 --- a/web/src/locales/it.json +++ b/web/src/locales/it.json @@ -338,7 +338,6 @@ "display-with-updated-time": "Mostra con tempo aggiornato", "enable-password-login": "Abilita login password", "enable-password-login-warning": "Ciò consentirà l'accesso tramite password per tutti gli utenti. Continua solo se desideri che gli utenti possano accedere utilizzando sia SSO che password❗", - "ignore-version-upgrade": "Ignora aggiornamento versione", "max-upload-size": "Dimensione massima caricamento (MiB)", "max-upload-size-hint": "Valore consigliato di 32 MiB.", "server-name": "Nome server", diff --git a/web/src/locales/ja.json b/web/src/locales/ja.json index 6a0cd60816bcf..34fa833d87c2f 100644 --- a/web/src/locales/ja.json +++ b/web/src/locales/ja.json @@ -336,7 +336,6 @@ "display-with-updated-time": "更新日時を表示する", "enable-password-login": "パスワードでのログインを有効にする", "enable-password-login-warning": "これにより、すべてのユーザーのパスワードでのログインが有効になります。SSOとパスワードの両方を使用してログインできるようにしたい場合のみ、続行してください❗", - "ignore-version-upgrade": "アップデートを無効にする", "max-upload-size": "最大ファイルサイズ(MiB)", "max-upload-size-hint": "推奨サイズは32 MiBです。", "server-name": "サーバーの名前", diff --git a/web/src/locales/ko.json b/web/src/locales/ko.json index 62df9b6798b00..de46cdf7f9167 100644 --- a/web/src/locales/ko.json +++ b/web/src/locales/ko.json @@ -349,7 +349,6 @@ "display-with-updated-time": "수정된 시각을 표시", "enable-password-login": "비밀번호 로그인 허용", "enable-password-login-warning": "모든 사용자가 비밀번호를 사용해서 로그인할 수 있게 합니다. 사용자들이 SSO와 비밀번호 둘 다 사용할 수 있게 하고 싶은 경우에만 켜 주세요", - "ignore-version-upgrade": "업그레이드 알림 무시", "max-upload-size": "최대 업로드 크기 (MiB)", "max-upload-size-hint": "권장값은 32 MiB입니다.", "server-name": "서버 이름", diff --git a/web/src/locales/nl.json b/web/src/locales/nl.json index 28d03fcba9ccc..0c46b89177061 100644 --- a/web/src/locales/nl.json +++ b/web/src/locales/nl.json @@ -1,336 +1,335 @@ { - "common": { - "about": "Over", - "home": "Home", - "resources": "Bronnen", - "settings": "Instellingen", - "archived": "Gearchiveerd", - "email": "E-mailadres", - "password": "Wachtwoord", - "avatar": "Avatar", - "username": "Gebruikersnaam", - "nickname": "Bijnaam", - "save": "Opslaan", - "close": "Sluiten", - "cancel": "Annuleren", - "create": "Aanmaken", - "change": "Wijzigen", - "confirm": "Bevestigen", - "reset": "Herstel", - "language": "Taal", - "version": "Versie", - "pin": "Vastzetten", - "unpin": "Losmaken", - "edit": "Bewerken", - "restore": "Terugzetten", - "delete": "Verwijderen", - "null": "Null", - "share": "Delen", - "archive": "Archiveren", - "basic": "Simpel", - "admin": "Admin", - "explore": "Ontdekken", - "sign-in": "Inloggen", - "sign-up": "Registreren", - "sign-out": "Uitloggen", - "type": "Type", - "title": "Titel", - "filter": "Filter", - "tags": "Labels", - "yourself": "Jijzelf", - "changed": "gewijzigd", - "fold": "Inklappen", - "expand": "Uitklappen", - "vacuum": "Optimaliseren", - "image": "Afbeelding", - "link": "Link", - "select": "Selecteer", - "database": "Database", - "mark": "Citeren", - "preview": "Voorbeeld", - "name": "Naam", - "beta": "Beta", - "upload": "Uploaden", - "update": "Bijwerken", - "visibility": "Zichtbaarheid", - "clear": "Leegmaken", - "rename": "Hernoemen", - "learn-more": "Lees meer", - "new": "Nieuw", - "or": "of", - "filter-period": "{{from}} tot {{to}}", - "sign-in-with": "Log in met {{provider}}", - "profile": "Profiel" + "common": { + "about": "Over", + "home": "Home", + "resources": "Bronnen", + "settings": "Instellingen", + "archived": "Gearchiveerd", + "email": "E-mailadres", + "password": "Wachtwoord", + "avatar": "Avatar", + "username": "Gebruikersnaam", + "nickname": "Bijnaam", + "save": "Opslaan", + "close": "Sluiten", + "cancel": "Annuleren", + "create": "Aanmaken", + "change": "Wijzigen", + "confirm": "Bevestigen", + "reset": "Herstel", + "language": "Taal", + "version": "Versie", + "pin": "Vastzetten", + "unpin": "Losmaken", + "edit": "Bewerken", + "restore": "Terugzetten", + "delete": "Verwijderen", + "null": "Null", + "share": "Delen", + "archive": "Archiveren", + "basic": "Simpel", + "admin": "Admin", + "explore": "Ontdekken", + "sign-in": "Inloggen", + "sign-up": "Registreren", + "sign-out": "Uitloggen", + "type": "Type", + "title": "Titel", + "filter": "Filter", + "tags": "Labels", + "yourself": "Jijzelf", + "changed": "gewijzigd", + "fold": "Inklappen", + "expand": "Uitklappen", + "vacuum": "Optimaliseren", + "image": "Afbeelding", + "link": "Link", + "select": "Selecteer", + "database": "Database", + "mark": "Citeren", + "preview": "Voorbeeld", + "name": "Naam", + "beta": "Beta", + "upload": "Uploaden", + "update": "Bijwerken", + "visibility": "Zichtbaarheid", + "clear": "Leegmaken", + "rename": "Hernoemen", + "learn-more": "Lees meer", + "new": "Nieuw", + "or": "of", + "filter-period": "{{from}} tot {{to}}", + "sign-in-with": "Log in met {{provider}}", + "profile": "Profiel" + }, + "auth": { + "host-tip": "Je registreert je als Site Host.", + "new-password": "Nieuw wachtwoord", + "repeat-new-password": "Nieuw wachtwoord herhalen", + "create-your-account": "Maak je account", + "sign-up-tip": "Nog geen account?", + "sign-in-tip": "Al een account?" + }, + "resource": { + "no-resources": "Geen bronnen.", + "fetching-data": "data aan het ophalen...", + "copy-link": "Kopieer Link", + "delete-resource": "Bron verwijderen", + "warning-text": "Weet je zeker dat je deze bron wilt verwijderen? Deze actie is NIET terug te draaien!", + "linked-amount": "Aantal gelinkte memo's", + "warning-text-unused": "Weet je zeker dat je deze ongebruikte bron wilt verwijderen? Deze actie is NIET terug te draaien!", + "no-unused-resources": "Geen ongebruikte bronnen", + "clear": "Opruimen", + "reset-resource-link": "Link resetten", + "reset-link": "Link resetten" + }, + "editor": { + "editing": "Aan het bewerken...", + "cancel-edit": "Annuleer bewerking", + "save": "Opslaan", + "placeholder": "Leeg je gedachten...", + "only-image-supported": "Alleen afbeeldingen worden ondersteund.", + "cant-empty": "Inhoud kan niet leeg zijn", + "local": "Lokaal", + "resources": "Bronnen" + }, + "memo": { + "view-detail": "Bekijk details", + "copy-link": "Kopieer link", + "search-placeholder": "Zoek memos", + "fetching-data": "data aan het ophalen...", + "fetch-more": "Klik hier om meer op te halen", + "visibility": { + "private": "Privé", + "protected": "Werkruimte", + "public": "Openbaar", + "disabled": "Openbare memos zijn uitgezet" }, - "auth": { - "host-tip": "Je registreert je als Site Host.", - "new-password": "Nieuw wachtwoord", - "repeat-new-password": "Nieuw wachtwoord herhalen", - "create-your-account": "Maak je account", - "sign-up-tip": "Nog geen account?", - "sign-in-tip": "Al een account?" + "delete-memo": "Memo verwijderen", + "delete-confirm": "Weet je zeker dat je deze memo wilt verwijderen?\n\nDit kan niet teruggedraaid worden!", + "embed": "Insluiten", + "archived-memos": "Gearchiveerde memos", + "archived-at": "Gearchiveerd op", + "comment": { + "no-comment": "Geen opmerking", + "self": "Opmerkingen" }, - "resource": { - "no-resources": "Geen bronnen.", - "fetching-data": "data aan het ophalen...", - "copy-link": "Kopieer Link", - "delete-resource": "Bron verwijderen", - "warning-text": "Weet je zeker dat je deze bron wilt verwijderen? Deze actie is NIET terug te draaien!", - "linked-amount": "Aantal gelinkte memo's", - "warning-text-unused": "Weet je zeker dat je deze ongebruikte bron wilt verwijderen? Deze actie is NIET terug te draaien!", - "no-unused-resources": "Geen ongebruikte bronnen", - "clear": "Opruimen", - "reset-resource-link": "Link resetten", - "reset-link": "Link resetten" + "no-archived-memos": "Geen gearchiveerde memos." + }, + "tag-list": { + "tip-text": "Typ `#label` om aan te maken", + "create-tag": "Label maken", + "all-tags": "Alle labels", + "tag-name": "LABEL_NAAM", + "invalid-tag-name": "Onjuiste label naam" + }, + "daily-review": { + "title": "Dagelijks", + "no-memos": "Oeps, er is niks." + }, + "setting": { + "my-account": "Mijn account", + "preference": "Voorkeuren", + "member": "Gebruikers", + "member-list": "Gebruikers", + "system": "Systeem", + "account-section": { + "title": "Accountinformatie", + "update-information": "Informatie wijzigen", + "change-password": "Wachtwoord wijzigen", + "openapi-sample-post": "Hallo #memos vanaf {{url}}" }, - "editor": { - "editing": "Aan het bewerken...", - "cancel-edit": "Annuleer bewerking", - "save": "Opslaan", - "placeholder": "Leeg je gedachten...", - "only-image-supported": "Alleen afbeeldingen worden ondersteund.", - "cant-empty": "Inhoud kan niet leeg zijn", - "local": "Lokaal", - "resources": "Bronnen" + "preference-section": { + "theme": "Thema", + "default-memo-visibility": "Standaard memo zichtbaarheid", + "enable-folding-memo": "Vouwende memo aanzetten", + "editor-font-style": "Editor lettertype", + "mobile-editor-style": "Mobiele editor uiterlijk", + "default-memo-sort-option": "Sorteer op tijd van aanmaken/wijziging", + "telegram-user-id": "Telegram User ID", + "telegram-user-id-placeholder": "Stuur je memos naar je Telegram bot", + "created_ts": "Tijd van aanmaken", + "updated_ts": "Tijd van wijziging", + "daily-review-time-offset": "Dagelijkse review tijdscompensatie", + "enable-double-click": "Dubbelklik op memo om te bewerken", + "auto-collapse": "Automatisch samenvouwen", + "default-resource-visibility": "Standaard bron zichtbaarheid" }, - "memo": { - "view-detail": "Bekijk details", - "copy-link": "Kopieer link", - "search-placeholder": "Zoek memos", - "fetching-data": "data aan het ophalen...", - "fetch-more": "Klik hier om meer op te halen", - "visibility": { - "private": "Privé", - "protected": "Werkruimte", - "public": "Openbaar", - "disabled": "Openbare memos zijn uitgezet" - }, - "delete-memo": "Memo verwijderen", - "delete-confirm": "Weet je zeker dat je deze memo wilt verwijderen?\n\nDit kan niet teruggedraaid worden!", - "embed": "Insluiten", - "archived-memos": "Gearchiveerde memos", - "archived-at": "Gearchiveerd op", - "comment": { - "no-comment": "Geen opmerking", - "self": "Opmerkingen" - }, - "no-archived-memos": "Geen gearchiveerde memos." + "member-section": { + "create-a-member": "Lid toevoegen", + "delete-warning": "Weet je zeker dat je {{username}} wilt verwijderen?\n\nDEZE ACTIE IS NIET TERUG TE DRAAIEN", + "archive-member": "Archiveer gebruiker", + "archive-warning": "Weet je zeker dat je {{username}} wilt archiveren?", + "delete-member": "Gebruiker verwijderen" }, - "tag-list": { - "tip-text": "Typ `#label` om aan te maken", - "create-tag": "Label maken", - "all-tags": "Alle labels", - "tag-name": "LABEL_NAAM", - "invalid-tag-name": "Onjuiste label naam" + "system-section": { + "server-name": "Servernaam", + "customize-server": { + "title": "Server aanpassen", + "default": "Standaard is 'memos'", + "icon-url": "Icoon URL", + "appearance": "Server uiterlijk", + "locale": "Server taal", + "description": "Beschrijving" + }, + "database-file-size": "Database bestandsgrootte", + "allow-user-signup": "Registratie toestaan", + "disable-password-login": "Wachtwoordlogin uitzetten", + "disable-password-login-warning": "Als je dit uitzet, kan je niet meer inloggen met een wachtwoord, zonder de database aan te passen. Als je inlogprovider niet werkt, kan je memos niet in.", + "disable-password-login-final-warning": "Typ \"CONFIRM\" als je zeker weet wat je doet.", + "enable-password-login": "Wachtwoordlogin aanzetten", + "enable-password-login-warning": "Als je dit aanzet kan er met zowel SSO als een wachtwoord ingelogd worden", + "additional-style": "Optionele stijl", + "additional-script": "Optionele scripts", + "additional-style-placeholder": "Optionele CSS code", + "additional-script-placeholder": "Optionele JavaScript code", + "disable-public-memos": "Openbare memos uitzetten", + "max-upload-size": "Maximum uploadgrootte (MiB)", + "max-upload-size-hint": "32 MiB wordt aangeraden.", + "auto-backup-interval": "Automatische backupinterval (seconden)", + "auto-backup-interval-hint": "Kies 0 om de automatische backup uit te zetten. Herstart van memos is nodig na deze aanpassing.", + "display-with-updated-time": "Laten zien met bewerkte tijd", + "telegram-bot-token": "Telegram bot token", + "telegram-bot-token-description": "Telegram bot token of API proxy zoals `http://.../bot`", + "telegram-bot-token-placeholder": "Je Telegram bot token" }, - "daily-review": { - "title": "Dagelijks", - "no-memos": "Oeps, er is niks." + "appearance-option": { + "light": "Altijd licht", + "dark": "Altijd donker", + "system": "Volg systeem" }, - "setting": { - "my-account": "Mijn account", - "preference": "Voorkeuren", - "member": "Gebruikers", - "member-list": "Gebruikers", - "system": "Systeem", - "account-section": { - "title": "Accountinformatie", - "update-information": "Informatie wijzigen", - "change-password": "Wachtwoord wijzigen", - "openapi-sample-post": "Hallo #memos vanaf {{url}}" - }, - "preference-section": { - "theme": "Thema", - "default-memo-visibility": "Standaard memo zichtbaarheid", - "enable-folding-memo": "Vouwende memo aanzetten", - "editor-font-style": "Editor lettertype", - "mobile-editor-style": "Mobiele editor uiterlijk", - "default-memo-sort-option": "Sorteer op tijd van aanmaken/wijziging", - "telegram-user-id": "Telegram User ID", - "telegram-user-id-placeholder": "Stuur je memos naar je Telegram bot", - "created_ts": "Tijd van aanmaken", - "updated_ts": "Tijd van wijziging", - "daily-review-time-offset": "Dagelijkse review tijdscompensatie", - "enable-double-click": "Dubbelklik op memo om te bewerken", - "auto-collapse": "Automatisch samenvouwen", - "default-resource-visibility": "Standaard bron zichtbaarheid" - }, - "member-section": { - "create-a-member": "Lid toevoegen", - "delete-warning": "Weet je zeker dat je {{username}} wilt verwijderen?\n\nDEZE ACTIE IS NIET TERUG TE DRAAIEN", - "archive-member": "Archiveer gebruiker", - "archive-warning": "Weet je zeker dat je {{username}} wilt archiveren?", - "delete-member": "Gebruiker verwijderen" - }, - "system-section": { - "server-name": "Servernaam", - "customize-server": { - "title": "Server aanpassen", - "default": "Standaard is 'memos'", - "icon-url": "Icoon URL", - "appearance": "Server uiterlijk", - "locale": "Server taal", - "description": "Beschrijving" - }, - "database-file-size": "Database bestandsgrootte", - "allow-user-signup": "Registratie toestaan", - "disable-password-login": "Wachtwoordlogin uitzetten", - "disable-password-login-warning": "Als je dit uitzet, kan je niet meer inloggen met een wachtwoord, zonder de database aan te passen. Als je inlogprovider niet werkt, kan je memos niet in.", - "disable-password-login-final-warning": "Typ \"CONFIRM\" als je zeker weet wat je doet.", - "enable-password-login": "Wachtwoordlogin aanzetten", - "enable-password-login-warning": "Als je dit aanzet kan er met zowel SSO als een wachtwoord ingelogd worden", - "additional-style": "Optionele stijl", - "additional-script": "Optionele scripts", - "additional-style-placeholder": "Optionele CSS code", - "additional-script-placeholder": "Optionele JavaScript code", - "disable-public-memos": "Openbare memos uitzetten", - "max-upload-size": "Maximum uploadgrootte (MiB)", - "max-upload-size-hint": "32 MiB wordt aangeraden.", - "auto-backup-interval": "Automatische backupinterval (seconden)", - "auto-backup-interval-hint": "Kies 0 om de automatische backup uit te zetten. Herstart van memos is nodig na deze aanpassing.", - "display-with-updated-time": "Laten zien met bewerkte tijd", - "telegram-bot-token": "Telegram bot token", - "telegram-bot-token-description": "Telegram bot token of API proxy zoals `http://.../bot`", - "telegram-bot-token-placeholder": "Je Telegram bot token", - "ignore-version-upgrade": "Versieupdate negeren" - }, - "appearance-option": { - "light": "Altijd licht", - "dark": "Altijd donker", - "system": "Volg systeem" - }, - "storage": "Opslag", - "sso": "SSO", - "sso-section": { - "sso-list": "SSO lijst", - "delete-sso": "Verwijdering bevestigen", - "confirm-delete": "Weet je zeker dat je de \"{{name}}\" SSO configuratie wilt verwijderen?\n\nDeze actie is niet terug te draaien", - "create-sso": "SSO instellen", - "update-sso": "SSO bijwerken", - "sso-created": "SSO {{name}} ingesteld", - "sso-updated": "SSO {{name}} bijgewerkt", - "identifier": "Identifier", - "display-name": "Weergavenaam", - "template": "Sjabloon", - "custom": "Aangepast", - "identifier-filter": "Identifier Filter", - "redirect-url": "Redirect URL", - "client-id": "Client ID", - "client-secret": "Client secret", - "authorization-endpoint": "Authorization endpoint", - "token-endpoint": "Token endpoint", - "user-endpoint": "User endpoint", - "scopes": "Scopes", - "disabled-password-login-warning": "Wachtwoordlogin is uitgeschakeld. Kijk uit met het verwijderen van inlogproviders" - }, - "storage-section": { - "current-storage": "Huidige objectopslag", - "type-database": "Database", - "type-local": "Lokaal bestandssysteem", - "storage-services-list": "Opslagdiensten", - "create-a-service": "Opslagdienst instellen", - "update-a-service": "Opslagdienst bijwerken", - "warning-text": "Weet je zeker dat je \"{{name}}\" wilt verwijderen?\n\nDeze actie is niet terug te draaien!", - "delete-storage": "Opslagdienst verwijderen", - "local-storage-path": "Lokaal opslagpad", - "update-local-path": "Lokaal opslagpad bijwerken", - "update-local-path-description": "Lokaal opslagpad is relatief aan je databasebestand.", - "create-storage": "Opslagdienst instellen", - "update-storage": "Opslagdienst bijwerken", - "endpoint": "Endpoint", - "s3-compatible-url": "S3 compatibele URL", - "region": "Regio", - "region-placeholder": "Regionaam", - "accesskey": "Access key", - "accesskey-placeholder": "Access key / Access ID", - "secretkey": "Secret key", - "secretkey-placeholder": "Secret key / Access Key", - "bucket": "Bucket", - "bucket-placeholder": "Bucket name", - "path": "Opslagpad", - "path-description": "Je kan dezelfde dynamische variabelen gebruiken, zoals {filename}", - "path-placeholder": "eigen/pad", - "url-prefix": "URL prefix", - "url-prefix-placeholder": "Aagnepaste URL prefix, optioneel", - "url-suffix": "URL suffix", - "url-suffix-placeholder": "Aangepaste URL suffix, optioneel" - } + "storage": "Opslag", + "sso": "SSO", + "sso-section": { + "sso-list": "SSO lijst", + "delete-sso": "Verwijdering bevestigen", + "confirm-delete": "Weet je zeker dat je de \"{{name}}\" SSO configuratie wilt verwijderen?\n\nDeze actie is niet terug te draaien", + "create-sso": "SSO instellen", + "update-sso": "SSO bijwerken", + "sso-created": "SSO {{name}} ingesteld", + "sso-updated": "SSO {{name}} bijgewerkt", + "identifier": "Identifier", + "display-name": "Weergavenaam", + "template": "Sjabloon", + "custom": "Aangepast", + "identifier-filter": "Identifier Filter", + "redirect-url": "Redirect URL", + "client-id": "Client ID", + "client-secret": "Client secret", + "authorization-endpoint": "Authorization endpoint", + "token-endpoint": "Token endpoint", + "user-endpoint": "User endpoint", + "scopes": "Scopes", + "disabled-password-login-warning": "Wachtwoordlogin is uitgeschakeld. Kijk uit met het verwijderen van inlogproviders" }, - "amount-text": { - "memo_one": "MEMO", - "memo_other": "MEMOS" - }, - "message": { - "no-data": "Geen data gevonden.", - "memos-ready": "alle memos zijn geladen 🎉", - "restored-successfully": "Succesvol teruggezet", - "memo-updated-datetime": "Tijd van aanmaken gewijzigd.", - "invalid-created-datetime": "Onjuiste tijd van aanmaken.", - "change-memo-created-time": "Tijd van aanmaken wijzigen", - "memo-not-found": "Memo niet gevonden.", - "fill-all": "Vul alsjeblieft alle velden in.", - "new-password-not-match": "Nieuwe wachtwoorden komen niet overeen.", - "image-load-failed": "Afbeelding laden mislukt", - "fill-form": "Vul alsjeblieft het formulier in.", - "login-failed": "Inloggen mislukt", - "signup-failed": "Registreren mislukt", - "user-not-found": "Gebruiker niet gevonden", - "password-changed": "Wachtwoord gewijzigd.", - "private-only": "Deze memo is privé.", - "copied": "Gekopieerd", - "succeed-copy-content": "Inhoud gekopieerd naar klembord.", - "change-resource-filename": "Bestandsnaam van bron wijzigen", - "resource-filename-updated": "Bestandsnaam van bron gewijzigd.", - "invalid-resource-filename": "Onjuiste bestandsnaam.", - "click-to-save-the-image": "Klik om de afbeelding op te slaan", - "generating-the-screenshot": "Screenshot genereren...", - "succeed-vacuum-database": "Succeed to vacuum database", - "succeed-update-additional-style": "Optionele stijl bijgewerkt", - "succeed-copy-resource-link": "Link naar bron gekopieërd naar klembord.", - "succeed-update-customized-profile": "Profiel bijgewerkt.", - "succeed-update-additional-script": "Optioneel script bijgewerkt.", - "update-succeed": "Update voltooid", - "succeed-copy-code": "Code gekopieërd naar klembord.", - "page-not-found": "404 - Pagina niet gevonden 😥", - "password-not-match": "Wachtwoorden komen niet overeen.", - "succeed-copy-link": "Link gekopieërd naar klembord.", - "count-selected-resources": "Totaal geselecteerd", - "file-exceeds-upload-limit-of": "Bestand {{file}} is groter dan het limiet van {{size}} MiB", - "updating-setting-failed": "Instelling aanpassen mislukt", - "password-login-disabled": "Je kan niet de laatste inlogprovider verwijderen als inloggen met wachtwoord is uitgeschakeld." - }, - "days": { - "mon": "ma", - "tue": "di", - "wed": "wo", - "thu": "do", - "fri": "vr", - "sat": "za", - "sun": "zo" - }, - "embed-memo": { - "title": "Memo insluiten", - "text": "Kopieer en plak onderstaande code op je eigen website", - "only-public-supported": "* alleen openbare memos kunnen ingesloten worden", - "copy": "Kopieer" - }, - "heatmap": { - "memo-in": "memo in {{period}}", - "memos-in": "memos in {{period}}", - "memo-on": "{{amount}} memo op {{date}}", - "memos-on": "{{amount}} memos op {{date}}", - "day": "dag", - "days": "dagen" - }, - "about": { - "about-memos": "Over Memos", - "memos-description": "Memos is een web-based noteerapplicatie die je kan gebruiekn om notities te schrijven, organiseren en delen.", - "no-server-description": "Geen beschrijving geconfigureerd.", - "powered-by": "Mogelijk gemaakt door", - "other-projects": "Andere projecten" - }, - "router": { - "go-to-home": "Ga naar homepagina", - "back-to-top": "Terug naar boven" + "storage-section": { + "current-storage": "Huidige objectopslag", + "type-database": "Database", + "type-local": "Lokaal bestandssysteem", + "storage-services-list": "Opslagdiensten", + "create-a-service": "Opslagdienst instellen", + "update-a-service": "Opslagdienst bijwerken", + "warning-text": "Weet je zeker dat je \"{{name}}\" wilt verwijderen?\n\nDeze actie is niet terug te draaien!", + "delete-storage": "Opslagdienst verwijderen", + "local-storage-path": "Lokaal opslagpad", + "update-local-path": "Lokaal opslagpad bijwerken", + "update-local-path-description": "Lokaal opslagpad is relatief aan je databasebestand.", + "create-storage": "Opslagdienst instellen", + "update-storage": "Opslagdienst bijwerken", + "endpoint": "Endpoint", + "s3-compatible-url": "S3 compatibele URL", + "region": "Regio", + "region-placeholder": "Regionaam", + "accesskey": "Access key", + "accesskey-placeholder": "Access key / Access ID", + "secretkey": "Secret key", + "secretkey-placeholder": "Secret key / Access Key", + "bucket": "Bucket", + "bucket-placeholder": "Bucket name", + "path": "Opslagpad", + "path-description": "Je kan dezelfde dynamische variabelen gebruiken, zoals {filename}", + "path-placeholder": "eigen/pad", + "url-prefix": "URL prefix", + "url-prefix-placeholder": "Aagnepaste URL prefix, optioneel", + "url-suffix": "URL suffix", + "url-suffix-placeholder": "Aangepaste URL suffix, optioneel" } + }, + "amount-text": { + "memo_one": "MEMO", + "memo_other": "MEMOS" + }, + "message": { + "no-data": "Geen data gevonden.", + "memos-ready": "alle memos zijn geladen 🎉", + "restored-successfully": "Succesvol teruggezet", + "memo-updated-datetime": "Tijd van aanmaken gewijzigd.", + "invalid-created-datetime": "Onjuiste tijd van aanmaken.", + "change-memo-created-time": "Tijd van aanmaken wijzigen", + "memo-not-found": "Memo niet gevonden.", + "fill-all": "Vul alsjeblieft alle velden in.", + "new-password-not-match": "Nieuwe wachtwoorden komen niet overeen.", + "image-load-failed": "Afbeelding laden mislukt", + "fill-form": "Vul alsjeblieft het formulier in.", + "login-failed": "Inloggen mislukt", + "signup-failed": "Registreren mislukt", + "user-not-found": "Gebruiker niet gevonden", + "password-changed": "Wachtwoord gewijzigd.", + "private-only": "Deze memo is privé.", + "copied": "Gekopieerd", + "succeed-copy-content": "Inhoud gekopieerd naar klembord.", + "change-resource-filename": "Bestandsnaam van bron wijzigen", + "resource-filename-updated": "Bestandsnaam van bron gewijzigd.", + "invalid-resource-filename": "Onjuiste bestandsnaam.", + "click-to-save-the-image": "Klik om de afbeelding op te slaan", + "generating-the-screenshot": "Screenshot genereren...", + "succeed-vacuum-database": "Succeed to vacuum database", + "succeed-update-additional-style": "Optionele stijl bijgewerkt", + "succeed-copy-resource-link": "Link naar bron gekopieërd naar klembord.", + "succeed-update-customized-profile": "Profiel bijgewerkt.", + "succeed-update-additional-script": "Optioneel script bijgewerkt.", + "update-succeed": "Update voltooid", + "succeed-copy-code": "Code gekopieërd naar klembord.", + "page-not-found": "404 - Pagina niet gevonden 😥", + "password-not-match": "Wachtwoorden komen niet overeen.", + "succeed-copy-link": "Link gekopieërd naar klembord.", + "count-selected-resources": "Totaal geselecteerd", + "file-exceeds-upload-limit-of": "Bestand {{file}} is groter dan het limiet van {{size}} MiB", + "updating-setting-failed": "Instelling aanpassen mislukt", + "password-login-disabled": "Je kan niet de laatste inlogprovider verwijderen als inloggen met wachtwoord is uitgeschakeld." + }, + "days": { + "mon": "ma", + "tue": "di", + "wed": "wo", + "thu": "do", + "fri": "vr", + "sat": "za", + "sun": "zo" + }, + "embed-memo": { + "title": "Memo insluiten", + "text": "Kopieer en plak onderstaande code op je eigen website", + "only-public-supported": "* alleen openbare memos kunnen ingesloten worden", + "copy": "Kopieer" + }, + "heatmap": { + "memo-in": "memo in {{period}}", + "memos-in": "memos in {{period}}", + "memo-on": "{{amount}} memo op {{date}}", + "memos-on": "{{amount}} memos op {{date}}", + "day": "dag", + "days": "dagen" + }, + "about": { + "about-memos": "Over Memos", + "memos-description": "Memos is een web-based noteerapplicatie die je kan gebruiekn om notities te schrijven, organiseren en delen.", + "no-server-description": "Geen beschrijving geconfigureerd.", + "powered-by": "Mogelijk gemaakt door", + "other-projects": "Andere projecten" + }, + "router": { + "go-to-home": "Ga naar homepagina", + "back-to-top": "Terug naar boven" + } } diff --git a/web/src/locales/pt-BR.json b/web/src/locales/pt-BR.json index 772257fbd9ae0..94d71be38005d 100644 --- a/web/src/locales/pt-BR.json +++ b/web/src/locales/pt-BR.json @@ -351,7 +351,6 @@ "display-with-updated-time": "Exibir hora de atualização nos memos", "enable-password-login": "Habilitar login com senha", "enable-password-login-warning": "Isso permitirá o login com senha para todos os usuários. Continue apenas se desejar que os usuários possam fazer login usando SSO e senha local❗", - "ignore-version-upgrade": "Ignorar atualização de versão", "max-upload-size": "Tamanho máximo de upload (MiB)", "max-upload-size-hint": "O valor recomendado é 32 MiB.", "server-name": "Nome do servidor", diff --git a/web/src/locales/ru.json b/web/src/locales/ru.json index 55798e40c72d1..753c04c782f1a 100644 --- a/web/src/locales/ru.json +++ b/web/src/locales/ru.json @@ -328,7 +328,6 @@ "database-file-size": "Размер файла базы данных", "disable-public-memos": "Отключить публичные записи", "display-with-updated-time": "Отображать время обновления записи", - "ignore-version-upgrade": "Игнорировать версию", "max-upload-size": "Максимальный размер загрузки (МБ)", "max-upload-size-hint": "Рекомендуемое значение 32 MБ.", "server-name": "Имя сервера", diff --git a/web/src/locales/zh-Hans.json b/web/src/locales/zh-Hans.json index 8e8ccea8705f5..bf30a0b894d5a 100644 --- a/web/src/locales/zh-Hans.json +++ b/web/src/locales/zh-Hans.json @@ -350,7 +350,6 @@ "display-with-updated-time": "显示最后修改时间", "enable-password-login": "启用密码登录", "enable-password-login-warning": "启用所有用户的密码登录。如果希望用户同时使用单点登录和密码登录,请开启密码登录", - "ignore-version-upgrade": "忽略版本升级", "max-upload-size": "最大上传大小 (MiB)", "max-upload-size-hint": "建议值为 32 MiB。", "server-name": "服务名称", diff --git a/web/src/locales/zh-Hant.json b/web/src/locales/zh-Hant.json index 41f9073df5610..7f42adfa19585 100644 --- a/web/src/locales/zh-Hant.json +++ b/web/src/locales/zh-Hant.json @@ -335,7 +335,6 @@ "display-with-updated-time": "顯示更新時間", "enable-password-login": "啟用密碼登入", "enable-password-login-warning": "啟用所有使用者的密碼登入。如果希望使用者同時使用 SSO 和密碼登入,請開啟密碼登入❗", - "ignore-version-upgrade": "忽略版本更新提示", "max-upload-size": "最大上傳檔案大小 (MiB)", "max-upload-size-hint": "建議值為 32 MiB。", "server-name": "伺服器名稱", From 64d4db81cab99af9c0b1866b40a952b5aa095cac Mon Sep 17 00:00:00 2001 From: boojack Date: Mon, 6 Nov 2023 21:00:42 +0800 Subject: [PATCH 027/650] chore: add frontend type definitions (#2482) chore: update --- web/.gitignore | 1 - .../types/proto/api/v2/activity_service.ts | 372 ++ web/src/types/proto/api/v2/common.ts | 10 + web/src/types/proto/api/v2/inbox_service.ts | 569 +++ web/src/types/proto/api/v2/memo_service.ts | 911 +++++ .../types/proto/api/v2/resource_service.ts | 770 ++++ web/src/types/proto/api/v2/system_service.ts | 504 +++ web/src/types/proto/api/v2/tag_service.ts | 413 ++ web/src/types/proto/api/v2/user_service.ts | 1248 ++++++ web/src/types/proto/google/api/annotations.ts | 3 + web/src/types/proto/google/api/client.ts | 1588 ++++++++ .../types/proto/google/api/field_behavior.ts | 62 + web/src/types/proto/google/api/http.ts | 653 +++ .../types/proto/google/api/launch_stage.ts | 58 + .../types/proto/google/protobuf/descriptor.ts | 3573 +++++++++++++++++ .../types/proto/google/protobuf/duration.ts | 178 + .../types/proto/google/protobuf/field_mask.ts | 272 ++ .../types/proto/google/protobuf/timestamp.ts | 207 + web/src/types/proto/store/activity.ts | 189 + web/src/types/proto/store/common.ts | 3 + web/src/types/proto/store/inbox.ts | 80 + web/src/types/proto/store/system_setting.ts | 95 + web/src/types/proto/store/user_setting.ts | 211 + 23 files changed, 11969 insertions(+), 1 deletion(-) create mode 100644 web/src/types/proto/api/v2/activity_service.ts create mode 100644 web/src/types/proto/api/v2/common.ts create mode 100644 web/src/types/proto/api/v2/inbox_service.ts create mode 100644 web/src/types/proto/api/v2/memo_service.ts create mode 100644 web/src/types/proto/api/v2/resource_service.ts create mode 100644 web/src/types/proto/api/v2/system_service.ts create mode 100644 web/src/types/proto/api/v2/tag_service.ts create mode 100644 web/src/types/proto/api/v2/user_service.ts create mode 100644 web/src/types/proto/google/api/annotations.ts create mode 100644 web/src/types/proto/google/api/client.ts create mode 100644 web/src/types/proto/google/api/field_behavior.ts create mode 100644 web/src/types/proto/google/api/http.ts create mode 100644 web/src/types/proto/google/api/launch_stage.ts create mode 100644 web/src/types/proto/google/protobuf/descriptor.ts create mode 100644 web/src/types/proto/google/protobuf/duration.ts create mode 100644 web/src/types/proto/google/protobuf/field_mask.ts create mode 100644 web/src/types/proto/google/protobuf/timestamp.ts create mode 100644 web/src/types/proto/store/activity.ts create mode 100644 web/src/types/proto/store/common.ts create mode 100644 web/src/types/proto/store/inbox.ts create mode 100644 web/src/types/proto/store/system_setting.ts create mode 100644 web/src/types/proto/store/user_setting.ts diff --git a/web/.gitignore b/web/.gitignore index f4e178b9b5bd0..d451ff16c1010 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -3,4 +3,3 @@ node_modules dist dist-ssr *.local -src/types/proto diff --git a/web/src/types/proto/api/v2/activity_service.ts b/web/src/types/proto/api/v2/activity_service.ts new file mode 100644 index 0000000000000..603ab818b2dd9 --- /dev/null +++ b/web/src/types/proto/api/v2/activity_service.ts @@ -0,0 +1,372 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Timestamp } from "../../google/protobuf/timestamp"; + +export const protobufPackage = "memos.api.v2"; + +export interface Activity { + id: number; + creatorId: number; + type: string; + level: string; + createTime?: Date | undefined; + payload?: ActivityPayload | undefined; +} + +export interface ActivityMemoCommentPayload { + memoId: number; + relatedMemoId: number; +} + +export interface ActivityPayload { + memoComment?: ActivityMemoCommentPayload | undefined; +} + +export interface GetActivityRequest { + id: number; +} + +export interface GetActivityResponse { + activity?: Activity | undefined; +} + +function createBaseActivity(): Activity { + return { id: 0, creatorId: 0, type: "", level: "", createTime: undefined, payload: undefined }; +} + +export const Activity = { + encode(message: Activity, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + if (message.creatorId !== 0) { + writer.uint32(16).int32(message.creatorId); + } + if (message.type !== "") { + writer.uint32(26).string(message.type); + } + if (message.level !== "") { + writer.uint32(34).string(message.level); + } + if (message.createTime !== undefined) { + Timestamp.encode(toTimestamp(message.createTime), writer.uint32(42).fork()).ldelim(); + } + if (message.payload !== undefined) { + ActivityPayload.encode(message.payload, writer.uint32(50).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Activity { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActivity(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.creatorId = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.type = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.level = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.payload = ActivityPayload.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Activity { + return Activity.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Activity { + const message = createBaseActivity(); + message.id = object.id ?? 0; + message.creatorId = object.creatorId ?? 0; + message.type = object.type ?? ""; + message.level = object.level ?? ""; + message.createTime = object.createTime ?? undefined; + message.payload = (object.payload !== undefined && object.payload !== null) + ? ActivityPayload.fromPartial(object.payload) + : undefined; + return message; + }, +}; + +function createBaseActivityMemoCommentPayload(): ActivityMemoCommentPayload { + return { memoId: 0, relatedMemoId: 0 }; +} + +export const ActivityMemoCommentPayload = { + encode(message: ActivityMemoCommentPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.memoId !== 0) { + writer.uint32(8).int32(message.memoId); + } + if (message.relatedMemoId !== 0) { + writer.uint32(16).int32(message.relatedMemoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ActivityMemoCommentPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActivityMemoCommentPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.memoId = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.relatedMemoId = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ActivityMemoCommentPayload { + return ActivityMemoCommentPayload.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ActivityMemoCommentPayload { + const message = createBaseActivityMemoCommentPayload(); + message.memoId = object.memoId ?? 0; + message.relatedMemoId = object.relatedMemoId ?? 0; + return message; + }, +}; + +function createBaseActivityPayload(): ActivityPayload { + return { memoComment: undefined }; +} + +export const ActivityPayload = { + encode(message: ActivityPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.memoComment !== undefined) { + ActivityMemoCommentPayload.encode(message.memoComment, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ActivityPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActivityPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.memoComment = ActivityMemoCommentPayload.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ActivityPayload { + return ActivityPayload.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ActivityPayload { + const message = createBaseActivityPayload(); + message.memoComment = (object.memoComment !== undefined && object.memoComment !== null) + ? ActivityMemoCommentPayload.fromPartial(object.memoComment) + : undefined; + return message; + }, +}; + +function createBaseGetActivityRequest(): GetActivityRequest { + return { id: 0 }; +} + +export const GetActivityRequest = { + encode(message: GetActivityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetActivityRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetActivityRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetActivityRequest { + return GetActivityRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GetActivityRequest { + const message = createBaseGetActivityRequest(); + message.id = object.id ?? 0; + return message; + }, +}; + +function createBaseGetActivityResponse(): GetActivityResponse { + return { activity: undefined }; +} + +export const GetActivityResponse = { + encode(message: GetActivityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.activity !== undefined) { + Activity.encode(message.activity, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetActivityResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetActivityResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.activity = Activity.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetActivityResponse { + return GetActivityResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GetActivityResponse { + const message = createBaseGetActivityResponse(); + message.activity = (object.activity !== undefined && object.activity !== null) + ? Activity.fromPartial(object.activity) + : undefined; + return message; + }, +}; + +export type ActivityServiceDefinition = typeof ActivityServiceDefinition; +export const ActivityServiceDefinition = { + name: "ActivityService", + fullName: "memos.api.v2.ActivityService", + methods: { + getActivity: { + name: "GetActivity", + requestType: GetActivityRequest, + requestStream: false, + responseType: GetActivityResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [new Uint8Array([16, 18, 14, 47, 118, 50, 47, 97, 99, 116, 105, 118, 105, 116, 105, 101, 115])], + }, + }, + }, + }, +} as const; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new Date(millis); +} diff --git a/web/src/types/proto/api/v2/common.ts b/web/src/types/proto/api/v2/common.ts new file mode 100644 index 0000000000000..81f0bf16bd4e3 --- /dev/null +++ b/web/src/types/proto/api/v2/common.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ + +export const protobufPackage = "memos.api.v2"; + +export enum RowStatus { + ROW_STATUS_UNSPECIFIED = 0, + ACTIVE = 1, + ARCHIVED = 2, + UNRECOGNIZED = -1, +} diff --git a/web/src/types/proto/api/v2/inbox_service.ts b/web/src/types/proto/api/v2/inbox_service.ts new file mode 100644 index 0000000000000..03e92ea1d3a9e --- /dev/null +++ b/web/src/types/proto/api/v2/inbox_service.ts @@ -0,0 +1,569 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../google/protobuf/field_mask"; +import { Timestamp } from "../../google/protobuf/timestamp"; + +export const protobufPackage = "memos.api.v2"; + +export interface Inbox { + /** + * The name of the inbox. + * Format: inboxes/{id} + */ + name: string; + /** Format: users/{username} */ + sender: string; + /** Format: users/{username} */ + receiver: string; + status: Inbox_Status; + createTime?: Date | undefined; + type: Inbox_Type; + activityId?: number | undefined; +} + +export enum Inbox_Status { + STATUS_UNSPECIFIED = 0, + UNREAD = 1, + ARCHIVED = 2, + UNRECOGNIZED = -1, +} + +export enum Inbox_Type { + TYPE_UNSPECIFIED = 0, + TYPE_MEMO_COMMENT = 1, + UNRECOGNIZED = -1, +} + +export interface ListInboxesRequest { + /** Format: users/{username} */ + user: string; +} + +export interface ListInboxesResponse { + inboxes: Inbox[]; +} + +export interface UpdateInboxRequest { + inbox?: Inbox | undefined; + updateMask?: string[] | undefined; +} + +export interface UpdateInboxResponse { + inbox?: Inbox | undefined; +} + +export interface DeleteInboxRequest { + /** + * The name of the inbox to delete. + * Format: inboxes/{inbox} + */ + name: string; +} + +export interface DeleteInboxResponse { +} + +function createBaseInbox(): Inbox { + return { name: "", sender: "", receiver: "", status: 0, createTime: undefined, type: 0, activityId: undefined }; +} + +export const Inbox = { + encode(message: Inbox, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.sender !== "") { + writer.uint32(18).string(message.sender); + } + if (message.receiver !== "") { + writer.uint32(26).string(message.receiver); + } + if (message.status !== 0) { + writer.uint32(32).int32(message.status); + } + if (message.createTime !== undefined) { + Timestamp.encode(toTimestamp(message.createTime), writer.uint32(42).fork()).ldelim(); + } + if (message.type !== 0) { + writer.uint32(48).int32(message.type); + } + if (message.activityId !== undefined) { + writer.uint32(56).int32(message.activityId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Inbox { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInbox(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.sender = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.receiver = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.status = reader.int32() as any; + continue; + case 5: + if (tag !== 42) { + break; + } + + message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.type = reader.int32() as any; + continue; + case 7: + if (tag !== 56) { + break; + } + + message.activityId = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Inbox { + return Inbox.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Inbox { + const message = createBaseInbox(); + message.name = object.name ?? ""; + message.sender = object.sender ?? ""; + message.receiver = object.receiver ?? ""; + message.status = object.status ?? 0; + message.createTime = object.createTime ?? undefined; + message.type = object.type ?? 0; + message.activityId = object.activityId ?? undefined; + return message; + }, +}; + +function createBaseListInboxesRequest(): ListInboxesRequest { + return { user: "" }; +} + +export const ListInboxesRequest = { + encode(message: ListInboxesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== "") { + writer.uint32(10).string(message.user); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListInboxesRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListInboxesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListInboxesRequest { + return ListInboxesRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListInboxesRequest { + const message = createBaseListInboxesRequest(); + message.user = object.user ?? ""; + return message; + }, +}; + +function createBaseListInboxesResponse(): ListInboxesResponse { + return { inboxes: [] }; +} + +export const ListInboxesResponse = { + encode(message: ListInboxesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.inboxes) { + Inbox.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListInboxesResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListInboxesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.inboxes.push(Inbox.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListInboxesResponse { + return ListInboxesResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListInboxesResponse { + const message = createBaseListInboxesResponse(); + message.inboxes = object.inboxes?.map((e) => Inbox.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseUpdateInboxRequest(): UpdateInboxRequest { + return { inbox: undefined, updateMask: undefined }; +} + +export const UpdateInboxRequest = { + encode(message: UpdateInboxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.inbox !== undefined) { + Inbox.encode(message.inbox, writer.uint32(10).fork()).ldelim(); + } + if (message.updateMask !== undefined) { + FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInboxRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInboxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.inbox = Inbox.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateInboxRequest { + return UpdateInboxRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateInboxRequest { + const message = createBaseUpdateInboxRequest(); + message.inbox = (object.inbox !== undefined && object.inbox !== null) ? Inbox.fromPartial(object.inbox) : undefined; + message.updateMask = object.updateMask ?? undefined; + return message; + }, +}; + +function createBaseUpdateInboxResponse(): UpdateInboxResponse { + return { inbox: undefined }; +} + +export const UpdateInboxResponse = { + encode(message: UpdateInboxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.inbox !== undefined) { + Inbox.encode(message.inbox, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInboxResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInboxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.inbox = Inbox.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateInboxResponse { + return UpdateInboxResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateInboxResponse { + const message = createBaseUpdateInboxResponse(); + message.inbox = (object.inbox !== undefined && object.inbox !== null) ? Inbox.fromPartial(object.inbox) : undefined; + return message; + }, +}; + +function createBaseDeleteInboxRequest(): DeleteInboxRequest { + return { name: "" }; +} + +export const DeleteInboxRequest = { + encode(message: DeleteInboxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteInboxRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteInboxRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteInboxRequest { + return DeleteInboxRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DeleteInboxRequest { + const message = createBaseDeleteInboxRequest(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseDeleteInboxResponse(): DeleteInboxResponse { + return {}; +} + +export const DeleteInboxResponse = { + encode(_: DeleteInboxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteInboxResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteInboxResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteInboxResponse { + return DeleteInboxResponse.fromPartial(base ?? {}); + }, + + fromPartial(_: DeepPartial): DeleteInboxResponse { + const message = createBaseDeleteInboxResponse(); + return message; + }, +}; + +export type InboxServiceDefinition = typeof InboxServiceDefinition; +export const InboxServiceDefinition = { + name: "InboxService", + fullName: "memos.api.v2.InboxService", + methods: { + listInboxes: { + name: "ListInboxes", + requestType: ListInboxesRequest, + requestStream: false, + responseType: ListInboxesResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [ + new Uint8Array([17, 18, 15, 47, 97, 112, 105, 47, 118, 50, 47, 105, 110, 98, 111, 120, 101, 115]), + ], + }, + }, + }, + updateInbox: { + name: "UpdateInbox", + requestType: UpdateInboxRequest, + requestStream: false, + responseType: UpdateInboxResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([17, 105, 110, 98, 111, 120, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])], + 578365826: [ + new Uint8Array([ + 20, + 58, + 5, + 105, + 110, + 98, + 111, + 120, + 50, + 11, + 47, + 118, + 50, + 47, + 105, + 110, + 98, + 111, + 120, + 101, + 115, + ]), + ], + }, + }, + }, + deleteInbox: { + name: "DeleteInbox", + requestType: DeleteInboxRequest, + requestStream: false, + responseType: DeleteInboxResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([4, 110, 97, 109, 101])], + 578365826: [ + new Uint8Array([ + 22, + 42, + 20, + 47, + 118, + 50, + 47, + 123, + 110, + 97, + 109, + 101, + 61, + 105, + 110, + 98, + 111, + 120, + 101, + 115, + 47, + 42, + 125, + ]), + ], + }, + }, + }, + }, +} as const; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new Date(millis); +} diff --git a/web/src/types/proto/api/v2/memo_service.ts b/web/src/types/proto/api/v2/memo_service.ts new file mode 100644 index 0000000000000..f60d18c21093a --- /dev/null +++ b/web/src/types/proto/api/v2/memo_service.ts @@ -0,0 +1,911 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { RowStatus } from "./common"; + +export const protobufPackage = "memos.api.v2"; + +export enum Visibility { + VISIBILITY_UNSPECIFIED = 0, + PRIVATE = 1, + PROTECTED = 2, + PUBLIC = 3, + UNRECOGNIZED = -1, +} + +export interface Memo { + id: number; + rowStatus: RowStatus; + creatorId: number; + createdTs: number; + updatedTs: number; + content: string; + visibility: Visibility; + pinned: boolean; +} + +export interface CreateMemoRequest { + content: string; + visibility: Visibility; +} + +export interface CreateMemoResponse { + memo?: Memo | undefined; +} + +export interface ListMemosRequest { + page: number; + pageSize: number; + /** Filter is used to filter memos returned in the list. */ + filter: string; + creatorId?: number | undefined; +} + +export interface ListMemosResponse { + memos: Memo[]; +} + +export interface GetMemoRequest { + id: number; +} + +export interface GetMemoResponse { + memo?: Memo | undefined; +} + +export interface CreateMemoCommentRequest { + /** id is the memo id to create comment for. */ + id: number; + create?: CreateMemoRequest | undefined; +} + +export interface CreateMemoCommentResponse { + memo?: Memo | undefined; +} + +export interface ListMemoCommentsRequest { + id: number; +} + +export interface ListMemoCommentsResponse { + memos: Memo[]; +} + +function createBaseMemo(): Memo { + return { id: 0, rowStatus: 0, creatorId: 0, createdTs: 0, updatedTs: 0, content: "", visibility: 0, pinned: false }; +} + +export const Memo = { + encode(message: Memo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + if (message.rowStatus !== 0) { + writer.uint32(16).int32(message.rowStatus); + } + if (message.creatorId !== 0) { + writer.uint32(24).int32(message.creatorId); + } + if (message.createdTs !== 0) { + writer.uint32(32).int64(message.createdTs); + } + if (message.updatedTs !== 0) { + writer.uint32(40).int64(message.updatedTs); + } + if (message.content !== "") { + writer.uint32(50).string(message.content); + } + if (message.visibility !== 0) { + writer.uint32(56).int32(message.visibility); + } + if (message.pinned === true) { + writer.uint32(64).bool(message.pinned); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Memo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMemo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.rowStatus = reader.int32() as any; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.creatorId = reader.int32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.createdTs = longToNumber(reader.int64() as Long); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.updatedTs = longToNumber(reader.int64() as Long); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.content = reader.string(); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.visibility = reader.int32() as any; + continue; + case 8: + if (tag !== 64) { + break; + } + + message.pinned = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Memo { + return Memo.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Memo { + const message = createBaseMemo(); + message.id = object.id ?? 0; + message.rowStatus = object.rowStatus ?? 0; + message.creatorId = object.creatorId ?? 0; + message.createdTs = object.createdTs ?? 0; + message.updatedTs = object.updatedTs ?? 0; + message.content = object.content ?? ""; + message.visibility = object.visibility ?? 0; + message.pinned = object.pinned ?? false; + return message; + }, +}; + +function createBaseCreateMemoRequest(): CreateMemoRequest { + return { content: "", visibility: 0 }; +} + +export const CreateMemoRequest = { + encode(message: CreateMemoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.content !== "") { + writer.uint32(10).string(message.content); + } + if (message.visibility !== 0) { + writer.uint32(16).int32(message.visibility); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMemoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.content = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.visibility = reader.int32() as any; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateMemoRequest { + return CreateMemoRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateMemoRequest { + const message = createBaseCreateMemoRequest(); + message.content = object.content ?? ""; + message.visibility = object.visibility ?? 0; + return message; + }, +}; + +function createBaseCreateMemoResponse(): CreateMemoResponse { + return { memo: undefined }; +} + +export const CreateMemoResponse = { + encode(message: CreateMemoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.memo !== undefined) { + Memo.encode(message.memo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMemoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.memo = Memo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateMemoResponse { + return CreateMemoResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateMemoResponse { + const message = createBaseCreateMemoResponse(); + message.memo = (object.memo !== undefined && object.memo !== null) ? Memo.fromPartial(object.memo) : undefined; + return message; + }, +}; + +function createBaseListMemosRequest(): ListMemosRequest { + return { page: 0, pageSize: 0, filter: "", creatorId: undefined }; +} + +export const ListMemosRequest = { + encode(message: ListMemosRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); + } + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); + } + if (message.filter !== "") { + writer.uint32(26).string(message.filter); + } + if (message.creatorId !== undefined) { + writer.uint32(32).int32(message.creatorId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListMemosRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListMemosRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.page = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.pageSize = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.filter = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.creatorId = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListMemosRequest { + return ListMemosRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListMemosRequest { + const message = createBaseListMemosRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.filter = object.filter ?? ""; + message.creatorId = object.creatorId ?? undefined; + return message; + }, +}; + +function createBaseListMemosResponse(): ListMemosResponse { + return { memos: [] }; +} + +export const ListMemosResponse = { + encode(message: ListMemosResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.memos) { + Memo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListMemosResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListMemosResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.memos.push(Memo.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListMemosResponse { + return ListMemosResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListMemosResponse { + const message = createBaseListMemosResponse(); + message.memos = object.memos?.map((e) => Memo.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetMemoRequest(): GetMemoRequest { + return { id: 0 }; +} + +export const GetMemoRequest = { + encode(message: GetMemoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetMemoRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetMemoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetMemoRequest { + return GetMemoRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GetMemoRequest { + const message = createBaseGetMemoRequest(); + message.id = object.id ?? 0; + return message; + }, +}; + +function createBaseGetMemoResponse(): GetMemoResponse { + return { memo: undefined }; +} + +export const GetMemoResponse = { + encode(message: GetMemoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.memo !== undefined) { + Memo.encode(message.memo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetMemoResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetMemoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.memo = Memo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetMemoResponse { + return GetMemoResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GetMemoResponse { + const message = createBaseGetMemoResponse(); + message.memo = (object.memo !== undefined && object.memo !== null) ? Memo.fromPartial(object.memo) : undefined; + return message; + }, +}; + +function createBaseCreateMemoCommentRequest(): CreateMemoCommentRequest { + return { id: 0, create: undefined }; +} + +export const CreateMemoCommentRequest = { + encode(message: CreateMemoCommentRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + if (message.create !== undefined) { + CreateMemoRequest.encode(message.create, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoCommentRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMemoCommentRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.create = CreateMemoRequest.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateMemoCommentRequest { + return CreateMemoCommentRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateMemoCommentRequest { + const message = createBaseCreateMemoCommentRequest(); + message.id = object.id ?? 0; + message.create = (object.create !== undefined && object.create !== null) + ? CreateMemoRequest.fromPartial(object.create) + : undefined; + return message; + }, +}; + +function createBaseCreateMemoCommentResponse(): CreateMemoCommentResponse { + return { memo: undefined }; +} + +export const CreateMemoCommentResponse = { + encode(message: CreateMemoCommentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.memo !== undefined) { + Memo.encode(message.memo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoCommentResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMemoCommentResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.memo = Memo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateMemoCommentResponse { + return CreateMemoCommentResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateMemoCommentResponse { + const message = createBaseCreateMemoCommentResponse(); + message.memo = (object.memo !== undefined && object.memo !== null) ? Memo.fromPartial(object.memo) : undefined; + return message; + }, +}; + +function createBaseListMemoCommentsRequest(): ListMemoCommentsRequest { + return { id: 0 }; +} + +export const ListMemoCommentsRequest = { + encode(message: ListMemoCommentsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListMemoCommentsRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListMemoCommentsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListMemoCommentsRequest { + return ListMemoCommentsRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListMemoCommentsRequest { + const message = createBaseListMemoCommentsRequest(); + message.id = object.id ?? 0; + return message; + }, +}; + +function createBaseListMemoCommentsResponse(): ListMemoCommentsResponse { + return { memos: [] }; +} + +export const ListMemoCommentsResponse = { + encode(message: ListMemoCommentsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.memos) { + Memo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListMemoCommentsResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListMemoCommentsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.memos.push(Memo.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListMemoCommentsResponse { + return ListMemoCommentsResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListMemoCommentsResponse { + const message = createBaseListMemoCommentsResponse(); + message.memos = object.memos?.map((e) => Memo.fromPartial(e)) || []; + return message; + }, +}; + +export type MemoServiceDefinition = typeof MemoServiceDefinition; +export const MemoServiceDefinition = { + name: "MemoService", + fullName: "memos.api.v2.MemoService", + methods: { + createMemo: { + name: "CreateMemo", + requestType: CreateMemoRequest, + requestStream: false, + responseType: CreateMemoResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [new Uint8Array([15, 34, 13, 47, 97, 112, 105, 47, 118, 50, 47, 109, 101, 109, 111, 115])], + }, + }, + }, + listMemos: { + name: "ListMemos", + requestType: ListMemosRequest, + requestStream: false, + responseType: ListMemosResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [new Uint8Array([15, 18, 13, 47, 97, 112, 105, 47, 118, 50, 47, 109, 101, 109, 111, 115])], + }, + }, + }, + getMemo: { + name: "GetMemo", + requestType: GetMemoRequest, + requestStream: false, + responseType: GetMemoResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([2, 105, 100])], + 578365826: [ + new Uint8Array([ + 20, + 18, + 18, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 109, + 101, + 109, + 111, + 115, + 47, + 123, + 105, + 100, + 125, + ]), + ], + }, + }, + }, + createMemoComment: { + name: "CreateMemoComment", + requestType: CreateMemoCommentRequest, + requestStream: false, + responseType: CreateMemoCommentResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([2, 105, 100])], + 578365826: [ + new Uint8Array([ + 29, + 34, + 27, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 109, + 101, + 109, + 111, + 115, + 47, + 123, + 105, + 100, + 125, + 47, + 99, + 111, + 109, + 109, + 101, + 110, + 116, + 115, + ]), + ], + }, + }, + }, + listMemoComments: { + name: "ListMemoComments", + requestType: ListMemoCommentsRequest, + requestStream: false, + responseType: ListMemoCommentsResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([2, 105, 100])], + 578365826: [ + new Uint8Array([ + 29, + 18, + 27, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 109, + 101, + 109, + 111, + 115, + 47, + 123, + 105, + 100, + 125, + 47, + 99, + 111, + 109, + 109, + 101, + 110, + 116, + 115, + ]), + ], + }, + }, + }, + }, +} as const; + +declare const self: any | undefined; +declare const window: any | undefined; +declare const global: any | undefined; +const tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/web/src/types/proto/api/v2/resource_service.ts b/web/src/types/proto/api/v2/resource_service.ts new file mode 100644 index 0000000000000..f96b9f0ef9f2a --- /dev/null +++ b/web/src/types/proto/api/v2/resource_service.ts @@ -0,0 +1,770 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../google/protobuf/field_mask"; +import { Timestamp } from "../../google/protobuf/timestamp"; + +export const protobufPackage = "memos.api.v2"; + +export interface Resource { + id: number; + createdTs?: Date | undefined; + filename: string; + externalLink: string; + type: string; + size: number; + memoId?: number | undefined; +} + +export interface CreateResourceRequest { + filename: string; + externalLink: string; + type: string; + memoId?: number | undefined; +} + +export interface CreateResourceResponse { + resource?: Resource | undefined; +} + +export interface ListResourcesRequest { +} + +export interface ListResourcesResponse { + resources: Resource[]; +} + +export interface UpdateResourceRequest { + resource?: Resource | undefined; + updateMask?: string[] | undefined; +} + +export interface UpdateResourceResponse { + resource?: Resource | undefined; +} + +export interface DeleteResourceRequest { + id: number; +} + +export interface DeleteResourceResponse { +} + +function createBaseResource(): Resource { + return { id: 0, createdTs: undefined, filename: "", externalLink: "", type: "", size: 0, memoId: undefined }; +} + +export const Resource = { + encode(message: Resource, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + if (message.createdTs !== undefined) { + Timestamp.encode(toTimestamp(message.createdTs), writer.uint32(18).fork()).ldelim(); + } + if (message.filename !== "") { + writer.uint32(26).string(message.filename); + } + if (message.externalLink !== "") { + writer.uint32(34).string(message.externalLink); + } + if (message.type !== "") { + writer.uint32(42).string(message.type); + } + if (message.size !== 0) { + writer.uint32(48).int64(message.size); + } + if (message.memoId !== undefined) { + writer.uint32(56).int32(message.memoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Resource { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResource(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.createdTs = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.filename = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.externalLink = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.type = reader.string(); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.size = longToNumber(reader.int64() as Long); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.memoId = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Resource { + return Resource.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Resource { + const message = createBaseResource(); + message.id = object.id ?? 0; + message.createdTs = object.createdTs ?? undefined; + message.filename = object.filename ?? ""; + message.externalLink = object.externalLink ?? ""; + message.type = object.type ?? ""; + message.size = object.size ?? 0; + message.memoId = object.memoId ?? undefined; + return message; + }, +}; + +function createBaseCreateResourceRequest(): CreateResourceRequest { + return { filename: "", externalLink: "", type: "", memoId: undefined }; +} + +export const CreateResourceRequest = { + encode(message: CreateResourceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.filename !== "") { + writer.uint32(10).string(message.filename); + } + if (message.externalLink !== "") { + writer.uint32(18).string(message.externalLink); + } + if (message.type !== "") { + writer.uint32(26).string(message.type); + } + if (message.memoId !== undefined) { + writer.uint32(32).int32(message.memoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateResourceRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateResourceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.filename = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.externalLink = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.type = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.memoId = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateResourceRequest { + return CreateResourceRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateResourceRequest { + const message = createBaseCreateResourceRequest(); + message.filename = object.filename ?? ""; + message.externalLink = object.externalLink ?? ""; + message.type = object.type ?? ""; + message.memoId = object.memoId ?? undefined; + return message; + }, +}; + +function createBaseCreateResourceResponse(): CreateResourceResponse { + return { resource: undefined }; +} + +export const CreateResourceResponse = { + encode(message: CreateResourceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateResourceResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateResourceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resource = Resource.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateResourceResponse { + return CreateResourceResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateResourceResponse { + const message = createBaseCreateResourceResponse(); + message.resource = (object.resource !== undefined && object.resource !== null) + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +function createBaseListResourcesRequest(): ListResourcesRequest { + return {}; +} + +export const ListResourcesRequest = { + encode(_: ListResourcesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListResourcesRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListResourcesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListResourcesRequest { + return ListResourcesRequest.fromPartial(base ?? {}); + }, + + fromPartial(_: DeepPartial): ListResourcesRequest { + const message = createBaseListResourcesRequest(); + return message; + }, +}; + +function createBaseListResourcesResponse(): ListResourcesResponse { + return { resources: [] }; +} + +export const ListResourcesResponse = { + encode(message: ListResourcesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.resources) { + Resource.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListResourcesResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListResourcesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resources.push(Resource.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListResourcesResponse { + return ListResourcesResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListResourcesResponse { + const message = createBaseListResourcesResponse(); + message.resources = object.resources?.map((e) => Resource.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseUpdateResourceRequest(): UpdateResourceRequest { + return { resource: undefined, updateMask: undefined }; +} + +export const UpdateResourceRequest = { + encode(message: UpdateResourceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + } + if (message.updateMask !== undefined) { + FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateResourceRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateResourceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resource = Resource.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateResourceRequest { + return UpdateResourceRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateResourceRequest { + const message = createBaseUpdateResourceRequest(); + message.resource = (object.resource !== undefined && object.resource !== null) + ? Resource.fromPartial(object.resource) + : undefined; + message.updateMask = object.updateMask ?? undefined; + return message; + }, +}; + +function createBaseUpdateResourceResponse(): UpdateResourceResponse { + return { resource: undefined }; +} + +export const UpdateResourceResponse = { + encode(message: UpdateResourceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resource !== undefined) { + Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateResourceResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateResourceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.resource = Resource.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateResourceResponse { + return UpdateResourceResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateResourceResponse { + const message = createBaseUpdateResourceResponse(); + message.resource = (object.resource !== undefined && object.resource !== null) + ? Resource.fromPartial(object.resource) + : undefined; + return message; + }, +}; + +function createBaseDeleteResourceRequest(): DeleteResourceRequest { + return { id: 0 }; +} + +export const DeleteResourceRequest = { + encode(message: DeleteResourceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.id !== 0) { + writer.uint32(8).int32(message.id); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteResourceRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteResourceRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.id = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteResourceRequest { + return DeleteResourceRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DeleteResourceRequest { + const message = createBaseDeleteResourceRequest(); + message.id = object.id ?? 0; + return message; + }, +}; + +function createBaseDeleteResourceResponse(): DeleteResourceResponse { + return {}; +} + +export const DeleteResourceResponse = { + encode(_: DeleteResourceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteResourceResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteResourceResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteResourceResponse { + return DeleteResourceResponse.fromPartial(base ?? {}); + }, + + fromPartial(_: DeepPartial): DeleteResourceResponse { + const message = createBaseDeleteResourceResponse(); + return message; + }, +}; + +export type ResourceServiceDefinition = typeof ResourceServiceDefinition; +export const ResourceServiceDefinition = { + name: "ResourceService", + fullName: "memos.api.v2.ResourceService", + methods: { + createResource: { + name: "CreateResource", + requestType: CreateResourceRequest, + requestStream: false, + responseType: CreateResourceResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [ + new Uint8Array([19, 34, 17, 47, 97, 112, 105, 47, 118, 50, 47, 114, 101, 115, 111, 117, 114, 99, 101, 115]), + ], + }, + }, + }, + listResources: { + name: "ListResources", + requestType: ListResourcesRequest, + requestStream: false, + responseType: ListResourcesResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [ + new Uint8Array([19, 18, 17, 47, 97, 112, 105, 47, 118, 50, 47, 114, 101, 115, 111, 117, 114, 99, 101, 115]), + ], + }, + }, + }, + updateResource: { + name: "UpdateResource", + requestType: UpdateResourceRequest, + requestStream: false, + responseType: UpdateResourceResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [ + new Uint8Array([ + 20, + 114, + 101, + 115, + 111, + 117, + 114, + 99, + 101, + 44, + 117, + 112, + 100, + 97, + 116, + 101, + 95, + 109, + 97, + 115, + 107, + ]), + ], + 578365826: [ + new Uint8Array([ + 43, + 58, + 8, + 114, + 101, + 115, + 111, + 117, + 114, + 99, + 101, + 50, + 31, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 114, + 101, + 115, + 111, + 117, + 114, + 99, + 101, + 115, + 47, + 123, + 114, + 101, + 115, + 111, + 117, + 114, + 99, + 101, + 46, + 105, + 100, + 125, + ]), + ], + }, + }, + }, + deleteResource: { + name: "DeleteResource", + requestType: DeleteResourceRequest, + requestStream: false, + responseType: DeleteResourceResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([2, 105, 100])], + 578365826: [ + new Uint8Array([ + 24, + 18, + 22, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 114, + 101, + 115, + 111, + 117, + 114, + 99, + 101, + 115, + 47, + 123, + 105, + 100, + 125, + ]), + ], + }, + }, + }, + }, +} as const; + +declare const self: any | undefined; +declare const window: any | undefined; +declare const global: any | undefined; +const tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new Date(millis); +} + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/web/src/types/proto/api/v2/system_service.ts b/web/src/types/proto/api/v2/system_service.ts new file mode 100644 index 0000000000000..25d2b2612792b --- /dev/null +++ b/web/src/types/proto/api/v2/system_service.ts @@ -0,0 +1,504 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../google/protobuf/field_mask"; + +export const protobufPackage = "memos.api.v2"; + +export interface SystemInfo { + version: string; + mode: string; + allowRegistration: boolean; + disablePasswordLogin: boolean; + additionalScript: string; + additionalStyle: string; + dbSize: number; +} + +export interface GetSystemInfoRequest { +} + +export interface GetSystemInfoResponse { + systemInfo?: SystemInfo | undefined; +} + +export interface UpdateSystemInfoRequest { + /** System info is the updated data. */ + systemInfo?: SystemInfo | undefined; + updateMask?: string[] | undefined; +} + +export interface UpdateSystemInfoResponse { + systemInfo?: SystemInfo | undefined; +} + +function createBaseSystemInfo(): SystemInfo { + return { + version: "", + mode: "", + allowRegistration: false, + disablePasswordLogin: false, + additionalScript: "", + additionalStyle: "", + dbSize: 0, + }; +} + +export const SystemInfo = { + encode(message: SystemInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.mode !== "") { + writer.uint32(18).string(message.mode); + } + if (message.allowRegistration === true) { + writer.uint32(24).bool(message.allowRegistration); + } + if (message.disablePasswordLogin === true) { + writer.uint32(32).bool(message.disablePasswordLogin); + } + if (message.additionalScript !== "") { + writer.uint32(42).string(message.additionalScript); + } + if (message.additionalStyle !== "") { + writer.uint32(50).string(message.additionalStyle); + } + if (message.dbSize !== 0) { + writer.uint32(56).int64(message.dbSize); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SystemInfo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSystemInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.version = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.mode = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.allowRegistration = reader.bool(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.disablePasswordLogin = reader.bool(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.additionalScript = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.additionalStyle = reader.string(); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.dbSize = longToNumber(reader.int64() as Long); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): SystemInfo { + return SystemInfo.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): SystemInfo { + const message = createBaseSystemInfo(); + message.version = object.version ?? ""; + message.mode = object.mode ?? ""; + message.allowRegistration = object.allowRegistration ?? false; + message.disablePasswordLogin = object.disablePasswordLogin ?? false; + message.additionalScript = object.additionalScript ?? ""; + message.additionalStyle = object.additionalStyle ?? ""; + message.dbSize = object.dbSize ?? 0; + return message; + }, +}; + +function createBaseGetSystemInfoRequest(): GetSystemInfoRequest { + return {}; +} + +export const GetSystemInfoRequest = { + encode(_: GetSystemInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetSystemInfoRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetSystemInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetSystemInfoRequest { + return GetSystemInfoRequest.fromPartial(base ?? {}); + }, + + fromPartial(_: DeepPartial): GetSystemInfoRequest { + const message = createBaseGetSystemInfoRequest(); + return message; + }, +}; + +function createBaseGetSystemInfoResponse(): GetSystemInfoResponse { + return { systemInfo: undefined }; +} + +export const GetSystemInfoResponse = { + encode(message: GetSystemInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.systemInfo !== undefined) { + SystemInfo.encode(message.systemInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetSystemInfoResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetSystemInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.systemInfo = SystemInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetSystemInfoResponse { + return GetSystemInfoResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GetSystemInfoResponse { + const message = createBaseGetSystemInfoResponse(); + message.systemInfo = (object.systemInfo !== undefined && object.systemInfo !== null) + ? SystemInfo.fromPartial(object.systemInfo) + : undefined; + return message; + }, +}; + +function createBaseUpdateSystemInfoRequest(): UpdateSystemInfoRequest { + return { systemInfo: undefined, updateMask: undefined }; +} + +export const UpdateSystemInfoRequest = { + encode(message: UpdateSystemInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.systemInfo !== undefined) { + SystemInfo.encode(message.systemInfo, writer.uint32(10).fork()).ldelim(); + } + if (message.updateMask !== undefined) { + FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSystemInfoRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateSystemInfoRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.systemInfo = SystemInfo.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateSystemInfoRequest { + return UpdateSystemInfoRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateSystemInfoRequest { + const message = createBaseUpdateSystemInfoRequest(); + message.systemInfo = (object.systemInfo !== undefined && object.systemInfo !== null) + ? SystemInfo.fromPartial(object.systemInfo) + : undefined; + message.updateMask = object.updateMask ?? undefined; + return message; + }, +}; + +function createBaseUpdateSystemInfoResponse(): UpdateSystemInfoResponse { + return { systemInfo: undefined }; +} + +export const UpdateSystemInfoResponse = { + encode(message: UpdateSystemInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.systemInfo !== undefined) { + SystemInfo.encode(message.systemInfo, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSystemInfoResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateSystemInfoResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.systemInfo = SystemInfo.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateSystemInfoResponse { + return UpdateSystemInfoResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateSystemInfoResponse { + const message = createBaseUpdateSystemInfoResponse(); + message.systemInfo = (object.systemInfo !== undefined && object.systemInfo !== null) + ? SystemInfo.fromPartial(object.systemInfo) + : undefined; + return message; + }, +}; + +export type SystemServiceDefinition = typeof SystemServiceDefinition; +export const SystemServiceDefinition = { + name: "SystemService", + fullName: "memos.api.v2.SystemService", + methods: { + getSystemInfo: { + name: "GetSystemInfo", + requestType: GetSystemInfoRequest, + requestStream: false, + responseType: GetSystemInfoResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [ + new Uint8Array([ + 21, + 18, + 19, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 115, + 121, + 115, + 116, + 101, + 109, + 47, + 105, + 110, + 102, + 111, + ]), + ], + }, + }, + }, + updateSystemInfo: { + name: "UpdateSystemInfo", + requestType: UpdateSystemInfoRequest, + requestStream: false, + responseType: UpdateSystemInfoResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [ + new Uint8Array([ + 23, + 115, + 121, + 115, + 116, + 101, + 109, + 95, + 105, + 110, + 102, + 111, + 44, + 117, + 112, + 100, + 97, + 116, + 101, + 95, + 109, + 97, + 115, + 107, + ]), + ], + 578365826: [ + new Uint8Array([ + 34, + 58, + 11, + 115, + 121, + 115, + 116, + 101, + 109, + 95, + 105, + 110, + 102, + 111, + 50, + 19, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 115, + 121, + 115, + 116, + 101, + 109, + 47, + 105, + 110, + 102, + 111, + ]), + ], + }, + }, + }, + }, +} as const; + +declare const self: any | undefined; +declare const window: any | undefined; +declare const global: any | undefined; +const tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/web/src/types/proto/api/v2/tag_service.ts b/web/src/types/proto/api/v2/tag_service.ts new file mode 100644 index 0000000000000..26d4aceba6a1a --- /dev/null +++ b/web/src/types/proto/api/v2/tag_service.ts @@ -0,0 +1,413 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "memos.api.v2"; + +export interface Tag { + name: string; + /** + * The creator of tags. + * Format: users/{username} + */ + creator: string; +} + +export interface UpsertTagRequest { + name: string; +} + +export interface UpsertTagResponse { + tag?: Tag | undefined; +} + +export interface ListTagsRequest { + /** + * The creator of tags. + * Format: users/{username} + */ + creator: string; +} + +export interface ListTagsResponse { + tags: Tag[]; +} + +export interface DeleteTagRequest { + tag?: Tag | undefined; +} + +export interface DeleteTagResponse { +} + +function createBaseTag(): Tag { + return { name: "", creator: "" }; +} + +export const Tag = { + encode(message: Tag, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.creator !== "") { + writer.uint32(18).string(message.creator); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Tag { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTag(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.creator = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Tag { + return Tag.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Tag { + const message = createBaseTag(); + message.name = object.name ?? ""; + message.creator = object.creator ?? ""; + return message; + }, +}; + +function createBaseUpsertTagRequest(): UpsertTagRequest { + return { name: "" }; +} + +export const UpsertTagRequest = { + encode(message: UpsertTagRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpsertTagRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpsertTagRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpsertTagRequest { + return UpsertTagRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpsertTagRequest { + const message = createBaseUpsertTagRequest(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseUpsertTagResponse(): UpsertTagResponse { + return { tag: undefined }; +} + +export const UpsertTagResponse = { + encode(message: UpsertTagResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tag !== undefined) { + Tag.encode(message.tag, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpsertTagResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpsertTagResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.tag = Tag.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpsertTagResponse { + return UpsertTagResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpsertTagResponse { + const message = createBaseUpsertTagResponse(); + message.tag = (object.tag !== undefined && object.tag !== null) ? Tag.fromPartial(object.tag) : undefined; + return message; + }, +}; + +function createBaseListTagsRequest(): ListTagsRequest { + return { creator: "" }; +} + +export const ListTagsRequest = { + encode(message: ListTagsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.creator !== "") { + writer.uint32(10).string(message.creator); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListTagsRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTagsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.creator = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListTagsRequest { + return ListTagsRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListTagsRequest { + const message = createBaseListTagsRequest(); + message.creator = object.creator ?? ""; + return message; + }, +}; + +function createBaseListTagsResponse(): ListTagsResponse { + return { tags: [] }; +} + +export const ListTagsResponse = { + encode(message: ListTagsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.tags) { + Tag.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListTagsResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListTagsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.tags.push(Tag.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListTagsResponse { + return ListTagsResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListTagsResponse { + const message = createBaseListTagsResponse(); + message.tags = object.tags?.map((e) => Tag.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDeleteTagRequest(): DeleteTagRequest { + return { tag: undefined }; +} + +export const DeleteTagRequest = { + encode(message: DeleteTagRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.tag !== undefined) { + Tag.encode(message.tag, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTagRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTagRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.tag = Tag.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteTagRequest { + return DeleteTagRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DeleteTagRequest { + const message = createBaseDeleteTagRequest(); + message.tag = (object.tag !== undefined && object.tag !== null) ? Tag.fromPartial(object.tag) : undefined; + return message; + }, +}; + +function createBaseDeleteTagResponse(): DeleteTagResponse { + return {}; +} + +export const DeleteTagResponse = { + encode(_: DeleteTagResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTagResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteTagResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteTagResponse { + return DeleteTagResponse.fromPartial(base ?? {}); + }, + + fromPartial(_: DeepPartial): DeleteTagResponse { + const message = createBaseDeleteTagResponse(); + return message; + }, +}; + +export type TagServiceDefinition = typeof TagServiceDefinition; +export const TagServiceDefinition = { + name: "TagService", + fullName: "memos.api.v2.TagService", + methods: { + upsertTag: { + name: "UpsertTag", + requestType: UpsertTagRequest, + requestStream: false, + responseType: UpsertTagResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [new Uint8Array([14, 34, 12, 47, 97, 112, 105, 47, 118, 50, 47, 116, 97, 103, 115])], + }, + }, + }, + listTags: { + name: "ListTags", + requestType: ListTagsRequest, + requestStream: false, + responseType: ListTagsResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [new Uint8Array([14, 18, 12, 47, 97, 112, 105, 47, 118, 50, 47, 116, 97, 103, 115])], + }, + }, + }, + deleteTag: { + name: "DeleteTag", + requestType: DeleteTagRequest, + requestStream: false, + responseType: DeleteTagResponse, + responseStream: false, + options: { + _unknownFields: { + 578365826: [new Uint8Array([14, 42, 12, 47, 97, 112, 105, 47, 118, 50, 47, 116, 97, 103, 115])], + }, + }, + }, + }, +} as const; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/web/src/types/proto/api/v2/user_service.ts b/web/src/types/proto/api/v2/user_service.ts new file mode 100644 index 0000000000000..493f77e8d0801 --- /dev/null +++ b/web/src/types/proto/api/v2/user_service.ts @@ -0,0 +1,1248 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { FieldMask } from "../../google/protobuf/field_mask"; +import { Timestamp } from "../../google/protobuf/timestamp"; +import { RowStatus } from "./common"; + +export const protobufPackage = "memos.api.v2"; + +export interface User { + /** + * The name of the user. + * Format: users/{username} + */ + name: string; + id: number; + role: User_Role; + email: string; + nickname: string; + avatarUrl: string; + password: string; + rowStatus: RowStatus; + createTime?: Date | undefined; + updateTime?: Date | undefined; +} + +export enum User_Role { + ROLE_UNSPECIFIED = 0, + HOST = 1, + ADMIN = 2, + USER = 3, + UNRECOGNIZED = -1, +} + +export interface GetUserRequest { + /** + * The name of the user. + * Format: users/{username} + */ + name: string; +} + +export interface GetUserResponse { + user?: User | undefined; +} + +export interface CreateUserRequest { + user?: User | undefined; +} + +export interface CreateUserResponse { + user?: User | undefined; +} + +export interface UpdateUserRequest { + user?: User | undefined; + updateMask?: string[] | undefined; +} + +export interface UpdateUserResponse { + user?: User | undefined; +} + +export interface UserAccessToken { + accessToken: string; + description: string; + issuedAt?: Date | undefined; + expiresAt?: Date | undefined; +} + +export interface ListUserAccessTokensRequest { + /** + * The name of the user. + * Format: users/{username} + */ + name: string; +} + +export interface ListUserAccessTokensResponse { + accessTokens: UserAccessToken[]; +} + +export interface CreateUserAccessTokenRequest { + /** + * The name of the user. + * Format: users/{username} + */ + name: string; + description: string; + expiresAt?: Date | undefined; +} + +export interface CreateUserAccessTokenResponse { + accessToken?: UserAccessToken | undefined; +} + +export interface DeleteUserAccessTokenRequest { + /** + * The name of the user. + * Format: users/{username} + */ + name: string; + /** access_token is the access token to delete. */ + accessToken: string; +} + +export interface DeleteUserAccessTokenResponse { +} + +function createBaseUser(): User { + return { + name: "", + id: 0, + role: 0, + email: "", + nickname: "", + avatarUrl: "", + password: "", + rowStatus: 0, + createTime: undefined, + updateTime: undefined, + }; +} + +export const User = { + encode(message: User, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.id !== 0) { + writer.uint32(16).int32(message.id); + } + if (message.role !== 0) { + writer.uint32(24).int32(message.role); + } + if (message.email !== "") { + writer.uint32(34).string(message.email); + } + if (message.nickname !== "") { + writer.uint32(42).string(message.nickname); + } + if (message.avatarUrl !== "") { + writer.uint32(50).string(message.avatarUrl); + } + if (message.password !== "") { + writer.uint32(58).string(message.password); + } + if (message.rowStatus !== 0) { + writer.uint32(64).int32(message.rowStatus); + } + if (message.createTime !== undefined) { + Timestamp.encode(toTimestamp(message.createTime), writer.uint32(74).fork()).ldelim(); + } + if (message.updateTime !== undefined) { + Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(82).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): User { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUser(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.id = reader.int32(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.role = reader.int32() as any; + continue; + case 4: + if (tag !== 34) { + break; + } + + message.email = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.nickname = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.avatarUrl = reader.string(); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.password = reader.string(); + continue; + case 8: + if (tag !== 64) { + break; + } + + message.rowStatus = reader.int32() as any; + continue; + case 9: + if (tag !== 74) { + break; + } + + message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): User { + return User.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): User { + const message = createBaseUser(); + message.name = object.name ?? ""; + message.id = object.id ?? 0; + message.role = object.role ?? 0; + message.email = object.email ?? ""; + message.nickname = object.nickname ?? ""; + message.avatarUrl = object.avatarUrl ?? ""; + message.password = object.password ?? ""; + message.rowStatus = object.rowStatus ?? 0; + message.createTime = object.createTime ?? undefined; + message.updateTime = object.updateTime ?? undefined; + return message; + }, +}; + +function createBaseGetUserRequest(): GetUserRequest { + return { name: "" }; +} + +export const GetUserRequest = { + encode(message: GetUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetUserRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetUserRequest { + return GetUserRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GetUserRequest { + const message = createBaseGetUserRequest(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseGetUserResponse(): GetUserResponse { + return { user: undefined }; +} + +export const GetUserResponse = { + encode(message: GetUserResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetUserResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetUserResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GetUserResponse { + return GetUserResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GetUserResponse { + const message = createBaseGetUserResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseCreateUserRequest(): CreateUserRequest { + return { user: undefined }; +} + +export const CreateUserRequest = { + encode(message: CreateUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateUserRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateUserRequest { + return CreateUserRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateUserRequest { + const message = createBaseCreateUserRequest(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseCreateUserResponse(): CreateUserResponse { + return { user: undefined }; +} + +export const CreateUserResponse = { + encode(message: CreateUserResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateUserResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateUserResponse { + return CreateUserResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateUserResponse { + const message = createBaseCreateUserResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseUpdateUserRequest(): UpdateUserRequest { + return { user: undefined, updateMask: undefined }; +} + +export const UpdateUserRequest = { + encode(message: UpdateUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + if (message.updateMask !== undefined) { + FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateUserRequest { + return UpdateUserRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateUserRequest { + const message = createBaseUpdateUserRequest(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + message.updateMask = object.updateMask ?? undefined; + return message; + }, +}; + +function createBaseUpdateUserResponse(): UpdateUserResponse { + return { user: undefined }; +} + +export const UpdateUserResponse = { + encode(message: UpdateUserResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.user !== undefined) { + User.encode(message.user, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUserResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.user = User.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UpdateUserResponse { + return UpdateUserResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UpdateUserResponse { + const message = createBaseUpdateUserResponse(); + message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; + return message; + }, +}; + +function createBaseUserAccessToken(): UserAccessToken { + return { accessToken: "", description: "", issuedAt: undefined, expiresAt: undefined }; +} + +export const UserAccessToken = { + encode(message: UserAccessToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.accessToken !== "") { + writer.uint32(10).string(message.accessToken); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.issuedAt !== undefined) { + Timestamp.encode(toTimestamp(message.issuedAt), writer.uint32(26).fork()).ldelim(); + } + if (message.expiresAt !== undefined) { + Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UserAccessToken { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserAccessToken(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accessToken = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.issuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UserAccessToken { + return UserAccessToken.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UserAccessToken { + const message = createBaseUserAccessToken(); + message.accessToken = object.accessToken ?? ""; + message.description = object.description ?? ""; + message.issuedAt = object.issuedAt ?? undefined; + message.expiresAt = object.expiresAt ?? undefined; + return message; + }, +}; + +function createBaseListUserAccessTokensRequest(): ListUserAccessTokensRequest { + return { name: "" }; +} + +export const ListUserAccessTokensRequest = { + encode(message: ListUserAccessTokensRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListUserAccessTokensRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListUserAccessTokensRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListUserAccessTokensRequest { + return ListUserAccessTokensRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListUserAccessTokensRequest { + const message = createBaseListUserAccessTokensRequest(); + message.name = object.name ?? ""; + return message; + }, +}; + +function createBaseListUserAccessTokensResponse(): ListUserAccessTokensResponse { + return { accessTokens: [] }; +} + +export const ListUserAccessTokensResponse = { + encode(message: ListUserAccessTokensResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.accessTokens) { + UserAccessToken.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ListUserAccessTokensResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListUserAccessTokensResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accessTokens.push(UserAccessToken.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ListUserAccessTokensResponse { + return ListUserAccessTokensResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ListUserAccessTokensResponse { + const message = createBaseListUserAccessTokensResponse(); + message.accessTokens = object.accessTokens?.map((e) => UserAccessToken.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCreateUserAccessTokenRequest(): CreateUserAccessTokenRequest { + return { name: "", description: "", expiresAt: undefined }; +} + +export const CreateUserAccessTokenRequest = { + encode(message: CreateUserAccessTokenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + if (message.expiresAt !== undefined) { + Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserAccessTokenRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateUserAccessTokenRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateUserAccessTokenRequest { + return CreateUserAccessTokenRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateUserAccessTokenRequest { + const message = createBaseCreateUserAccessTokenRequest(); + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.expiresAt = object.expiresAt ?? undefined; + return message; + }, +}; + +function createBaseCreateUserAccessTokenResponse(): CreateUserAccessTokenResponse { + return { accessToken: undefined }; +} + +export const CreateUserAccessTokenResponse = { + encode(message: CreateUserAccessTokenResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.accessToken !== undefined) { + UserAccessToken.encode(message.accessToken, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserAccessTokenResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateUserAccessTokenResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accessToken = UserAccessToken.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CreateUserAccessTokenResponse { + return CreateUserAccessTokenResponse.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CreateUserAccessTokenResponse { + const message = createBaseCreateUserAccessTokenResponse(); + message.accessToken = (object.accessToken !== undefined && object.accessToken !== null) + ? UserAccessToken.fromPartial(object.accessToken) + : undefined; + return message; + }, +}; + +function createBaseDeleteUserAccessTokenRequest(): DeleteUserAccessTokenRequest { + return { name: "", accessToken: "" }; +} + +export const DeleteUserAccessTokenRequest = { + encode(message: DeleteUserAccessTokenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.accessToken !== "") { + writer.uint32(18).string(message.accessToken); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserAccessTokenRequest { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteUserAccessTokenRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.accessToken = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteUserAccessTokenRequest { + return DeleteUserAccessTokenRequest.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DeleteUserAccessTokenRequest { + const message = createBaseDeleteUserAccessTokenRequest(); + message.name = object.name ?? ""; + message.accessToken = object.accessToken ?? ""; + return message; + }, +}; + +function createBaseDeleteUserAccessTokenResponse(): DeleteUserAccessTokenResponse { + return {}; +} + +export const DeleteUserAccessTokenResponse = { + encode(_: DeleteUserAccessTokenResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserAccessTokenResponse { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteUserAccessTokenResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DeleteUserAccessTokenResponse { + return DeleteUserAccessTokenResponse.fromPartial(base ?? {}); + }, + + fromPartial(_: DeepPartial): DeleteUserAccessTokenResponse { + const message = createBaseDeleteUserAccessTokenResponse(); + return message; + }, +}; + +export type UserServiceDefinition = typeof UserServiceDefinition; +export const UserServiceDefinition = { + name: "UserService", + fullName: "memos.api.v2.UserService", + methods: { + getUser: { + name: "GetUser", + requestType: GetUserRequest, + requestStream: false, + responseType: GetUserResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([4, 110, 97, 109, 101])], + 578365826: [ + new Uint8Array([ + 24, + 18, + 22, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 123, + 110, + 97, + 109, + 101, + 61, + 117, + 115, + 101, + 114, + 115, + 47, + 42, + 125, + ]), + ], + }, + }, + }, + createUser: { + name: "CreateUser", + requestType: CreateUserRequest, + requestStream: false, + responseType: CreateUserResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([4, 117, 115, 101, 114])], + 578365826: [new Uint8Array([17, 58, 4, 117, 115, 101, 114, 34, 9, 47, 118, 49, 47, 117, 115, 101, 114, 115])], + }, + }, + }, + updateUser: { + name: "UpdateUser", + requestType: UpdateUserRequest, + requestStream: false, + responseType: UpdateUserResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([16, 117, 115, 101, 114, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])], + 578365826: [ + new Uint8Array([ + 35, + 58, + 4, + 117, + 115, + 101, + 114, + 50, + 27, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 123, + 117, + 115, + 101, + 114, + 46, + 110, + 97, + 109, + 101, + 61, + 117, + 115, + 101, + 114, + 115, + 47, + 42, + 125, + ]), + ], + }, + }, + }, + /** ListUserAccessTokens returns a list of access tokens for a user. */ + listUserAccessTokens: { + name: "ListUserAccessTokens", + requestType: ListUserAccessTokensRequest, + requestStream: false, + responseType: ListUserAccessTokensResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([4, 110, 97, 109, 101])], + 578365826: [ + new Uint8Array([ + 38, + 18, + 36, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 123, + 110, + 97, + 109, + 101, + 61, + 117, + 115, + 101, + 114, + 115, + 47, + 42, + 125, + 47, + 97, + 99, + 99, + 101, + 115, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 115, + ]), + ], + }, + }, + }, + /** CreateUserAccessToken creates a new access token for a user. */ + createUserAccessToken: { + name: "CreateUserAccessToken", + requestType: CreateUserAccessTokenRequest, + requestStream: false, + responseType: CreateUserAccessTokenResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([4, 110, 97, 109, 101])], + 578365826: [ + new Uint8Array([ + 41, + 58, + 1, + 42, + 34, + 36, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 123, + 110, + 97, + 109, + 101, + 61, + 117, + 115, + 101, + 114, + 115, + 47, + 42, + 125, + 47, + 97, + 99, + 99, + 101, + 115, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 115, + ]), + ], + }, + }, + }, + /** DeleteUserAccessToken deletes an access token for a user. */ + deleteUserAccessToken: { + name: "DeleteUserAccessToken", + requestType: DeleteUserAccessTokenRequest, + requestStream: false, + responseType: DeleteUserAccessTokenResponse, + responseStream: false, + options: { + _unknownFields: { + 8410: [new Uint8Array([17, 110, 97, 109, 101, 44, 97, 99, 99, 101, 115, 115, 95, 116, 111, 107, 101, 110])], + 578365826: [ + new Uint8Array([ + 53, + 42, + 51, + 47, + 97, + 112, + 105, + 47, + 118, + 50, + 47, + 123, + 110, + 97, + 109, + 101, + 61, + 117, + 115, + 101, + 114, + 115, + 47, + 42, + 125, + 47, + 97, + 99, + 99, + 101, + 115, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 115, + 47, + 123, + 97, + 99, + 99, + 101, + 115, + 115, + 95, + 116, + 111, + 107, + 101, + 110, + 125, + ]), + ], + }, + }, + }, + }, +} as const; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function toTimestamp(date: Date): Timestamp { + const seconds = date.getTime() / 1_000; + const nanos = (date.getTime() % 1_000) * 1_000_000; + return { seconds, nanos }; +} + +function fromTimestamp(t: Timestamp): Date { + let millis = (t.seconds || 0) * 1_000; + millis += (t.nanos || 0) / 1_000_000; + return new Date(millis); +} diff --git a/web/src/types/proto/google/api/annotations.ts b/web/src/types/proto/google/api/annotations.ts new file mode 100644 index 0000000000000..c2161053d4836 --- /dev/null +++ b/web/src/types/proto/google/api/annotations.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = "google.api"; diff --git a/web/src/types/proto/google/api/client.ts b/web/src/types/proto/google/api/client.ts new file mode 100644 index 0000000000000..ca455ebab2660 --- /dev/null +++ b/web/src/types/proto/google/api/client.ts @@ -0,0 +1,1588 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Duration } from "../protobuf/duration"; +import { LaunchStage } from "./launch_stage"; + +export const protobufPackage = "google.api"; + +/** + * The organization for which the client libraries are being published. + * Affects the url where generated docs are published, etc. + */ +export enum ClientLibraryOrganization { + /** CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED - Not useful. */ + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + /** CLOUD - Google Cloud Platform Org. */ + CLOUD = 1, + /** ADS - Ads (Advertising) Org. */ + ADS = 2, + /** PHOTOS - Photos Org. */ + PHOTOS = 3, + /** STREET_VIEW - Street View Org. */ + STREET_VIEW = 4, + /** SHOPPING - Shopping Org. */ + SHOPPING = 5, + /** GEO - Geo Org. */ + GEO = 6, + /** GENERATIVE_AI - Generative AI - https://developers.generativeai.google */ + GENERATIVE_AI = 7, + UNRECOGNIZED = -1, +} + +/** To where should client libraries be published? */ +export enum ClientLibraryDestination { + /** + * CLIENT_LIBRARY_DESTINATION_UNSPECIFIED - Client libraries will neither be generated nor published to package + * managers. + */ + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + /** + * GITHUB - Generate the client library in a repo under github.com/googleapis, + * but don't publish it to package managers. + */ + GITHUB = 10, + /** PACKAGE_MANAGER - Publish the library to package managers like nuget.org and npmjs.com. */ + PACKAGE_MANAGER = 20, + UNRECOGNIZED = -1, +} + +/** Required information for every language. */ +export interface CommonLanguageSettings { + /** + * Link to automatically generated reference documentation. Example: + * https://cloud.google.com/nodejs/docs/reference/asset/latest + * + * @deprecated + */ + referenceDocsUri: string; + /** The destination where API teams want this client library to be published. */ + destinations: ClientLibraryDestination[]; +} + +/** Details about how and where to publish client libraries. */ +export interface ClientLibrarySettings { + /** + * Version of the API to apply these settings to. This is the full protobuf + * package for the API, ending in the version element. + * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". + */ + version: string; + /** Launch stage of this version of the API. */ + launchStage: LaunchStage; + /** + * When using transport=rest, the client request will encode enums as + * numbers rather than strings. + */ + restNumericEnums: boolean; + /** Settings for legacy Java features, supported in the Service YAML. */ + javaSettings?: + | JavaSettings + | undefined; + /** Settings for C++ client libraries. */ + cppSettings?: + | CppSettings + | undefined; + /** Settings for PHP client libraries. */ + phpSettings?: + | PhpSettings + | undefined; + /** Settings for Python client libraries. */ + pythonSettings?: + | PythonSettings + | undefined; + /** Settings for Node client libraries. */ + nodeSettings?: + | NodeSettings + | undefined; + /** Settings for .NET client libraries. */ + dotnetSettings?: + | DotnetSettings + | undefined; + /** Settings for Ruby client libraries. */ + rubySettings?: + | RubySettings + | undefined; + /** Settings for Go client libraries. */ + goSettings?: GoSettings | undefined; +} + +/** + * This message configures the settings for publishing [Google Cloud Client + * libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + * generated from the service config. + */ +export interface Publishing { + /** + * A list of API method settings, e.g. the behavior for methods that use the + * long-running operation pattern. + */ + methodSettings: MethodSettings[]; + /** + * Link to a *public* URI where users can report issues. Example: + * https://issuetracker.google.com/issues/new?component=190865&template=1161103 + */ + newIssueUri: string; + /** + * Link to product home page. Example: + * https://cloud.google.com/asset-inventory/docs/overview + */ + documentationUri: string; + /** + * Used as a tracking tag when collecting data about the APIs developer + * relations artifacts like docs, packages delivered to package managers, + * etc. Example: "speech". + */ + apiShortName: string; + /** GitHub label to apply to issues and pull requests opened for this API. */ + githubLabel: string; + /** + * GitHub teams to be added to CODEOWNERS in the directory in GitHub + * containing source code for the client libraries for this API. + */ + codeownerGithubTeams: string[]; + /** + * A prefix used in sample code when demarking regions to be included in + * documentation. + */ + docTagPrefix: string; + /** For whom the client library is being published. */ + organization: ClientLibraryOrganization; + /** + * Client library settings. If the same version string appears multiple + * times in this list, then the last one wins. Settings from earlier + * settings with the same version string are discarded. + */ + librarySettings: ClientLibrarySettings[]; + /** + * Optional link to proto reference documentation. Example: + * https://cloud.google.com/pubsub/lite/docs/reference/rpc + */ + protoReferenceDocumentationUri: string; +} + +/** Settings for Java client libraries. */ +export interface JavaSettings { + /** + * The package name to use in Java. Clobbers the java_package option + * set in the protobuf. This should be used **only** by APIs + * who have already set the language_settings.java.package_name" field + * in gapic.yaml. API teams should use the protobuf java_package option + * where possible. + * + * Example of a YAML configuration:: + * + * publishing: + * java_settings: + * library_package: com.google.cloud.pubsub.v1 + */ + libraryPackage: string; + /** + * Configure the Java class name to use instead of the service's for its + * corresponding generated GAPIC client. Keys are fully-qualified + * service names as they appear in the protobuf (including the full + * the language_settings.java.interface_names" field in gapic.yaml. API + * teams should otherwise use the service name as it appears in the + * protobuf. + * + * Example of a YAML configuration:: + * + * publishing: + * java_settings: + * service_class_names: + * - google.pubsub.v1.Publisher: TopicAdmin + * - google.pubsub.v1.Subscriber: SubscriptionAdmin + */ + serviceClassNames: { [key: string]: string }; + /** Some settings. */ + common?: CommonLanguageSettings | undefined; +} + +export interface JavaSettings_ServiceClassNamesEntry { + key: string; + value: string; +} + +/** Settings for C++ client libraries. */ +export interface CppSettings { + /** Some settings. */ + common?: CommonLanguageSettings | undefined; +} + +/** Settings for Php client libraries. */ +export interface PhpSettings { + /** Some settings. */ + common?: CommonLanguageSettings | undefined; +} + +/** Settings for Python client libraries. */ +export interface PythonSettings { + /** Some settings. */ + common?: CommonLanguageSettings | undefined; +} + +/** Settings for Node client libraries. */ +export interface NodeSettings { + /** Some settings. */ + common?: CommonLanguageSettings | undefined; +} + +/** Settings for Dotnet client libraries. */ +export interface DotnetSettings { + /** Some settings. */ + common?: + | CommonLanguageSettings + | undefined; + /** + * Map from original service names to renamed versions. + * This is used when the default generated types + * would cause a naming conflict. (Neither name is + * fully-qualified.) + * Example: Subscriber to SubscriberServiceApi. + */ + renamedServices: { [key: string]: string }; + /** + * Map from full resource types to the effective short name + * for the resource. This is used when otherwise resource + * named from different services would cause naming collisions. + * Example entry: + * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" + */ + renamedResources: { [key: string]: string }; + /** + * List of full resource types to ignore during generation. + * This is typically used for API-specific Location resources, + * which should be handled by the generator as if they were actually + * the common Location resources. + * Example entry: "documentai.googleapis.com/Location" + */ + ignoredResources: string[]; + /** + * Namespaces which must be aliased in snippets due to + * a known (but non-generator-predictable) naming collision + */ + forcedNamespaceAliases: string[]; + /** + * Method signatures (in the form "service.method(signature)") + * which are provided separately, so shouldn't be generated. + * Snippets *calling* these methods are still generated, however. + */ + handwrittenSignatures: string[]; +} + +export interface DotnetSettings_RenamedServicesEntry { + key: string; + value: string; +} + +export interface DotnetSettings_RenamedResourcesEntry { + key: string; + value: string; +} + +/** Settings for Ruby client libraries. */ +export interface RubySettings { + /** Some settings. */ + common?: CommonLanguageSettings | undefined; +} + +/** Settings for Go client libraries. */ +export interface GoSettings { + /** Some settings. */ + common?: CommonLanguageSettings | undefined; +} + +/** Describes the generator configuration for a method. */ +export interface MethodSettings { + /** + * The fully qualified name of the method, for which the options below apply. + * This is used to find the method to apply the options. + */ + selector: string; + /** + * Describes settings to use for long-running operations when generating + * API methods for RPCs. Complements RPCs that use the annotations in + * google/longrunning/operations.proto. + * + * Example of a YAML configuration:: + * + * publishing: + * method_settings: + * - selector: google.cloud.speech.v2.Speech.BatchRecognize + * long_running: + * initial_poll_delay: + * seconds: 60 # 1 minute + * poll_delay_multiplier: 1.5 + * max_poll_delay: + * seconds: 360 # 6 minutes + * total_poll_timeout: + * seconds: 54000 # 90 minutes + */ + longRunning?: MethodSettings_LongRunning | undefined; +} + +/** + * Describes settings to use when generating API methods that use the + * long-running operation pattern. + * All default values below are from those used in the client library + * generators (e.g. + * [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + */ +export interface MethodSettings_LongRunning { + /** + * Initial delay after which the first poll request will be made. + * Default value: 5 seconds. + */ + initialPollDelay?: + | Duration + | undefined; + /** + * Multiplier to gradually increase delay between subsequent polls until it + * reaches max_poll_delay. + * Default value: 1.5. + */ + pollDelayMultiplier: number; + /** + * Maximum time between two subsequent poll requests. + * Default value: 45 seconds. + */ + maxPollDelay?: + | Duration + | undefined; + /** + * Total polling timeout. + * Default value: 5 minutes. + */ + totalPollTimeout?: Duration | undefined; +} + +function createBaseCommonLanguageSettings(): CommonLanguageSettings { + return { referenceDocsUri: "", destinations: [] }; +} + +export const CommonLanguageSettings = { + encode(message: CommonLanguageSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.referenceDocsUri !== "") { + writer.uint32(10).string(message.referenceDocsUri); + } + writer.uint32(18).fork(); + for (const v of message.destinations) { + writer.int32(v); + } + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CommonLanguageSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCommonLanguageSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.referenceDocsUri = reader.string(); + continue; + case 2: + if (tag === 16) { + message.destinations.push(reader.int32() as any); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.destinations.push(reader.int32() as any); + } + + continue; + } + + break; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CommonLanguageSettings { + return CommonLanguageSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CommonLanguageSettings { + const message = createBaseCommonLanguageSettings(); + message.referenceDocsUri = object.referenceDocsUri ?? ""; + message.destinations = object.destinations?.map((e) => e) || []; + return message; + }, +}; + +function createBaseClientLibrarySettings(): ClientLibrarySettings { + return { + version: "", + launchStage: 0, + restNumericEnums: false, + javaSettings: undefined, + cppSettings: undefined, + phpSettings: undefined, + pythonSettings: undefined, + nodeSettings: undefined, + dotnetSettings: undefined, + rubySettings: undefined, + goSettings: undefined, + }; +} + +export const ClientLibrarySettings = { + encode(message: ClientLibrarySettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + if (message.launchStage !== 0) { + writer.uint32(16).int32(message.launchStage); + } + if (message.restNumericEnums === true) { + writer.uint32(24).bool(message.restNumericEnums); + } + if (message.javaSettings !== undefined) { + JavaSettings.encode(message.javaSettings, writer.uint32(170).fork()).ldelim(); + } + if (message.cppSettings !== undefined) { + CppSettings.encode(message.cppSettings, writer.uint32(178).fork()).ldelim(); + } + if (message.phpSettings !== undefined) { + PhpSettings.encode(message.phpSettings, writer.uint32(186).fork()).ldelim(); + } + if (message.pythonSettings !== undefined) { + PythonSettings.encode(message.pythonSettings, writer.uint32(194).fork()).ldelim(); + } + if (message.nodeSettings !== undefined) { + NodeSettings.encode(message.nodeSettings, writer.uint32(202).fork()).ldelim(); + } + if (message.dotnetSettings !== undefined) { + DotnetSettings.encode(message.dotnetSettings, writer.uint32(210).fork()).ldelim(); + } + if (message.rubySettings !== undefined) { + RubySettings.encode(message.rubySettings, writer.uint32(218).fork()).ldelim(); + } + if (message.goSettings !== undefined) { + GoSettings.encode(message.goSettings, writer.uint32(226).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ClientLibrarySettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseClientLibrarySettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.version = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.launchStage = reader.int32() as any; + continue; + case 3: + if (tag !== 24) { + break; + } + + message.restNumericEnums = reader.bool(); + continue; + case 21: + if (tag !== 170) { + break; + } + + message.javaSettings = JavaSettings.decode(reader, reader.uint32()); + continue; + case 22: + if (tag !== 178) { + break; + } + + message.cppSettings = CppSettings.decode(reader, reader.uint32()); + continue; + case 23: + if (tag !== 186) { + break; + } + + message.phpSettings = PhpSettings.decode(reader, reader.uint32()); + continue; + case 24: + if (tag !== 194) { + break; + } + + message.pythonSettings = PythonSettings.decode(reader, reader.uint32()); + continue; + case 25: + if (tag !== 202) { + break; + } + + message.nodeSettings = NodeSettings.decode(reader, reader.uint32()); + continue; + case 26: + if (tag !== 210) { + break; + } + + message.dotnetSettings = DotnetSettings.decode(reader, reader.uint32()); + continue; + case 27: + if (tag !== 218) { + break; + } + + message.rubySettings = RubySettings.decode(reader, reader.uint32()); + continue; + case 28: + if (tag !== 226) { + break; + } + + message.goSettings = GoSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ClientLibrarySettings { + return ClientLibrarySettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ClientLibrarySettings { + const message = createBaseClientLibrarySettings(); + message.version = object.version ?? ""; + message.launchStage = object.launchStage ?? 0; + message.restNumericEnums = object.restNumericEnums ?? false; + message.javaSettings = (object.javaSettings !== undefined && object.javaSettings !== null) + ? JavaSettings.fromPartial(object.javaSettings) + : undefined; + message.cppSettings = (object.cppSettings !== undefined && object.cppSettings !== null) + ? CppSettings.fromPartial(object.cppSettings) + : undefined; + message.phpSettings = (object.phpSettings !== undefined && object.phpSettings !== null) + ? PhpSettings.fromPartial(object.phpSettings) + : undefined; + message.pythonSettings = (object.pythonSettings !== undefined && object.pythonSettings !== null) + ? PythonSettings.fromPartial(object.pythonSettings) + : undefined; + message.nodeSettings = (object.nodeSettings !== undefined && object.nodeSettings !== null) + ? NodeSettings.fromPartial(object.nodeSettings) + : undefined; + message.dotnetSettings = (object.dotnetSettings !== undefined && object.dotnetSettings !== null) + ? DotnetSettings.fromPartial(object.dotnetSettings) + : undefined; + message.rubySettings = (object.rubySettings !== undefined && object.rubySettings !== null) + ? RubySettings.fromPartial(object.rubySettings) + : undefined; + message.goSettings = (object.goSettings !== undefined && object.goSettings !== null) + ? GoSettings.fromPartial(object.goSettings) + : undefined; + return message; + }, +}; + +function createBasePublishing(): Publishing { + return { + methodSettings: [], + newIssueUri: "", + documentationUri: "", + apiShortName: "", + githubLabel: "", + codeownerGithubTeams: [], + docTagPrefix: "", + organization: 0, + librarySettings: [], + protoReferenceDocumentationUri: "", + }; +} + +export const Publishing = { + encode(message: Publishing, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.methodSettings) { + MethodSettings.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.newIssueUri !== "") { + writer.uint32(810).string(message.newIssueUri); + } + if (message.documentationUri !== "") { + writer.uint32(818).string(message.documentationUri); + } + if (message.apiShortName !== "") { + writer.uint32(826).string(message.apiShortName); + } + if (message.githubLabel !== "") { + writer.uint32(834).string(message.githubLabel); + } + for (const v of message.codeownerGithubTeams) { + writer.uint32(842).string(v!); + } + if (message.docTagPrefix !== "") { + writer.uint32(850).string(message.docTagPrefix); + } + if (message.organization !== 0) { + writer.uint32(856).int32(message.organization); + } + for (const v of message.librarySettings) { + ClientLibrarySettings.encode(v!, writer.uint32(874).fork()).ldelim(); + } + if (message.protoReferenceDocumentationUri !== "") { + writer.uint32(882).string(message.protoReferenceDocumentationUri); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Publishing { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePublishing(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 18) { + break; + } + + message.methodSettings.push(MethodSettings.decode(reader, reader.uint32())); + continue; + case 101: + if (tag !== 810) { + break; + } + + message.newIssueUri = reader.string(); + continue; + case 102: + if (tag !== 818) { + break; + } + + message.documentationUri = reader.string(); + continue; + case 103: + if (tag !== 826) { + break; + } + + message.apiShortName = reader.string(); + continue; + case 104: + if (tag !== 834) { + break; + } + + message.githubLabel = reader.string(); + continue; + case 105: + if (tag !== 842) { + break; + } + + message.codeownerGithubTeams.push(reader.string()); + continue; + case 106: + if (tag !== 850) { + break; + } + + message.docTagPrefix = reader.string(); + continue; + case 107: + if (tag !== 856) { + break; + } + + message.organization = reader.int32() as any; + continue; + case 109: + if (tag !== 874) { + break; + } + + message.librarySettings.push(ClientLibrarySettings.decode(reader, reader.uint32())); + continue; + case 110: + if (tag !== 882) { + break; + } + + message.protoReferenceDocumentationUri = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Publishing { + return Publishing.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Publishing { + const message = createBasePublishing(); + message.methodSettings = object.methodSettings?.map((e) => MethodSettings.fromPartial(e)) || []; + message.newIssueUri = object.newIssueUri ?? ""; + message.documentationUri = object.documentationUri ?? ""; + message.apiShortName = object.apiShortName ?? ""; + message.githubLabel = object.githubLabel ?? ""; + message.codeownerGithubTeams = object.codeownerGithubTeams?.map((e) => e) || []; + message.docTagPrefix = object.docTagPrefix ?? ""; + message.organization = object.organization ?? 0; + message.librarySettings = object.librarySettings?.map((e) => ClientLibrarySettings.fromPartial(e)) || []; + message.protoReferenceDocumentationUri = object.protoReferenceDocumentationUri ?? ""; + return message; + }, +}; + +function createBaseJavaSettings(): JavaSettings { + return { libraryPackage: "", serviceClassNames: {}, common: undefined }; +} + +export const JavaSettings = { + encode(message: JavaSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.libraryPackage !== "") { + writer.uint32(10).string(message.libraryPackage); + } + Object.entries(message.serviceClassNames).forEach(([key, value]) => { + JavaSettings_ServiceClassNamesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); + }); + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): JavaSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseJavaSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.libraryPackage = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + const entry2 = JavaSettings_ServiceClassNamesEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.serviceClassNames[entry2.key] = entry2.value; + } + continue; + case 3: + if (tag !== 26) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): JavaSettings { + return JavaSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): JavaSettings { + const message = createBaseJavaSettings(); + message.libraryPackage = object.libraryPackage ?? ""; + message.serviceClassNames = Object.entries(object.serviceClassNames ?? {}).reduce<{ [key: string]: string }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, + {}, + ); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + return message; + }, +}; + +function createBaseJavaSettings_ServiceClassNamesEntry(): JavaSettings_ServiceClassNamesEntry { + return { key: "", value: "" }; +} + +export const JavaSettings_ServiceClassNamesEntry = { + encode(message: JavaSettings_ServiceClassNamesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): JavaSettings_ServiceClassNamesEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseJavaSettings_ServiceClassNamesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): JavaSettings_ServiceClassNamesEntry { + return JavaSettings_ServiceClassNamesEntry.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): JavaSettings_ServiceClassNamesEntry { + const message = createBaseJavaSettings_ServiceClassNamesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseCppSettings(): CppSettings { + return { common: undefined }; +} + +export const CppSettings = { + encode(message: CppSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CppSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCppSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CppSettings { + return CppSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CppSettings { + const message = createBaseCppSettings(); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + return message; + }, +}; + +function createBasePhpSettings(): PhpSettings { + return { common: undefined }; +} + +export const PhpSettings = { + encode(message: PhpSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhpSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePhpSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): PhpSettings { + return PhpSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): PhpSettings { + const message = createBasePhpSettings(); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + return message; + }, +}; + +function createBasePythonSettings(): PythonSettings { + return { common: undefined }; +} + +export const PythonSettings = { + encode(message: PythonSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PythonSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePythonSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): PythonSettings { + return PythonSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): PythonSettings { + const message = createBasePythonSettings(); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + return message; + }, +}; + +function createBaseNodeSettings(): NodeSettings { + return { common: undefined }; +} + +export const NodeSettings = { + encode(message: NodeSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NodeSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNodeSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): NodeSettings { + return NodeSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): NodeSettings { + const message = createBaseNodeSettings(); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + return message; + }, +}; + +function createBaseDotnetSettings(): DotnetSettings { + return { + common: undefined, + renamedServices: {}, + renamedResources: {}, + ignoredResources: [], + forcedNamespaceAliases: [], + handwrittenSignatures: [], + }; +} + +export const DotnetSettings = { + encode(message: DotnetSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); + } + Object.entries(message.renamedServices).forEach(([key, value]) => { + DotnetSettings_RenamedServicesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); + }); + Object.entries(message.renamedResources).forEach(([key, value]) => { + DotnetSettings_RenamedResourcesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).ldelim(); + }); + for (const v of message.ignoredResources) { + writer.uint32(34).string(v!); + } + for (const v of message.forcedNamespaceAliases) { + writer.uint32(42).string(v!); + } + for (const v of message.handwrittenSignatures) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DotnetSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDotnetSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + const entry2 = DotnetSettings_RenamedServicesEntry.decode(reader, reader.uint32()); + if (entry2.value !== undefined) { + message.renamedServices[entry2.key] = entry2.value; + } + continue; + case 3: + if (tag !== 26) { + break; + } + + const entry3 = DotnetSettings_RenamedResourcesEntry.decode(reader, reader.uint32()); + if (entry3.value !== undefined) { + message.renamedResources[entry3.key] = entry3.value; + } + continue; + case 4: + if (tag !== 34) { + break; + } + + message.ignoredResources.push(reader.string()); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.forcedNamespaceAliases.push(reader.string()); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.handwrittenSignatures.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DotnetSettings { + return DotnetSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DotnetSettings { + const message = createBaseDotnetSettings(); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + message.renamedServices = Object.entries(object.renamedServices ?? {}).reduce<{ [key: string]: string }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, + {}, + ); + message.renamedResources = Object.entries(object.renamedResources ?? {}).reduce<{ [key: string]: string }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[key] = String(value); + } + return acc; + }, + {}, + ); + message.ignoredResources = object.ignoredResources?.map((e) => e) || []; + message.forcedNamespaceAliases = object.forcedNamespaceAliases?.map((e) => e) || []; + message.handwrittenSignatures = object.handwrittenSignatures?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDotnetSettings_RenamedServicesEntry(): DotnetSettings_RenamedServicesEntry { + return { key: "", value: "" }; +} + +export const DotnetSettings_RenamedServicesEntry = { + encode(message: DotnetSettings_RenamedServicesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DotnetSettings_RenamedServicesEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDotnetSettings_RenamedServicesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DotnetSettings_RenamedServicesEntry { + return DotnetSettings_RenamedServicesEntry.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DotnetSettings_RenamedServicesEntry { + const message = createBaseDotnetSettings_RenamedServicesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseDotnetSettings_RenamedResourcesEntry(): DotnetSettings_RenamedResourcesEntry { + return { key: "", value: "" }; +} + +export const DotnetSettings_RenamedResourcesEntry = { + encode(message: DotnetSettings_RenamedResourcesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DotnetSettings_RenamedResourcesEntry { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDotnetSettings_RenamedResourcesEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DotnetSettings_RenamedResourcesEntry { + return DotnetSettings_RenamedResourcesEntry.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DotnetSettings_RenamedResourcesEntry { + const message = createBaseDotnetSettings_RenamedResourcesEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseRubySettings(): RubySettings { + return { common: undefined }; +} + +export const RubySettings = { + encode(message: RubySettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RubySettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRubySettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): RubySettings { + return RubySettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): RubySettings { + const message = createBaseRubySettings(); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + return message; + }, +}; + +function createBaseGoSettings(): GoSettings { + return { common: undefined }; +} + +export const GoSettings = { + encode(message: GoSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.common !== undefined) { + CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GoSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGoSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.common = CommonLanguageSettings.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GoSettings { + return GoSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GoSettings { + const message = createBaseGoSettings(); + message.common = (object.common !== undefined && object.common !== null) + ? CommonLanguageSettings.fromPartial(object.common) + : undefined; + return message; + }, +}; + +function createBaseMethodSettings(): MethodSettings { + return { selector: "", longRunning: undefined }; +} + +export const MethodSettings = { + encode(message: MethodSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.longRunning !== undefined) { + MethodSettings_LongRunning.encode(message.longRunning, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodSettings { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodSettings(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.selector = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.longRunning = MethodSettings_LongRunning.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): MethodSettings { + return MethodSettings.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): MethodSettings { + const message = createBaseMethodSettings(); + message.selector = object.selector ?? ""; + message.longRunning = (object.longRunning !== undefined && object.longRunning !== null) + ? MethodSettings_LongRunning.fromPartial(object.longRunning) + : undefined; + return message; + }, +}; + +function createBaseMethodSettings_LongRunning(): MethodSettings_LongRunning { + return { initialPollDelay: undefined, pollDelayMultiplier: 0, maxPollDelay: undefined, totalPollTimeout: undefined }; +} + +export const MethodSettings_LongRunning = { + encode(message: MethodSettings_LongRunning, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.initialPollDelay !== undefined) { + Duration.encode(message.initialPollDelay, writer.uint32(10).fork()).ldelim(); + } + if (message.pollDelayMultiplier !== 0) { + writer.uint32(21).float(message.pollDelayMultiplier); + } + if (message.maxPollDelay !== undefined) { + Duration.encode(message.maxPollDelay, writer.uint32(26).fork()).ldelim(); + } + if (message.totalPollTimeout !== undefined) { + Duration.encode(message.totalPollTimeout, writer.uint32(34).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodSettings_LongRunning { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodSettings_LongRunning(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.initialPollDelay = Duration.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 21) { + break; + } + + message.pollDelayMultiplier = reader.float(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.maxPollDelay = Duration.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.totalPollTimeout = Duration.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): MethodSettings_LongRunning { + return MethodSettings_LongRunning.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): MethodSettings_LongRunning { + const message = createBaseMethodSettings_LongRunning(); + message.initialPollDelay = (object.initialPollDelay !== undefined && object.initialPollDelay !== null) + ? Duration.fromPartial(object.initialPollDelay) + : undefined; + message.pollDelayMultiplier = object.pollDelayMultiplier ?? 0; + message.maxPollDelay = (object.maxPollDelay !== undefined && object.maxPollDelay !== null) + ? Duration.fromPartial(object.maxPollDelay) + : undefined; + message.totalPollTimeout = (object.totalPollTimeout !== undefined && object.totalPollTimeout !== null) + ? Duration.fromPartial(object.totalPollTimeout) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/web/src/types/proto/google/api/field_behavior.ts b/web/src/types/proto/google/api/field_behavior.ts new file mode 100644 index 0000000000000..0f52c7f07ddee --- /dev/null +++ b/web/src/types/proto/google/api/field_behavior.ts @@ -0,0 +1,62 @@ +/* eslint-disable */ + +export const protobufPackage = "google.api"; + +/** + * An indicator of the behavior of a given field (for example, that a field + * is required in requests, or given as output but ignored as input). + * This **does not** change the behavior in protocol buffers itself; it only + * denotes the behavior and may affect how API tooling handles the field. + * + * Note: This enum **may** receive new values in the future. + */ +export enum FieldBehavior { + /** FIELD_BEHAVIOR_UNSPECIFIED - Conventional default for enums. Do not use this. */ + FIELD_BEHAVIOR_UNSPECIFIED = 0, + /** + * OPTIONAL - Specifically denotes a field as optional. + * While all fields in protocol buffers are optional, this may be specified + * for emphasis if appropriate. + */ + OPTIONAL = 1, + /** + * REQUIRED - Denotes a field as required. + * This indicates that the field **must** be provided as part of the request, + * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). + */ + REQUIRED = 2, + /** + * OUTPUT_ONLY - Denotes a field as output only. + * This indicates that the field is provided in responses, but including the + * field in a request does nothing (the server *must* ignore it and + * *must not* throw an error as a result of the field's presence). + */ + OUTPUT_ONLY = 3, + /** + * INPUT_ONLY - Denotes a field as input only. + * This indicates that the field is provided in requests, and the + * corresponding field is not included in output. + */ + INPUT_ONLY = 4, + /** + * IMMUTABLE - Denotes a field as immutable. + * This indicates that the field may be set once in a request to create a + * resource, but may not be changed thereafter. + */ + IMMUTABLE = 5, + /** + * UNORDERED_LIST - Denotes that a (repeated) field is an unordered list. + * This indicates that the service may provide the elements of the list + * in any arbitrary order, rather than the order the user originally + * provided. Additionally, the list's order may or may not be stable. + */ + UNORDERED_LIST = 6, + /** + * NON_EMPTY_DEFAULT - Denotes that this field returns a non-empty default value if not set. + * This indicates that if the user provides the empty value in a request, + * a non-empty value will be returned. The user will not be aware of what + * non-empty value to expect. + */ + NON_EMPTY_DEFAULT = 7, + UNRECOGNIZED = -1, +} diff --git a/web/src/types/proto/google/api/http.ts b/web/src/types/proto/google/api/http.ts new file mode 100644 index 0000000000000..50b5c5d88ff8f --- /dev/null +++ b/web/src/types/proto/google/api/http.ts @@ -0,0 +1,653 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + +/** + * Defines the HTTP configuration for an API service. It contains a list of + * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method + * to one or more HTTP REST API methods. + */ +export interface Http { + /** + * A list of HTTP configuration rules that apply to individual API methods. + * + * **NOTE:** All service configuration rules follow "last one wins" order. + */ + rules: HttpRule[]; + /** + * When set to true, URL path parameters will be fully URI-decoded except in + * cases of single segment matches in reserved expansion, where "%2F" will be + * left encoded. + * + * The default behavior is to not decode RFC 6570 reserved characters in multi + * segment matches. + */ + fullyDecodeReservedExpansion: boolean; +} + +/** + * # gRPC Transcoding + * + * gRPC Transcoding is a feature for mapping between a gRPC method and one or + * more HTTP REST endpoints. It allows developers to build a single API service + * that supports both gRPC APIs and REST APIs. Many systems, including [Google + * APIs](https://github.com/googleapis/googleapis), + * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC + * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), + * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature + * and use it for large scale production services. + * + * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies + * how different portions of the gRPC request message are mapped to the URL + * path, URL query parameters, and HTTP request body. It also controls how the + * gRPC response message is mapped to the HTTP response body. `HttpRule` is + * typically specified as an `google.api.http` annotation on the gRPC method. + * + * Each mapping specifies a URL path template and an HTTP method. The path + * template may refer to one or more fields in the gRPC request message, as long + * as each field is a non-repeated field with a primitive (non-message) type. + * The path template controls how fields of the request message are mapped to + * the URL path. + * + * Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/{name=messages/*}" + * }; + * } + * } + * message GetMessageRequest { + * string name = 1; // Mapped to URL path. + * } + * message Message { + * string text = 1; // The resource content. + * } + * + * This enables an HTTP REST to gRPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` + * + * Any fields in the request message which are not bound by the path template + * automatically become HTTP query parameters if there is no HTTP request body. + * For example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get:"/v1/messages/{message_id}" + * }; + * } + * } + * message GetMessageRequest { + * message SubMessage { + * string subfield = 1; + * } + * string message_id = 1; // Mapped to URL path. + * int64 revision = 2; // Mapped to URL query parameter `revision`. + * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. + * } + * + * This enables a HTTP JSON to RPC mapping as below: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | + * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: + * "foo"))` + * + * Note that fields which are mapped to URL query parameters must have a + * primitive type or a repeated primitive type or a non-repeated message type. + * In the case of a repeated type, the parameter can be repeated in the URL + * as `...?param=A¶m=B`. In the case of a message type, each field of the + * message is mapped to a separate parameter, such as + * `...?foo.a=A&foo.b=B&foo.c=C`. + * + * For HTTP methods that allow a request body, the `body` field + * specifies the mapping. Consider a REST update method on the + * message resource collection: + * + * service Messaging { + * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "message" + * }; + * } + * } + * message UpdateMessageRequest { + * string message_id = 1; // mapped to the URL + * Message message = 2; // mapped to the body + * } + * + * The following HTTP JSON to RPC mapping is enabled, where the + * representation of the JSON in the request body is determined by + * protos JSON encoding: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" message { text: "Hi!" })` + * + * The special name `*` can be used in the body mapping to define that + * every field not bound by the path template should be mapped to the + * request body. This enables the following alternative definition of + * the update method: + * + * service Messaging { + * rpc UpdateMessage(Message) returns (Message) { + * option (google.api.http) = { + * patch: "/v1/messages/{message_id}" + * body: "*" + * }; + * } + * } + * message Message { + * string message_id = 1; + * string text = 2; + * } + * + * The following HTTP JSON to RPC mapping is enabled: + * + * HTTP | gRPC + * -----|----- + * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: + * "123456" text: "Hi!")` + * + * Note that when using `*` in the body mapping, it is not possible to + * have HTTP parameters, as all fields not bound by the path end in + * the body. This makes this option more rarely used in practice when + * defining REST APIs. The common usage of `*` is in custom methods + * which don't use the URL at all for transferring data. + * + * It is possible to define multiple HTTP methods for one RPC by using + * the `additional_bindings` option. Example: + * + * service Messaging { + * rpc GetMessage(GetMessageRequest) returns (Message) { + * option (google.api.http) = { + * get: "/v1/messages/{message_id}" + * additional_bindings { + * get: "/v1/users/{user_id}/messages/{message_id}" + * } + * }; + * } + * } + * message GetMessageRequest { + * string message_id = 1; + * string user_id = 2; + * } + * + * This enables the following two alternative HTTP JSON to RPC mappings: + * + * HTTP | gRPC + * -----|----- + * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` + * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: + * "123456")` + * + * ## Rules for HTTP mapping + * + * 1. Leaf request fields (recursive expansion nested messages in the request + * message) are classified into three categories: + * - Fields referred by the path template. They are passed via the URL path. + * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They + * are passed via the HTTP + * request body. + * - All other fields are passed via the URL query parameters, and the + * parameter name is the field path in the request message. A repeated + * field can be represented as multiple query parameters under the same + * name. + * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL + * query parameter, all fields + * are passed via URL path and HTTP request body. + * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP + * request body, all + * fields are passed via URL path and URL query parameters. + * + * ### Path template syntax + * + * Template = "/" Segments [ Verb ] ; + * Segments = Segment { "/" Segment } ; + * Segment = "*" | "**" | LITERAL | Variable ; + * Variable = "{" FieldPath [ "=" Segments ] "}" ; + * FieldPath = IDENT { "." IDENT } ; + * Verb = ":" LITERAL ; + * + * The syntax `*` matches a single URL path segment. The syntax `**` matches + * zero or more URL path segments, which must be the last part of the URL path + * except the `Verb`. + * + * The syntax `Variable` matches part of the URL path as specified by its + * template. A variable template must not contain other variables. If a variable + * matches a single path segment, its template may be omitted, e.g. `{var}` + * is equivalent to `{var=*}`. + * + * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` + * contains any reserved character, such characters should be percent-encoded + * before the matching. + * + * If a variable contains exactly one path segment, such as `"{var}"` or + * `"{var=*}"`, when such a variable is expanded into a URL path on the client + * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The + * server side does the reverse decoding. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{var}`. + * + * If a variable contains multiple path segments, such as `"{var=foo/*}"` + * or `"{var=**}"`, when such a variable is expanded into a URL path on the + * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. + * The server side does the reverse decoding, except "%2F" and "%2f" are left + * unchanged. Such variables show up in the + * [Discovery + * Document](https://developers.google.com/discovery/v1/reference/apis) as + * `{+var}`. + * + * ## Using gRPC API Service Configuration + * + * gRPC API Service Configuration (service config) is a configuration language + * for configuring a gRPC service to become a user-facing product. The + * service config is simply the YAML representation of the `google.api.Service` + * proto message. + * + * As an alternative to annotating your proto file, you can configure gRPC + * transcoding in your service config YAML files. You do this by specifying a + * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same + * effect as the proto annotation. This can be particularly useful if you + * have a proto that is reused in multiple services. Note that any transcoding + * specified in the service config will override any matching transcoding + * configuration in the proto. + * + * Example: + * + * http: + * rules: + * # Selects a gRPC method and applies HttpRule to it. + * - selector: example.v1.Messaging.GetMessage + * get: /v1/messages/{message_id}/{sub.subfield} + * + * ## Special notes + * + * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the + * proto to JSON conversion must follow the [proto3 + * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). + * + * While the single segment variable follows the semantics of + * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String + * Expansion, the multi segment variable **does not** follow RFC 6570 Section + * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion + * does not expand special characters like `?` and `#`, which would lead + * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding + * for multi segment variables. + * + * The path variables **must not** refer to any repeated or mapped field, + * because client libraries are not capable of handling such variable expansion. + * + * The path variables **must not** capture the leading "/" character. The reason + * is that the most common use case "{var}" does not capture the leading "/" + * character. For consistency, all path variables must share the same behavior. + * + * Repeated message fields must not be mapped to URL query parameters, because + * no client library can support such complicated mapping. + * + * If an API needs to use a JSON array for request or response body, it can map + * the request or response body to a repeated field. However, some gRPC + * Transcoding implementations may not support this feature. + */ +export interface HttpRule { + /** + * Selects a method to which this rule applies. + * + * Refer to [selector][google.api.DocumentationRule.selector] for syntax + * details. + */ + selector: string; + /** + * Maps to HTTP GET. Used for listing and getting information about + * resources. + */ + get?: + | string + | undefined; + /** Maps to HTTP PUT. Used for replacing a resource. */ + put?: + | string + | undefined; + /** Maps to HTTP POST. Used for creating a resource or performing an action. */ + post?: + | string + | undefined; + /** Maps to HTTP DELETE. Used for deleting a resource. */ + delete?: + | string + | undefined; + /** Maps to HTTP PATCH. Used for updating a resource. */ + patch?: + | string + | undefined; + /** + * The custom pattern is used for specifying an HTTP method that is not + * included in the `pattern` field, such as HEAD, or "*" to leave the + * HTTP method unspecified for this rule. The wild-card rule is useful + * for services that provide content to Web (HTML) clients. + */ + custom?: + | CustomHttpPattern + | undefined; + /** + * The name of the request field whose value is mapped to the HTTP request + * body, or `*` for mapping all request fields not captured by the path + * pattern to the HTTP body, or omitted for not having any HTTP request body. + * + * NOTE: the referred field must be present at the top-level of the request + * message type. + */ + body: string; + /** + * Optional. The name of the response field whose value is mapped to the HTTP + * response body. When omitted, the entire response message will be used + * as the HTTP response body. + * + * NOTE: The referred field must be present at the top-level of the response + * message type. + */ + responseBody: string; + /** + * Additional HTTP bindings for the selector. Nested bindings must + * not contain an `additional_bindings` field themselves (that is, + * the nesting may only be one level deep). + */ + additionalBindings: HttpRule[]; +} + +/** A custom pattern is used for defining custom HTTP verb. */ +export interface CustomHttpPattern { + /** The name of this custom HTTP verb. */ + kind: string; + /** The path matched by this custom verb. */ + path: string; +} + +function createBaseHttp(): Http { + return { rules: [], fullyDecodeReservedExpansion: false }; +} + +export const Http = { + encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rules) { + HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.fullyDecodeReservedExpansion === true) { + writer.uint32(16).bool(message.fullyDecodeReservedExpansion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Http { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.rules.push(HttpRule.decode(reader, reader.uint32())); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.fullyDecodeReservedExpansion = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Http { + return Http.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Http { + const message = createBaseHttp(); + message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; + message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; + return message; + }, +}; + +function createBaseHttpRule(): HttpRule { + return { + selector: "", + get: undefined, + put: undefined, + post: undefined, + delete: undefined, + patch: undefined, + custom: undefined, + body: "", + responseBody: "", + additionalBindings: [], + }; +} + +export const HttpRule = { + encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.selector !== "") { + writer.uint32(10).string(message.selector); + } + if (message.get !== undefined) { + writer.uint32(18).string(message.get); + } + if (message.put !== undefined) { + writer.uint32(26).string(message.put); + } + if (message.post !== undefined) { + writer.uint32(34).string(message.post); + } + if (message.delete !== undefined) { + writer.uint32(42).string(message.delete); + } + if (message.patch !== undefined) { + writer.uint32(50).string(message.patch); + } + if (message.custom !== undefined) { + CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); + } + if (message.body !== "") { + writer.uint32(58).string(message.body); + } + if (message.responseBody !== "") { + writer.uint32(98).string(message.responseBody); + } + for (const v of message.additionalBindings) { + HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseHttpRule(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.selector = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.get = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.put = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.post = reader.string(); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.delete = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.patch = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.custom = CustomHttpPattern.decode(reader, reader.uint32()); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.body = reader.string(); + continue; + case 12: + if (tag !== 98) { + break; + } + + message.responseBody = reader.string(); + continue; + case 11: + if (tag !== 90) { + break; + } + + message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): HttpRule { + return HttpRule.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): HttpRule { + const message = createBaseHttpRule(); + message.selector = object.selector ?? ""; + message.get = object.get ?? undefined; + message.put = object.put ?? undefined; + message.post = object.post ?? undefined; + message.delete = object.delete ?? undefined; + message.patch = object.patch ?? undefined; + message.custom = (object.custom !== undefined && object.custom !== null) + ? CustomHttpPattern.fromPartial(object.custom) + : undefined; + message.body = object.body ?? ""; + message.responseBody = object.responseBody ?? ""; + message.additionalBindings = object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCustomHttpPattern(): CustomHttpPattern { + return { kind: "", path: "" }; +} + +export const CustomHttpPattern = { + encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.kind !== "") { + writer.uint32(10).string(message.kind); + } + if (message.path !== "") { + writer.uint32(18).string(message.path); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCustomHttpPattern(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.kind = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.path = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): CustomHttpPattern { + return CustomHttpPattern.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): CustomHttpPattern { + const message = createBaseCustomHttpPattern(); + message.kind = object.kind ?? ""; + message.path = object.path ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/web/src/types/proto/google/api/launch_stage.ts b/web/src/types/proto/google/api/launch_stage.ts new file mode 100644 index 0000000000000..47b30ac2f26a6 --- /dev/null +++ b/web/src/types/proto/google/api/launch_stage.ts @@ -0,0 +1,58 @@ +/* eslint-disable */ + +export const protobufPackage = "google.api"; + +/** + * The launch stage as defined by [Google Cloud Platform + * Launch Stages](https://cloud.google.com/terms/launch-stages). + */ +export enum LaunchStage { + /** LAUNCH_STAGE_UNSPECIFIED - Do not use this default value. */ + LAUNCH_STAGE_UNSPECIFIED = 0, + /** UNIMPLEMENTED - The feature is not yet implemented. Users can not use it. */ + UNIMPLEMENTED = 6, + /** PRELAUNCH - Prelaunch features are hidden from users and are only visible internally. */ + PRELAUNCH = 7, + /** + * EARLY_ACCESS - Early Access features are limited to a closed group of testers. To use + * these features, you must sign up in advance and sign a Trusted Tester + * agreement (which includes confidentiality provisions). These features may + * be unstable, changed in backward-incompatible ways, and are not + * guaranteed to be released. + */ + EARLY_ACCESS = 1, + /** + * ALPHA - Alpha is a limited availability test for releases before they are cleared + * for widespread use. By Alpha, all significant design issues are resolved + * and we are in the process of verifying functionality. Alpha customers + * need to apply for access, agree to applicable terms, and have their + * projects allowlisted. Alpha releases don't have to be feature complete, + * no SLAs are provided, and there are no technical support obligations, but + * they will be far enough along that customers can actually use them in + * test environments or for limited-use tests -- just like they would in + * normal production cases. + */ + ALPHA = 2, + /** + * BETA - Beta is the point at which we are ready to open a release for any + * customer to use. There are no SLA or technical support obligations in a + * Beta release. Products will be complete from a feature perspective, but + * may have some open outstanding issues. Beta releases are suitable for + * limited production use cases. + */ + BETA = 3, + /** + * GA - GA features are open to all developers and are considered stable and + * fully qualified for production use. + */ + GA = 4, + /** + * DEPRECATED - Deprecated features are scheduled to be shut down and removed. For more + * information, see the "Deprecation Policy" section of our [Terms of + * Service](https://cloud.google.com/terms/) + * and the [Google Cloud Platform Subject to the Deprecation + * Policy](https://cloud.google.com/terms/deprecation) documentation. + */ + DEPRECATED = 5, + UNRECOGNIZED = -1, +} diff --git a/web/src/types/proto/google/protobuf/descriptor.ts b/web/src/types/proto/google/protobuf/descriptor.ts new file mode 100644 index 0000000000000..51796d26cf519 --- /dev/null +++ b/web/src/types/proto/google/protobuf/descriptor.ts @@ -0,0 +1,3573 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: + | FileOptions + | undefined; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: + | SourceCodeInfo + | undefined; + /** + * The syntax of the proto file. + * The supported values are "proto2", "proto3", and "editions". + * + * If `edition` is present, this value must be "editions". + */ + syntax: string; + /** The edition of the proto file, which is an opaque string. */ + edition: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions | undefined; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptions | undefined; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: + | FieldOptions + | undefined; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions | undefined; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: + | EnumOptions + | undefined; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions | undefined; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions | undefined; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: + | MethodOptions + | undefined; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + javaOuterClassname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + * + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + */ + mapEntry: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * + * This should only be used as a temporary measure against broken builds due + * to the change in behavior for JSON field name conflicts. + * + * TODO(b/261750190) This is legacy behavior we plan to remove once downstream + * teams have had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * + * As of May 2022, lazy verifies the contents of the byte stream during + * parsing. An invalid byte stream will cause the overall parsing to fail. + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverifiedLazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** + * Indicate that the field value should not be printed out when using debug + * formats, e.g. when the field contains sensitive credentials. + */ + debugRedact: boolean; + retention: FieldOptions_OptionRetention; + target: FieldOptions_OptionTargetType; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +/** + * If set to RETENTION_SOURCE, the option will be omitted from the binary. + * Note: as of January 2023, support for this is in progress and does not yet + * have an effect (b/264593489). + */ +export enum FieldOptions_OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2, + UNRECOGNIZED = -1, +} + +/** + * This indicates the types of entities that the field may apply to when used + * as an option. If it is unset, then the field may be freely used as an + * option on any kind of entity. Note: as of January 2023, support for this is + * in progress and does not yet have an effect (b/264593489). + */ +export enum FieldOptions_OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9, + UNRECOGNIZED = -1, +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** + * Enable the legacy handling of JSON field name conflicts. This lowercases + * and strips underscored from the fields before comparison in proto3 only. + * The new behavior takes `json_name` into account and applies to proto2 as + * well. + * TODO(b/261750190) Remove this legacy behavior once downstream teams have + * had time to migrate. + * + * @deprecated + */ + deprecatedLegacyJsonFieldConflicts: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: number; + negativeIntValue: number; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified object. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; + semantic: GeneratedCodeInfo_Annotation_Semantic; +} + +/** + * Represents the identified object's effect on the element in the original + * .proto file. + */ +export enum GeneratedCodeInfo_Annotation_Semantic { + /** NONE - There is no effect or the effect is indescribable. */ + NONE = 0, + /** SET - The element is set or otherwise mutated. */ + SET = 1, + /** ALIAS - An alias to the element is returned. */ + ALIAS = 2, + UNRECOGNIZED = -1, +} + +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} + +export const FileDescriptorSet = { + encode(message: FileDescriptorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): FileDescriptorSet { + return FileDescriptorSet.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: "", + package: "", + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: "", + edition: "", + }; +} + +export const FileDescriptorProto = { + encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + if (message.edition !== "") { + writer.uint32(106).string(message.edition); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.package = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.dependency.push(reader.string()); + continue; + case 10: + if (tag === 80) { + message.publicDependency.push(reader.int32()); + + continue; + } + + if (tag === 82) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + + continue; + } + + break; + case 11: + if (tag === 88) { + message.weakDependency.push(reader.int32()); + + continue; + } + + if (tag === 90) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + + continue; + } + + break; + case 4: + if (tag !== 34) { + break; + } + + message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.options = FileOptions.decode(reader, reader.uint32()); + continue; + case 9: + if (tag !== 74) { + break; + } + + message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); + continue; + case 12: + if (tag !== 98) { + break; + } + + message.syntax = reader.string(); + continue; + case 13: + if (tag !== 106) { + break; + } + + message.edition = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): FileDescriptorProto { + return FileDescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ""; + message.package = object.package ?? ""; + message.dependency = object.dependency?.map((e) => e) || []; + message.publicDependency = object.publicDependency?.map((e) => e) || []; + message.weakDependency = object.weakDependency?.map((e) => e) || []; + message.messageType = object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.service = object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? FileOptions.fromPartial(object.options) + : undefined; + message.sourceCodeInfo = (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) + ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) + : undefined; + message.syntax = object.syntax ?? ""; + message.edition = object.edition ?? ""; + return message; + }, +}; + +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} + +export const DescriptorProto = { + encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.options = MessageOptions.decode(reader, reader.uint32()); + continue; + case 9: + if (tag !== 74) { + break; + } + + message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DescriptorProto { + return DescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ""; + message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = object.extensionRange?.map((e) => DescriptorProto_ExtensionRange.fromPartial(e)) || []; + message.oneofDecl = object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? MessageOptions.fromPartial(object.options) + : undefined; + message.reservedRange = object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} + +export const DescriptorProto_ExtensionRange = { + encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DescriptorProto_ExtensionRange { + return DescriptorProto_ExtensionRange.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = (object.options !== undefined && object.options !== null) + ? ExtensionRangeOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} + +export const DescriptorProto_ReservedRange = { + encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): DescriptorProto_ReservedRange { + return DescriptorProto_ReservedRange.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} + +export const ExtensionRangeOptions = { + encode(message: ExtensionRangeOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ExtensionRangeOptions { + return ExtensionRangeOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + options: undefined, + proto3Optional: false, + }; +} + +export const FieldDescriptorProto = { + encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.number = reader.int32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.label = reader.int32() as any; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.type = reader.int32() as any; + continue; + case 6: + if (tag !== 50) { + break; + } + + message.typeName = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.extendee = reader.string(); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.defaultValue = reader.string(); + continue; + case 9: + if (tag !== 72) { + break; + } + + message.oneofIndex = reader.int32(); + continue; + case 10: + if (tag !== 82) { + break; + } + + message.jsonName = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.options = FieldOptions.decode(reader, reader.uint32()); + continue; + case 17: + if (tag !== 136) { + break; + } + + message.proto3Optional = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): FieldDescriptorProto { + return FieldDescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ""; + message.extendee = object.extendee ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? FieldOptions.fromPartial(object.options) + : undefined; + message.proto3Optional = object.proto3Optional ?? false; + return message; + }, +}; + +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} + +export const OneofDescriptorProto = { + encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OneofDescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.options = OneofOptions.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): OneofDescriptorProto { + return OneofDescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? OneofOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; +} + +export const EnumDescriptorProto = { + encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = EnumOptions.decode(reader, reader.uint32()); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); + continue; + case 5: + if (tag !== 42) { + break; + } + + message.reservedName.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): EnumDescriptorProto { + return EnumDescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ""; + message.value = object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? EnumOptions.fromPartial(object.options) + : undefined; + message.reservedRange = object.reservedRange?.map((e) => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || + []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} + +export const EnumDescriptorProto_EnumReservedRange = { + encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.start = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.end = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): EnumDescriptorProto_EnumReservedRange { + return EnumDescriptorProto_EnumReservedRange.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} + +export const EnumValueDescriptorProto = { + encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueDescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.number = reader.int32(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = EnumValueOptions.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): EnumValueDescriptorProto { + return EnumValueDescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.options = (object.options !== undefined && object.options !== null) + ? EnumValueOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} + +export const ServiceDescriptorProto = { + encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceDescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.options = ServiceOptions.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ServiceDescriptorProto { + return ServiceDescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ""; + message.method = object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; + message.options = (object.options !== undefined && object.options !== null) + ? ServiceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} + +export const MethodDescriptorProto = { + encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.name = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.inputType = reader.string(); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.outputType = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.options = MethodOptions.decode(reader, reader.uint32()); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.clientStreaming = reader.bool(); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.serverStreaming = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): MethodDescriptorProto { + return MethodDescriptorProto.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ""; + message.inputType = object.inputType ?? ""; + message.outputType = object.outputType ?? ""; + message.options = (object.options !== undefined && object.options !== null) + ? MethodOptions.fromPartial(object.options) + : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, +}; + +function createBaseFileOptions(): FileOptions { + return { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", + uninterpretedOption: [], + }; +} + +export const FileOptions = { + encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.javaPackage = reader.string(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.javaOuterClassname = reader.string(); + continue; + case 10: + if (tag !== 80) { + break; + } + + message.javaMultipleFiles = reader.bool(); + continue; + case 20: + if (tag !== 160) { + break; + } + + message.javaGenerateEqualsAndHash = reader.bool(); + continue; + case 27: + if (tag !== 216) { + break; + } + + message.javaStringCheckUtf8 = reader.bool(); + continue; + case 9: + if (tag !== 72) { + break; + } + + message.optimizeFor = reader.int32() as any; + continue; + case 11: + if (tag !== 90) { + break; + } + + message.goPackage = reader.string(); + continue; + case 16: + if (tag !== 128) { + break; + } + + message.ccGenericServices = reader.bool(); + continue; + case 17: + if (tag !== 136) { + break; + } + + message.javaGenericServices = reader.bool(); + continue; + case 18: + if (tag !== 144) { + break; + } + + message.pyGenericServices = reader.bool(); + continue; + case 42: + if (tag !== 336) { + break; + } + + message.phpGenericServices = reader.bool(); + continue; + case 23: + if (tag !== 184) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 31: + if (tag !== 248) { + break; + } + + message.ccEnableArenas = reader.bool(); + continue; + case 36: + if (tag !== 290) { + break; + } + + message.objcClassPrefix = reader.string(); + continue; + case 37: + if (tag !== 298) { + break; + } + + message.csharpNamespace = reader.string(); + continue; + case 39: + if (tag !== 314) { + break; + } + + message.swiftPrefix = reader.string(); + continue; + case 40: + if (tag !== 322) { + break; + } + + message.phpClassPrefix = reader.string(); + continue; + case 41: + if (tag !== 330) { + break; + } + + message.phpNamespace = reader.string(); + continue; + case 44: + if (tag !== 354) { + break; + } + + message.phpMetadataNamespace = reader.string(); + continue; + case 45: + if (tag !== 362) { + break; + } + + message.rubyPackage = reader.string(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): FileOptions { + return FileOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ""; + message.javaOuterClassname = object.javaOuterClassname ?? ""; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ""; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.phpGenericServices = object.phpGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? false; + message.objcClassPrefix = object.objcClassPrefix ?? ""; + message.csharpNamespace = object.csharpNamespace ?? ""; + message.swiftPrefix = object.swiftPrefix ?? ""; + message.phpClassPrefix = object.phpClassPrefix ?? ""; + message.phpNamespace = object.phpNamespace ?? ""; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; + message.rubyPackage = object.rubyPackage ?? ""; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + deprecatedLegacyJsonFieldConflicts: false, + uninterpretedOption: [], + }; +} + +export const MessageOptions = { + encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); + } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.messageSetWireFormat = reader.bool(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.noStandardDescriptorAccessor = reader.bool(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 7: + if (tag !== 56) { + break; + } + + message.mapEntry = reader.bool(); + continue; + case 11: + if (tag !== 88) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): MessageOptions { + return MessageOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + debugRedact: false, + retention: 0, + target: 0, + uninterpretedOption: [], + }; +} + +export const FieldOptions = { + encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.unverifiedLazy === true) { + writer.uint32(120).bool(message.unverifiedLazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + if (message.debugRedact === true) { + writer.uint32(128).bool(message.debugRedact); + } + if (message.retention !== 0) { + writer.uint32(136).int32(message.retention); + } + if (message.target !== 0) { + writer.uint32(144).int32(message.target); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.ctype = reader.int32() as any; + continue; + case 2: + if (tag !== 16) { + break; + } + + message.packed = reader.bool(); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.jstype = reader.int32() as any; + continue; + case 5: + if (tag !== 40) { + break; + } + + message.lazy = reader.bool(); + continue; + case 15: + if (tag !== 120) { + break; + } + + message.unverifiedLazy = reader.bool(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 10: + if (tag !== 80) { + break; + } + + message.weak = reader.bool(); + continue; + case 16: + if (tag !== 128) { + break; + } + + message.debugRedact = reader.bool(); + continue; + case 17: + if (tag !== 136) { + break; + } + + message.retention = reader.int32() as any; + continue; + case 18: + if (tag !== 144) { + break; + } + + message.target = reader.int32() as any; + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): FieldOptions { + return FieldOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 0; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 0; + message.lazy = object.lazy ?? false; + message.unverifiedLazy = object.unverifiedLazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.debugRedact = object.debugRedact ?? false; + message.retention = object.retention ?? 0; + message.target = object.target ?? 0; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} + +export const OneofOptions = { + encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): OneofOptions { + return OneofOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [] }; +} + +export const EnumOptions = { + encode(message: EnumOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.allowAlias === true) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.deprecatedLegacyJsonFieldConflicts === true) { + writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 16) { + break; + } + + message.allowAlias = reader.bool(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 6: + if (tag !== 48) { + break; + } + + message.deprecatedLegacyJsonFieldConflicts = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): EnumOptions { + return EnumOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} + +export const EnumValueOptions = { + encode(message: EnumValueOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): EnumValueOptions { + return EnumValueOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} + +export const ServiceOptions = { + encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ServiceOptions { + return ServiceOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} + +export const MethodOptions = { + encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + if (tag !== 264) { + break; + } + + message.deprecated = reader.bool(); + continue; + case 34: + if (tag !== 272) { + break; + } + + message.idempotencyLevel = reader.int32() as any; + continue; + case 999: + if (tag !== 7994) { + break; + } + + message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): MethodOptions { + return MethodOptions.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 0; + message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: 0, + negativeIntValue: 0, + doubleValue: 0, + stringValue: new Uint8Array(0), + aggregateValue: "", + }; +} + +export const UninterpretedOption = { + encode(message: UninterpretedOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (message.positiveIntValue !== 0) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (message.negativeIntValue !== 0) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (tag !== 18) { + break; + } + + message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); + continue; + case 3: + if (tag !== 26) { + break; + } + + message.identifierValue = reader.string(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.positiveIntValue = longToNumber(reader.uint64() as Long); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.negativeIntValue = longToNumber(reader.int64() as Long); + continue; + case 6: + if (tag !== 49) { + break; + } + + message.doubleValue = reader.double(); + continue; + case 7: + if (tag !== 58) { + break; + } + + message.stringValue = reader.bytes(); + continue; + case 8: + if (tag !== 66) { + break; + } + + message.aggregateValue = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UninterpretedOption { + return UninterpretedOption.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || []; + message.identifierValue = object.identifierValue ?? ""; + message.positiveIntValue = object.positiveIntValue ?? 0; + message.negativeIntValue = object.negativeIntValue ?? 0; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(0); + message.aggregateValue = object.aggregateValue ?? ""; + return message; + }, +}; + +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} + +export const UninterpretedOption_NamePart = { + encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.namePart = reader.string(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.isExtension = reader.bool(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UninterpretedOption_NamePart { + return UninterpretedOption_NamePart.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; + return message; + }, +}; + +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} + +export const SourceCodeInfo = { + encode(message: SourceCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): SourceCodeInfo { + return SourceCodeInfo.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; +} + +export const SourceCodeInfo_Location = { + encode(message: SourceCodeInfo_Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo_Location { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + case 2: + if (tag === 16) { + message.span.push(reader.int32()); + + continue; + } + + if (tag === 18) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + + continue; + } + + break; + case 3: + if (tag !== 26) { + break; + } + + message.leadingComments = reader.string(); + continue; + case 4: + if (tag !== 34) { + break; + } + + message.trailingComments = reader.string(); + continue; + case 6: + if (tag !== 50) { + break; + } + + message.leadingDetachedComments.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): SourceCodeInfo_Location { + return SourceCodeInfo_Location.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map((e) => e) || []; + message.span = object.span?.map((e) => e) || []; + message.leadingComments = object.leadingComments ?? ""; + message.trailingComments = object.trailingComments ?? ""; + message.leadingDetachedComments = object.leadingDetachedComments?.map((e) => e) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} + +export const GeneratedCodeInfo = { + encode(message: GeneratedCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GeneratedCodeInfo { + return GeneratedCodeInfo.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 }; +} + +export const GeneratedCodeInfo_Annotation = { + encode(message: GeneratedCodeInfo_Annotation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + if (message.semantic !== 0) { + writer.uint32(40).int32(message.semantic); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag === 8) { + message.path.push(reader.int32()); + + continue; + } + + if (tag === 10) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + + continue; + } + + break; + case 2: + if (tag !== 18) { + break; + } + + message.sourceFile = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.begin = reader.int32(); + continue; + case 4: + if (tag !== 32) { + break; + } + + message.end = reader.int32(); + continue; + case 5: + if (tag !== 40) { + break; + } + + message.semantic = reader.int32() as any; + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): GeneratedCodeInfo_Annotation { + return GeneratedCodeInfo_Annotation.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map((e) => e) || []; + message.sourceFile = object.sourceFile ?? ""; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + message.semantic = object.semantic ?? 0; + return message; + }, +}; + +declare const self: any | undefined; +declare const window: any | undefined; +declare const global: any | undefined; +const tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/web/src/types/proto/google/protobuf/duration.ts b/web/src/types/proto/google/protobuf/duration.ts new file mode 100644 index 0000000000000..0d723a1e1b18e --- /dev/null +++ b/web/src/types/proto/google/protobuf/duration.ts @@ -0,0 +1,178 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Duration represents a signed, fixed-length span of time represented + * as a count of seconds and fractions of seconds at nanosecond + * resolution. It is independent of any calendar and concepts like "day" + * or "month". It is related to Timestamp in that the difference between + * two Timestamp values is a Duration and it can be added or subtracted + * from a Timestamp. Range is approximately +-10,000 years. + * + * # Examples + * + * Example 1: Compute Duration from two Timestamps in pseudo code. + * + * Timestamp start = ...; + * Timestamp end = ...; + * Duration duration = ...; + * + * duration.seconds = end.seconds - start.seconds; + * duration.nanos = end.nanos - start.nanos; + * + * if (duration.seconds < 0 && duration.nanos > 0) { + * duration.seconds += 1; + * duration.nanos -= 1000000000; + * } else if (duration.seconds > 0 && duration.nanos < 0) { + * duration.seconds -= 1; + * duration.nanos += 1000000000; + * } + * + * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + * + * Timestamp start = ...; + * Duration duration = ...; + * Timestamp end = ...; + * + * end.seconds = start.seconds + duration.seconds; + * end.nanos = start.nanos + duration.nanos; + * + * if (end.nanos < 0) { + * end.seconds -= 1; + * end.nanos += 1000000000; + * } else if (end.nanos >= 1000000000) { + * end.seconds += 1; + * end.nanos -= 1000000000; + * } + * + * Example 3: Compute Duration from datetime.timedelta in Python. + * + * td = datetime.timedelta(days=3, minutes=10) + * duration = Duration() + * duration.FromTimedelta(td) + * + * # JSON Mapping + * + * In JSON format, the Duration type is encoded as a string rather than an + * object, where the string ends in the suffix "s" (indicating seconds) and + * is preceded by the number of seconds, with nanoseconds expressed as + * fractional seconds. For example, 3 seconds with 0 nanoseconds should be + * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + * microsecond should be expressed in JSON format as "3.000001s". + */ +export interface Duration { + /** + * Signed seconds of the span of time. Must be from -315,576,000,000 + * to +315,576,000,000 inclusive. Note: these bounds are computed from: + * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + */ + seconds: number; + /** + * Signed fractions of a second at nanosecond resolution of the span + * of time. Durations less than one second are represented with a 0 + * `seconds` field and a positive or negative `nanos` field. For durations + * of one second or more, a non-zero value for the `nanos` field must be + * of the same sign as the `seconds` field. Must be from -999,999,999 + * to +999,999,999 inclusive. + */ + nanos: number; +} + +function createBaseDuration(): Duration { + return { seconds: 0, nanos: 0 }; +} + +export const Duration = { + encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Duration { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDuration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.seconds = longToNumber(reader.int64() as Long); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.nanos = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Duration { + return Duration.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Duration { + const message = createBaseDuration(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +declare const self: any | undefined; +declare const window: any | undefined; +declare const global: any | undefined; +const tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/web/src/types/proto/google/protobuf/field_mask.ts b/web/src/types/proto/google/protobuf/field_mask.ts new file mode 100644 index 0000000000000..42e644700d549 --- /dev/null +++ b/web/src/types/proto/google/protobuf/field_mask.ts @@ -0,0 +1,272 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * `FieldMask` represents a set of symbolic field paths, for example: + * + * paths: "f.a" + * paths: "f.b.d" + * + * Here `f` represents a field in some root message, `a` and `b` + * fields in the message found in `f`, and `d` a field found in the + * message in `f.b`. + * + * Field masks are used to specify a subset of fields that should be + * returned by a get operation or modified by an update operation. + * Field masks also have a custom JSON encoding (see below). + * + * # Field Masks in Projections + * + * When used in the context of a projection, a response message or + * sub-message is filtered by the API to only contain those fields as + * specified in the mask. For example, if the mask in the previous + * example is applied to a response message as follows: + * + * f { + * a : 22 + * b { + * d : 1 + * x : 2 + * } + * y : 13 + * } + * z: 8 + * + * The result will not contain specific values for fields x,y and z + * (their value will be set to the default, and omitted in proto text + * output): + * + * f { + * a : 22 + * b { + * d : 1 + * } + * } + * + * A repeated field is not allowed except at the last position of a + * paths string. + * + * If a FieldMask object is not present in a get operation, the + * operation applies to all fields (as if a FieldMask of all fields + * had been specified). + * + * Note that a field mask does not necessarily apply to the + * top-level response message. In case of a REST get operation, the + * field mask applies directly to the response, but in case of a REST + * list operation, the mask instead applies to each individual message + * in the returned resource list. In case of a REST custom method, + * other definitions may be used. Where the mask applies will be + * clearly documented together with its declaration in the API. In + * any case, the effect on the returned resource/resources is required + * behavior for APIs. + * + * # Field Masks in Update Operations + * + * A field mask in update operations specifies which fields of the + * targeted resource are going to be updated. The API is required + * to only change the values of the fields as specified in the mask + * and leave the others untouched. If a resource is passed in to + * describe the updated values, the API ignores the values of all + * fields not covered by the mask. + * + * If a repeated field is specified for an update operation, new values will + * be appended to the existing repeated field in the target resource. Note that + * a repeated field is only allowed in the last position of a `paths` string. + * + * If a sub-message is specified in the last position of the field mask for an + * update operation, then new value will be merged into the existing sub-message + * in the target resource. + * + * For example, given the target message: + * + * f { + * b { + * d: 1 + * x: 2 + * } + * c: [1] + * } + * + * And an update message: + * + * f { + * b { + * d: 10 + * } + * c: [2] + * } + * + * then if the field mask is: + * + * paths: ["f.b", "f.c"] + * + * then the result will be: + * + * f { + * b { + * d: 10 + * x: 2 + * } + * c: [1, 2] + * } + * + * An implementation may provide options to override this default behavior for + * repeated and message fields. + * + * In order to reset a field's value to the default, the field must + * be in the mask and set to the default value in the provided resource. + * Hence, in order to reset all fields of a resource, provide a default + * instance of the resource and set all fields in the mask, or do + * not provide a mask as described below. + * + * If a field mask is not present on update, the operation applies to + * all fields (as if a field mask of all fields has been specified). + * Note that in the presence of schema evolution, this may mean that + * fields the client does not know and has therefore not filled into + * the request will be reset to their default. If this is unwanted + * behavior, a specific service may require a client to always specify + * a field mask, producing an error if not. + * + * As with get operations, the location of the resource which + * describes the updated values in the request message depends on the + * operation kind. In any case, the effect of the field mask is + * required to be honored by the API. + * + * ## Considerations for HTTP REST + * + * The HTTP kind of an update operation which uses a field mask must + * be set to PATCH instead of PUT in order to satisfy HTTP semantics + * (PUT must only be used for full updates). + * + * # JSON Encoding of Field Masks + * + * In JSON, a field mask is encoded as a single string where paths are + * separated by a comma. Fields name in each path are converted + * to/from lower-camel naming conventions. + * + * As an example, consider the following message declarations: + * + * message Profile { + * User user = 1; + * Photo photo = 2; + * } + * message User { + * string display_name = 1; + * string address = 2; + * } + * + * In proto a field mask for `Profile` may look as such: + * + * mask { + * paths: "user.display_name" + * paths: "photo" + * } + * + * In JSON, the same mask is represented as below: + * + * { + * mask: "user.displayName,photo" + * } + * + * # Field Masks and Oneof Fields + * + * Field masks treat fields in oneofs just as regular fields. Consider the + * following message: + * + * message SampleMessage { + * oneof test_oneof { + * string name = 4; + * SubMessage sub_message = 9; + * } + * } + * + * The field mask can be: + * + * mask { + * paths: "name" + * } + * + * Or: + * + * mask { + * paths: "sub_message" + * } + * + * Note that oneof type names ("test_oneof" in this case) cannot be used in + * paths. + * + * ## Field Mask Verification + * + * The implementation of any API method which has a FieldMask type field in the + * request should verify the included field paths, and return an + * `INVALID_ARGUMENT` error if any path is unmappable. + */ +export interface FieldMask { + /** The set of field mask paths. */ + paths: string[]; +} + +function createBaseFieldMask(): FieldMask { + return { paths: [] }; +} + +export const FieldMask = { + encode(message: FieldMask, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.paths) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldMask { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldMask(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.paths.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): FieldMask { + return FieldMask.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): FieldMask { + const message = createBaseFieldMask(); + message.paths = object.paths?.map((e) => e) || []; + return message; + }, + + wrap(paths: string[]): FieldMask { + const result = createBaseFieldMask(); + result.paths = paths; + return result; + }, + + unwrap(message: FieldMask): string[] { + return message.paths; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/web/src/types/proto/google/protobuf/timestamp.ts b/web/src/types/proto/google/protobuf/timestamp.ts new file mode 100644 index 0000000000000..cdf3e4d792bb8 --- /dev/null +++ b/web/src/types/proto/google/protobuf/timestamp.ts @@ -0,0 +1,207 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.protobuf"; + +/** + * A Timestamp represents a point in time independent of any time zone or local + * calendar, encoded as a count of seconds and fractions of seconds at + * nanosecond resolution. The count is relative to an epoch at UTC midnight on + * January 1, 1970, in the proleptic Gregorian calendar which extends the + * Gregorian calendar backwards to year one. + * + * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + * second table is needed for interpretation, using a [24-hour linear + * smear](https://developers.google.com/time/smear). + * + * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + * restricting to that range, we ensure that we can convert to and from [RFC + * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + * + * # Examples + * + * Example 1: Compute Timestamp from POSIX `time()`. + * + * Timestamp timestamp; + * timestamp.set_seconds(time(NULL)); + * timestamp.set_nanos(0); + * + * Example 2: Compute Timestamp from POSIX `gettimeofday()`. + * + * struct timeval tv; + * gettimeofday(&tv, NULL); + * + * Timestamp timestamp; + * timestamp.set_seconds(tv.tv_sec); + * timestamp.set_nanos(tv.tv_usec * 1000); + * + * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + * + * FILETIME ft; + * GetSystemTimeAsFileTime(&ft); + * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + * + * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + * Timestamp timestamp; + * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + * + * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + * + * long millis = System.currentTimeMillis(); + * + * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + * .setNanos((int) ((millis % 1000) * 1000000)).build(); + * + * Example 5: Compute Timestamp from Java `Instant.now()`. + * + * Instant now = Instant.now(); + * + * Timestamp timestamp = + * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + * .setNanos(now.getNano()).build(); + * + * Example 6: Compute Timestamp from current time in Python. + * + * timestamp = Timestamp() + * timestamp.GetCurrentTime() + * + * # JSON Mapping + * + * In JSON format, the Timestamp type is encoded as a string in the + * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + * where {year} is always expressed using four digits while {month}, {day}, + * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + * is required. A proto3 JSON serializer should always use UTC (as indicated by + * "Z") when printing the Timestamp type and a proto3 JSON parser should be + * able to accept both UTC and other timezones (as indicated by an offset). + * + * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + * 01:30 UTC on January 15, 2017. + * + * In JavaScript, one can convert a Date object to this format using the + * standard + * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + * method. In Python, a standard `datetime.datetime` object can be converted + * to this format using + * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + * the Joda Time's [`ISODateTimeFormat.dateTime()`]( + * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D + * ) to obtain a formatter capable of generating timestamps in this format. + */ +export interface Timestamp { + /** + * Represents seconds of UTC time since Unix epoch + * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + * 9999-12-31T23:59:59Z inclusive. + */ + seconds: number; + /** + * Non-negative fractions of a second at nanosecond resolution. Negative + * second values with fractions must still have non-negative nanos values + * that count forward in time. Must be from 0 to 999,999,999 + * inclusive. + */ + nanos: number; +} + +function createBaseTimestamp(): Timestamp { + return { seconds: 0, nanos: 0 }; +} + +export const Timestamp = { + encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.seconds !== 0) { + writer.uint32(8).int64(message.seconds); + } + if (message.nanos !== 0) { + writer.uint32(16).int32(message.nanos); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTimestamp(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.seconds = longToNumber(reader.int64() as Long); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.nanos = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): Timestamp { + return Timestamp.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): Timestamp { + const message = createBaseTimestamp(); + message.seconds = object.seconds ?? 0; + message.nanos = object.nanos ?? 0; + return message; + }, +}; + +declare const self: any | undefined; +declare const window: any | undefined; +declare const global: any | undefined; +const tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} diff --git a/web/src/types/proto/store/activity.ts b/web/src/types/proto/store/activity.ts new file mode 100644 index 0000000000000..4248b389bdb9a --- /dev/null +++ b/web/src/types/proto/store/activity.ts @@ -0,0 +1,189 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "memos.store"; + +export interface ActivityMemoCommentPayload { + memoId: number; + relatedMemoId: number; +} + +export interface ActivityVersionUpdatePayload { + version: string; +} + +export interface ActivityPayload { + memoComment?: ActivityMemoCommentPayload | undefined; + versionUpdate?: ActivityVersionUpdatePayload | undefined; +} + +function createBaseActivityMemoCommentPayload(): ActivityMemoCommentPayload { + return { memoId: 0, relatedMemoId: 0 }; +} + +export const ActivityMemoCommentPayload = { + encode(message: ActivityMemoCommentPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.memoId !== 0) { + writer.uint32(8).int32(message.memoId); + } + if (message.relatedMemoId !== 0) { + writer.uint32(16).int32(message.relatedMemoId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ActivityMemoCommentPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActivityMemoCommentPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.memoId = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.relatedMemoId = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ActivityMemoCommentPayload { + return ActivityMemoCommentPayload.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ActivityMemoCommentPayload { + const message = createBaseActivityMemoCommentPayload(); + message.memoId = object.memoId ?? 0; + message.relatedMemoId = object.relatedMemoId ?? 0; + return message; + }, +}; + +function createBaseActivityVersionUpdatePayload(): ActivityVersionUpdatePayload { + return { version: "" }; +} + +export const ActivityVersionUpdatePayload = { + encode(message: ActivityVersionUpdatePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.version !== "") { + writer.uint32(10).string(message.version); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ActivityVersionUpdatePayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActivityVersionUpdatePayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.version = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ActivityVersionUpdatePayload { + return ActivityVersionUpdatePayload.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ActivityVersionUpdatePayload { + const message = createBaseActivityVersionUpdatePayload(); + message.version = object.version ?? ""; + return message; + }, +}; + +function createBaseActivityPayload(): ActivityPayload { + return { memoComment: undefined, versionUpdate: undefined }; +} + +export const ActivityPayload = { + encode(message: ActivityPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.memoComment !== undefined) { + ActivityMemoCommentPayload.encode(message.memoComment, writer.uint32(10).fork()).ldelim(); + } + if (message.versionUpdate !== undefined) { + ActivityVersionUpdatePayload.encode(message.versionUpdate, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ActivityPayload { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseActivityPayload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.memoComment = ActivityMemoCommentPayload.decode(reader, reader.uint32()); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.versionUpdate = ActivityVersionUpdatePayload.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): ActivityPayload { + return ActivityPayload.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): ActivityPayload { + const message = createBaseActivityPayload(); + message.memoComment = (object.memoComment !== undefined && object.memoComment !== null) + ? ActivityMemoCommentPayload.fromPartial(object.memoComment) + : undefined; + message.versionUpdate = (object.versionUpdate !== undefined && object.versionUpdate !== null) + ? ActivityVersionUpdatePayload.fromPartial(object.versionUpdate) + : undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/web/src/types/proto/store/common.ts b/web/src/types/proto/store/common.ts new file mode 100644 index 0000000000000..2b4af3af27056 --- /dev/null +++ b/web/src/types/proto/store/common.ts @@ -0,0 +1,3 @@ +/* eslint-disable */ + +export const protobufPackage = "memos.store"; diff --git a/web/src/types/proto/store/inbox.ts b/web/src/types/proto/store/inbox.ts new file mode 100644 index 0000000000000..e21b3c49c737a --- /dev/null +++ b/web/src/types/proto/store/inbox.ts @@ -0,0 +1,80 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "memos.store"; + +export interface InboxMessage { + type: InboxMessage_Type; + activityId?: number | undefined; +} + +export enum InboxMessage_Type { + TYPE_UNSPECIFIED = 0, + TYPE_MEMO_COMMENT = 1, + TYPE_VERSION_UPDATE = 2, + UNRECOGNIZED = -1, +} + +function createBaseInboxMessage(): InboxMessage { + return { type: 0, activityId: undefined }; +} + +export const InboxMessage = { + encode(message: InboxMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.type !== 0) { + writer.uint32(8).int32(message.type); + } + if (message.activityId !== undefined) { + writer.uint32(16).int32(message.activityId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): InboxMessage { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseInboxMessage(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.type = reader.int32() as any; + continue; + case 2: + if (tag !== 16) { + break; + } + + message.activityId = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): InboxMessage { + return InboxMessage.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): InboxMessage { + const message = createBaseInboxMessage(); + message.type = object.type ?? 0; + message.activityId = object.activityId ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/web/src/types/proto/store/system_setting.ts b/web/src/types/proto/store/system_setting.ts new file mode 100644 index 0000000000000..e853f9c5d48ff --- /dev/null +++ b/web/src/types/proto/store/system_setting.ts @@ -0,0 +1,95 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "memos.store"; + +export enum SystemSettingKey { + SYSTEM_SETTING_KEY_UNSPECIFIED = 0, + /** BACKUP_CONFIG - BackupConfig is the key for auto-backup configuration. */ + BACKUP_CONFIG = 1, + UNRECOGNIZED = -1, +} + +export interface BackupConfig { + /** enabled indicates whether backup is enabled. */ + enabled: boolean; + /** cron is the cron expression for backup. See https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format */ + cron: string; + /** max_keep is the maximum number of backups to keep. */ + maxKeep: number; +} + +function createBaseBackupConfig(): BackupConfig { + return { enabled: false, cron: "", maxKeep: 0 }; +} + +export const BackupConfig = { + encode(message: BackupConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.enabled === true) { + writer.uint32(8).bool(message.enabled); + } + if (message.cron !== "") { + writer.uint32(18).string(message.cron); + } + if (message.maxKeep !== 0) { + writer.uint32(24).int32(message.maxKeep); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): BackupConfig { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBackupConfig(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.enabled = reader.bool(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.cron = reader.string(); + continue; + case 3: + if (tag !== 24) { + break; + } + + message.maxKeep = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): BackupConfig { + return BackupConfig.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): BackupConfig { + const message = createBaseBackupConfig(); + message.enabled = object.enabled ?? false; + message.cron = object.cron ?? ""; + message.maxKeep = object.maxKeep ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; diff --git a/web/src/types/proto/store/user_setting.ts b/web/src/types/proto/store/user_setting.ts new file mode 100644 index 0000000000000..b2dc6cc4b58da --- /dev/null +++ b/web/src/types/proto/store/user_setting.ts @@ -0,0 +1,211 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "memos.store"; + +export enum UserSettingKey { + USER_SETTING_KEY_UNSPECIFIED = 0, + /** USER_SETTING_ACCESS_TOKENS - Access tokens for the user. */ + USER_SETTING_ACCESS_TOKENS = 1, + UNRECOGNIZED = -1, +} + +export interface UserSetting { + userId: number; + key: UserSettingKey; + accessTokens?: AccessTokensUserSetting | undefined; +} + +export interface AccessTokensUserSetting { + accessTokens: AccessTokensUserSetting_AccessToken[]; +} + +export interface AccessTokensUserSetting_AccessToken { + /** + * The access token is a JWT token. + * Including expiration time, issuer, etc. + */ + accessToken: string; + /** A description for the access token. */ + description: string; +} + +function createBaseUserSetting(): UserSetting { + return { userId: 0, key: 0, accessTokens: undefined }; +} + +export const UserSetting = { + encode(message: UserSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.userId !== 0) { + writer.uint32(8).int32(message.userId); + } + if (message.key !== 0) { + writer.uint32(16).int32(message.key); + } + if (message.accessTokens !== undefined) { + AccessTokensUserSetting.encode(message.accessTokens, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UserSetting { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUserSetting(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.userId = reader.int32(); + continue; + case 2: + if (tag !== 16) { + break; + } + + message.key = reader.int32() as any; + continue; + case 3: + if (tag !== 26) { + break; + } + + message.accessTokens = AccessTokensUserSetting.decode(reader, reader.uint32()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): UserSetting { + return UserSetting.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): UserSetting { + const message = createBaseUserSetting(); + message.userId = object.userId ?? 0; + message.key = object.key ?? 0; + message.accessTokens = (object.accessTokens !== undefined && object.accessTokens !== null) + ? AccessTokensUserSetting.fromPartial(object.accessTokens) + : undefined; + return message; + }, +}; + +function createBaseAccessTokensUserSetting(): AccessTokensUserSetting { + return { accessTokens: [] }; +} + +export const AccessTokensUserSetting = { + encode(message: AccessTokensUserSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.accessTokens) { + AccessTokensUserSetting_AccessToken.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccessTokensUserSetting { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessTokensUserSetting(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accessTokens.push(AccessTokensUserSetting_AccessToken.decode(reader, reader.uint32())); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): AccessTokensUserSetting { + return AccessTokensUserSetting.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): AccessTokensUserSetting { + const message = createBaseAccessTokensUserSetting(); + message.accessTokens = object.accessTokens?.map((e) => AccessTokensUserSetting_AccessToken.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseAccessTokensUserSetting_AccessToken(): AccessTokensUserSetting_AccessToken { + return { accessToken: "", description: "" }; +} + +export const AccessTokensUserSetting_AccessToken = { + encode(message: AccessTokensUserSetting_AccessToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.accessToken !== "") { + writer.uint32(10).string(message.accessToken); + } + if (message.description !== "") { + writer.uint32(18).string(message.description); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AccessTokensUserSetting_AccessToken { + const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAccessTokensUserSetting_AccessToken(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.accessToken = reader.string(); + continue; + case 2: + if (tag !== 18) { + break; + } + + message.description = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skipType(tag & 7); + } + return message; + }, + + create(base?: DeepPartial): AccessTokensUserSetting_AccessToken { + return AccessTokensUserSetting_AccessToken.fromPartial(base ?? {}); + }, + + fromPartial(object: DeepPartial): AccessTokensUserSetting_AccessToken { + const message = createBaseAccessTokensUserSetting_AccessToken(); + message.accessToken = object.accessToken ?? ""; + message.description = object.description ?? ""; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; From 0458269e154c82477cab032247d8211a7b12092c Mon Sep 17 00:00:00 2001 From: boojack Date: Mon, 6 Nov 2023 21:01:17 +0800 Subject: [PATCH 028/650] revert: "chore: add frontend type definitions" (#2483) Revert "chore: add frontend type definitions (#2482)" This reverts commit 64d4db81cab99af9c0b1866b40a952b5aa095cac. --- web/.gitignore | 1 + .../types/proto/api/v2/activity_service.ts | 372 -- web/src/types/proto/api/v2/common.ts | 10 - web/src/types/proto/api/v2/inbox_service.ts | 569 --- web/src/types/proto/api/v2/memo_service.ts | 911 ----- .../types/proto/api/v2/resource_service.ts | 770 ---- web/src/types/proto/api/v2/system_service.ts | 504 --- web/src/types/proto/api/v2/tag_service.ts | 413 -- web/src/types/proto/api/v2/user_service.ts | 1248 ------ web/src/types/proto/google/api/annotations.ts | 3 - web/src/types/proto/google/api/client.ts | 1588 -------- .../types/proto/google/api/field_behavior.ts | 62 - web/src/types/proto/google/api/http.ts | 653 --- .../types/proto/google/api/launch_stage.ts | 58 - .../types/proto/google/protobuf/descriptor.ts | 3573 ----------------- .../types/proto/google/protobuf/duration.ts | 178 - .../types/proto/google/protobuf/field_mask.ts | 272 -- .../types/proto/google/protobuf/timestamp.ts | 207 - web/src/types/proto/store/activity.ts | 189 - web/src/types/proto/store/common.ts | 3 - web/src/types/proto/store/inbox.ts | 80 - web/src/types/proto/store/system_setting.ts | 95 - web/src/types/proto/store/user_setting.ts | 211 - 23 files changed, 1 insertion(+), 11969 deletions(-) delete mode 100644 web/src/types/proto/api/v2/activity_service.ts delete mode 100644 web/src/types/proto/api/v2/common.ts delete mode 100644 web/src/types/proto/api/v2/inbox_service.ts delete mode 100644 web/src/types/proto/api/v2/memo_service.ts delete mode 100644 web/src/types/proto/api/v2/resource_service.ts delete mode 100644 web/src/types/proto/api/v2/system_service.ts delete mode 100644 web/src/types/proto/api/v2/tag_service.ts delete mode 100644 web/src/types/proto/api/v2/user_service.ts delete mode 100644 web/src/types/proto/google/api/annotations.ts delete mode 100644 web/src/types/proto/google/api/client.ts delete mode 100644 web/src/types/proto/google/api/field_behavior.ts delete mode 100644 web/src/types/proto/google/api/http.ts delete mode 100644 web/src/types/proto/google/api/launch_stage.ts delete mode 100644 web/src/types/proto/google/protobuf/descriptor.ts delete mode 100644 web/src/types/proto/google/protobuf/duration.ts delete mode 100644 web/src/types/proto/google/protobuf/field_mask.ts delete mode 100644 web/src/types/proto/google/protobuf/timestamp.ts delete mode 100644 web/src/types/proto/store/activity.ts delete mode 100644 web/src/types/proto/store/common.ts delete mode 100644 web/src/types/proto/store/inbox.ts delete mode 100644 web/src/types/proto/store/system_setting.ts delete mode 100644 web/src/types/proto/store/user_setting.ts diff --git a/web/.gitignore b/web/.gitignore index d451ff16c1010..f4e178b9b5bd0 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -3,3 +3,4 @@ node_modules dist dist-ssr *.local +src/types/proto diff --git a/web/src/types/proto/api/v2/activity_service.ts b/web/src/types/proto/api/v2/activity_service.ts deleted file mode 100644 index 603ab818b2dd9..0000000000000 --- a/web/src/types/proto/api/v2/activity_service.ts +++ /dev/null @@ -1,372 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; -import { Timestamp } from "../../google/protobuf/timestamp"; - -export const protobufPackage = "memos.api.v2"; - -export interface Activity { - id: number; - creatorId: number; - type: string; - level: string; - createTime?: Date | undefined; - payload?: ActivityPayload | undefined; -} - -export interface ActivityMemoCommentPayload { - memoId: number; - relatedMemoId: number; -} - -export interface ActivityPayload { - memoComment?: ActivityMemoCommentPayload | undefined; -} - -export interface GetActivityRequest { - id: number; -} - -export interface GetActivityResponse { - activity?: Activity | undefined; -} - -function createBaseActivity(): Activity { - return { id: 0, creatorId: 0, type: "", level: "", createTime: undefined, payload: undefined }; -} - -export const Activity = { - encode(message: Activity, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - if (message.creatorId !== 0) { - writer.uint32(16).int32(message.creatorId); - } - if (message.type !== "") { - writer.uint32(26).string(message.type); - } - if (message.level !== "") { - writer.uint32(34).string(message.level); - } - if (message.createTime !== undefined) { - Timestamp.encode(toTimestamp(message.createTime), writer.uint32(42).fork()).ldelim(); - } - if (message.payload !== undefined) { - ActivityPayload.encode(message.payload, writer.uint32(50).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Activity { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseActivity(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.creatorId = reader.int32(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.type = reader.string(); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.level = reader.string(); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.payload = ActivityPayload.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Activity { - return Activity.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Activity { - const message = createBaseActivity(); - message.id = object.id ?? 0; - message.creatorId = object.creatorId ?? 0; - message.type = object.type ?? ""; - message.level = object.level ?? ""; - message.createTime = object.createTime ?? undefined; - message.payload = (object.payload !== undefined && object.payload !== null) - ? ActivityPayload.fromPartial(object.payload) - : undefined; - return message; - }, -}; - -function createBaseActivityMemoCommentPayload(): ActivityMemoCommentPayload { - return { memoId: 0, relatedMemoId: 0 }; -} - -export const ActivityMemoCommentPayload = { - encode(message: ActivityMemoCommentPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.memoId !== 0) { - writer.uint32(8).int32(message.memoId); - } - if (message.relatedMemoId !== 0) { - writer.uint32(16).int32(message.relatedMemoId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ActivityMemoCommentPayload { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseActivityMemoCommentPayload(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.memoId = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.relatedMemoId = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ActivityMemoCommentPayload { - return ActivityMemoCommentPayload.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ActivityMemoCommentPayload { - const message = createBaseActivityMemoCommentPayload(); - message.memoId = object.memoId ?? 0; - message.relatedMemoId = object.relatedMemoId ?? 0; - return message; - }, -}; - -function createBaseActivityPayload(): ActivityPayload { - return { memoComment: undefined }; -} - -export const ActivityPayload = { - encode(message: ActivityPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.memoComment !== undefined) { - ActivityMemoCommentPayload.encode(message.memoComment, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ActivityPayload { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseActivityPayload(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.memoComment = ActivityMemoCommentPayload.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ActivityPayload { - return ActivityPayload.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ActivityPayload { - const message = createBaseActivityPayload(); - message.memoComment = (object.memoComment !== undefined && object.memoComment !== null) - ? ActivityMemoCommentPayload.fromPartial(object.memoComment) - : undefined; - return message; - }, -}; - -function createBaseGetActivityRequest(): GetActivityRequest { - return { id: 0 }; -} - -export const GetActivityRequest = { - encode(message: GetActivityRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetActivityRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetActivityRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetActivityRequest { - return GetActivityRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GetActivityRequest { - const message = createBaseGetActivityRequest(); - message.id = object.id ?? 0; - return message; - }, -}; - -function createBaseGetActivityResponse(): GetActivityResponse { - return { activity: undefined }; -} - -export const GetActivityResponse = { - encode(message: GetActivityResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.activity !== undefined) { - Activity.encode(message.activity, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetActivityResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetActivityResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.activity = Activity.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetActivityResponse { - return GetActivityResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GetActivityResponse { - const message = createBaseGetActivityResponse(); - message.activity = (object.activity !== undefined && object.activity !== null) - ? Activity.fromPartial(object.activity) - : undefined; - return message; - }, -}; - -export type ActivityServiceDefinition = typeof ActivityServiceDefinition; -export const ActivityServiceDefinition = { - name: "ActivityService", - fullName: "memos.api.v2.ActivityService", - methods: { - getActivity: { - name: "GetActivity", - requestType: GetActivityRequest, - requestStream: false, - responseType: GetActivityResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [new Uint8Array([16, 18, 14, 47, 118, 50, 47, 97, 99, 116, 105, 118, 105, 116, 105, 101, 115])], - }, - }, - }, - }, -} as const; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = (t.seconds || 0) * 1_000; - millis += (t.nanos || 0) / 1_000_000; - return new Date(millis); -} diff --git a/web/src/types/proto/api/v2/common.ts b/web/src/types/proto/api/v2/common.ts deleted file mode 100644 index 81f0bf16bd4e3..0000000000000 --- a/web/src/types/proto/api/v2/common.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* eslint-disable */ - -export const protobufPackage = "memos.api.v2"; - -export enum RowStatus { - ROW_STATUS_UNSPECIFIED = 0, - ACTIVE = 1, - ARCHIVED = 2, - UNRECOGNIZED = -1, -} diff --git a/web/src/types/proto/api/v2/inbox_service.ts b/web/src/types/proto/api/v2/inbox_service.ts deleted file mode 100644 index 03e92ea1d3a9e..0000000000000 --- a/web/src/types/proto/api/v2/inbox_service.ts +++ /dev/null @@ -1,569 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; -import { FieldMask } from "../../google/protobuf/field_mask"; -import { Timestamp } from "../../google/protobuf/timestamp"; - -export const protobufPackage = "memos.api.v2"; - -export interface Inbox { - /** - * The name of the inbox. - * Format: inboxes/{id} - */ - name: string; - /** Format: users/{username} */ - sender: string; - /** Format: users/{username} */ - receiver: string; - status: Inbox_Status; - createTime?: Date | undefined; - type: Inbox_Type; - activityId?: number | undefined; -} - -export enum Inbox_Status { - STATUS_UNSPECIFIED = 0, - UNREAD = 1, - ARCHIVED = 2, - UNRECOGNIZED = -1, -} - -export enum Inbox_Type { - TYPE_UNSPECIFIED = 0, - TYPE_MEMO_COMMENT = 1, - UNRECOGNIZED = -1, -} - -export interface ListInboxesRequest { - /** Format: users/{username} */ - user: string; -} - -export interface ListInboxesResponse { - inboxes: Inbox[]; -} - -export interface UpdateInboxRequest { - inbox?: Inbox | undefined; - updateMask?: string[] | undefined; -} - -export interface UpdateInboxResponse { - inbox?: Inbox | undefined; -} - -export interface DeleteInboxRequest { - /** - * The name of the inbox to delete. - * Format: inboxes/{inbox} - */ - name: string; -} - -export interface DeleteInboxResponse { -} - -function createBaseInbox(): Inbox { - return { name: "", sender: "", receiver: "", status: 0, createTime: undefined, type: 0, activityId: undefined }; -} - -export const Inbox = { - encode(message: Inbox, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.sender !== "") { - writer.uint32(18).string(message.sender); - } - if (message.receiver !== "") { - writer.uint32(26).string(message.receiver); - } - if (message.status !== 0) { - writer.uint32(32).int32(message.status); - } - if (message.createTime !== undefined) { - Timestamp.encode(toTimestamp(message.createTime), writer.uint32(42).fork()).ldelim(); - } - if (message.type !== 0) { - writer.uint32(48).int32(message.type); - } - if (message.activityId !== undefined) { - writer.uint32(56).int32(message.activityId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Inbox { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInbox(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.sender = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.receiver = reader.string(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.status = reader.int32() as any; - continue; - case 5: - if (tag !== 42) { - break; - } - - message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - case 6: - if (tag !== 48) { - break; - } - - message.type = reader.int32() as any; - continue; - case 7: - if (tag !== 56) { - break; - } - - message.activityId = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Inbox { - return Inbox.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Inbox { - const message = createBaseInbox(); - message.name = object.name ?? ""; - message.sender = object.sender ?? ""; - message.receiver = object.receiver ?? ""; - message.status = object.status ?? 0; - message.createTime = object.createTime ?? undefined; - message.type = object.type ?? 0; - message.activityId = object.activityId ?? undefined; - return message; - }, -}; - -function createBaseListInboxesRequest(): ListInboxesRequest { - return { user: "" }; -} - -export const ListInboxesRequest = { - encode(message: ListInboxesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.user !== "") { - writer.uint32(10).string(message.user); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListInboxesRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListInboxesRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.user = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListInboxesRequest { - return ListInboxesRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListInboxesRequest { - const message = createBaseListInboxesRequest(); - message.user = object.user ?? ""; - return message; - }, -}; - -function createBaseListInboxesResponse(): ListInboxesResponse { - return { inboxes: [] }; -} - -export const ListInboxesResponse = { - encode(message: ListInboxesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.inboxes) { - Inbox.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListInboxesResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListInboxesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.inboxes.push(Inbox.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListInboxesResponse { - return ListInboxesResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListInboxesResponse { - const message = createBaseListInboxesResponse(); - message.inboxes = object.inboxes?.map((e) => Inbox.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseUpdateInboxRequest(): UpdateInboxRequest { - return { inbox: undefined, updateMask: undefined }; -} - -export const UpdateInboxRequest = { - encode(message: UpdateInboxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.inbox !== undefined) { - Inbox.encode(message.inbox, writer.uint32(10).fork()).ldelim(); - } - if (message.updateMask !== undefined) { - FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInboxRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateInboxRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.inbox = Inbox.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateInboxRequest { - return UpdateInboxRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateInboxRequest { - const message = createBaseUpdateInboxRequest(); - message.inbox = (object.inbox !== undefined && object.inbox !== null) ? Inbox.fromPartial(object.inbox) : undefined; - message.updateMask = object.updateMask ?? undefined; - return message; - }, -}; - -function createBaseUpdateInboxResponse(): UpdateInboxResponse { - return { inbox: undefined }; -} - -export const UpdateInboxResponse = { - encode(message: UpdateInboxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.inbox !== undefined) { - Inbox.encode(message.inbox, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateInboxResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateInboxResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.inbox = Inbox.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateInboxResponse { - return UpdateInboxResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateInboxResponse { - const message = createBaseUpdateInboxResponse(); - message.inbox = (object.inbox !== undefined && object.inbox !== null) ? Inbox.fromPartial(object.inbox) : undefined; - return message; - }, -}; - -function createBaseDeleteInboxRequest(): DeleteInboxRequest { - return { name: "" }; -} - -export const DeleteInboxRequest = { - encode(message: DeleteInboxRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteInboxRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteInboxRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteInboxRequest { - return DeleteInboxRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DeleteInboxRequest { - const message = createBaseDeleteInboxRequest(); - message.name = object.name ?? ""; - return message; - }, -}; - -function createBaseDeleteInboxResponse(): DeleteInboxResponse { - return {}; -} - -export const DeleteInboxResponse = { - encode(_: DeleteInboxResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteInboxResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteInboxResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteInboxResponse { - return DeleteInboxResponse.fromPartial(base ?? {}); - }, - - fromPartial(_: DeepPartial): DeleteInboxResponse { - const message = createBaseDeleteInboxResponse(); - return message; - }, -}; - -export type InboxServiceDefinition = typeof InboxServiceDefinition; -export const InboxServiceDefinition = { - name: "InboxService", - fullName: "memos.api.v2.InboxService", - methods: { - listInboxes: { - name: "ListInboxes", - requestType: ListInboxesRequest, - requestStream: false, - responseType: ListInboxesResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [ - new Uint8Array([17, 18, 15, 47, 97, 112, 105, 47, 118, 50, 47, 105, 110, 98, 111, 120, 101, 115]), - ], - }, - }, - }, - updateInbox: { - name: "UpdateInbox", - requestType: UpdateInboxRequest, - requestStream: false, - responseType: UpdateInboxResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([17, 105, 110, 98, 111, 120, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])], - 578365826: [ - new Uint8Array([ - 20, - 58, - 5, - 105, - 110, - 98, - 111, - 120, - 50, - 11, - 47, - 118, - 50, - 47, - 105, - 110, - 98, - 111, - 120, - 101, - 115, - ]), - ], - }, - }, - }, - deleteInbox: { - name: "DeleteInbox", - requestType: DeleteInboxRequest, - requestStream: false, - responseType: DeleteInboxResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([4, 110, 97, 109, 101])], - 578365826: [ - new Uint8Array([ - 22, - 42, - 20, - 47, - 118, - 50, - 47, - 123, - 110, - 97, - 109, - 101, - 61, - 105, - 110, - 98, - 111, - 120, - 101, - 115, - 47, - 42, - 125, - ]), - ], - }, - }, - }, - }, -} as const; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = (t.seconds || 0) * 1_000; - millis += (t.nanos || 0) / 1_000_000; - return new Date(millis); -} diff --git a/web/src/types/proto/api/v2/memo_service.ts b/web/src/types/proto/api/v2/memo_service.ts deleted file mode 100644 index f60d18c21093a..0000000000000 --- a/web/src/types/proto/api/v2/memo_service.ts +++ /dev/null @@ -1,911 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { RowStatus } from "./common"; - -export const protobufPackage = "memos.api.v2"; - -export enum Visibility { - VISIBILITY_UNSPECIFIED = 0, - PRIVATE = 1, - PROTECTED = 2, - PUBLIC = 3, - UNRECOGNIZED = -1, -} - -export interface Memo { - id: number; - rowStatus: RowStatus; - creatorId: number; - createdTs: number; - updatedTs: number; - content: string; - visibility: Visibility; - pinned: boolean; -} - -export interface CreateMemoRequest { - content: string; - visibility: Visibility; -} - -export interface CreateMemoResponse { - memo?: Memo | undefined; -} - -export interface ListMemosRequest { - page: number; - pageSize: number; - /** Filter is used to filter memos returned in the list. */ - filter: string; - creatorId?: number | undefined; -} - -export interface ListMemosResponse { - memos: Memo[]; -} - -export interface GetMemoRequest { - id: number; -} - -export interface GetMemoResponse { - memo?: Memo | undefined; -} - -export interface CreateMemoCommentRequest { - /** id is the memo id to create comment for. */ - id: number; - create?: CreateMemoRequest | undefined; -} - -export interface CreateMemoCommentResponse { - memo?: Memo | undefined; -} - -export interface ListMemoCommentsRequest { - id: number; -} - -export interface ListMemoCommentsResponse { - memos: Memo[]; -} - -function createBaseMemo(): Memo { - return { id: 0, rowStatus: 0, creatorId: 0, createdTs: 0, updatedTs: 0, content: "", visibility: 0, pinned: false }; -} - -export const Memo = { - encode(message: Memo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - if (message.rowStatus !== 0) { - writer.uint32(16).int32(message.rowStatus); - } - if (message.creatorId !== 0) { - writer.uint32(24).int32(message.creatorId); - } - if (message.createdTs !== 0) { - writer.uint32(32).int64(message.createdTs); - } - if (message.updatedTs !== 0) { - writer.uint32(40).int64(message.updatedTs); - } - if (message.content !== "") { - writer.uint32(50).string(message.content); - } - if (message.visibility !== 0) { - writer.uint32(56).int32(message.visibility); - } - if (message.pinned === true) { - writer.uint32(64).bool(message.pinned); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Memo { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMemo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.rowStatus = reader.int32() as any; - continue; - case 3: - if (tag !== 24) { - break; - } - - message.creatorId = reader.int32(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.createdTs = longToNumber(reader.int64() as Long); - continue; - case 5: - if (tag !== 40) { - break; - } - - message.updatedTs = longToNumber(reader.int64() as Long); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.content = reader.string(); - continue; - case 7: - if (tag !== 56) { - break; - } - - message.visibility = reader.int32() as any; - continue; - case 8: - if (tag !== 64) { - break; - } - - message.pinned = reader.bool(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Memo { - return Memo.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Memo { - const message = createBaseMemo(); - message.id = object.id ?? 0; - message.rowStatus = object.rowStatus ?? 0; - message.creatorId = object.creatorId ?? 0; - message.createdTs = object.createdTs ?? 0; - message.updatedTs = object.updatedTs ?? 0; - message.content = object.content ?? ""; - message.visibility = object.visibility ?? 0; - message.pinned = object.pinned ?? false; - return message; - }, -}; - -function createBaseCreateMemoRequest(): CreateMemoRequest { - return { content: "", visibility: 0 }; -} - -export const CreateMemoRequest = { - encode(message: CreateMemoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.content !== "") { - writer.uint32(10).string(message.content); - } - if (message.visibility !== 0) { - writer.uint32(16).int32(message.visibility); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMemoRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.content = reader.string(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.visibility = reader.int32() as any; - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateMemoRequest { - return CreateMemoRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateMemoRequest { - const message = createBaseCreateMemoRequest(); - message.content = object.content ?? ""; - message.visibility = object.visibility ?? 0; - return message; - }, -}; - -function createBaseCreateMemoResponse(): CreateMemoResponse { - return { memo: undefined }; -} - -export const CreateMemoResponse = { - encode(message: CreateMemoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.memo !== undefined) { - Memo.encode(message.memo, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMemoResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.memo = Memo.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateMemoResponse { - return CreateMemoResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateMemoResponse { - const message = createBaseCreateMemoResponse(); - message.memo = (object.memo !== undefined && object.memo !== null) ? Memo.fromPartial(object.memo) : undefined; - return message; - }, -}; - -function createBaseListMemosRequest(): ListMemosRequest { - return { page: 0, pageSize: 0, filter: "", creatorId: undefined }; -} - -export const ListMemosRequest = { - encode(message: ListMemosRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.page !== 0) { - writer.uint32(8).int32(message.page); - } - if (message.pageSize !== 0) { - writer.uint32(16).int32(message.pageSize); - } - if (message.filter !== "") { - writer.uint32(26).string(message.filter); - } - if (message.creatorId !== undefined) { - writer.uint32(32).int32(message.creatorId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListMemosRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMemosRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.page = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.pageSize = reader.int32(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.filter = reader.string(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.creatorId = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListMemosRequest { - return ListMemosRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListMemosRequest { - const message = createBaseListMemosRequest(); - message.page = object.page ?? 0; - message.pageSize = object.pageSize ?? 0; - message.filter = object.filter ?? ""; - message.creatorId = object.creatorId ?? undefined; - return message; - }, -}; - -function createBaseListMemosResponse(): ListMemosResponse { - return { memos: [] }; -} - -export const ListMemosResponse = { - encode(message: ListMemosResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.memos) { - Memo.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListMemosResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMemosResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.memos.push(Memo.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListMemosResponse { - return ListMemosResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListMemosResponse { - const message = createBaseListMemosResponse(); - message.memos = object.memos?.map((e) => Memo.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseGetMemoRequest(): GetMemoRequest { - return { id: 0 }; -} - -export const GetMemoRequest = { - encode(message: GetMemoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetMemoRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMemoRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetMemoRequest { - return GetMemoRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GetMemoRequest { - const message = createBaseGetMemoRequest(); - message.id = object.id ?? 0; - return message; - }, -}; - -function createBaseGetMemoResponse(): GetMemoResponse { - return { memo: undefined }; -} - -export const GetMemoResponse = { - encode(message: GetMemoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.memo !== undefined) { - Memo.encode(message.memo, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetMemoResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMemoResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.memo = Memo.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetMemoResponse { - return GetMemoResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GetMemoResponse { - const message = createBaseGetMemoResponse(); - message.memo = (object.memo !== undefined && object.memo !== null) ? Memo.fromPartial(object.memo) : undefined; - return message; - }, -}; - -function createBaseCreateMemoCommentRequest(): CreateMemoCommentRequest { - return { id: 0, create: undefined }; -} - -export const CreateMemoCommentRequest = { - encode(message: CreateMemoCommentRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - if (message.create !== undefined) { - CreateMemoRequest.encode(message.create, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoCommentRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMemoCommentRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.create = CreateMemoRequest.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateMemoCommentRequest { - return CreateMemoCommentRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateMemoCommentRequest { - const message = createBaseCreateMemoCommentRequest(); - message.id = object.id ?? 0; - message.create = (object.create !== undefined && object.create !== null) - ? CreateMemoRequest.fromPartial(object.create) - : undefined; - return message; - }, -}; - -function createBaseCreateMemoCommentResponse(): CreateMemoCommentResponse { - return { memo: undefined }; -} - -export const CreateMemoCommentResponse = { - encode(message: CreateMemoCommentResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.memo !== undefined) { - Memo.encode(message.memo, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateMemoCommentResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMemoCommentResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.memo = Memo.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateMemoCommentResponse { - return CreateMemoCommentResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateMemoCommentResponse { - const message = createBaseCreateMemoCommentResponse(); - message.memo = (object.memo !== undefined && object.memo !== null) ? Memo.fromPartial(object.memo) : undefined; - return message; - }, -}; - -function createBaseListMemoCommentsRequest(): ListMemoCommentsRequest { - return { id: 0 }; -} - -export const ListMemoCommentsRequest = { - encode(message: ListMemoCommentsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListMemoCommentsRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMemoCommentsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListMemoCommentsRequest { - return ListMemoCommentsRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListMemoCommentsRequest { - const message = createBaseListMemoCommentsRequest(); - message.id = object.id ?? 0; - return message; - }, -}; - -function createBaseListMemoCommentsResponse(): ListMemoCommentsResponse { - return { memos: [] }; -} - -export const ListMemoCommentsResponse = { - encode(message: ListMemoCommentsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.memos) { - Memo.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListMemoCommentsResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMemoCommentsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.memos.push(Memo.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListMemoCommentsResponse { - return ListMemoCommentsResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListMemoCommentsResponse { - const message = createBaseListMemoCommentsResponse(); - message.memos = object.memos?.map((e) => Memo.fromPartial(e)) || []; - return message; - }, -}; - -export type MemoServiceDefinition = typeof MemoServiceDefinition; -export const MemoServiceDefinition = { - name: "MemoService", - fullName: "memos.api.v2.MemoService", - methods: { - createMemo: { - name: "CreateMemo", - requestType: CreateMemoRequest, - requestStream: false, - responseType: CreateMemoResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [new Uint8Array([15, 34, 13, 47, 97, 112, 105, 47, 118, 50, 47, 109, 101, 109, 111, 115])], - }, - }, - }, - listMemos: { - name: "ListMemos", - requestType: ListMemosRequest, - requestStream: false, - responseType: ListMemosResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [new Uint8Array([15, 18, 13, 47, 97, 112, 105, 47, 118, 50, 47, 109, 101, 109, 111, 115])], - }, - }, - }, - getMemo: { - name: "GetMemo", - requestType: GetMemoRequest, - requestStream: false, - responseType: GetMemoResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([2, 105, 100])], - 578365826: [ - new Uint8Array([ - 20, - 18, - 18, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 109, - 101, - 109, - 111, - 115, - 47, - 123, - 105, - 100, - 125, - ]), - ], - }, - }, - }, - createMemoComment: { - name: "CreateMemoComment", - requestType: CreateMemoCommentRequest, - requestStream: false, - responseType: CreateMemoCommentResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([2, 105, 100])], - 578365826: [ - new Uint8Array([ - 29, - 34, - 27, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 109, - 101, - 109, - 111, - 115, - 47, - 123, - 105, - 100, - 125, - 47, - 99, - 111, - 109, - 109, - 101, - 110, - 116, - 115, - ]), - ], - }, - }, - }, - listMemoComments: { - name: "ListMemoComments", - requestType: ListMemoCommentsRequest, - requestStream: false, - responseType: ListMemoCommentsResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([2, 105, 100])], - 578365826: [ - new Uint8Array([ - 29, - 18, - 27, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 109, - 101, - 109, - 111, - 115, - 47, - 123, - 105, - 100, - 125, - 47, - 99, - 111, - 109, - 109, - 101, - 110, - 116, - 115, - ]), - ], - }, - }, - }, - }, -} as const; - -declare const self: any | undefined; -declare const window: any | undefined; -declare const global: any | undefined; -const tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/web/src/types/proto/api/v2/resource_service.ts b/web/src/types/proto/api/v2/resource_service.ts deleted file mode 100644 index f96b9f0ef9f2a..0000000000000 --- a/web/src/types/proto/api/v2/resource_service.ts +++ /dev/null @@ -1,770 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { FieldMask } from "../../google/protobuf/field_mask"; -import { Timestamp } from "../../google/protobuf/timestamp"; - -export const protobufPackage = "memos.api.v2"; - -export interface Resource { - id: number; - createdTs?: Date | undefined; - filename: string; - externalLink: string; - type: string; - size: number; - memoId?: number | undefined; -} - -export interface CreateResourceRequest { - filename: string; - externalLink: string; - type: string; - memoId?: number | undefined; -} - -export interface CreateResourceResponse { - resource?: Resource | undefined; -} - -export interface ListResourcesRequest { -} - -export interface ListResourcesResponse { - resources: Resource[]; -} - -export interface UpdateResourceRequest { - resource?: Resource | undefined; - updateMask?: string[] | undefined; -} - -export interface UpdateResourceResponse { - resource?: Resource | undefined; -} - -export interface DeleteResourceRequest { - id: number; -} - -export interface DeleteResourceResponse { -} - -function createBaseResource(): Resource { - return { id: 0, createdTs: undefined, filename: "", externalLink: "", type: "", size: 0, memoId: undefined }; -} - -export const Resource = { - encode(message: Resource, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - if (message.createdTs !== undefined) { - Timestamp.encode(toTimestamp(message.createdTs), writer.uint32(18).fork()).ldelim(); - } - if (message.filename !== "") { - writer.uint32(26).string(message.filename); - } - if (message.externalLink !== "") { - writer.uint32(34).string(message.externalLink); - } - if (message.type !== "") { - writer.uint32(42).string(message.type); - } - if (message.size !== 0) { - writer.uint32(48).int64(message.size); - } - if (message.memoId !== undefined) { - writer.uint32(56).int32(message.memoId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Resource { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseResource(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.createdTs = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.filename = reader.string(); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.externalLink = reader.string(); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.type = reader.string(); - continue; - case 6: - if (tag !== 48) { - break; - } - - message.size = longToNumber(reader.int64() as Long); - continue; - case 7: - if (tag !== 56) { - break; - } - - message.memoId = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Resource { - return Resource.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Resource { - const message = createBaseResource(); - message.id = object.id ?? 0; - message.createdTs = object.createdTs ?? undefined; - message.filename = object.filename ?? ""; - message.externalLink = object.externalLink ?? ""; - message.type = object.type ?? ""; - message.size = object.size ?? 0; - message.memoId = object.memoId ?? undefined; - return message; - }, -}; - -function createBaseCreateResourceRequest(): CreateResourceRequest { - return { filename: "", externalLink: "", type: "", memoId: undefined }; -} - -export const CreateResourceRequest = { - encode(message: CreateResourceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.filename !== "") { - writer.uint32(10).string(message.filename); - } - if (message.externalLink !== "") { - writer.uint32(18).string(message.externalLink); - } - if (message.type !== "") { - writer.uint32(26).string(message.type); - } - if (message.memoId !== undefined) { - writer.uint32(32).int32(message.memoId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateResourceRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateResourceRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.filename = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.externalLink = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.type = reader.string(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.memoId = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateResourceRequest { - return CreateResourceRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateResourceRequest { - const message = createBaseCreateResourceRequest(); - message.filename = object.filename ?? ""; - message.externalLink = object.externalLink ?? ""; - message.type = object.type ?? ""; - message.memoId = object.memoId ?? undefined; - return message; - }, -}; - -function createBaseCreateResourceResponse(): CreateResourceResponse { - return { resource: undefined }; -} - -export const CreateResourceResponse = { - encode(message: CreateResourceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.resource !== undefined) { - Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateResourceResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateResourceResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.resource = Resource.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateResourceResponse { - return CreateResourceResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateResourceResponse { - const message = createBaseCreateResourceResponse(); - message.resource = (object.resource !== undefined && object.resource !== null) - ? Resource.fromPartial(object.resource) - : undefined; - return message; - }, -}; - -function createBaseListResourcesRequest(): ListResourcesRequest { - return {}; -} - -export const ListResourcesRequest = { - encode(_: ListResourcesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListResourcesRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListResourcesRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListResourcesRequest { - return ListResourcesRequest.fromPartial(base ?? {}); - }, - - fromPartial(_: DeepPartial): ListResourcesRequest { - const message = createBaseListResourcesRequest(); - return message; - }, -}; - -function createBaseListResourcesResponse(): ListResourcesResponse { - return { resources: [] }; -} - -export const ListResourcesResponse = { - encode(message: ListResourcesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.resources) { - Resource.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListResourcesResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListResourcesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.resources.push(Resource.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListResourcesResponse { - return ListResourcesResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListResourcesResponse { - const message = createBaseListResourcesResponse(); - message.resources = object.resources?.map((e) => Resource.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseUpdateResourceRequest(): UpdateResourceRequest { - return { resource: undefined, updateMask: undefined }; -} - -export const UpdateResourceRequest = { - encode(message: UpdateResourceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.resource !== undefined) { - Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - } - if (message.updateMask !== undefined) { - FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateResourceRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateResourceRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.resource = Resource.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateResourceRequest { - return UpdateResourceRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateResourceRequest { - const message = createBaseUpdateResourceRequest(); - message.resource = (object.resource !== undefined && object.resource !== null) - ? Resource.fromPartial(object.resource) - : undefined; - message.updateMask = object.updateMask ?? undefined; - return message; - }, -}; - -function createBaseUpdateResourceResponse(): UpdateResourceResponse { - return { resource: undefined }; -} - -export const UpdateResourceResponse = { - encode(message: UpdateResourceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.resource !== undefined) { - Resource.encode(message.resource, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateResourceResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateResourceResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.resource = Resource.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateResourceResponse { - return UpdateResourceResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateResourceResponse { - const message = createBaseUpdateResourceResponse(); - message.resource = (object.resource !== undefined && object.resource !== null) - ? Resource.fromPartial(object.resource) - : undefined; - return message; - }, -}; - -function createBaseDeleteResourceRequest(): DeleteResourceRequest { - return { id: 0 }; -} - -export const DeleteResourceRequest = { - encode(message: DeleteResourceRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.id !== 0) { - writer.uint32(8).int32(message.id); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteResourceRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteResourceRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.id = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteResourceRequest { - return DeleteResourceRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DeleteResourceRequest { - const message = createBaseDeleteResourceRequest(); - message.id = object.id ?? 0; - return message; - }, -}; - -function createBaseDeleteResourceResponse(): DeleteResourceResponse { - return {}; -} - -export const DeleteResourceResponse = { - encode(_: DeleteResourceResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteResourceResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteResourceResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteResourceResponse { - return DeleteResourceResponse.fromPartial(base ?? {}); - }, - - fromPartial(_: DeepPartial): DeleteResourceResponse { - const message = createBaseDeleteResourceResponse(); - return message; - }, -}; - -export type ResourceServiceDefinition = typeof ResourceServiceDefinition; -export const ResourceServiceDefinition = { - name: "ResourceService", - fullName: "memos.api.v2.ResourceService", - methods: { - createResource: { - name: "CreateResource", - requestType: CreateResourceRequest, - requestStream: false, - responseType: CreateResourceResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [ - new Uint8Array([19, 34, 17, 47, 97, 112, 105, 47, 118, 50, 47, 114, 101, 115, 111, 117, 114, 99, 101, 115]), - ], - }, - }, - }, - listResources: { - name: "ListResources", - requestType: ListResourcesRequest, - requestStream: false, - responseType: ListResourcesResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [ - new Uint8Array([19, 18, 17, 47, 97, 112, 105, 47, 118, 50, 47, 114, 101, 115, 111, 117, 114, 99, 101, 115]), - ], - }, - }, - }, - updateResource: { - name: "UpdateResource", - requestType: UpdateResourceRequest, - requestStream: false, - responseType: UpdateResourceResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [ - new Uint8Array([ - 20, - 114, - 101, - 115, - 111, - 117, - 114, - 99, - 101, - 44, - 117, - 112, - 100, - 97, - 116, - 101, - 95, - 109, - 97, - 115, - 107, - ]), - ], - 578365826: [ - new Uint8Array([ - 43, - 58, - 8, - 114, - 101, - 115, - 111, - 117, - 114, - 99, - 101, - 50, - 31, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 114, - 101, - 115, - 111, - 117, - 114, - 99, - 101, - 115, - 47, - 123, - 114, - 101, - 115, - 111, - 117, - 114, - 99, - 101, - 46, - 105, - 100, - 125, - ]), - ], - }, - }, - }, - deleteResource: { - name: "DeleteResource", - requestType: DeleteResourceRequest, - requestStream: false, - responseType: DeleteResourceResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([2, 105, 100])], - 578365826: [ - new Uint8Array([ - 24, - 18, - 22, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 114, - 101, - 115, - 111, - 117, - 114, - 99, - 101, - 115, - 47, - 123, - 105, - 100, - 125, - ]), - ], - }, - }, - }, - }, -} as const; - -declare const self: any | undefined; -declare const window: any | undefined; -declare const global: any | undefined; -const tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = (t.seconds || 0) * 1_000; - millis += (t.nanos || 0) / 1_000_000; - return new Date(millis); -} - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/web/src/types/proto/api/v2/system_service.ts b/web/src/types/proto/api/v2/system_service.ts deleted file mode 100644 index 25d2b2612792b..0000000000000 --- a/web/src/types/proto/api/v2/system_service.ts +++ /dev/null @@ -1,504 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; -import { FieldMask } from "../../google/protobuf/field_mask"; - -export const protobufPackage = "memos.api.v2"; - -export interface SystemInfo { - version: string; - mode: string; - allowRegistration: boolean; - disablePasswordLogin: boolean; - additionalScript: string; - additionalStyle: string; - dbSize: number; -} - -export interface GetSystemInfoRequest { -} - -export interface GetSystemInfoResponse { - systemInfo?: SystemInfo | undefined; -} - -export interface UpdateSystemInfoRequest { - /** System info is the updated data. */ - systemInfo?: SystemInfo | undefined; - updateMask?: string[] | undefined; -} - -export interface UpdateSystemInfoResponse { - systemInfo?: SystemInfo | undefined; -} - -function createBaseSystemInfo(): SystemInfo { - return { - version: "", - mode: "", - allowRegistration: false, - disablePasswordLogin: false, - additionalScript: "", - additionalStyle: "", - dbSize: 0, - }; -} - -export const SystemInfo = { - encode(message: SystemInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.version !== "") { - writer.uint32(10).string(message.version); - } - if (message.mode !== "") { - writer.uint32(18).string(message.mode); - } - if (message.allowRegistration === true) { - writer.uint32(24).bool(message.allowRegistration); - } - if (message.disablePasswordLogin === true) { - writer.uint32(32).bool(message.disablePasswordLogin); - } - if (message.additionalScript !== "") { - writer.uint32(42).string(message.additionalScript); - } - if (message.additionalStyle !== "") { - writer.uint32(50).string(message.additionalStyle); - } - if (message.dbSize !== 0) { - writer.uint32(56).int64(message.dbSize); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): SystemInfo { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSystemInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.version = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.mode = reader.string(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.allowRegistration = reader.bool(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.disablePasswordLogin = reader.bool(); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.additionalScript = reader.string(); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.additionalStyle = reader.string(); - continue; - case 7: - if (tag !== 56) { - break; - } - - message.dbSize = longToNumber(reader.int64() as Long); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): SystemInfo { - return SystemInfo.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): SystemInfo { - const message = createBaseSystemInfo(); - message.version = object.version ?? ""; - message.mode = object.mode ?? ""; - message.allowRegistration = object.allowRegistration ?? false; - message.disablePasswordLogin = object.disablePasswordLogin ?? false; - message.additionalScript = object.additionalScript ?? ""; - message.additionalStyle = object.additionalStyle ?? ""; - message.dbSize = object.dbSize ?? 0; - return message; - }, -}; - -function createBaseGetSystemInfoRequest(): GetSystemInfoRequest { - return {}; -} - -export const GetSystemInfoRequest = { - encode(_: GetSystemInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetSystemInfoRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSystemInfoRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetSystemInfoRequest { - return GetSystemInfoRequest.fromPartial(base ?? {}); - }, - - fromPartial(_: DeepPartial): GetSystemInfoRequest { - const message = createBaseGetSystemInfoRequest(); - return message; - }, -}; - -function createBaseGetSystemInfoResponse(): GetSystemInfoResponse { - return { systemInfo: undefined }; -} - -export const GetSystemInfoResponse = { - encode(message: GetSystemInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.systemInfo !== undefined) { - SystemInfo.encode(message.systemInfo, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetSystemInfoResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetSystemInfoResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.systemInfo = SystemInfo.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetSystemInfoResponse { - return GetSystemInfoResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GetSystemInfoResponse { - const message = createBaseGetSystemInfoResponse(); - message.systemInfo = (object.systemInfo !== undefined && object.systemInfo !== null) - ? SystemInfo.fromPartial(object.systemInfo) - : undefined; - return message; - }, -}; - -function createBaseUpdateSystemInfoRequest(): UpdateSystemInfoRequest { - return { systemInfo: undefined, updateMask: undefined }; -} - -export const UpdateSystemInfoRequest = { - encode(message: UpdateSystemInfoRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.systemInfo !== undefined) { - SystemInfo.encode(message.systemInfo, writer.uint32(10).fork()).ldelim(); - } - if (message.updateMask !== undefined) { - FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSystemInfoRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateSystemInfoRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.systemInfo = SystemInfo.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateSystemInfoRequest { - return UpdateSystemInfoRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateSystemInfoRequest { - const message = createBaseUpdateSystemInfoRequest(); - message.systemInfo = (object.systemInfo !== undefined && object.systemInfo !== null) - ? SystemInfo.fromPartial(object.systemInfo) - : undefined; - message.updateMask = object.updateMask ?? undefined; - return message; - }, -}; - -function createBaseUpdateSystemInfoResponse(): UpdateSystemInfoResponse { - return { systemInfo: undefined }; -} - -export const UpdateSystemInfoResponse = { - encode(message: UpdateSystemInfoResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.systemInfo !== undefined) { - SystemInfo.encode(message.systemInfo, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSystemInfoResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateSystemInfoResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.systemInfo = SystemInfo.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateSystemInfoResponse { - return UpdateSystemInfoResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateSystemInfoResponse { - const message = createBaseUpdateSystemInfoResponse(); - message.systemInfo = (object.systemInfo !== undefined && object.systemInfo !== null) - ? SystemInfo.fromPartial(object.systemInfo) - : undefined; - return message; - }, -}; - -export type SystemServiceDefinition = typeof SystemServiceDefinition; -export const SystemServiceDefinition = { - name: "SystemService", - fullName: "memos.api.v2.SystemService", - methods: { - getSystemInfo: { - name: "GetSystemInfo", - requestType: GetSystemInfoRequest, - requestStream: false, - responseType: GetSystemInfoResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [ - new Uint8Array([ - 21, - 18, - 19, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 115, - 121, - 115, - 116, - 101, - 109, - 47, - 105, - 110, - 102, - 111, - ]), - ], - }, - }, - }, - updateSystemInfo: { - name: "UpdateSystemInfo", - requestType: UpdateSystemInfoRequest, - requestStream: false, - responseType: UpdateSystemInfoResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [ - new Uint8Array([ - 23, - 115, - 121, - 115, - 116, - 101, - 109, - 95, - 105, - 110, - 102, - 111, - 44, - 117, - 112, - 100, - 97, - 116, - 101, - 95, - 109, - 97, - 115, - 107, - ]), - ], - 578365826: [ - new Uint8Array([ - 34, - 58, - 11, - 115, - 121, - 115, - 116, - 101, - 109, - 95, - 105, - 110, - 102, - 111, - 50, - 19, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 115, - 121, - 115, - 116, - 101, - 109, - 47, - 105, - 110, - 102, - 111, - ]), - ], - }, - }, - }, - }, -} as const; - -declare const self: any | undefined; -declare const window: any | undefined; -declare const global: any | undefined; -const tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/web/src/types/proto/api/v2/tag_service.ts b/web/src/types/proto/api/v2/tag_service.ts deleted file mode 100644 index 26d4aceba6a1a..0000000000000 --- a/web/src/types/proto/api/v2/tag_service.ts +++ /dev/null @@ -1,413 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "memos.api.v2"; - -export interface Tag { - name: string; - /** - * The creator of tags. - * Format: users/{username} - */ - creator: string; -} - -export interface UpsertTagRequest { - name: string; -} - -export interface UpsertTagResponse { - tag?: Tag | undefined; -} - -export interface ListTagsRequest { - /** - * The creator of tags. - * Format: users/{username} - */ - creator: string; -} - -export interface ListTagsResponse { - tags: Tag[]; -} - -export interface DeleteTagRequest { - tag?: Tag | undefined; -} - -export interface DeleteTagResponse { -} - -function createBaseTag(): Tag { - return { name: "", creator: "" }; -} - -export const Tag = { - encode(message: Tag, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.creator !== "") { - writer.uint32(18).string(message.creator); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Tag { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTag(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.creator = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Tag { - return Tag.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Tag { - const message = createBaseTag(); - message.name = object.name ?? ""; - message.creator = object.creator ?? ""; - return message; - }, -}; - -function createBaseUpsertTagRequest(): UpsertTagRequest { - return { name: "" }; -} - -export const UpsertTagRequest = { - encode(message: UpsertTagRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpsertTagRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpsertTagRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpsertTagRequest { - return UpsertTagRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpsertTagRequest { - const message = createBaseUpsertTagRequest(); - message.name = object.name ?? ""; - return message; - }, -}; - -function createBaseUpsertTagResponse(): UpsertTagResponse { - return { tag: undefined }; -} - -export const UpsertTagResponse = { - encode(message: UpsertTagResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tag !== undefined) { - Tag.encode(message.tag, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpsertTagResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpsertTagResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.tag = Tag.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpsertTagResponse { - return UpsertTagResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpsertTagResponse { - const message = createBaseUpsertTagResponse(); - message.tag = (object.tag !== undefined && object.tag !== null) ? Tag.fromPartial(object.tag) : undefined; - return message; - }, -}; - -function createBaseListTagsRequest(): ListTagsRequest { - return { creator: "" }; -} - -export const ListTagsRequest = { - encode(message: ListTagsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.creator !== "") { - writer.uint32(10).string(message.creator); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListTagsRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListTagsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.creator = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListTagsRequest { - return ListTagsRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListTagsRequest { - const message = createBaseListTagsRequest(); - message.creator = object.creator ?? ""; - return message; - }, -}; - -function createBaseListTagsResponse(): ListTagsResponse { - return { tags: [] }; -} - -export const ListTagsResponse = { - encode(message: ListTagsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.tags) { - Tag.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListTagsResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListTagsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.tags.push(Tag.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListTagsResponse { - return ListTagsResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListTagsResponse { - const message = createBaseListTagsResponse(); - message.tags = object.tags?.map((e) => Tag.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseDeleteTagRequest(): DeleteTagRequest { - return { tag: undefined }; -} - -export const DeleteTagRequest = { - encode(message: DeleteTagRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.tag !== undefined) { - Tag.encode(message.tag, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTagRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteTagRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.tag = Tag.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteTagRequest { - return DeleteTagRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DeleteTagRequest { - const message = createBaseDeleteTagRequest(); - message.tag = (object.tag !== undefined && object.tag !== null) ? Tag.fromPartial(object.tag) : undefined; - return message; - }, -}; - -function createBaseDeleteTagResponse(): DeleteTagResponse { - return {}; -} - -export const DeleteTagResponse = { - encode(_: DeleteTagResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteTagResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteTagResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteTagResponse { - return DeleteTagResponse.fromPartial(base ?? {}); - }, - - fromPartial(_: DeepPartial): DeleteTagResponse { - const message = createBaseDeleteTagResponse(); - return message; - }, -}; - -export type TagServiceDefinition = typeof TagServiceDefinition; -export const TagServiceDefinition = { - name: "TagService", - fullName: "memos.api.v2.TagService", - methods: { - upsertTag: { - name: "UpsertTag", - requestType: UpsertTagRequest, - requestStream: false, - responseType: UpsertTagResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [new Uint8Array([14, 34, 12, 47, 97, 112, 105, 47, 118, 50, 47, 116, 97, 103, 115])], - }, - }, - }, - listTags: { - name: "ListTags", - requestType: ListTagsRequest, - requestStream: false, - responseType: ListTagsResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [new Uint8Array([14, 18, 12, 47, 97, 112, 105, 47, 118, 50, 47, 116, 97, 103, 115])], - }, - }, - }, - deleteTag: { - name: "DeleteTag", - requestType: DeleteTagRequest, - requestStream: false, - responseType: DeleteTagResponse, - responseStream: false, - options: { - _unknownFields: { - 578365826: [new Uint8Array([14, 42, 12, 47, 97, 112, 105, 47, 118, 50, 47, 116, 97, 103, 115])], - }, - }, - }, - }, -} as const; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/web/src/types/proto/api/v2/user_service.ts b/web/src/types/proto/api/v2/user_service.ts deleted file mode 100644 index 493f77e8d0801..0000000000000 --- a/web/src/types/proto/api/v2/user_service.ts +++ /dev/null @@ -1,1248 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; -import { FieldMask } from "../../google/protobuf/field_mask"; -import { Timestamp } from "../../google/protobuf/timestamp"; -import { RowStatus } from "./common"; - -export const protobufPackage = "memos.api.v2"; - -export interface User { - /** - * The name of the user. - * Format: users/{username} - */ - name: string; - id: number; - role: User_Role; - email: string; - nickname: string; - avatarUrl: string; - password: string; - rowStatus: RowStatus; - createTime?: Date | undefined; - updateTime?: Date | undefined; -} - -export enum User_Role { - ROLE_UNSPECIFIED = 0, - HOST = 1, - ADMIN = 2, - USER = 3, - UNRECOGNIZED = -1, -} - -export interface GetUserRequest { - /** - * The name of the user. - * Format: users/{username} - */ - name: string; -} - -export interface GetUserResponse { - user?: User | undefined; -} - -export interface CreateUserRequest { - user?: User | undefined; -} - -export interface CreateUserResponse { - user?: User | undefined; -} - -export interface UpdateUserRequest { - user?: User | undefined; - updateMask?: string[] | undefined; -} - -export interface UpdateUserResponse { - user?: User | undefined; -} - -export interface UserAccessToken { - accessToken: string; - description: string; - issuedAt?: Date | undefined; - expiresAt?: Date | undefined; -} - -export interface ListUserAccessTokensRequest { - /** - * The name of the user. - * Format: users/{username} - */ - name: string; -} - -export interface ListUserAccessTokensResponse { - accessTokens: UserAccessToken[]; -} - -export interface CreateUserAccessTokenRequest { - /** - * The name of the user. - * Format: users/{username} - */ - name: string; - description: string; - expiresAt?: Date | undefined; -} - -export interface CreateUserAccessTokenResponse { - accessToken?: UserAccessToken | undefined; -} - -export interface DeleteUserAccessTokenRequest { - /** - * The name of the user. - * Format: users/{username} - */ - name: string; - /** access_token is the access token to delete. */ - accessToken: string; -} - -export interface DeleteUserAccessTokenResponse { -} - -function createBaseUser(): User { - return { - name: "", - id: 0, - role: 0, - email: "", - nickname: "", - avatarUrl: "", - password: "", - rowStatus: 0, - createTime: undefined, - updateTime: undefined, - }; -} - -export const User = { - encode(message: User, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.id !== 0) { - writer.uint32(16).int32(message.id); - } - if (message.role !== 0) { - writer.uint32(24).int32(message.role); - } - if (message.email !== "") { - writer.uint32(34).string(message.email); - } - if (message.nickname !== "") { - writer.uint32(42).string(message.nickname); - } - if (message.avatarUrl !== "") { - writer.uint32(50).string(message.avatarUrl); - } - if (message.password !== "") { - writer.uint32(58).string(message.password); - } - if (message.rowStatus !== 0) { - writer.uint32(64).int32(message.rowStatus); - } - if (message.createTime !== undefined) { - Timestamp.encode(toTimestamp(message.createTime), writer.uint32(74).fork()).ldelim(); - } - if (message.updateTime !== undefined) { - Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(82).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): User { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUser(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.id = reader.int32(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.role = reader.int32() as any; - continue; - case 4: - if (tag !== 34) { - break; - } - - message.email = reader.string(); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.nickname = reader.string(); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.avatarUrl = reader.string(); - continue; - case 7: - if (tag !== 58) { - break; - } - - message.password = reader.string(); - continue; - case 8: - if (tag !== 64) { - break; - } - - message.rowStatus = reader.int32() as any; - continue; - case 9: - if (tag !== 74) { - break; - } - - message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - case 10: - if (tag !== 82) { - break; - } - - message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): User { - return User.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): User { - const message = createBaseUser(); - message.name = object.name ?? ""; - message.id = object.id ?? 0; - message.role = object.role ?? 0; - message.email = object.email ?? ""; - message.nickname = object.nickname ?? ""; - message.avatarUrl = object.avatarUrl ?? ""; - message.password = object.password ?? ""; - message.rowStatus = object.rowStatus ?? 0; - message.createTime = object.createTime ?? undefined; - message.updateTime = object.updateTime ?? undefined; - return message; - }, -}; - -function createBaseGetUserRequest(): GetUserRequest { - return { name: "" }; -} - -export const GetUserRequest = { - encode(message: GetUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetUserRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetUserRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetUserRequest { - return GetUserRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GetUserRequest { - const message = createBaseGetUserRequest(); - message.name = object.name ?? ""; - return message; - }, -}; - -function createBaseGetUserResponse(): GetUserResponse { - return { user: undefined }; -} - -export const GetUserResponse = { - encode(message: GetUserResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.user !== undefined) { - User.encode(message.user, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GetUserResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetUserResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.user = User.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GetUserResponse { - return GetUserResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GetUserResponse { - const message = createBaseGetUserResponse(); - message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; - return message; - }, -}; - -function createBaseCreateUserRequest(): CreateUserRequest { - return { user: undefined }; -} - -export const CreateUserRequest = { - encode(message: CreateUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.user !== undefined) { - User.encode(message.user, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateUserRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.user = User.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateUserRequest { - return CreateUserRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateUserRequest { - const message = createBaseCreateUserRequest(); - message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; - return message; - }, -}; - -function createBaseCreateUserResponse(): CreateUserResponse { - return { user: undefined }; -} - -export const CreateUserResponse = { - encode(message: CreateUserResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.user !== undefined) { - User.encode(message.user, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateUserResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.user = User.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateUserResponse { - return CreateUserResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateUserResponse { - const message = createBaseCreateUserResponse(); - message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; - return message; - }, -}; - -function createBaseUpdateUserRequest(): UpdateUserRequest { - return { user: undefined, updateMask: undefined }; -} - -export const UpdateUserRequest = { - encode(message: UpdateUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.user !== undefined) { - User.encode(message.user, writer.uint32(10).fork()).ldelim(); - } - if (message.updateMask !== undefined) { - FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateUserRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.user = User.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateUserRequest { - return UpdateUserRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateUserRequest { - const message = createBaseUpdateUserRequest(); - message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; - message.updateMask = object.updateMask ?? undefined; - return message; - }, -}; - -function createBaseUpdateUserResponse(): UpdateUserResponse { - return { user: undefined }; -} - -export const UpdateUserResponse = { - encode(message: UpdateUserResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.user !== undefined) { - User.encode(message.user, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateUserResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.user = User.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UpdateUserResponse { - return UpdateUserResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UpdateUserResponse { - const message = createBaseUpdateUserResponse(); - message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined; - return message; - }, -}; - -function createBaseUserAccessToken(): UserAccessToken { - return { accessToken: "", description: "", issuedAt: undefined, expiresAt: undefined }; -} - -export const UserAccessToken = { - encode(message: UserAccessToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.accessToken !== "") { - writer.uint32(10).string(message.accessToken); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.issuedAt !== undefined) { - Timestamp.encode(toTimestamp(message.issuedAt), writer.uint32(26).fork()).ldelim(); - } - if (message.expiresAt !== undefined) { - Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UserAccessToken { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserAccessToken(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.accessToken = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.description = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.issuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UserAccessToken { - return UserAccessToken.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UserAccessToken { - const message = createBaseUserAccessToken(); - message.accessToken = object.accessToken ?? ""; - message.description = object.description ?? ""; - message.issuedAt = object.issuedAt ?? undefined; - message.expiresAt = object.expiresAt ?? undefined; - return message; - }, -}; - -function createBaseListUserAccessTokensRequest(): ListUserAccessTokensRequest { - return { name: "" }; -} - -export const ListUserAccessTokensRequest = { - encode(message: ListUserAccessTokensRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListUserAccessTokensRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListUserAccessTokensRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListUserAccessTokensRequest { - return ListUserAccessTokensRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListUserAccessTokensRequest { - const message = createBaseListUserAccessTokensRequest(); - message.name = object.name ?? ""; - return message; - }, -}; - -function createBaseListUserAccessTokensResponse(): ListUserAccessTokensResponse { - return { accessTokens: [] }; -} - -export const ListUserAccessTokensResponse = { - encode(message: ListUserAccessTokensResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.accessTokens) { - UserAccessToken.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ListUserAccessTokensResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListUserAccessTokensResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.accessTokens.push(UserAccessToken.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ListUserAccessTokensResponse { - return ListUserAccessTokensResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ListUserAccessTokensResponse { - const message = createBaseListUserAccessTokensResponse(); - message.accessTokens = object.accessTokens?.map((e) => UserAccessToken.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseCreateUserAccessTokenRequest(): CreateUserAccessTokenRequest { - return { name: "", description: "", expiresAt: undefined }; -} - -export const CreateUserAccessTokenRequest = { - encode(message: CreateUserAccessTokenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - if (message.expiresAt !== undefined) { - Timestamp.encode(toTimestamp(message.expiresAt), writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserAccessTokenRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateUserAccessTokenRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.description = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.expiresAt = fromTimestamp(Timestamp.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateUserAccessTokenRequest { - return CreateUserAccessTokenRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateUserAccessTokenRequest { - const message = createBaseCreateUserAccessTokenRequest(); - message.name = object.name ?? ""; - message.description = object.description ?? ""; - message.expiresAt = object.expiresAt ?? undefined; - return message; - }, -}; - -function createBaseCreateUserAccessTokenResponse(): CreateUserAccessTokenResponse { - return { accessToken: undefined }; -} - -export const CreateUserAccessTokenResponse = { - encode(message: CreateUserAccessTokenResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.accessToken !== undefined) { - UserAccessToken.encode(message.accessToken, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CreateUserAccessTokenResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateUserAccessTokenResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.accessToken = UserAccessToken.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CreateUserAccessTokenResponse { - return CreateUserAccessTokenResponse.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CreateUserAccessTokenResponse { - const message = createBaseCreateUserAccessTokenResponse(); - message.accessToken = (object.accessToken !== undefined && object.accessToken !== null) - ? UserAccessToken.fromPartial(object.accessToken) - : undefined; - return message; - }, -}; - -function createBaseDeleteUserAccessTokenRequest(): DeleteUserAccessTokenRequest { - return { name: "", accessToken: "" }; -} - -export const DeleteUserAccessTokenRequest = { - encode(message: DeleteUserAccessTokenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.accessToken !== "") { - writer.uint32(18).string(message.accessToken); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserAccessTokenRequest { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteUserAccessTokenRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.accessToken = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteUserAccessTokenRequest { - return DeleteUserAccessTokenRequest.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DeleteUserAccessTokenRequest { - const message = createBaseDeleteUserAccessTokenRequest(); - message.name = object.name ?? ""; - message.accessToken = object.accessToken ?? ""; - return message; - }, -}; - -function createBaseDeleteUserAccessTokenResponse(): DeleteUserAccessTokenResponse { - return {}; -} - -export const DeleteUserAccessTokenResponse = { - encode(_: DeleteUserAccessTokenResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserAccessTokenResponse { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteUserAccessTokenResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DeleteUserAccessTokenResponse { - return DeleteUserAccessTokenResponse.fromPartial(base ?? {}); - }, - - fromPartial(_: DeepPartial): DeleteUserAccessTokenResponse { - const message = createBaseDeleteUserAccessTokenResponse(); - return message; - }, -}; - -export type UserServiceDefinition = typeof UserServiceDefinition; -export const UserServiceDefinition = { - name: "UserService", - fullName: "memos.api.v2.UserService", - methods: { - getUser: { - name: "GetUser", - requestType: GetUserRequest, - requestStream: false, - responseType: GetUserResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([4, 110, 97, 109, 101])], - 578365826: [ - new Uint8Array([ - 24, - 18, - 22, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 123, - 110, - 97, - 109, - 101, - 61, - 117, - 115, - 101, - 114, - 115, - 47, - 42, - 125, - ]), - ], - }, - }, - }, - createUser: { - name: "CreateUser", - requestType: CreateUserRequest, - requestStream: false, - responseType: CreateUserResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([4, 117, 115, 101, 114])], - 578365826: [new Uint8Array([17, 58, 4, 117, 115, 101, 114, 34, 9, 47, 118, 49, 47, 117, 115, 101, 114, 115])], - }, - }, - }, - updateUser: { - name: "UpdateUser", - requestType: UpdateUserRequest, - requestStream: false, - responseType: UpdateUserResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([16, 117, 115, 101, 114, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])], - 578365826: [ - new Uint8Array([ - 35, - 58, - 4, - 117, - 115, - 101, - 114, - 50, - 27, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 123, - 117, - 115, - 101, - 114, - 46, - 110, - 97, - 109, - 101, - 61, - 117, - 115, - 101, - 114, - 115, - 47, - 42, - 125, - ]), - ], - }, - }, - }, - /** ListUserAccessTokens returns a list of access tokens for a user. */ - listUserAccessTokens: { - name: "ListUserAccessTokens", - requestType: ListUserAccessTokensRequest, - requestStream: false, - responseType: ListUserAccessTokensResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([4, 110, 97, 109, 101])], - 578365826: [ - new Uint8Array([ - 38, - 18, - 36, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 123, - 110, - 97, - 109, - 101, - 61, - 117, - 115, - 101, - 114, - 115, - 47, - 42, - 125, - 47, - 97, - 99, - 99, - 101, - 115, - 115, - 95, - 116, - 111, - 107, - 101, - 110, - 115, - ]), - ], - }, - }, - }, - /** CreateUserAccessToken creates a new access token for a user. */ - createUserAccessToken: { - name: "CreateUserAccessToken", - requestType: CreateUserAccessTokenRequest, - requestStream: false, - responseType: CreateUserAccessTokenResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([4, 110, 97, 109, 101])], - 578365826: [ - new Uint8Array([ - 41, - 58, - 1, - 42, - 34, - 36, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 123, - 110, - 97, - 109, - 101, - 61, - 117, - 115, - 101, - 114, - 115, - 47, - 42, - 125, - 47, - 97, - 99, - 99, - 101, - 115, - 115, - 95, - 116, - 111, - 107, - 101, - 110, - 115, - ]), - ], - }, - }, - }, - /** DeleteUserAccessToken deletes an access token for a user. */ - deleteUserAccessToken: { - name: "DeleteUserAccessToken", - requestType: DeleteUserAccessTokenRequest, - requestStream: false, - responseType: DeleteUserAccessTokenResponse, - responseStream: false, - options: { - _unknownFields: { - 8410: [new Uint8Array([17, 110, 97, 109, 101, 44, 97, 99, 99, 101, 115, 115, 95, 116, 111, 107, 101, 110])], - 578365826: [ - new Uint8Array([ - 53, - 42, - 51, - 47, - 97, - 112, - 105, - 47, - 118, - 50, - 47, - 123, - 110, - 97, - 109, - 101, - 61, - 117, - 115, - 101, - 114, - 115, - 47, - 42, - 125, - 47, - 97, - 99, - 99, - 101, - 115, - 115, - 95, - 116, - 111, - 107, - 101, - 110, - 115, - 47, - 123, - 97, - 99, - 99, - 101, - 115, - 115, - 95, - 116, - 111, - 107, - 101, - 110, - 125, - ]), - ], - }, - }, - }, - }, -} as const; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function toTimestamp(date: Date): Timestamp { - const seconds = date.getTime() / 1_000; - const nanos = (date.getTime() % 1_000) * 1_000_000; - return { seconds, nanos }; -} - -function fromTimestamp(t: Timestamp): Date { - let millis = (t.seconds || 0) * 1_000; - millis += (t.nanos || 0) / 1_000_000; - return new Date(millis); -} diff --git a/web/src/types/proto/google/api/annotations.ts b/web/src/types/proto/google/api/annotations.ts deleted file mode 100644 index c2161053d4836..0000000000000 --- a/web/src/types/proto/google/api/annotations.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable */ - -export const protobufPackage = "google.api"; diff --git a/web/src/types/proto/google/api/client.ts b/web/src/types/proto/google/api/client.ts deleted file mode 100644 index ca455ebab2660..0000000000000 --- a/web/src/types/proto/google/api/client.ts +++ /dev/null @@ -1,1588 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; -import { Duration } from "../protobuf/duration"; -import { LaunchStage } from "./launch_stage"; - -export const protobufPackage = "google.api"; - -/** - * The organization for which the client libraries are being published. - * Affects the url where generated docs are published, etc. - */ -export enum ClientLibraryOrganization { - /** CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED - Not useful. */ - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - /** CLOUD - Google Cloud Platform Org. */ - CLOUD = 1, - /** ADS - Ads (Advertising) Org. */ - ADS = 2, - /** PHOTOS - Photos Org. */ - PHOTOS = 3, - /** STREET_VIEW - Street View Org. */ - STREET_VIEW = 4, - /** SHOPPING - Shopping Org. */ - SHOPPING = 5, - /** GEO - Geo Org. */ - GEO = 6, - /** GENERATIVE_AI - Generative AI - https://developers.generativeai.google */ - GENERATIVE_AI = 7, - UNRECOGNIZED = -1, -} - -/** To where should client libraries be published? */ -export enum ClientLibraryDestination { - /** - * CLIENT_LIBRARY_DESTINATION_UNSPECIFIED - Client libraries will neither be generated nor published to package - * managers. - */ - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - /** - * GITHUB - Generate the client library in a repo under github.com/googleapis, - * but don't publish it to package managers. - */ - GITHUB = 10, - /** PACKAGE_MANAGER - Publish the library to package managers like nuget.org and npmjs.com. */ - PACKAGE_MANAGER = 20, - UNRECOGNIZED = -1, -} - -/** Required information for every language. */ -export interface CommonLanguageSettings { - /** - * Link to automatically generated reference documentation. Example: - * https://cloud.google.com/nodejs/docs/reference/asset/latest - * - * @deprecated - */ - referenceDocsUri: string; - /** The destination where API teams want this client library to be published. */ - destinations: ClientLibraryDestination[]; -} - -/** Details about how and where to publish client libraries. */ -export interface ClientLibrarySettings { - /** - * Version of the API to apply these settings to. This is the full protobuf - * package for the API, ending in the version element. - * Examples: "google.cloud.speech.v1" and "google.spanner.admin.database.v1". - */ - version: string; - /** Launch stage of this version of the API. */ - launchStage: LaunchStage; - /** - * When using transport=rest, the client request will encode enums as - * numbers rather than strings. - */ - restNumericEnums: boolean; - /** Settings for legacy Java features, supported in the Service YAML. */ - javaSettings?: - | JavaSettings - | undefined; - /** Settings for C++ client libraries. */ - cppSettings?: - | CppSettings - | undefined; - /** Settings for PHP client libraries. */ - phpSettings?: - | PhpSettings - | undefined; - /** Settings for Python client libraries. */ - pythonSettings?: - | PythonSettings - | undefined; - /** Settings for Node client libraries. */ - nodeSettings?: - | NodeSettings - | undefined; - /** Settings for .NET client libraries. */ - dotnetSettings?: - | DotnetSettings - | undefined; - /** Settings for Ruby client libraries. */ - rubySettings?: - | RubySettings - | undefined; - /** Settings for Go client libraries. */ - goSettings?: GoSettings | undefined; -} - -/** - * This message configures the settings for publishing [Google Cloud Client - * libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) - * generated from the service config. - */ -export interface Publishing { - /** - * A list of API method settings, e.g. the behavior for methods that use the - * long-running operation pattern. - */ - methodSettings: MethodSettings[]; - /** - * Link to a *public* URI where users can report issues. Example: - * https://issuetracker.google.com/issues/new?component=190865&template=1161103 - */ - newIssueUri: string; - /** - * Link to product home page. Example: - * https://cloud.google.com/asset-inventory/docs/overview - */ - documentationUri: string; - /** - * Used as a tracking tag when collecting data about the APIs developer - * relations artifacts like docs, packages delivered to package managers, - * etc. Example: "speech". - */ - apiShortName: string; - /** GitHub label to apply to issues and pull requests opened for this API. */ - githubLabel: string; - /** - * GitHub teams to be added to CODEOWNERS in the directory in GitHub - * containing source code for the client libraries for this API. - */ - codeownerGithubTeams: string[]; - /** - * A prefix used in sample code when demarking regions to be included in - * documentation. - */ - docTagPrefix: string; - /** For whom the client library is being published. */ - organization: ClientLibraryOrganization; - /** - * Client library settings. If the same version string appears multiple - * times in this list, then the last one wins. Settings from earlier - * settings with the same version string are discarded. - */ - librarySettings: ClientLibrarySettings[]; - /** - * Optional link to proto reference documentation. Example: - * https://cloud.google.com/pubsub/lite/docs/reference/rpc - */ - protoReferenceDocumentationUri: string; -} - -/** Settings for Java client libraries. */ -export interface JavaSettings { - /** - * The package name to use in Java. Clobbers the java_package option - * set in the protobuf. This should be used **only** by APIs - * who have already set the language_settings.java.package_name" field - * in gapic.yaml. API teams should use the protobuf java_package option - * where possible. - * - * Example of a YAML configuration:: - * - * publishing: - * java_settings: - * library_package: com.google.cloud.pubsub.v1 - */ - libraryPackage: string; - /** - * Configure the Java class name to use instead of the service's for its - * corresponding generated GAPIC client. Keys are fully-qualified - * service names as they appear in the protobuf (including the full - * the language_settings.java.interface_names" field in gapic.yaml. API - * teams should otherwise use the service name as it appears in the - * protobuf. - * - * Example of a YAML configuration:: - * - * publishing: - * java_settings: - * service_class_names: - * - google.pubsub.v1.Publisher: TopicAdmin - * - google.pubsub.v1.Subscriber: SubscriptionAdmin - */ - serviceClassNames: { [key: string]: string }; - /** Some settings. */ - common?: CommonLanguageSettings | undefined; -} - -export interface JavaSettings_ServiceClassNamesEntry { - key: string; - value: string; -} - -/** Settings for C++ client libraries. */ -export interface CppSettings { - /** Some settings. */ - common?: CommonLanguageSettings | undefined; -} - -/** Settings for Php client libraries. */ -export interface PhpSettings { - /** Some settings. */ - common?: CommonLanguageSettings | undefined; -} - -/** Settings for Python client libraries. */ -export interface PythonSettings { - /** Some settings. */ - common?: CommonLanguageSettings | undefined; -} - -/** Settings for Node client libraries. */ -export interface NodeSettings { - /** Some settings. */ - common?: CommonLanguageSettings | undefined; -} - -/** Settings for Dotnet client libraries. */ -export interface DotnetSettings { - /** Some settings. */ - common?: - | CommonLanguageSettings - | undefined; - /** - * Map from original service names to renamed versions. - * This is used when the default generated types - * would cause a naming conflict. (Neither name is - * fully-qualified.) - * Example: Subscriber to SubscriberServiceApi. - */ - renamedServices: { [key: string]: string }; - /** - * Map from full resource types to the effective short name - * for the resource. This is used when otherwise resource - * named from different services would cause naming collisions. - * Example entry: - * "datalabeling.googleapis.com/Dataset": "DataLabelingDataset" - */ - renamedResources: { [key: string]: string }; - /** - * List of full resource types to ignore during generation. - * This is typically used for API-specific Location resources, - * which should be handled by the generator as if they were actually - * the common Location resources. - * Example entry: "documentai.googleapis.com/Location" - */ - ignoredResources: string[]; - /** - * Namespaces which must be aliased in snippets due to - * a known (but non-generator-predictable) naming collision - */ - forcedNamespaceAliases: string[]; - /** - * Method signatures (in the form "service.method(signature)") - * which are provided separately, so shouldn't be generated. - * Snippets *calling* these methods are still generated, however. - */ - handwrittenSignatures: string[]; -} - -export interface DotnetSettings_RenamedServicesEntry { - key: string; - value: string; -} - -export interface DotnetSettings_RenamedResourcesEntry { - key: string; - value: string; -} - -/** Settings for Ruby client libraries. */ -export interface RubySettings { - /** Some settings. */ - common?: CommonLanguageSettings | undefined; -} - -/** Settings for Go client libraries. */ -export interface GoSettings { - /** Some settings. */ - common?: CommonLanguageSettings | undefined; -} - -/** Describes the generator configuration for a method. */ -export interface MethodSettings { - /** - * The fully qualified name of the method, for which the options below apply. - * This is used to find the method to apply the options. - */ - selector: string; - /** - * Describes settings to use for long-running operations when generating - * API methods for RPCs. Complements RPCs that use the annotations in - * google/longrunning/operations.proto. - * - * Example of a YAML configuration:: - * - * publishing: - * method_settings: - * - selector: google.cloud.speech.v2.Speech.BatchRecognize - * long_running: - * initial_poll_delay: - * seconds: 60 # 1 minute - * poll_delay_multiplier: 1.5 - * max_poll_delay: - * seconds: 360 # 6 minutes - * total_poll_timeout: - * seconds: 54000 # 90 minutes - */ - longRunning?: MethodSettings_LongRunning | undefined; -} - -/** - * Describes settings to use when generating API methods that use the - * long-running operation pattern. - * All default values below are from those used in the client library - * generators (e.g. - * [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). - */ -export interface MethodSettings_LongRunning { - /** - * Initial delay after which the first poll request will be made. - * Default value: 5 seconds. - */ - initialPollDelay?: - | Duration - | undefined; - /** - * Multiplier to gradually increase delay between subsequent polls until it - * reaches max_poll_delay. - * Default value: 1.5. - */ - pollDelayMultiplier: number; - /** - * Maximum time between two subsequent poll requests. - * Default value: 45 seconds. - */ - maxPollDelay?: - | Duration - | undefined; - /** - * Total polling timeout. - * Default value: 5 minutes. - */ - totalPollTimeout?: Duration | undefined; -} - -function createBaseCommonLanguageSettings(): CommonLanguageSettings { - return { referenceDocsUri: "", destinations: [] }; -} - -export const CommonLanguageSettings = { - encode(message: CommonLanguageSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.referenceDocsUri !== "") { - writer.uint32(10).string(message.referenceDocsUri); - } - writer.uint32(18).fork(); - for (const v of message.destinations) { - writer.int32(v); - } - writer.ldelim(); - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CommonLanguageSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCommonLanguageSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.referenceDocsUri = reader.string(); - continue; - case 2: - if (tag === 16) { - message.destinations.push(reader.int32() as any); - - continue; - } - - if (tag === 18) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.destinations.push(reader.int32() as any); - } - - continue; - } - - break; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CommonLanguageSettings { - return CommonLanguageSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CommonLanguageSettings { - const message = createBaseCommonLanguageSettings(); - message.referenceDocsUri = object.referenceDocsUri ?? ""; - message.destinations = object.destinations?.map((e) => e) || []; - return message; - }, -}; - -function createBaseClientLibrarySettings(): ClientLibrarySettings { - return { - version: "", - launchStage: 0, - restNumericEnums: false, - javaSettings: undefined, - cppSettings: undefined, - phpSettings: undefined, - pythonSettings: undefined, - nodeSettings: undefined, - dotnetSettings: undefined, - rubySettings: undefined, - goSettings: undefined, - }; -} - -export const ClientLibrarySettings = { - encode(message: ClientLibrarySettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.version !== "") { - writer.uint32(10).string(message.version); - } - if (message.launchStage !== 0) { - writer.uint32(16).int32(message.launchStage); - } - if (message.restNumericEnums === true) { - writer.uint32(24).bool(message.restNumericEnums); - } - if (message.javaSettings !== undefined) { - JavaSettings.encode(message.javaSettings, writer.uint32(170).fork()).ldelim(); - } - if (message.cppSettings !== undefined) { - CppSettings.encode(message.cppSettings, writer.uint32(178).fork()).ldelim(); - } - if (message.phpSettings !== undefined) { - PhpSettings.encode(message.phpSettings, writer.uint32(186).fork()).ldelim(); - } - if (message.pythonSettings !== undefined) { - PythonSettings.encode(message.pythonSettings, writer.uint32(194).fork()).ldelim(); - } - if (message.nodeSettings !== undefined) { - NodeSettings.encode(message.nodeSettings, writer.uint32(202).fork()).ldelim(); - } - if (message.dotnetSettings !== undefined) { - DotnetSettings.encode(message.dotnetSettings, writer.uint32(210).fork()).ldelim(); - } - if (message.rubySettings !== undefined) { - RubySettings.encode(message.rubySettings, writer.uint32(218).fork()).ldelim(); - } - if (message.goSettings !== undefined) { - GoSettings.encode(message.goSettings, writer.uint32(226).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ClientLibrarySettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseClientLibrarySettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.version = reader.string(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.launchStage = reader.int32() as any; - continue; - case 3: - if (tag !== 24) { - break; - } - - message.restNumericEnums = reader.bool(); - continue; - case 21: - if (tag !== 170) { - break; - } - - message.javaSettings = JavaSettings.decode(reader, reader.uint32()); - continue; - case 22: - if (tag !== 178) { - break; - } - - message.cppSettings = CppSettings.decode(reader, reader.uint32()); - continue; - case 23: - if (tag !== 186) { - break; - } - - message.phpSettings = PhpSettings.decode(reader, reader.uint32()); - continue; - case 24: - if (tag !== 194) { - break; - } - - message.pythonSettings = PythonSettings.decode(reader, reader.uint32()); - continue; - case 25: - if (tag !== 202) { - break; - } - - message.nodeSettings = NodeSettings.decode(reader, reader.uint32()); - continue; - case 26: - if (tag !== 210) { - break; - } - - message.dotnetSettings = DotnetSettings.decode(reader, reader.uint32()); - continue; - case 27: - if (tag !== 218) { - break; - } - - message.rubySettings = RubySettings.decode(reader, reader.uint32()); - continue; - case 28: - if (tag !== 226) { - break; - } - - message.goSettings = GoSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ClientLibrarySettings { - return ClientLibrarySettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ClientLibrarySettings { - const message = createBaseClientLibrarySettings(); - message.version = object.version ?? ""; - message.launchStage = object.launchStage ?? 0; - message.restNumericEnums = object.restNumericEnums ?? false; - message.javaSettings = (object.javaSettings !== undefined && object.javaSettings !== null) - ? JavaSettings.fromPartial(object.javaSettings) - : undefined; - message.cppSettings = (object.cppSettings !== undefined && object.cppSettings !== null) - ? CppSettings.fromPartial(object.cppSettings) - : undefined; - message.phpSettings = (object.phpSettings !== undefined && object.phpSettings !== null) - ? PhpSettings.fromPartial(object.phpSettings) - : undefined; - message.pythonSettings = (object.pythonSettings !== undefined && object.pythonSettings !== null) - ? PythonSettings.fromPartial(object.pythonSettings) - : undefined; - message.nodeSettings = (object.nodeSettings !== undefined && object.nodeSettings !== null) - ? NodeSettings.fromPartial(object.nodeSettings) - : undefined; - message.dotnetSettings = (object.dotnetSettings !== undefined && object.dotnetSettings !== null) - ? DotnetSettings.fromPartial(object.dotnetSettings) - : undefined; - message.rubySettings = (object.rubySettings !== undefined && object.rubySettings !== null) - ? RubySettings.fromPartial(object.rubySettings) - : undefined; - message.goSettings = (object.goSettings !== undefined && object.goSettings !== null) - ? GoSettings.fromPartial(object.goSettings) - : undefined; - return message; - }, -}; - -function createBasePublishing(): Publishing { - return { - methodSettings: [], - newIssueUri: "", - documentationUri: "", - apiShortName: "", - githubLabel: "", - codeownerGithubTeams: [], - docTagPrefix: "", - organization: 0, - librarySettings: [], - protoReferenceDocumentationUri: "", - }; -} - -export const Publishing = { - encode(message: Publishing, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.methodSettings) { - MethodSettings.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.newIssueUri !== "") { - writer.uint32(810).string(message.newIssueUri); - } - if (message.documentationUri !== "") { - writer.uint32(818).string(message.documentationUri); - } - if (message.apiShortName !== "") { - writer.uint32(826).string(message.apiShortName); - } - if (message.githubLabel !== "") { - writer.uint32(834).string(message.githubLabel); - } - for (const v of message.codeownerGithubTeams) { - writer.uint32(842).string(v!); - } - if (message.docTagPrefix !== "") { - writer.uint32(850).string(message.docTagPrefix); - } - if (message.organization !== 0) { - writer.uint32(856).int32(message.organization); - } - for (const v of message.librarySettings) { - ClientLibrarySettings.encode(v!, writer.uint32(874).fork()).ldelim(); - } - if (message.protoReferenceDocumentationUri !== "") { - writer.uint32(882).string(message.protoReferenceDocumentationUri); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Publishing { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePublishing(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (tag !== 18) { - break; - } - - message.methodSettings.push(MethodSettings.decode(reader, reader.uint32())); - continue; - case 101: - if (tag !== 810) { - break; - } - - message.newIssueUri = reader.string(); - continue; - case 102: - if (tag !== 818) { - break; - } - - message.documentationUri = reader.string(); - continue; - case 103: - if (tag !== 826) { - break; - } - - message.apiShortName = reader.string(); - continue; - case 104: - if (tag !== 834) { - break; - } - - message.githubLabel = reader.string(); - continue; - case 105: - if (tag !== 842) { - break; - } - - message.codeownerGithubTeams.push(reader.string()); - continue; - case 106: - if (tag !== 850) { - break; - } - - message.docTagPrefix = reader.string(); - continue; - case 107: - if (tag !== 856) { - break; - } - - message.organization = reader.int32() as any; - continue; - case 109: - if (tag !== 874) { - break; - } - - message.librarySettings.push(ClientLibrarySettings.decode(reader, reader.uint32())); - continue; - case 110: - if (tag !== 882) { - break; - } - - message.protoReferenceDocumentationUri = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Publishing { - return Publishing.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Publishing { - const message = createBasePublishing(); - message.methodSettings = object.methodSettings?.map((e) => MethodSettings.fromPartial(e)) || []; - message.newIssueUri = object.newIssueUri ?? ""; - message.documentationUri = object.documentationUri ?? ""; - message.apiShortName = object.apiShortName ?? ""; - message.githubLabel = object.githubLabel ?? ""; - message.codeownerGithubTeams = object.codeownerGithubTeams?.map((e) => e) || []; - message.docTagPrefix = object.docTagPrefix ?? ""; - message.organization = object.organization ?? 0; - message.librarySettings = object.librarySettings?.map((e) => ClientLibrarySettings.fromPartial(e)) || []; - message.protoReferenceDocumentationUri = object.protoReferenceDocumentationUri ?? ""; - return message; - }, -}; - -function createBaseJavaSettings(): JavaSettings { - return { libraryPackage: "", serviceClassNames: {}, common: undefined }; -} - -export const JavaSettings = { - encode(message: JavaSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.libraryPackage !== "") { - writer.uint32(10).string(message.libraryPackage); - } - Object.entries(message.serviceClassNames).forEach(([key, value]) => { - JavaSettings_ServiceClassNamesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); - }); - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): JavaSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseJavaSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.libraryPackage = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - const entry2 = JavaSettings_ServiceClassNamesEntry.decode(reader, reader.uint32()); - if (entry2.value !== undefined) { - message.serviceClassNames[entry2.key] = entry2.value; - } - continue; - case 3: - if (tag !== 26) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): JavaSettings { - return JavaSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): JavaSettings { - const message = createBaseJavaSettings(); - message.libraryPackage = object.libraryPackage ?? ""; - message.serviceClassNames = Object.entries(object.serviceClassNames ?? {}).reduce<{ [key: string]: string }>( - (acc, [key, value]) => { - if (value !== undefined) { - acc[key] = String(value); - } - return acc; - }, - {}, - ); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - return message; - }, -}; - -function createBaseJavaSettings_ServiceClassNamesEntry(): JavaSettings_ServiceClassNamesEntry { - return { key: "", value: "" }; -} - -export const JavaSettings_ServiceClassNamesEntry = { - encode(message: JavaSettings_ServiceClassNamesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): JavaSettings_ServiceClassNamesEntry { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseJavaSettings_ServiceClassNamesEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.value = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): JavaSettings_ServiceClassNamesEntry { - return JavaSettings_ServiceClassNamesEntry.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): JavaSettings_ServiceClassNamesEntry { - const message = createBaseJavaSettings_ServiceClassNamesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, -}; - -function createBaseCppSettings(): CppSettings { - return { common: undefined }; -} - -export const CppSettings = { - encode(message: CppSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CppSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCppSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CppSettings { - return CppSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CppSettings { - const message = createBaseCppSettings(); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - return message; - }, -}; - -function createBasePhpSettings(): PhpSettings { - return { common: undefined }; -} - -export const PhpSettings = { - encode(message: PhpSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PhpSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePhpSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): PhpSettings { - return PhpSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): PhpSettings { - const message = createBasePhpSettings(); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - return message; - }, -}; - -function createBasePythonSettings(): PythonSettings { - return { common: undefined }; -} - -export const PythonSettings = { - encode(message: PythonSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): PythonSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBasePythonSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): PythonSettings { - return PythonSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): PythonSettings { - const message = createBasePythonSettings(); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - return message; - }, -}; - -function createBaseNodeSettings(): NodeSettings { - return { common: undefined }; -} - -export const NodeSettings = { - encode(message: NodeSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): NodeSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseNodeSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): NodeSettings { - return NodeSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): NodeSettings { - const message = createBaseNodeSettings(); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - return message; - }, -}; - -function createBaseDotnetSettings(): DotnetSettings { - return { - common: undefined, - renamedServices: {}, - renamedResources: {}, - ignoredResources: [], - forcedNamespaceAliases: [], - handwrittenSignatures: [], - }; -} - -export const DotnetSettings = { - encode(message: DotnetSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); - } - Object.entries(message.renamedServices).forEach(([key, value]) => { - DotnetSettings_RenamedServicesEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).ldelim(); - }); - Object.entries(message.renamedResources).forEach(([key, value]) => { - DotnetSettings_RenamedResourcesEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).ldelim(); - }); - for (const v of message.ignoredResources) { - writer.uint32(34).string(v!); - } - for (const v of message.forcedNamespaceAliases) { - writer.uint32(42).string(v!); - } - for (const v of message.handwrittenSignatures) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DotnetSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDotnetSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - const entry2 = DotnetSettings_RenamedServicesEntry.decode(reader, reader.uint32()); - if (entry2.value !== undefined) { - message.renamedServices[entry2.key] = entry2.value; - } - continue; - case 3: - if (tag !== 26) { - break; - } - - const entry3 = DotnetSettings_RenamedResourcesEntry.decode(reader, reader.uint32()); - if (entry3.value !== undefined) { - message.renamedResources[entry3.key] = entry3.value; - } - continue; - case 4: - if (tag !== 34) { - break; - } - - message.ignoredResources.push(reader.string()); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.forcedNamespaceAliases.push(reader.string()); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.handwrittenSignatures.push(reader.string()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DotnetSettings { - return DotnetSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DotnetSettings { - const message = createBaseDotnetSettings(); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - message.renamedServices = Object.entries(object.renamedServices ?? {}).reduce<{ [key: string]: string }>( - (acc, [key, value]) => { - if (value !== undefined) { - acc[key] = String(value); - } - return acc; - }, - {}, - ); - message.renamedResources = Object.entries(object.renamedResources ?? {}).reduce<{ [key: string]: string }>( - (acc, [key, value]) => { - if (value !== undefined) { - acc[key] = String(value); - } - return acc; - }, - {}, - ); - message.ignoredResources = object.ignoredResources?.map((e) => e) || []; - message.forcedNamespaceAliases = object.forcedNamespaceAliases?.map((e) => e) || []; - message.handwrittenSignatures = object.handwrittenSignatures?.map((e) => e) || []; - return message; - }, -}; - -function createBaseDotnetSettings_RenamedServicesEntry(): DotnetSettings_RenamedServicesEntry { - return { key: "", value: "" }; -} - -export const DotnetSettings_RenamedServicesEntry = { - encode(message: DotnetSettings_RenamedServicesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DotnetSettings_RenamedServicesEntry { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDotnetSettings_RenamedServicesEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.value = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DotnetSettings_RenamedServicesEntry { - return DotnetSettings_RenamedServicesEntry.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DotnetSettings_RenamedServicesEntry { - const message = createBaseDotnetSettings_RenamedServicesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, -}; - -function createBaseDotnetSettings_RenamedResourcesEntry(): DotnetSettings_RenamedResourcesEntry { - return { key: "", value: "" }; -} - -export const DotnetSettings_RenamedResourcesEntry = { - encode(message: DotnetSettings_RenamedResourcesEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DotnetSettings_RenamedResourcesEntry { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDotnetSettings_RenamedResourcesEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.value = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DotnetSettings_RenamedResourcesEntry { - return DotnetSettings_RenamedResourcesEntry.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DotnetSettings_RenamedResourcesEntry { - const message = createBaseDotnetSettings_RenamedResourcesEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; - return message; - }, -}; - -function createBaseRubySettings(): RubySettings { - return { common: undefined }; -} - -export const RubySettings = { - encode(message: RubySettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): RubySettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseRubySettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): RubySettings { - return RubySettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): RubySettings { - const message = createBaseRubySettings(); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - return message; - }, -}; - -function createBaseGoSettings(): GoSettings { - return { common: undefined }; -} - -export const GoSettings = { - encode(message: GoSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.common !== undefined) { - CommonLanguageSettings.encode(message.common, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GoSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGoSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.common = CommonLanguageSettings.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GoSettings { - return GoSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GoSettings { - const message = createBaseGoSettings(); - message.common = (object.common !== undefined && object.common !== null) - ? CommonLanguageSettings.fromPartial(object.common) - : undefined; - return message; - }, -}; - -function createBaseMethodSettings(): MethodSettings { - return { selector: "", longRunning: undefined }; -} - -export const MethodSettings = { - encode(message: MethodSettings, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.selector !== "") { - writer.uint32(10).string(message.selector); - } - if (message.longRunning !== undefined) { - MethodSettings_LongRunning.encode(message.longRunning, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MethodSettings { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodSettings(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.selector = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.longRunning = MethodSettings_LongRunning.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): MethodSettings { - return MethodSettings.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): MethodSettings { - const message = createBaseMethodSettings(); - message.selector = object.selector ?? ""; - message.longRunning = (object.longRunning !== undefined && object.longRunning !== null) - ? MethodSettings_LongRunning.fromPartial(object.longRunning) - : undefined; - return message; - }, -}; - -function createBaseMethodSettings_LongRunning(): MethodSettings_LongRunning { - return { initialPollDelay: undefined, pollDelayMultiplier: 0, maxPollDelay: undefined, totalPollTimeout: undefined }; -} - -export const MethodSettings_LongRunning = { - encode(message: MethodSettings_LongRunning, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.initialPollDelay !== undefined) { - Duration.encode(message.initialPollDelay, writer.uint32(10).fork()).ldelim(); - } - if (message.pollDelayMultiplier !== 0) { - writer.uint32(21).float(message.pollDelayMultiplier); - } - if (message.maxPollDelay !== undefined) { - Duration.encode(message.maxPollDelay, writer.uint32(26).fork()).ldelim(); - } - if (message.totalPollTimeout !== undefined) { - Duration.encode(message.totalPollTimeout, writer.uint32(34).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MethodSettings_LongRunning { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodSettings_LongRunning(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.initialPollDelay = Duration.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 21) { - break; - } - - message.pollDelayMultiplier = reader.float(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.maxPollDelay = Duration.decode(reader, reader.uint32()); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.totalPollTimeout = Duration.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): MethodSettings_LongRunning { - return MethodSettings_LongRunning.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): MethodSettings_LongRunning { - const message = createBaseMethodSettings_LongRunning(); - message.initialPollDelay = (object.initialPollDelay !== undefined && object.initialPollDelay !== null) - ? Duration.fromPartial(object.initialPollDelay) - : undefined; - message.pollDelayMultiplier = object.pollDelayMultiplier ?? 0; - message.maxPollDelay = (object.maxPollDelay !== undefined && object.maxPollDelay !== null) - ? Duration.fromPartial(object.maxPollDelay) - : undefined; - message.totalPollTimeout = (object.totalPollTimeout !== undefined && object.totalPollTimeout !== null) - ? Duration.fromPartial(object.totalPollTimeout) - : undefined; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/web/src/types/proto/google/api/field_behavior.ts b/web/src/types/proto/google/api/field_behavior.ts deleted file mode 100644 index 0f52c7f07ddee..0000000000000 --- a/web/src/types/proto/google/api/field_behavior.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* eslint-disable */ - -export const protobufPackage = "google.api"; - -/** - * An indicator of the behavior of a given field (for example, that a field - * is required in requests, or given as output but ignored as input). - * This **does not** change the behavior in protocol buffers itself; it only - * denotes the behavior and may affect how API tooling handles the field. - * - * Note: This enum **may** receive new values in the future. - */ -export enum FieldBehavior { - /** FIELD_BEHAVIOR_UNSPECIFIED - Conventional default for enums. Do not use this. */ - FIELD_BEHAVIOR_UNSPECIFIED = 0, - /** - * OPTIONAL - Specifically denotes a field as optional. - * While all fields in protocol buffers are optional, this may be specified - * for emphasis if appropriate. - */ - OPTIONAL = 1, - /** - * REQUIRED - Denotes a field as required. - * This indicates that the field **must** be provided as part of the request, - * and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - */ - REQUIRED = 2, - /** - * OUTPUT_ONLY - Denotes a field as output only. - * This indicates that the field is provided in responses, but including the - * field in a request does nothing (the server *must* ignore it and - * *must not* throw an error as a result of the field's presence). - */ - OUTPUT_ONLY = 3, - /** - * INPUT_ONLY - Denotes a field as input only. - * This indicates that the field is provided in requests, and the - * corresponding field is not included in output. - */ - INPUT_ONLY = 4, - /** - * IMMUTABLE - Denotes a field as immutable. - * This indicates that the field may be set once in a request to create a - * resource, but may not be changed thereafter. - */ - IMMUTABLE = 5, - /** - * UNORDERED_LIST - Denotes that a (repeated) field is an unordered list. - * This indicates that the service may provide the elements of the list - * in any arbitrary order, rather than the order the user originally - * provided. Additionally, the list's order may or may not be stable. - */ - UNORDERED_LIST = 6, - /** - * NON_EMPTY_DEFAULT - Denotes that this field returns a non-empty default value if not set. - * This indicates that if the user provides the empty value in a request, - * a non-empty value will be returned. The user will not be aware of what - * non-empty value to expect. - */ - NON_EMPTY_DEFAULT = 7, - UNRECOGNIZED = -1, -} diff --git a/web/src/types/proto/google/api/http.ts b/web/src/types/proto/google/api/http.ts deleted file mode 100644 index 50b5c5d88ff8f..0000000000000 --- a/web/src/types/proto/google/api/http.ts +++ /dev/null @@ -1,653 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "google.api"; - -/** - * Defines the HTTP configuration for an API service. It contains a list of - * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method - * to one or more HTTP REST API methods. - */ -export interface Http { - /** - * A list of HTTP configuration rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - */ - rules: HttpRule[]; - /** - * When set to true, URL path parameters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where "%2F" will be - * left encoded. - * - * The default behavior is to not decode RFC 6570 reserved characters in multi - * segment matches. - */ - fullyDecodeReservedExpansion: boolean; -} - -/** - * # gRPC Transcoding - * - * gRPC Transcoding is a feature for mapping between a gRPC method and one or - * more HTTP REST endpoints. It allows developers to build a single API service - * that supports both gRPC APIs and REST APIs. Many systems, including [Google - * APIs](https://github.com/googleapis/googleapis), - * [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC - * Gateway](https://github.com/grpc-ecosystem/grpc-gateway), - * and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature - * and use it for large scale production services. - * - * `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies - * how different portions of the gRPC request message are mapped to the URL - * path, URL query parameters, and HTTP request body. It also controls how the - * gRPC response message is mapped to the HTTP response body. `HttpRule` is - * typically specified as an `google.api.http` annotation on the gRPC method. - * - * Each mapping specifies a URL path template and an HTTP method. The path - * template may refer to one or more fields in the gRPC request message, as long - * as each field is a non-repeated field with a primitive (non-message) type. - * The path template controls how fields of the request message are mapped to - * the URL path. - * - * Example: - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http) = { - * get: "/v1/{name=messages/*}" - * }; - * } - * } - * message GetMessageRequest { - * string name = 1; // Mapped to URL path. - * } - * message Message { - * string text = 1; // The resource content. - * } - * - * This enables an HTTP REST to gRPC mapping as below: - * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` - * - * Any fields in the request message which are not bound by the path template - * automatically become HTTP query parameters if there is no HTTP request body. - * For example: - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http) = { - * get:"/v1/messages/{message_id}" - * }; - * } - * } - * message GetMessageRequest { - * message SubMessage { - * string subfield = 1; - * } - * string message_id = 1; // Mapped to URL path. - * int64 revision = 2; // Mapped to URL query parameter `revision`. - * SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. - * } - * - * This enables a HTTP JSON to RPC mapping as below: - * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | - * `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: - * "foo"))` - * - * Note that fields which are mapped to URL query parameters must have a - * primitive type or a repeated primitive type or a non-repeated message type. - * In the case of a repeated type, the parameter can be repeated in the URL - * as `...?param=A¶m=B`. In the case of a message type, each field of the - * message is mapped to a separate parameter, such as - * `...?foo.a=A&foo.b=B&foo.c=C`. - * - * For HTTP methods that allow a request body, the `body` field - * specifies the mapping. Consider a REST update method on the - * message resource collection: - * - * service Messaging { - * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { - * option (google.api.http) = { - * patch: "/v1/messages/{message_id}" - * body: "message" - * }; - * } - * } - * message UpdateMessageRequest { - * string message_id = 1; // mapped to the URL - * Message message = 2; // mapped to the body - * } - * - * The following HTTP JSON to RPC mapping is enabled, where the - * representation of the JSON in the request body is determined by - * protos JSON encoding: - * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" message { text: "Hi!" })` - * - * The special name `*` can be used in the body mapping to define that - * every field not bound by the path template should be mapped to the - * request body. This enables the following alternative definition of - * the update method: - * - * service Messaging { - * rpc UpdateMessage(Message) returns (Message) { - * option (google.api.http) = { - * patch: "/v1/messages/{message_id}" - * body: "*" - * }; - * } - * } - * message Message { - * string message_id = 1; - * string text = 2; - * } - * - * The following HTTP JSON to RPC mapping is enabled: - * - * HTTP | gRPC - * -----|----- - * `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: - * "123456" text: "Hi!")` - * - * Note that when using `*` in the body mapping, it is not possible to - * have HTTP parameters, as all fields not bound by the path end in - * the body. This makes this option more rarely used in practice when - * defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. - * - * It is possible to define multiple HTTP methods for one RPC by using - * the `additional_bindings` option. Example: - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http) = { - * get: "/v1/messages/{message_id}" - * additional_bindings { - * get: "/v1/users/{user_id}/messages/{message_id}" - * } - * }; - * } - * } - * message GetMessageRequest { - * string message_id = 1; - * string user_id = 2; - * } - * - * This enables the following two alternative HTTP JSON to RPC mappings: - * - * HTTP | gRPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` - * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: - * "123456")` - * - * ## Rules for HTTP mapping - * - * 1. Leaf request fields (recursive expansion nested messages in the request - * message) are classified into three categories: - * - Fields referred by the path template. They are passed via the URL path. - * - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They - * are passed via the HTTP - * request body. - * - All other fields are passed via the URL query parameters, and the - * parameter name is the field path in the request message. A repeated - * field can be represented as multiple query parameters under the same - * name. - * 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL - * query parameter, all fields - * are passed via URL path and HTTP request body. - * 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP - * request body, all - * fields are passed via URL path and URL query parameters. - * - * ### Path template syntax - * - * Template = "/" Segments [ Verb ] ; - * Segments = Segment { "/" Segment } ; - * Segment = "*" | "**" | LITERAL | Variable ; - * Variable = "{" FieldPath [ "=" Segments ] "}" ; - * FieldPath = IDENT { "." IDENT } ; - * Verb = ":" LITERAL ; - * - * The syntax `*` matches a single URL path segment. The syntax `**` matches - * zero or more URL path segments, which must be the last part of the URL path - * except the `Verb`. - * - * The syntax `Variable` matches part of the URL path as specified by its - * template. A variable template must not contain other variables. If a variable - * matches a single path segment, its template may be omitted, e.g. `{var}` - * is equivalent to `{var=*}`. - * - * The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` - * contains any reserved character, such characters should be percent-encoded - * before the matching. - * - * If a variable contains exactly one path segment, such as `"{var}"` or - * `"{var=*}"`, when such a variable is expanded into a URL path on the client - * side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The - * server side does the reverse decoding. Such variables show up in the - * [Discovery - * Document](https://developers.google.com/discovery/v1/reference/apis) as - * `{var}`. - * - * If a variable contains multiple path segments, such as `"{var=foo/*}"` - * or `"{var=**}"`, when such a variable is expanded into a URL path on the - * client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. - * The server side does the reverse decoding, except "%2F" and "%2f" are left - * unchanged. Such variables show up in the - * [Discovery - * Document](https://developers.google.com/discovery/v1/reference/apis) as - * `{+var}`. - * - * ## Using gRPC API Service Configuration - * - * gRPC API Service Configuration (service config) is a configuration language - * for configuring a gRPC service to become a user-facing product. The - * service config is simply the YAML representation of the `google.api.Service` - * proto message. - * - * As an alternative to annotating your proto file, you can configure gRPC - * transcoding in your service config YAML files. You do this by specifying a - * `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same - * effect as the proto annotation. This can be particularly useful if you - * have a proto that is reused in multiple services. Note that any transcoding - * specified in the service config will override any matching transcoding - * configuration in the proto. - * - * Example: - * - * http: - * rules: - * # Selects a gRPC method and applies HttpRule to it. - * - selector: example.v1.Messaging.GetMessage - * get: /v1/messages/{message_id}/{sub.subfield} - * - * ## Special notes - * - * When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the - * proto to JSON conversion must follow the [proto3 - * specification](https://developers.google.com/protocol-buffers/docs/proto3#json). - * - * While the single segment variable follows the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String - * Expansion, the multi segment variable **does not** follow RFC 6570 Section - * 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion - * does not expand special characters like `?` and `#`, which would lead - * to invalid URLs. As the result, gRPC Transcoding uses a custom encoding - * for multi segment variables. - * - * The path variables **must not** refer to any repeated or mapped field, - * because client libraries are not capable of handling such variable expansion. - * - * The path variables **must not** capture the leading "/" character. The reason - * is that the most common use case "{var}" does not capture the leading "/" - * character. For consistency, all path variables must share the same behavior. - * - * Repeated message fields must not be mapped to URL query parameters, because - * no client library can support such complicated mapping. - * - * If an API needs to use a JSON array for request or response body, it can map - * the request or response body to a repeated field. However, some gRPC - * Transcoding implementations may not support this feature. - */ -export interface HttpRule { - /** - * Selects a method to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax - * details. - */ - selector: string; - /** - * Maps to HTTP GET. Used for listing and getting information about - * resources. - */ - get?: - | string - | undefined; - /** Maps to HTTP PUT. Used for replacing a resource. */ - put?: - | string - | undefined; - /** Maps to HTTP POST. Used for creating a resource or performing an action. */ - post?: - | string - | undefined; - /** Maps to HTTP DELETE. Used for deleting a resource. */ - delete?: - | string - | undefined; - /** Maps to HTTP PATCH. Used for updating a resource. */ - patch?: - | string - | undefined; - /** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave the - * HTTP method unspecified for this rule. The wild-card rule is useful - * for services that provide content to Web (HTML) clients. - */ - custom?: - | CustomHttpPattern - | undefined; - /** - * The name of the request field whose value is mapped to the HTTP request - * body, or `*` for mapping all request fields not captured by the path - * pattern to the HTTP body, or omitted for not having any HTTP request body. - * - * NOTE: the referred field must be present at the top-level of the request - * message type. - */ - body: string; - /** - * Optional. The name of the response field whose value is mapped to the HTTP - * response body. When omitted, the entire response message will be used - * as the HTTP response body. - * - * NOTE: The referred field must be present at the top-level of the response - * message type. - */ - responseBody: string; - /** - * Additional HTTP bindings for the selector. Nested bindings must - * not contain an `additional_bindings` field themselves (that is, - * the nesting may only be one level deep). - */ - additionalBindings: HttpRule[]; -} - -/** A custom pattern is used for defining custom HTTP verb. */ -export interface CustomHttpPattern { - /** The name of this custom HTTP verb. */ - kind: string; - /** The path matched by this custom verb. */ - path: string; -} - -function createBaseHttp(): Http { - return { rules: [], fullyDecodeReservedExpansion: false }; -} - -export const Http = { - encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.rules) { - HttpRule.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.fullyDecodeReservedExpansion === true) { - writer.uint32(16).bool(message.fullyDecodeReservedExpansion); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Http { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttp(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.rules.push(HttpRule.decode(reader, reader.uint32())); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.fullyDecodeReservedExpansion = reader.bool(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Http { - return Http.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Http { - const message = createBaseHttp(); - message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || []; - message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false; - return message; - }, -}; - -function createBaseHttpRule(): HttpRule { - return { - selector: "", - get: undefined, - put: undefined, - post: undefined, - delete: undefined, - patch: undefined, - custom: undefined, - body: "", - responseBody: "", - additionalBindings: [], - }; -} - -export const HttpRule = { - encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.selector !== "") { - writer.uint32(10).string(message.selector); - } - if (message.get !== undefined) { - writer.uint32(18).string(message.get); - } - if (message.put !== undefined) { - writer.uint32(26).string(message.put); - } - if (message.post !== undefined) { - writer.uint32(34).string(message.post); - } - if (message.delete !== undefined) { - writer.uint32(42).string(message.delete); - } - if (message.patch !== undefined) { - writer.uint32(50).string(message.patch); - } - if (message.custom !== undefined) { - CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim(); - } - if (message.body !== "") { - writer.uint32(58).string(message.body); - } - if (message.responseBody !== "") { - writer.uint32(98).string(message.responseBody); - } - for (const v of message.additionalBindings) { - HttpRule.encode(v!, writer.uint32(90).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseHttpRule(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.selector = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.get = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.put = reader.string(); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.post = reader.string(); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.delete = reader.string(); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.patch = reader.string(); - continue; - case 8: - if (tag !== 66) { - break; - } - - message.custom = CustomHttpPattern.decode(reader, reader.uint32()); - continue; - case 7: - if (tag !== 58) { - break; - } - - message.body = reader.string(); - continue; - case 12: - if (tag !== 98) { - break; - } - - message.responseBody = reader.string(); - continue; - case 11: - if (tag !== 90) { - break; - } - - message.additionalBindings.push(HttpRule.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): HttpRule { - return HttpRule.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): HttpRule { - const message = createBaseHttpRule(); - message.selector = object.selector ?? ""; - message.get = object.get ?? undefined; - message.put = object.put ?? undefined; - message.post = object.post ?? undefined; - message.delete = object.delete ?? undefined; - message.patch = object.patch ?? undefined; - message.custom = (object.custom !== undefined && object.custom !== null) - ? CustomHttpPattern.fromPartial(object.custom) - : undefined; - message.body = object.body ?? ""; - message.responseBody = object.responseBody ?? ""; - message.additionalBindings = object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseCustomHttpPattern(): CustomHttpPattern { - return { kind: "", path: "" }; -} - -export const CustomHttpPattern = { - encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.kind !== "") { - writer.uint32(10).string(message.kind); - } - if (message.path !== "") { - writer.uint32(18).string(message.path); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCustomHttpPattern(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.kind = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.path = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): CustomHttpPattern { - return CustomHttpPattern.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): CustomHttpPattern { - const message = createBaseCustomHttpPattern(); - message.kind = object.kind ?? ""; - message.path = object.path ?? ""; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/web/src/types/proto/google/api/launch_stage.ts b/web/src/types/proto/google/api/launch_stage.ts deleted file mode 100644 index 47b30ac2f26a6..0000000000000 --- a/web/src/types/proto/google/api/launch_stage.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* eslint-disable */ - -export const protobufPackage = "google.api"; - -/** - * The launch stage as defined by [Google Cloud Platform - * Launch Stages](https://cloud.google.com/terms/launch-stages). - */ -export enum LaunchStage { - /** LAUNCH_STAGE_UNSPECIFIED - Do not use this default value. */ - LAUNCH_STAGE_UNSPECIFIED = 0, - /** UNIMPLEMENTED - The feature is not yet implemented. Users can not use it. */ - UNIMPLEMENTED = 6, - /** PRELAUNCH - Prelaunch features are hidden from users and are only visible internally. */ - PRELAUNCH = 7, - /** - * EARLY_ACCESS - Early Access features are limited to a closed group of testers. To use - * these features, you must sign up in advance and sign a Trusted Tester - * agreement (which includes confidentiality provisions). These features may - * be unstable, changed in backward-incompatible ways, and are not - * guaranteed to be released. - */ - EARLY_ACCESS = 1, - /** - * ALPHA - Alpha is a limited availability test for releases before they are cleared - * for widespread use. By Alpha, all significant design issues are resolved - * and we are in the process of verifying functionality. Alpha customers - * need to apply for access, agree to applicable terms, and have their - * projects allowlisted. Alpha releases don't have to be feature complete, - * no SLAs are provided, and there are no technical support obligations, but - * they will be far enough along that customers can actually use them in - * test environments or for limited-use tests -- just like they would in - * normal production cases. - */ - ALPHA = 2, - /** - * BETA - Beta is the point at which we are ready to open a release for any - * customer to use. There are no SLA or technical support obligations in a - * Beta release. Products will be complete from a feature perspective, but - * may have some open outstanding issues. Beta releases are suitable for - * limited production use cases. - */ - BETA = 3, - /** - * GA - GA features are open to all developers and are considered stable and - * fully qualified for production use. - */ - GA = 4, - /** - * DEPRECATED - Deprecated features are scheduled to be shut down and removed. For more - * information, see the "Deprecation Policy" section of our [Terms of - * Service](https://cloud.google.com/terms/) - * and the [Google Cloud Platform Subject to the Deprecation - * Policy](https://cloud.google.com/terms/deprecation) documentation. - */ - DEPRECATED = 5, - UNRECOGNIZED = -1, -} diff --git a/web/src/types/proto/google/protobuf/descriptor.ts b/web/src/types/proto/google/protobuf/descriptor.ts deleted file mode 100644 index 51796d26cf519..0000000000000 --- a/web/src/types/proto/google/protobuf/descriptor.ts +++ /dev/null @@ -1,3573 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface FileDescriptorProto { - /** file name, relative to root of source tree */ - name: string; - /** e.g. "foo", "foo.bar", etc. */ - package: string; - /** Names of files imported by this file. */ - dependency: string[]; - /** Indexes of the public imported files in the dependency list above. */ - publicDependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weakDependency: number[]; - /** All top-level definitions in this file. */ - messageType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - service: ServiceDescriptorProto[]; - extension: FieldDescriptorProto[]; - options?: - | FileOptions - | undefined; - /** - * This field contains optional information about the original source code. - * You may safely remove this entire field without harming runtime - * functionality of the descriptors -- the information is needed only by - * development tools. - */ - sourceCodeInfo?: - | SourceCodeInfo - | undefined; - /** - * The syntax of the proto file. - * The supported values are "proto2", "proto3", and "editions". - * - * If `edition` is present, this value must be "editions". - */ - syntax: string; - /** The edition of the proto file, which is an opaque string. */ - edition: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nestedType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - extensionRange: DescriptorProto_ExtensionRange[]; - oneofDecl: OneofDescriptorProto[]; - options?: MessageOptions | undefined; - reservedRange: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reservedName: string[]; -} - -export interface DescriptorProto_ExtensionRange { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; - options?: ExtensionRangeOptions | undefined; -} - -/** - * Range of reserved tag numbers. Reserved tag numbers may not be used by - * fields or extension ranges in the same message. Reserved ranges may - * not overlap. - */ -export interface DescriptorProto_ReservedRange { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface FieldDescriptorProto { - name: string; - number: number; - label: FieldDescriptorProto_Label; - /** - * If type_name is set, this need not be set. If both this and type_name - * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - */ - type: FieldDescriptorProto_Type; - /** - * For message and enum types, this is the name of the type. If the name - * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - * rules are used to find the type (i.e. first the nested types within this - * message are searched, then within the parent, on up to the root - * namespace). - */ - typeName: string; - /** - * For extensions, this is the name of the type being extended. It is - * resolved in the same manner as type_name. - */ - extendee: string; - /** - * For numeric types, contains the original text representation of the value. - * For booleans, "true" or "false". - * For strings, contains the default text contents (not escaped in any way). - * For bytes, contains the C escaped value. All bytes >= 128 are escaped. - */ - defaultValue: string; - /** - * If set, gives the index of a oneof in the containing type's oneof_decl - * list. This field is a member of that oneof. - */ - oneofIndex: number; - /** - * JSON name of this field. The value is set by protocol compiler. If the - * user has set a "json_name" option on this field, that option's value - * will be used. Otherwise, it's deduced from the field's name by converting - * it to camelCase. - */ - jsonName: string; - options?: - | FieldOptions - | undefined; - /** - * If true, this is a proto3 "optional". When a proto3 field is optional, it - * tracks presence regardless of field type. - * - * When proto3_optional is true, this field must be belong to a oneof to - * signal to old proto3 clients that presence is tracked for this field. This - * oneof is known as a "synthetic" oneof, and this field must be its sole - * member (each proto3 optional field gets its own synthetic oneof). Synthetic - * oneofs exist in the descriptor only, and do not generate any API. Synthetic - * oneofs must be ordered after all "real" oneofs. - * - * For message fields, proto3_optional doesn't create any semantic change, - * since non-repeated message fields always track presence. However it still - * indicates the semantic detail of whether the user wrote "optional" or not. - * This can be useful for round-tripping the .proto file. For consistency we - * give message fields a synthetic oneof also, even though it is not required - * to track presence. This is especially important because the parser can't - * tell if a field is a message or an enum, so it must always create a - * synthetic oneof. - * - * Proto2 optional fields do not set this flag, because they already indicate - * optional with `LABEL_OPTIONAL`. - */ - proto3Optional: boolean; -} - -export enum FieldDescriptorProto_Type { - /** - * TYPE_DOUBLE - 0 is reserved for errors. - * Order is weird for historical reasons. - */ - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - /** - * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - * negative values are likely. - */ - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - /** - * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - * negative values are likely. - */ - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - /** - * TYPE_GROUP - Tag-delimited aggregate. - * Group type is deprecated and not supported in proto3. However, Proto3 - * implementations should still be able to parse the group wire format and - * treat group fields as unknown fields. - */ - TYPE_GROUP = 10, - /** TYPE_MESSAGE - Length-delimited aggregate. */ - TYPE_MESSAGE = 11, - /** TYPE_BYTES - New in version 2. */ - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - /** TYPE_SINT32 - Uses ZigZag encoding. */ - TYPE_SINT32 = 17, - /** TYPE_SINT64 - Uses ZigZag encoding. */ - TYPE_SINT64 = 18, - UNRECOGNIZED = -1, -} - -export enum FieldDescriptorProto_Label { - /** LABEL_OPTIONAL - 0 is reserved for errors */ - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3, - UNRECOGNIZED = -1, -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options?: OneofOptions | undefined; -} - -/** Describes an enum type. */ -export interface EnumDescriptorProto { - name: string; - value: EnumValueDescriptorProto[]; - options?: - | EnumOptions - | undefined; - /** - * Range of reserved numeric values. Reserved numeric values may not be used - * by enum values in the same enum declaration. Reserved ranges may not - * overlap. - */ - reservedRange: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reservedName: string[]; -} - -/** - * Range of reserved numeric values. Reserved values may not be used by - * entries in the same enum. Reserved ranges may not overlap. - * - * Note that this is distinct from DescriptorProto.ReservedRange in that it - * is inclusive such that it can appropriately represent the entire int32 - * domain. - */ -export interface EnumDescriptorProto_EnumReservedRange { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options?: EnumValueOptions | undefined; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options?: ServiceOptions | undefined; -} - -/** Describes a method of a service. */ -export interface MethodDescriptorProto { - name: string; - /** - * Input and output type names. These are resolved in the same way as - * FieldDescriptorProto.type_name, but must refer to a message type. - */ - inputType: string; - outputType: string; - options?: - | MethodOptions - | undefined; - /** Identifies if client streams multiple client messages */ - clientStreaming: boolean; - /** Identifies if server streams multiple server messages */ - serverStreaming: boolean; -} - -export interface FileOptions { - /** - * Sets the Java package where classes generated from this .proto will be - * placed. By default, the proto package is used, but this is often - * inappropriate because proto packages do not normally start with backwards - * domain names. - */ - javaPackage: string; - /** - * Controls the name of the wrapper Java class generated for the .proto file. - * That class will always contain the .proto file's getDescriptor() method as - * well as any top-level extensions defined in the .proto file. - * If java_multiple_files is disabled, then all the other classes from the - * .proto file will be nested inside the single wrapper outer class. - */ - javaOuterClassname: string; - /** - * If enabled, then the Java code generator will generate a separate .java - * file for each top-level message, enum, and service defined in the .proto - * file. Thus, these types will *not* be nested inside the wrapper class - * named by java_outer_classname. However, the wrapper class will still be - * generated to contain the file's getDescriptor() method as well as any - * top-level extensions defined in the file. - */ - javaMultipleFiles: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - javaGenerateEqualsAndHash: boolean; - /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. - */ - javaStringCheckUtf8: boolean; - optimizeFor: FileOptions_OptimizeMode; - /** - * Sets the Go package where structs generated from this .proto will be - * placed. If omitted, the Go package will be derived from the following: - * - The basename of the package import path, if provided. - * - Otherwise, the package statement in the .proto file, if present. - * - Otherwise, the basename of the .proto file, without extension. - */ - goPackage: string; - /** - * Should generic services be generated in each language? "Generic" services - * are not specific to any particular RPC system. They are generated by the - * main code generators in each language (without additional plugins). - * Generic services were the only kind of service generation supported by - * early versions of google.protobuf. - * - * Generic services are now considered deprecated in favor of using plugins - * that generate code specific to your particular RPC system. Therefore, - * these default to false. Old code which depends on generic services should - * explicitly set them to true. - */ - ccGenericServices: boolean; - javaGenericServices: boolean; - pyGenericServices: boolean; - phpGenericServices: boolean; - /** - * Is this file deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for everything in the file, or it will be completely ignored; in the very - * least, this is a formalization for deprecating files. - */ - deprecated: boolean; - /** - * Enables the use of arenas for the proto messages in this file. This applies - * only to generated classes for C++. - */ - ccEnableArenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objcClassPrefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharpNamespace: string; - /** - * By default Swift generators will take the proto package and CamelCase it - * replacing '.' with underscore and use that to prefix the types/symbols - * defined. When this options is provided, they will use this value instead - * to prefix the types/symbols defined. - */ - swiftPrefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - phpClassPrefix: string; - /** - * Use this option to change the namespace of php generated classes. Default - * is empty. When this option is empty, the package name will be used for - * determining the namespace. - */ - phpNamespace: string; - /** - * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be - * used for determining the namespace. - */ - phpMetadataNamespace: string; - /** - * Use this option to change the package of ruby generated classes. Default - * is empty. When this option is not set, the package name will be used for - * determining the ruby package. - */ - rubyPackage: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpretedOption: UninterpretedOption[]; -} - -/** Generated classes can be optimized for speed or code size. */ -export enum FileOptions_OptimizeMode { - /** SPEED - Generate complete code for parsing, serialization, */ - SPEED = 1, - /** CODE_SIZE - etc. */ - CODE_SIZE = 2, - /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ - LITE_RUNTIME = 3, - UNRECOGNIZED = -1, -} - -export interface MessageOptions { - /** - * Set true to use the old proto1 MessageSet wire format for extensions. - * This is provided for backwards-compatibility with the MessageSet wire - * format. You should not use this for any other reason: It's less - * efficient, has fewer features, and is more complicated. - * - * The message must be defined exactly as follows: - * message Foo { - * option message_set_wire_format = true; - * extensions 4 to max; - * } - * Note that the message cannot have any defined fields; MessageSets only - * have extensions. - * - * All extensions of your type must be singular messages; e.g. they cannot - * be int32s, enums, or repeated messages. - * - * Because this is an option, the above two restrictions are not enforced by - * the protocol compiler. - */ - messageSetWireFormat: boolean; - /** - * Disables the generation of the standard "descriptor()" accessor, which can - * conflict with a field of the same name. This is meant to make migration - * from proto1 easier; new code should avoid fields named "descriptor". - */ - noStandardDescriptorAccessor: boolean; - /** - * Is this message deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the message, or it will be completely ignored; in the very least, - * this is a formalization for deprecating messages. - */ - deprecated: boolean; - /** - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. - * - * Whether the message is an automatically generated map entry type for the - * maps field. - * - * For maps fields: - * map map_field = 1; - * The parsed descriptor looks like: - * message MapFieldEntry { - * option map_entry = true; - * optional KeyType key = 1; - * optional ValueType value = 2; - * } - * repeated MapFieldEntry map_field = 1; - * - * Implementations may choose not to generate the map_entry=true message, but - * use a native map in the target language to hold the keys and values. - * The reflection APIs in such implementations still need to work as - * if the field is a repeated message field. - */ - mapEntry: boolean; - /** - * Enable the legacy handling of JSON field name conflicts. This lowercases - * and strips underscored from the fields before comparison in proto3 only. - * The new behavior takes `json_name` into account and applies to proto2 as - * well. - * - * This should only be used as a temporary measure against broken builds due - * to the change in behavior for JSON field name conflicts. - * - * TODO(b/261750190) This is legacy behavior we plan to remove once downstream - * teams have had time to migrate. - * - * @deprecated - */ - deprecatedLegacyJsonFieldConflicts: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface FieldOptions { - /** - * The ctype option instructs the C++ code generator to use a different - * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! - */ - ctype: FieldOptions_CType; - /** - * The packed option can be enabled for repeated primitive fields to enable - * a more efficient representation on the wire. Rather than repeatedly - * writing the tag and type for each element, the entire array is encoded as - * a single length-delimited blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. - */ - packed: boolean; - /** - * The jstype option determines the JavaScript type used for values of the - * field. The option is permitted only for 64 bit integral and fixed types - * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - * is represented as JavaScript string, which avoids loss of precision that - * can happen when a large value is converted to a floating point JavaScript. - * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - * use the JavaScript "number" type. The behavior of the default option - * JS_NORMAL is implementation dependent. - * - * This option is an enum to permit additional types to be added, e.g. - * goog.math.Integer. - */ - jstype: FieldOptions_JSType; - /** - * Should this field be parsed lazily? Lazy applies only to message-type - * fields. It means that when the outer message is initially parsed, the - * inner message's contents will not be parsed but instead stored in encoded - * form. The inner message will actually be parsed when it is first accessed. - * - * This is only a hint. Implementations are free to choose whether to use - * eager or lazy parsing regardless of the value of this option. However, - * setting this option true suggests that the protocol author believes that - * using lazy parsing on this field is worth the additional bookkeeping - * overhead typically needed to implement it. - * - * This option does not affect the public interface of any generated code; - * all method signatures remain the same. Furthermore, thread-safety of the - * interface is not affected by this option; const methods remain safe to - * call from multiple threads concurrently, while non-const methods continue - * to require exclusive access. - * - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - * - * As of May 2022, lazy verifies the contents of the byte stream during - * parsing. An invalid byte stream will cause the overall parsing to fail. - */ - lazy: boolean; - /** - * unverified_lazy does no correctness checks on the byte stream. This should - * only be used where lazy with verification is prohibitive for performance - * reasons. - */ - unverifiedLazy: boolean; - /** - * Is this field deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for accessors, or it will be completely ignored; in the very least, this - * is a formalization for deprecating fields. - */ - deprecated: boolean; - /** For Google-internal migration only. Do not use. */ - weak: boolean; - /** - * Indicate that the field value should not be printed out when using debug - * formats, e.g. when the field contains sensitive credentials. - */ - debugRedact: boolean; - retention: FieldOptions_OptionRetention; - target: FieldOptions_OptionTargetType; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export enum FieldOptions_CType { - /** STRING - Default mode. */ - STRING = 0, - CORD = 1, - STRING_PIECE = 2, - UNRECOGNIZED = -1, -} - -export enum FieldOptions_JSType { - /** JS_NORMAL - Use the default type. */ - JS_NORMAL = 0, - /** JS_STRING - Use JavaScript strings. */ - JS_STRING = 1, - /** JS_NUMBER - Use JavaScript numbers. */ - JS_NUMBER = 2, - UNRECOGNIZED = -1, -} - -/** - * If set to RETENTION_SOURCE, the option will be omitted from the binary. - * Note: as of January 2023, support for this is in progress and does not yet - * have an effect (b/264593489). - */ -export enum FieldOptions_OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2, - UNRECOGNIZED = -1, -} - -/** - * This indicates the types of entities that the field may apply to when used - * as an option. If it is unset, then the field may be freely used as an - * option on any kind of entity. Note: as of January 2023, support for this is - * in progress and does not yet have an effect (b/264593489). - */ -export enum FieldOptions_OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9, - UNRECOGNIZED = -1, -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allowAlias: boolean; - /** - * Is this enum deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum, or it will be completely ignored; in the very least, this - * is a formalization for deprecating enums. - */ - deprecated: boolean; - /** - * Enable the legacy handling of JSON field name conflicts. This lowercases - * and strips underscored from the fields before comparison in proto3 only. - * The new behavior takes `json_name` into account and applies to proto2 as - * well. - * TODO(b/261750190) Remove this legacy behavior once downstream teams have - * had time to migrate. - * - * @deprecated - */ - deprecatedLegacyJsonFieldConflicts: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface EnumValueOptions { - /** - * Is this enum value deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum value, or it will be completely ignored; in the very least, - * this is a formalization for deprecating enum values. - */ - deprecated: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface ServiceOptions { - /** - * Is this service deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the service, or it will be completely ignored; in the very least, - * this is a formalization for deprecating services. - */ - deprecated: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface MethodOptions { - /** - * Is this method deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the method, or it will be completely ignored; in the very least, - * this is a formalization for deprecating methods. - */ - deprecated: boolean; - idempotencyLevel: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -/** - * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - * or neither? HTTP based RPC implementation may choose GET verb for safe - * methods, and PUT verb for idempotent methods instead of the default POST. - */ -export enum MethodOptions_IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - /** NO_SIDE_EFFECTS - implies idempotent */ - NO_SIDE_EFFECTS = 1, - /** IDEMPOTENT - idempotent, but may have side effects */ - IDEMPOTENT = 2, - UNRECOGNIZED = -1, -} - -/** - * A message representing a option the parser does not recognize. This only - * appears in options protos created by the compiler::Parser class. - * DescriptorPool resolves these when building Descriptor objects. Therefore, - * options protos in descriptor objects (e.g. returned by Descriptor::options(), - * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - * in them. - */ -export interface UninterpretedOption { - name: UninterpretedOption_NamePart[]; - /** - * The value of the uninterpreted option, in whatever type the tokenizer - * identified it as during parsing. Exactly one of these should be set. - */ - identifierValue: string; - positiveIntValue: number; - negativeIntValue: number; - doubleValue: number; - stringValue: Uint8Array; - aggregateValue: string; -} - -/** - * The name of the uninterpreted option. Each string represents a segment in - * a dot-separated name. is_extension is true iff a segment represents an - * extension (denoted with parentheses in options specs in .proto files). - * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - * "foo.(bar.baz).moo". - */ -export interface UninterpretedOption_NamePart { - namePart: string; - isExtension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface SourceCodeInfo { - /** - * A Location identifies a piece of source code in a .proto file which - * corresponds to a particular definition. This information is intended - * to be useful to IDEs, code indexers, documentation generators, and similar - * tools. - * - * For example, say we have a file like: - * message Foo { - * optional string foo = 1; - * } - * Let's look at just the field definition: - * optional string foo = 1; - * ^ ^^ ^^ ^ ^^^ - * a bc de f ghi - * We have the following locations: - * span path represents - * [a,i) [ 4, 0, 2, 0 ] The whole field definition. - * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - * - * Notes: - * - A location may refer to a repeated field itself (i.e. not to any - * particular index within it). This is used whenever a set of elements are - * logically enclosed in a single code segment. For example, an entire - * extend block (possibly containing multiple extension definitions) will - * have an outer location whose path refers to the "extensions" repeated - * field without an index. - * - Multiple locations may have the same path. This happens when a single - * logical declaration is spread out across multiple places. The most - * obvious example is the "extend" block again -- there may be multiple - * extend blocks in the same scope, each of which will have the same path. - * - A location's span is not always a subset of its parent's span. For - * example, the "extendee" of an extension declaration appears at the - * beginning of the "extend" block and is shared by all extensions within - * the block. - * - Just because a location's span is a subset of some other location's span - * does not mean that it is a descendant. For example, a "group" defines - * both a type and a field in a single declaration. Thus, the locations - * corresponding to the type and field and their components will overlap. - * - Code which tries to interpret locations should probably be designed to - * ignore those that it doesn't understand, as more types of locations could - * be recorded in the future. - */ - location: SourceCodeInfo_Location[]; -} - -export interface SourceCodeInfo_Location { - /** - * Identifies which part of the FileDescriptorProto was defined at this - * location. - * - * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition occurs. - * For example, this path: - * [ 4, 3, 2, 7, 1 ] - * refers to: - * file.message_type(3) // 4, 3 - * .field(7) // 2, 7 - * .name() // 1 - * This is because FileDescriptorProto.message_type has field number 4: - * repeated DescriptorProto message_type = 4; - * and DescriptorProto.field has field number 2: - * repeated FieldDescriptorProto field = 2; - * and FieldDescriptorProto.name has field number 1: - * optional string name = 1; - * - * Thus, the above path gives the location of a field name. If we removed - * the last element: - * [ 4, 3, 2, 7 ] - * this path refers to the whole field declaration (from the beginning - * of the label to the terminating semicolon). - */ - path: number[]; - /** - * Always has exactly three or four elements: start line, start column, - * end line (optional, otherwise assumed same as start line), end column. - * These are packed into a single field for efficiency. Note that line - * and column numbers are zero-based -- typically you will want to add - * 1 to each before displaying to a user. - */ - span: number[]; - /** - * If this SourceCodeInfo represents a complete declaration, these are any - * comments appearing before and after the declaration which appear to be - * attached to the declaration. - * - * A series of line comments appearing on consecutive lines, with no other - * tokens appearing on those lines, will be treated as a single comment. - * - * leading_detached_comments will keep paragraphs of comments that appear - * before (but not connected to) the current element. Each paragraph, - * separated by empty lines, will be one comment element in the repeated - * field. - * - * Only the comment content is provided; comment markers (e.g. //) are - * stripped out. For block comments, leading whitespace and an asterisk - * will be stripped from the beginning of each line other than the first. - * Newlines are included in the output. - * - * Examples: - * - * optional int32 foo = 1; // Comment attached to foo. - * // Comment attached to bar. - * optional int32 bar = 2; - * - * optional string baz = 3; - * // Comment attached to baz. - * // Another line attached to baz. - * - * // Comment attached to moo. - * // - * // Another line attached to moo. - * optional double moo = 4; - * - * // Detached comment for corge. This is not leading or trailing comments - * // to moo or corge because there are blank lines separating it from - * // both. - * - * // Detached comment for corge paragraph 2. - * - * optional string corge = 5; - * /* Block comment attached - * * to corge. Leading asterisks - * * will be removed. * / - * /* Block comment attached to - * * grault. * / - * optional int32 grault = 6; - * - * // ignored detached comments. - */ - leadingComments: string; - trailingComments: string; - leadingDetachedComments: string[]; -} - -/** - * Describes the relationship between generated code and its original source - * file. A GeneratedCodeInfo message is associated with only one generated - * source file, but may contain references to different source .proto files. - */ -export interface GeneratedCodeInfo { - /** - * An Annotation connects some span of text in generated code to an element - * of its generating .proto file. - */ - annotation: GeneratedCodeInfo_Annotation[]; -} - -export interface GeneratedCodeInfo_Annotation { - /** - * Identifies the element in the original source .proto file. This field - * is formatted the same as SourceCodeInfo.Location.path. - */ - path: number[]; - /** Identifies the filesystem path to the original source .proto. */ - sourceFile: string; - /** - * Identifies the starting offset in bytes in the generated code - * that relates to the identified object. - */ - begin: number; - /** - * Identifies the ending offset in bytes in the generated code that - * relates to the identified object. The end offset should be one past - * the last relevant byte (so the length of the text = end - begin). - */ - end: number; - semantic: GeneratedCodeInfo_Annotation_Semantic; -} - -/** - * Represents the identified object's effect on the element in the original - * .proto file. - */ -export enum GeneratedCodeInfo_Annotation_Semantic { - /** NONE - There is no effect or the effect is indescribable. */ - NONE = 0, - /** SET - The element is set or otherwise mutated. */ - SET = 1, - /** ALIAS - An alias to the element is returned. */ - ALIAS = 2, - UNRECOGNIZED = -1, -} - -function createBaseFileDescriptorSet(): FileDescriptorSet { - return { file: [] }; -} - -export const FileDescriptorSet = { - encode(message: FileDescriptorSet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorSet(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.file.push(FileDescriptorProto.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): FileDescriptorSet { - return FileDescriptorSet.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): FileDescriptorSet { - const message = createBaseFileDescriptorSet(); - message.file = object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFileDescriptorProto(): FileDescriptorProto { - return { - name: "", - package: "", - dependency: [], - publicDependency: [], - weakDependency: [], - messageType: [], - enumType: [], - service: [], - extension: [], - options: undefined, - sourceCodeInfo: undefined, - syntax: "", - edition: "", - }; -} - -export const FileDescriptorProto = { - encode(message: FileDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.package !== "") { - writer.uint32(18).string(message.package); - } - for (const v of message.dependency) { - writer.uint32(26).string(v!); - } - writer.uint32(82).fork(); - for (const v of message.publicDependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weakDependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.messageType) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); - } - for (const v of message.service) { - ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); - } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.options !== undefined) { - FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.sourceCodeInfo !== undefined) { - SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(74).fork()).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - if (message.edition !== "") { - writer.uint32(106).string(message.edition); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.package = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.dependency.push(reader.string()); - continue; - case 10: - if (tag === 80) { - message.publicDependency.push(reader.int32()); - - continue; - } - - if (tag === 82) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.publicDependency.push(reader.int32()); - } - - continue; - } - - break; - case 11: - if (tag === 88) { - message.weakDependency.push(reader.int32()); - - continue; - } - - if (tag === 90) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weakDependency.push(reader.int32()); - } - - continue; - } - - break; - case 4: - if (tag !== 34) { - break; - } - - message.messageType.push(DescriptorProto.decode(reader, reader.uint32())); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.service.push(ServiceDescriptorProto.decode(reader, reader.uint32())); - continue; - case 7: - if (tag !== 58) { - break; - } - - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - continue; - case 8: - if (tag !== 66) { - break; - } - - message.options = FileOptions.decode(reader, reader.uint32()); - continue; - case 9: - if (tag !== 74) { - break; - } - - message.sourceCodeInfo = SourceCodeInfo.decode(reader, reader.uint32()); - continue; - case 12: - if (tag !== 98) { - break; - } - - message.syntax = reader.string(); - continue; - case 13: - if (tag !== 106) { - break; - } - - message.edition = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): FileDescriptorProto { - return FileDescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): FileDescriptorProto { - const message = createBaseFileDescriptorProto(); - message.name = object.name ?? ""; - message.package = object.package ?? ""; - message.dependency = object.dependency?.map((e) => e) || []; - message.publicDependency = object.publicDependency?.map((e) => e) || []; - message.weakDependency = object.weakDependency?.map((e) => e) || []; - message.messageType = object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.service = object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? FileOptions.fromPartial(object.options) - : undefined; - message.sourceCodeInfo = (object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null) - ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) - : undefined; - message.syntax = object.syntax ?? ""; - message.edition = object.edition ?? ""; - return message; - }, -}; - -function createBaseDescriptorProto(): DescriptorProto { - return { - name: "", - field: [], - extension: [], - nestedType: [], - enumType: [], - extensionRange: [], - oneofDecl: [], - options: undefined, - reservedRange: [], - reservedName: [], - }; -} - -export const DescriptorProto = { - encode(message: DescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.field) { - FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); - } - for (const v of message.nestedType) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extensionRange) { - DescriptorProto_ExtensionRange.encode(v!, writer.uint32(42).fork()).ldelim(); - } - for (const v of message.oneofDecl) { - OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); - } - if (message.options !== undefined) { - MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); - } - for (const v of message.reservedRange) { - DescriptorProto_ReservedRange.encode(v!, writer.uint32(74).fork()).ldelim(); - } - for (const v of message.reservedName) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.field.push(FieldDescriptorProto.decode(reader, reader.uint32())); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.extension.push(FieldDescriptorProto.decode(reader, reader.uint32())); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.nestedType.push(DescriptorProto.decode(reader, reader.uint32())); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.enumType.push(EnumDescriptorProto.decode(reader, reader.uint32())); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.extensionRange.push(DescriptorProto_ExtensionRange.decode(reader, reader.uint32())); - continue; - case 8: - if (tag !== 66) { - break; - } - - message.oneofDecl.push(OneofDescriptorProto.decode(reader, reader.uint32())); - continue; - case 7: - if (tag !== 58) { - break; - } - - message.options = MessageOptions.decode(reader, reader.uint32()); - continue; - case 9: - if (tag !== 74) { - break; - } - - message.reservedRange.push(DescriptorProto_ReservedRange.decode(reader, reader.uint32())); - continue; - case 10: - if (tag !== 82) { - break; - } - - message.reservedName.push(reader.string()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DescriptorProto { - return DescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DescriptorProto { - const message = createBaseDescriptorProto(); - message.name = object.name ?? ""; - message.field = object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.extension = object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.nestedType = object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.extensionRange = object.extensionRange?.map((e) => DescriptorProto_ExtensionRange.fromPartial(e)) || []; - message.oneofDecl = object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? MessageOptions.fromPartial(object.options) - : undefined; - message.reservedRange = object.reservedRange?.map((e) => DescriptorProto_ReservedRange.fromPartial(e)) || []; - message.reservedName = object.reservedName?.map((e) => e) || []; - return message; - }, -}; - -function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { - return { start: 0, end: 0, options: undefined }; -} - -export const DescriptorProto_ExtensionRange = { - encode(message: DescriptorProto_ExtensionRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== 0) { - writer.uint32(16).int32(message.end); - } - if (message.options !== undefined) { - ExtensionRangeOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ExtensionRange { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ExtensionRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.start = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.end = reader.int32(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.options = ExtensionRangeOptions.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DescriptorProto_ExtensionRange { - return DescriptorProto_ExtensionRange.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DescriptorProto_ExtensionRange { - const message = createBaseDescriptorProto_ExtensionRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - message.options = (object.options !== undefined && object.options !== null) - ? ExtensionRangeOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { - return { start: 0, end: 0 }; -} - -export const DescriptorProto_ReservedRange = { - encode(message: DescriptorProto_ReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== 0) { - writer.uint32(16).int32(message.end); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto_ReservedRange { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ReservedRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.start = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.end = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): DescriptorProto_ReservedRange { - return DescriptorProto_ReservedRange.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): DescriptorProto_ReservedRange { - const message = createBaseDescriptorProto_ReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; - }, -}; - -function createBaseExtensionRangeOptions(): ExtensionRangeOptions { - return { uninterpretedOption: [] }; -} - -export const ExtensionRangeOptions = { - encode(message: ExtensionRangeOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ExtensionRangeOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtensionRangeOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ExtensionRangeOptions { - return ExtensionRangeOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ExtensionRangeOptions { - const message = createBaseExtensionRangeOptions(); - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFieldDescriptorProto(): FieldDescriptorProto { - return { - name: "", - number: 0, - label: 1, - type: 1, - typeName: "", - extendee: "", - defaultValue: "", - oneofIndex: 0, - jsonName: "", - options: undefined, - proto3Optional: false, - }; -} - -export const FieldDescriptorProto = { - encode(message: FieldDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.number !== 0) { - writer.uint32(24).int32(message.number); - } - if (message.label !== 1) { - writer.uint32(32).int32(message.label); - } - if (message.type !== 1) { - writer.uint32(40).int32(message.type); - } - if (message.typeName !== "") { - writer.uint32(50).string(message.typeName); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.defaultValue !== "") { - writer.uint32(58).string(message.defaultValue); - } - if (message.oneofIndex !== 0) { - writer.uint32(72).int32(message.oneofIndex); - } - if (message.jsonName !== "") { - writer.uint32(82).string(message.jsonName); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3Optional === true) { - writer.uint32(136).bool(message.proto3Optional); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FieldDescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.number = reader.int32(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.label = reader.int32() as any; - continue; - case 5: - if (tag !== 40) { - break; - } - - message.type = reader.int32() as any; - continue; - case 6: - if (tag !== 50) { - break; - } - - message.typeName = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.extendee = reader.string(); - continue; - case 7: - if (tag !== 58) { - break; - } - - message.defaultValue = reader.string(); - continue; - case 9: - if (tag !== 72) { - break; - } - - message.oneofIndex = reader.int32(); - continue; - case 10: - if (tag !== 82) { - break; - } - - message.jsonName = reader.string(); - continue; - case 8: - if (tag !== 66) { - break; - } - - message.options = FieldOptions.decode(reader, reader.uint32()); - continue; - case 17: - if (tag !== 136) { - break; - } - - message.proto3Optional = reader.bool(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): FieldDescriptorProto { - return FieldDescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): FieldDescriptorProto { - const message = createBaseFieldDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.label = object.label ?? 1; - message.type = object.type ?? 1; - message.typeName = object.typeName ?? ""; - message.extendee = object.extendee ?? ""; - message.defaultValue = object.defaultValue ?? ""; - message.oneofIndex = object.oneofIndex ?? 0; - message.jsonName = object.jsonName ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? FieldOptions.fromPartial(object.options) - : undefined; - message.proto3Optional = object.proto3Optional ?? false; - return message; - }, -}; - -function createBaseOneofDescriptorProto(): OneofDescriptorProto { - return { name: "", options: undefined }; -} - -export const OneofDescriptorProto = { - encode(message: OneofDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.options !== undefined) { - OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OneofDescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.options = OneofOptions.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): OneofDescriptorProto { - return OneofDescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): OneofDescriptorProto { - const message = createBaseOneofDescriptorProto(); - message.name = object.name ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? OneofOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseEnumDescriptorProto(): EnumDescriptorProto { - return { name: "", value: [], options: undefined, reservedRange: [], reservedName: [] }; -} - -export const EnumDescriptorProto = { - encode(message: EnumDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.value) { - EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.options !== undefined) { - EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.reservedRange) { - EnumDescriptorProto_EnumReservedRange.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.reservedName) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.value.push(EnumValueDescriptorProto.decode(reader, reader.uint32())); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.options = EnumOptions.decode(reader, reader.uint32()); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.reservedRange.push(EnumDescriptorProto_EnumReservedRange.decode(reader, reader.uint32())); - continue; - case 5: - if (tag !== 42) { - break; - } - - message.reservedName.push(reader.string()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): EnumDescriptorProto { - return EnumDescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto { - const message = createBaseEnumDescriptorProto(); - message.name = object.name ?? ""; - message.value = object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? EnumOptions.fromPartial(object.options) - : undefined; - message.reservedRange = object.reservedRange?.map((e) => EnumDescriptorProto_EnumReservedRange.fromPartial(e)) || - []; - message.reservedName = object.reservedName?.map((e) => e) || []; - return message; - }, -}; - -function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { - return { start: 0, end: 0 }; -} - -export const EnumDescriptorProto_EnumReservedRange = { - encode(message: EnumDescriptorProto_EnumReservedRange, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== 0) { - writer.uint32(16).int32(message.end); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.start = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.end = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): EnumDescriptorProto_EnumReservedRange { - return EnumDescriptorProto_EnumReservedRange.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): EnumDescriptorProto_EnumReservedRange { - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; - }, -}; - -function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { - return { name: "", number: 0, options: undefined }; -} - -export const EnumValueDescriptorProto = { - encode(message: EnumValueDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.number !== 0) { - writer.uint32(16).int32(message.number); - } - if (message.options !== undefined) { - EnumValueOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueDescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.number = reader.int32(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.options = EnumValueOptions.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): EnumValueDescriptorProto { - return EnumValueDescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): EnumValueDescriptorProto { - const message = createBaseEnumValueDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.options = (object.options !== undefined && object.options !== null) - ? EnumValueOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseServiceDescriptorProto(): ServiceDescriptorProto { - return { name: "", method: [], options: undefined }; -} - -export const ServiceDescriptorProto = { - encode(message: ServiceDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.method) { - MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.options !== undefined) { - ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ServiceDescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.method.push(MethodDescriptorProto.decode(reader, reader.uint32())); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.options = ServiceOptions.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ServiceDescriptorProto { - return ServiceDescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ServiceDescriptorProto { - const message = createBaseServiceDescriptorProto(); - message.name = object.name ?? ""; - message.method = object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; - message.options = (object.options !== undefined && object.options !== null) - ? ServiceOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseMethodDescriptorProto(): MethodDescriptorProto { - return { - name: "", - inputType: "", - outputType: "", - options: undefined, - clientStreaming: false, - serverStreaming: false, - }; -} - -export const MethodDescriptorProto = { - encode(message: MethodDescriptorProto, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.inputType !== "") { - writer.uint32(18).string(message.inputType); - } - if (message.outputType !== "") { - writer.uint32(26).string(message.outputType); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.clientStreaming === true) { - writer.uint32(40).bool(message.clientStreaming); - } - if (message.serverStreaming === true) { - writer.uint32(48).bool(message.serverStreaming); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MethodDescriptorProto { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.name = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.inputType = reader.string(); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.outputType = reader.string(); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.options = MethodOptions.decode(reader, reader.uint32()); - continue; - case 5: - if (tag !== 40) { - break; - } - - message.clientStreaming = reader.bool(); - continue; - case 6: - if (tag !== 48) { - break; - } - - message.serverStreaming = reader.bool(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): MethodDescriptorProto { - return MethodDescriptorProto.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): MethodDescriptorProto { - const message = createBaseMethodDescriptorProto(); - message.name = object.name ?? ""; - message.inputType = object.inputType ?? ""; - message.outputType = object.outputType ?? ""; - message.options = (object.options !== undefined && object.options !== null) - ? MethodOptions.fromPartial(object.options) - : undefined; - message.clientStreaming = object.clientStreaming ?? false; - message.serverStreaming = object.serverStreaming ?? false; - return message; - }, -}; - -function createBaseFileOptions(): FileOptions { - return { - javaPackage: "", - javaOuterClassname: "", - javaMultipleFiles: false, - javaGenerateEqualsAndHash: false, - javaStringCheckUtf8: false, - optimizeFor: 1, - goPackage: "", - ccGenericServices: false, - javaGenericServices: false, - pyGenericServices: false, - phpGenericServices: false, - deprecated: false, - ccEnableArenas: false, - objcClassPrefix: "", - csharpNamespace: "", - swiftPrefix: "", - phpClassPrefix: "", - phpNamespace: "", - phpMetadataNamespace: "", - rubyPackage: "", - uninterpretedOption: [], - }; -} - -export const FileOptions = { - encode(message: FileOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.javaPackage !== "") { - writer.uint32(10).string(message.javaPackage); - } - if (message.javaOuterClassname !== "") { - writer.uint32(66).string(message.javaOuterClassname); - } - if (message.javaMultipleFiles === true) { - writer.uint32(80).bool(message.javaMultipleFiles); - } - if (message.javaGenerateEqualsAndHash === true) { - writer.uint32(160).bool(message.javaGenerateEqualsAndHash); - } - if (message.javaStringCheckUtf8 === true) { - writer.uint32(216).bool(message.javaStringCheckUtf8); - } - if (message.optimizeFor !== 1) { - writer.uint32(72).int32(message.optimizeFor); - } - if (message.goPackage !== "") { - writer.uint32(90).string(message.goPackage); - } - if (message.ccGenericServices === true) { - writer.uint32(128).bool(message.ccGenericServices); - } - if (message.javaGenericServices === true) { - writer.uint32(136).bool(message.javaGenericServices); - } - if (message.pyGenericServices === true) { - writer.uint32(144).bool(message.pyGenericServices); - } - if (message.phpGenericServices === true) { - writer.uint32(336).bool(message.phpGenericServices); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.ccEnableArenas === true) { - writer.uint32(248).bool(message.ccEnableArenas); - } - if (message.objcClassPrefix !== "") { - writer.uint32(290).string(message.objcClassPrefix); - } - if (message.csharpNamespace !== "") { - writer.uint32(298).string(message.csharpNamespace); - } - if (message.swiftPrefix !== "") { - writer.uint32(314).string(message.swiftPrefix); - } - if (message.phpClassPrefix !== "") { - writer.uint32(322).string(message.phpClassPrefix); - } - if (message.phpNamespace !== "") { - writer.uint32(330).string(message.phpNamespace); - } - if (message.phpMetadataNamespace !== "") { - writer.uint32(354).string(message.phpMetadataNamespace); - } - if (message.rubyPackage !== "") { - writer.uint32(362).string(message.rubyPackage); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.javaPackage = reader.string(); - continue; - case 8: - if (tag !== 66) { - break; - } - - message.javaOuterClassname = reader.string(); - continue; - case 10: - if (tag !== 80) { - break; - } - - message.javaMultipleFiles = reader.bool(); - continue; - case 20: - if (tag !== 160) { - break; - } - - message.javaGenerateEqualsAndHash = reader.bool(); - continue; - case 27: - if (tag !== 216) { - break; - } - - message.javaStringCheckUtf8 = reader.bool(); - continue; - case 9: - if (tag !== 72) { - break; - } - - message.optimizeFor = reader.int32() as any; - continue; - case 11: - if (tag !== 90) { - break; - } - - message.goPackage = reader.string(); - continue; - case 16: - if (tag !== 128) { - break; - } - - message.ccGenericServices = reader.bool(); - continue; - case 17: - if (tag !== 136) { - break; - } - - message.javaGenericServices = reader.bool(); - continue; - case 18: - if (tag !== 144) { - break; - } - - message.pyGenericServices = reader.bool(); - continue; - case 42: - if (tag !== 336) { - break; - } - - message.phpGenericServices = reader.bool(); - continue; - case 23: - if (tag !== 184) { - break; - } - - message.deprecated = reader.bool(); - continue; - case 31: - if (tag !== 248) { - break; - } - - message.ccEnableArenas = reader.bool(); - continue; - case 36: - if (tag !== 290) { - break; - } - - message.objcClassPrefix = reader.string(); - continue; - case 37: - if (tag !== 298) { - break; - } - - message.csharpNamespace = reader.string(); - continue; - case 39: - if (tag !== 314) { - break; - } - - message.swiftPrefix = reader.string(); - continue; - case 40: - if (tag !== 322) { - break; - } - - message.phpClassPrefix = reader.string(); - continue; - case 41: - if (tag !== 330) { - break; - } - - message.phpNamespace = reader.string(); - continue; - case 44: - if (tag !== 354) { - break; - } - - message.phpMetadataNamespace = reader.string(); - continue; - case 45: - if (tag !== 362) { - break; - } - - message.rubyPackage = reader.string(); - continue; - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): FileOptions { - return FileOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): FileOptions { - const message = createBaseFileOptions(); - message.javaPackage = object.javaPackage ?? ""; - message.javaOuterClassname = object.javaOuterClassname ?? ""; - message.javaMultipleFiles = object.javaMultipleFiles ?? false; - message.javaGenerateEqualsAndHash = object.javaGenerateEqualsAndHash ?? false; - message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; - message.optimizeFor = object.optimizeFor ?? 1; - message.goPackage = object.goPackage ?? ""; - message.ccGenericServices = object.ccGenericServices ?? false; - message.javaGenericServices = object.javaGenericServices ?? false; - message.pyGenericServices = object.pyGenericServices ?? false; - message.phpGenericServices = object.phpGenericServices ?? false; - message.deprecated = object.deprecated ?? false; - message.ccEnableArenas = object.ccEnableArenas ?? false; - message.objcClassPrefix = object.objcClassPrefix ?? ""; - message.csharpNamespace = object.csharpNamespace ?? ""; - message.swiftPrefix = object.swiftPrefix ?? ""; - message.phpClassPrefix = object.phpClassPrefix ?? ""; - message.phpNamespace = object.phpNamespace ?? ""; - message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; - message.rubyPackage = object.rubyPackage ?? ""; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseMessageOptions(): MessageOptions { - return { - messageSetWireFormat: false, - noStandardDescriptorAccessor: false, - deprecated: false, - mapEntry: false, - deprecatedLegacyJsonFieldConflicts: false, - uninterpretedOption: [], - }; -} - -export const MessageOptions = { - encode(message: MessageOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.messageSetWireFormat === true) { - writer.uint32(8).bool(message.messageSetWireFormat); - } - if (message.noStandardDescriptorAccessor === true) { - writer.uint32(16).bool(message.noStandardDescriptorAccessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.mapEntry === true) { - writer.uint32(56).bool(message.mapEntry); - } - if (message.deprecatedLegacyJsonFieldConflicts === true) { - writer.uint32(88).bool(message.deprecatedLegacyJsonFieldConflicts); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessageOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.messageSetWireFormat = reader.bool(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.noStandardDescriptorAccessor = reader.bool(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.deprecated = reader.bool(); - continue; - case 7: - if (tag !== 56) { - break; - } - - message.mapEntry = reader.bool(); - continue; - case 11: - if (tag !== 88) { - break; - } - - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - continue; - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): MessageOptions { - return MessageOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): MessageOptions { - const message = createBaseMessageOptions(); - message.messageSetWireFormat = object.messageSetWireFormat ?? false; - message.noStandardDescriptorAccessor = object.noStandardDescriptorAccessor ?? false; - message.deprecated = object.deprecated ?? false; - message.mapEntry = object.mapEntry ?? false; - message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFieldOptions(): FieldOptions { - return { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - unverifiedLazy: false, - deprecated: false, - weak: false, - debugRedact: false, - retention: 0, - target: 0, - uninterpretedOption: [], - }; -} - -export const FieldOptions = { - encode(message: FieldOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.ctype !== 0) { - writer.uint32(8).int32(message.ctype); - } - if (message.packed === true) { - writer.uint32(16).bool(message.packed); - } - if (message.jstype !== 0) { - writer.uint32(48).int32(message.jstype); - } - if (message.lazy === true) { - writer.uint32(40).bool(message.lazy); - } - if (message.unverifiedLazy === true) { - writer.uint32(120).bool(message.unverifiedLazy); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.weak === true) { - writer.uint32(80).bool(message.weak); - } - if (message.debugRedact === true) { - writer.uint32(128).bool(message.debugRedact); - } - if (message.retention !== 0) { - writer.uint32(136).int32(message.retention); - } - if (message.target !== 0) { - writer.uint32(144).int32(message.target); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.ctype = reader.int32() as any; - continue; - case 2: - if (tag !== 16) { - break; - } - - message.packed = reader.bool(); - continue; - case 6: - if (tag !== 48) { - break; - } - - message.jstype = reader.int32() as any; - continue; - case 5: - if (tag !== 40) { - break; - } - - message.lazy = reader.bool(); - continue; - case 15: - if (tag !== 120) { - break; - } - - message.unverifiedLazy = reader.bool(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.deprecated = reader.bool(); - continue; - case 10: - if (tag !== 80) { - break; - } - - message.weak = reader.bool(); - continue; - case 16: - if (tag !== 128) { - break; - } - - message.debugRedact = reader.bool(); - continue; - case 17: - if (tag !== 136) { - break; - } - - message.retention = reader.int32() as any; - continue; - case 18: - if (tag !== 144) { - break; - } - - message.target = reader.int32() as any; - continue; - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): FieldOptions { - return FieldOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): FieldOptions { - const message = createBaseFieldOptions(); - message.ctype = object.ctype ?? 0; - message.packed = object.packed ?? false; - message.jstype = object.jstype ?? 0; - message.lazy = object.lazy ?? false; - message.unverifiedLazy = object.unverifiedLazy ?? false; - message.deprecated = object.deprecated ?? false; - message.weak = object.weak ?? false; - message.debugRedact = object.debugRedact ?? false; - message.retention = object.retention ?? 0; - message.target = object.target ?? 0; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseOneofOptions(): OneofOptions { - return { uninterpretedOption: [] }; -} - -export const OneofOptions = { - encode(message: OneofOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): OneofOptions { - return OneofOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): OneofOptions { - const message = createBaseOneofOptions(); - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseEnumOptions(): EnumOptions { - return { allowAlias: false, deprecated: false, deprecatedLegacyJsonFieldConflicts: false, uninterpretedOption: [] }; -} - -export const EnumOptions = { - encode(message: EnumOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.allowAlias === true) { - writer.uint32(16).bool(message.allowAlias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.deprecatedLegacyJsonFieldConflicts === true) { - writer.uint32(48).bool(message.deprecatedLegacyJsonFieldConflicts); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (tag !== 16) { - break; - } - - message.allowAlias = reader.bool(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.deprecated = reader.bool(); - continue; - case 6: - if (tag !== 48) { - break; - } - - message.deprecatedLegacyJsonFieldConflicts = reader.bool(); - continue; - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): EnumOptions { - return EnumOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): EnumOptions { - const message = createBaseEnumOptions(); - message.allowAlias = object.allowAlias ?? false; - message.deprecated = object.deprecated ?? false; - message.deprecatedLegacyJsonFieldConflicts = object.deprecatedLegacyJsonFieldConflicts ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseEnumValueOptions(): EnumValueOptions { - return { deprecated: false, uninterpretedOption: [] }; -} - -export const EnumValueOptions = { - encode(message: EnumValueOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.deprecated = reader.bool(); - continue; - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): EnumValueOptions { - return EnumValueOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): EnumValueOptions { - const message = createBaseEnumValueOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseServiceOptions(): ServiceOptions { - return { deprecated: false, uninterpretedOption: [] }; -} - -export const ServiceOptions = { - encode(message: ServiceOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - if (tag !== 264) { - break; - } - - message.deprecated = reader.bool(); - continue; - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ServiceOptions { - return ServiceOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ServiceOptions { - const message = createBaseServiceOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseMethodOptions(): MethodOptions { - return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; -} - -export const MethodOptions = { - encode(message: MethodOptions, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotencyLevel !== 0) { - writer.uint32(272).int32(message.idempotencyLevel); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - if (tag !== 264) { - break; - } - - message.deprecated = reader.bool(); - continue; - case 34: - if (tag !== 272) { - break; - } - - message.idempotencyLevel = reader.int32() as any; - continue; - case 999: - if (tag !== 7994) { - break; - } - - message.uninterpretedOption.push(UninterpretedOption.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): MethodOptions { - return MethodOptions.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): MethodOptions { - const message = createBaseMethodOptions(); - message.deprecated = object.deprecated ?? false; - message.idempotencyLevel = object.idempotencyLevel ?? 0; - message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseUninterpretedOption(): UninterpretedOption { - return { - name: [], - identifierValue: "", - positiveIntValue: 0, - negativeIntValue: 0, - doubleValue: 0, - stringValue: new Uint8Array(0), - aggregateValue: "", - }; -} - -export const UninterpretedOption = { - encode(message: UninterpretedOption, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.identifierValue !== "") { - writer.uint32(26).string(message.identifierValue); - } - if (message.positiveIntValue !== 0) { - writer.uint32(32).uint64(message.positiveIntValue); - } - if (message.negativeIntValue !== 0) { - writer.uint32(40).int64(message.negativeIntValue); - } - if (message.doubleValue !== 0) { - writer.uint32(49).double(message.doubleValue); - } - if (message.stringValue.length !== 0) { - writer.uint32(58).bytes(message.stringValue); - } - if (message.aggregateValue !== "") { - writer.uint32(66).string(message.aggregateValue); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (tag !== 18) { - break; - } - - message.name.push(UninterpretedOption_NamePart.decode(reader, reader.uint32())); - continue; - case 3: - if (tag !== 26) { - break; - } - - message.identifierValue = reader.string(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.positiveIntValue = longToNumber(reader.uint64() as Long); - continue; - case 5: - if (tag !== 40) { - break; - } - - message.negativeIntValue = longToNumber(reader.int64() as Long); - continue; - case 6: - if (tag !== 49) { - break; - } - - message.doubleValue = reader.double(); - continue; - case 7: - if (tag !== 58) { - break; - } - - message.stringValue = reader.bytes(); - continue; - case 8: - if (tag !== 66) { - break; - } - - message.aggregateValue = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UninterpretedOption { - return UninterpretedOption.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UninterpretedOption { - const message = createBaseUninterpretedOption(); - message.name = object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || []; - message.identifierValue = object.identifierValue ?? ""; - message.positiveIntValue = object.positiveIntValue ?? 0; - message.negativeIntValue = object.negativeIntValue ?? 0; - message.doubleValue = object.doubleValue ?? 0; - message.stringValue = object.stringValue ?? new Uint8Array(0); - message.aggregateValue = object.aggregateValue ?? ""; - return message; - }, -}; - -function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { - return { namePart: "", isExtension: false }; -} - -export const UninterpretedOption_NamePart = { - encode(message: UninterpretedOption_NamePart, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.namePart !== "") { - writer.uint32(10).string(message.namePart); - } - if (message.isExtension === true) { - writer.uint32(16).bool(message.isExtension); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption_NamePart { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption_NamePart(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.namePart = reader.string(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.isExtension = reader.bool(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UninterpretedOption_NamePart { - return UninterpretedOption_NamePart.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UninterpretedOption_NamePart { - const message = createBaseUninterpretedOption_NamePart(); - message.namePart = object.namePart ?? ""; - message.isExtension = object.isExtension ?? false; - return message; - }, -}; - -function createBaseSourceCodeInfo(): SourceCodeInfo { - return { location: [] }; -} - -export const SourceCodeInfo = { - encode(message: SourceCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.location.push(SourceCodeInfo_Location.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): SourceCodeInfo { - return SourceCodeInfo.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): SourceCodeInfo { - const message = createBaseSourceCodeInfo(); - message.location = object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { - return { path: [], span: [], leadingComments: "", trailingComments: "", leadingDetachedComments: [] }; -} - -export const SourceCodeInfo_Location = { - encode(message: SourceCodeInfo_Location, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(18).fork(); - for (const v of message.span) { - writer.int32(v); - } - writer.ldelim(); - if (message.leadingComments !== "") { - writer.uint32(26).string(message.leadingComments); - } - if (message.trailingComments !== "") { - writer.uint32(34).string(message.trailingComments); - } - for (const v of message.leadingDetachedComments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo_Location { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo_Location(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag === 8) { - message.path.push(reader.int32()); - - continue; - } - - if (tag === 10) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - - continue; - } - - break; - case 2: - if (tag === 16) { - message.span.push(reader.int32()); - - continue; - } - - if (tag === 18) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.span.push(reader.int32()); - } - - continue; - } - - break; - case 3: - if (tag !== 26) { - break; - } - - message.leadingComments = reader.string(); - continue; - case 4: - if (tag !== 34) { - break; - } - - message.trailingComments = reader.string(); - continue; - case 6: - if (tag !== 50) { - break; - } - - message.leadingDetachedComments.push(reader.string()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): SourceCodeInfo_Location { - return SourceCodeInfo_Location.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): SourceCodeInfo_Location { - const message = createBaseSourceCodeInfo_Location(); - message.path = object.path?.map((e) => e) || []; - message.span = object.span?.map((e) => e) || []; - message.leadingComments = object.leadingComments ?? ""; - message.trailingComments = object.trailingComments ?? ""; - message.leadingDetachedComments = object.leadingDetachedComments?.map((e) => e) || []; - return message; - }, -}; - -function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { - return { annotation: [] }; -} - -export const GeneratedCodeInfo = { - encode(message: GeneratedCodeInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.annotation.push(GeneratedCodeInfo_Annotation.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GeneratedCodeInfo { - return GeneratedCodeInfo.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GeneratedCodeInfo { - const message = createBaseGeneratedCodeInfo(); - message.annotation = object.annotation?.map((e) => GeneratedCodeInfo_Annotation.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { - return { path: [], sourceFile: "", begin: 0, end: 0, semantic: 0 }; -} - -export const GeneratedCodeInfo_Annotation = { - encode(message: GeneratedCodeInfo_Annotation, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.sourceFile !== "") { - writer.uint32(18).string(message.sourceFile); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - if (message.semantic !== 0) { - writer.uint32(40).int32(message.semantic); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo_Annotation { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo_Annotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag === 8) { - message.path.push(reader.int32()); - - continue; - } - - if (tag === 10) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - - continue; - } - - break; - case 2: - if (tag !== 18) { - break; - } - - message.sourceFile = reader.string(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.begin = reader.int32(); - continue; - case 4: - if (tag !== 32) { - break; - } - - message.end = reader.int32(); - continue; - case 5: - if (tag !== 40) { - break; - } - - message.semantic = reader.int32() as any; - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): GeneratedCodeInfo_Annotation { - return GeneratedCodeInfo_Annotation.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): GeneratedCodeInfo_Annotation { - const message = createBaseGeneratedCodeInfo_Annotation(); - message.path = object.path?.map((e) => e) || []; - message.sourceFile = object.sourceFile ?? ""; - message.begin = object.begin ?? 0; - message.end = object.end ?? 0; - message.semantic = object.semantic ?? 0; - return message; - }, -}; - -declare const self: any | undefined; -declare const window: any | undefined; -declare const global: any | undefined; -const tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/web/src/types/proto/google/protobuf/duration.ts b/web/src/types/proto/google/protobuf/duration.ts deleted file mode 100644 index 0d723a1e1b18e..0000000000000 --- a/web/src/types/proto/google/protobuf/duration.ts +++ /dev/null @@ -1,178 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Duration represents a signed, fixed-length span of time represented - * as a count of seconds and fractions of seconds at nanosecond - * resolution. It is independent of any calendar and concepts like "day" - * or "month". It is related to Timestamp in that the difference between - * two Timestamp values is a Duration and it can be added or subtracted - * from a Timestamp. Range is approximately +-10,000 years. - * - * # Examples - * - * Example 1: Compute Duration from two Timestamps in pseudo code. - * - * Timestamp start = ...; - * Timestamp end = ...; - * Duration duration = ...; - * - * duration.seconds = end.seconds - start.seconds; - * duration.nanos = end.nanos - start.nanos; - * - * if (duration.seconds < 0 && duration.nanos > 0) { - * duration.seconds += 1; - * duration.nanos -= 1000000000; - * } else if (duration.seconds > 0 && duration.nanos < 0) { - * duration.seconds -= 1; - * duration.nanos += 1000000000; - * } - * - * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. - * - * Timestamp start = ...; - * Duration duration = ...; - * Timestamp end = ...; - * - * end.seconds = start.seconds + duration.seconds; - * end.nanos = start.nanos + duration.nanos; - * - * if (end.nanos < 0) { - * end.seconds -= 1; - * end.nanos += 1000000000; - * } else if (end.nanos >= 1000000000) { - * end.seconds += 1; - * end.nanos -= 1000000000; - * } - * - * Example 3: Compute Duration from datetime.timedelta in Python. - * - * td = datetime.timedelta(days=3, minutes=10) - * duration = Duration() - * duration.FromTimedelta(td) - * - * # JSON Mapping - * - * In JSON format, the Duration type is encoded as a string rather than an - * object, where the string ends in the suffix "s" (indicating seconds) and - * is preceded by the number of seconds, with nanoseconds expressed as - * fractional seconds. For example, 3 seconds with 0 nanoseconds should be - * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should - * be expressed in JSON format as "3.000000001s", and 3 seconds and 1 - * microsecond should be expressed in JSON format as "3.000001s". - */ -export interface Duration { - /** - * Signed seconds of the span of time. Must be from -315,576,000,000 - * to +315,576,000,000 inclusive. Note: these bounds are computed from: - * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - */ - seconds: number; - /** - * Signed fractions of a second at nanosecond resolution of the span - * of time. Durations less than one second are represented with a 0 - * `seconds` field and a positive or negative `nanos` field. For durations - * of one second or more, a non-zero value for the `nanos` field must be - * of the same sign as the `seconds` field. Must be from -999,999,999 - * to +999,999,999 inclusive. - */ - nanos: number; -} - -function createBaseDuration(): Duration { - return { seconds: 0, nanos: 0 }; -} - -export const Duration = { - encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Duration { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDuration(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.seconds = longToNumber(reader.int64() as Long); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.nanos = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Duration { - return Duration.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Duration { - const message = createBaseDuration(); - message.seconds = object.seconds ?? 0; - message.nanos = object.nanos ?? 0; - return message; - }, -}; - -declare const self: any | undefined; -declare const window: any | undefined; -declare const global: any | undefined; -const tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/web/src/types/proto/google/protobuf/field_mask.ts b/web/src/types/proto/google/protobuf/field_mask.ts deleted file mode 100644 index 42e644700d549..0000000000000 --- a/web/src/types/proto/google/protobuf/field_mask.ts +++ /dev/null @@ -1,272 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * `FieldMask` represents a set of symbolic field paths, for example: - * - * paths: "f.a" - * paths: "f.b.d" - * - * Here `f` represents a field in some root message, `a` and `b` - * fields in the message found in `f`, and `d` a field found in the - * message in `f.b`. - * - * Field masks are used to specify a subset of fields that should be - * returned by a get operation or modified by an update operation. - * Field masks also have a custom JSON encoding (see below). - * - * # Field Masks in Projections - * - * When used in the context of a projection, a response message or - * sub-message is filtered by the API to only contain those fields as - * specified in the mask. For example, if the mask in the previous - * example is applied to a response message as follows: - * - * f { - * a : 22 - * b { - * d : 1 - * x : 2 - * } - * y : 13 - * } - * z: 8 - * - * The result will not contain specific values for fields x,y and z - * (their value will be set to the default, and omitted in proto text - * output): - * - * f { - * a : 22 - * b { - * d : 1 - * } - * } - * - * A repeated field is not allowed except at the last position of a - * paths string. - * - * If a FieldMask object is not present in a get operation, the - * operation applies to all fields (as if a FieldMask of all fields - * had been specified). - * - * Note that a field mask does not necessarily apply to the - * top-level response message. In case of a REST get operation, the - * field mask applies directly to the response, but in case of a REST - * list operation, the mask instead applies to each individual message - * in the returned resource list. In case of a REST custom method, - * other definitions may be used. Where the mask applies will be - * clearly documented together with its declaration in the API. In - * any case, the effect on the returned resource/resources is required - * behavior for APIs. - * - * # Field Masks in Update Operations - * - * A field mask in update operations specifies which fields of the - * targeted resource are going to be updated. The API is required - * to only change the values of the fields as specified in the mask - * and leave the others untouched. If a resource is passed in to - * describe the updated values, the API ignores the values of all - * fields not covered by the mask. - * - * If a repeated field is specified for an update operation, new values will - * be appended to the existing repeated field in the target resource. Note that - * a repeated field is only allowed in the last position of a `paths` string. - * - * If a sub-message is specified in the last position of the field mask for an - * update operation, then new value will be merged into the existing sub-message - * in the target resource. - * - * For example, given the target message: - * - * f { - * b { - * d: 1 - * x: 2 - * } - * c: [1] - * } - * - * And an update message: - * - * f { - * b { - * d: 10 - * } - * c: [2] - * } - * - * then if the field mask is: - * - * paths: ["f.b", "f.c"] - * - * then the result will be: - * - * f { - * b { - * d: 10 - * x: 2 - * } - * c: [1, 2] - * } - * - * An implementation may provide options to override this default behavior for - * repeated and message fields. - * - * In order to reset a field's value to the default, the field must - * be in the mask and set to the default value in the provided resource. - * Hence, in order to reset all fields of a resource, provide a default - * instance of the resource and set all fields in the mask, or do - * not provide a mask as described below. - * - * If a field mask is not present on update, the operation applies to - * all fields (as if a field mask of all fields has been specified). - * Note that in the presence of schema evolution, this may mean that - * fields the client does not know and has therefore not filled into - * the request will be reset to their default. If this is unwanted - * behavior, a specific service may require a client to always specify - * a field mask, producing an error if not. - * - * As with get operations, the location of the resource which - * describes the updated values in the request message depends on the - * operation kind. In any case, the effect of the field mask is - * required to be honored by the API. - * - * ## Considerations for HTTP REST - * - * The HTTP kind of an update operation which uses a field mask must - * be set to PATCH instead of PUT in order to satisfy HTTP semantics - * (PUT must only be used for full updates). - * - * # JSON Encoding of Field Masks - * - * In JSON, a field mask is encoded as a single string where paths are - * separated by a comma. Fields name in each path are converted - * to/from lower-camel naming conventions. - * - * As an example, consider the following message declarations: - * - * message Profile { - * User user = 1; - * Photo photo = 2; - * } - * message User { - * string display_name = 1; - * string address = 2; - * } - * - * In proto a field mask for `Profile` may look as such: - * - * mask { - * paths: "user.display_name" - * paths: "photo" - * } - * - * In JSON, the same mask is represented as below: - * - * { - * mask: "user.displayName,photo" - * } - * - * # Field Masks and Oneof Fields - * - * Field masks treat fields in oneofs just as regular fields. Consider the - * following message: - * - * message SampleMessage { - * oneof test_oneof { - * string name = 4; - * SubMessage sub_message = 9; - * } - * } - * - * The field mask can be: - * - * mask { - * paths: "name" - * } - * - * Or: - * - * mask { - * paths: "sub_message" - * } - * - * Note that oneof type names ("test_oneof" in this case) cannot be used in - * paths. - * - * ## Field Mask Verification - * - * The implementation of any API method which has a FieldMask type field in the - * request should verify the included field paths, and return an - * `INVALID_ARGUMENT` error if any path is unmappable. - */ -export interface FieldMask { - /** The set of field mask paths. */ - paths: string[]; -} - -function createBaseFieldMask(): FieldMask { - return { paths: [] }; -} - -export const FieldMask = { - encode(message: FieldMask, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.paths) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FieldMask { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldMask(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.paths.push(reader.string()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): FieldMask { - return FieldMask.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): FieldMask { - const message = createBaseFieldMask(); - message.paths = object.paths?.map((e) => e) || []; - return message; - }, - - wrap(paths: string[]): FieldMask { - const result = createBaseFieldMask(); - result.paths = paths; - return result; - }, - - unwrap(message: FieldMask): string[] { - return message.paths; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/web/src/types/proto/google/protobuf/timestamp.ts b/web/src/types/proto/google/protobuf/timestamp.ts deleted file mode 100644 index cdf3e4d792bb8..0000000000000 --- a/web/src/types/proto/google/protobuf/timestamp.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * A Timestamp represents a point in time independent of any time zone or local - * calendar, encoded as a count of seconds and fractions of seconds at - * nanosecond resolution. The count is relative to an epoch at UTC midnight on - * January 1, 1970, in the proleptic Gregorian calendar which extends the - * Gregorian calendar backwards to year one. - * - * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap - * second table is needed for interpretation, using a [24-hour linear - * smear](https://developers.google.com/time/smear). - * - * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By - * restricting to that range, we ensure that we can convert to and from [RFC - * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. - * - * # Examples - * - * Example 1: Compute Timestamp from POSIX `time()`. - * - * Timestamp timestamp; - * timestamp.set_seconds(time(NULL)); - * timestamp.set_nanos(0); - * - * Example 2: Compute Timestamp from POSIX `gettimeofday()`. - * - * struct timeval tv; - * gettimeofday(&tv, NULL); - * - * Timestamp timestamp; - * timestamp.set_seconds(tv.tv_sec); - * timestamp.set_nanos(tv.tv_usec * 1000); - * - * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. - * - * FILETIME ft; - * GetSystemTimeAsFileTime(&ft); - * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; - * - * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z - * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. - * Timestamp timestamp; - * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); - * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); - * - * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. - * - * long millis = System.currentTimeMillis(); - * - * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) - * .setNanos((int) ((millis % 1000) * 1000000)).build(); - * - * Example 5: Compute Timestamp from Java `Instant.now()`. - * - * Instant now = Instant.now(); - * - * Timestamp timestamp = - * Timestamp.newBuilder().setSeconds(now.getEpochSecond()) - * .setNanos(now.getNano()).build(); - * - * Example 6: Compute Timestamp from current time in Python. - * - * timestamp = Timestamp() - * timestamp.GetCurrentTime() - * - * # JSON Mapping - * - * In JSON format, the Timestamp type is encoded as a string in the - * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the - * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" - * where {year} is always expressed using four digits while {month}, {day}, - * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional - * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), - * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone - * is required. A proto3 JSON serializer should always use UTC (as indicated by - * "Z") when printing the Timestamp type and a proto3 JSON parser should be - * able to accept both UTC and other timezones (as indicated by an offset). - * - * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past - * 01:30 UTC on January 15, 2017. - * - * In JavaScript, one can convert a Date object to this format using the - * standard - * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) - * method. In Python, a standard `datetime.datetime` object can be converted - * to this format using - * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with - * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use - * the Joda Time's [`ISODateTimeFormat.dateTime()`]( - * http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D - * ) to obtain a formatter capable of generating timestamps in this format. - */ -export interface Timestamp { - /** - * Represents seconds of UTC time since Unix epoch - * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - * 9999-12-31T23:59:59Z inclusive. - */ - seconds: number; - /** - * Non-negative fractions of a second at nanosecond resolution. Negative - * second values with fractions must still have non-negative nanos values - * that count forward in time. Must be from 0 to 999,999,999 - * inclusive. - */ - nanos: number; -} - -function createBaseTimestamp(): Timestamp { - return { seconds: 0, nanos: 0 }; -} - -export const Timestamp = { - encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.seconds !== 0) { - writer.uint32(8).int64(message.seconds); - } - if (message.nanos !== 0) { - writer.uint32(16).int32(message.nanos); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTimestamp(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.seconds = longToNumber(reader.int64() as Long); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.nanos = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): Timestamp { - return Timestamp.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): Timestamp { - const message = createBaseTimestamp(); - message.seconds = object.seconds ?? 0; - message.nanos = object.nanos ?? 0; - return message; - }, -}; - -declare const self: any | undefined; -declare const window: any | undefined; -declare const global: any | undefined; -const tsProtoGlobalThis: any = (() => { - if (typeof globalThis !== "undefined") { - return globalThis; - } - if (typeof self !== "undefined") { - return self; - } - if (typeof window !== "undefined") { - return window; - } - if (typeof global !== "undefined") { - return global; - } - throw "Unable to locate global object"; -})(); - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; - -function longToNumber(long: Long): number { - if (long.gt(Number.MAX_SAFE_INTEGER)) { - throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); - } - return long.toNumber(); -} - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} diff --git a/web/src/types/proto/store/activity.ts b/web/src/types/proto/store/activity.ts deleted file mode 100644 index 4248b389bdb9a..0000000000000 --- a/web/src/types/proto/store/activity.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "memos.store"; - -export interface ActivityMemoCommentPayload { - memoId: number; - relatedMemoId: number; -} - -export interface ActivityVersionUpdatePayload { - version: string; -} - -export interface ActivityPayload { - memoComment?: ActivityMemoCommentPayload | undefined; - versionUpdate?: ActivityVersionUpdatePayload | undefined; -} - -function createBaseActivityMemoCommentPayload(): ActivityMemoCommentPayload { - return { memoId: 0, relatedMemoId: 0 }; -} - -export const ActivityMemoCommentPayload = { - encode(message: ActivityMemoCommentPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.memoId !== 0) { - writer.uint32(8).int32(message.memoId); - } - if (message.relatedMemoId !== 0) { - writer.uint32(16).int32(message.relatedMemoId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ActivityMemoCommentPayload { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseActivityMemoCommentPayload(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.memoId = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.relatedMemoId = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ActivityMemoCommentPayload { - return ActivityMemoCommentPayload.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ActivityMemoCommentPayload { - const message = createBaseActivityMemoCommentPayload(); - message.memoId = object.memoId ?? 0; - message.relatedMemoId = object.relatedMemoId ?? 0; - return message; - }, -}; - -function createBaseActivityVersionUpdatePayload(): ActivityVersionUpdatePayload { - return { version: "" }; -} - -export const ActivityVersionUpdatePayload = { - encode(message: ActivityVersionUpdatePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.version !== "") { - writer.uint32(10).string(message.version); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ActivityVersionUpdatePayload { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseActivityVersionUpdatePayload(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.version = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ActivityVersionUpdatePayload { - return ActivityVersionUpdatePayload.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ActivityVersionUpdatePayload { - const message = createBaseActivityVersionUpdatePayload(); - message.version = object.version ?? ""; - return message; - }, -}; - -function createBaseActivityPayload(): ActivityPayload { - return { memoComment: undefined, versionUpdate: undefined }; -} - -export const ActivityPayload = { - encode(message: ActivityPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.memoComment !== undefined) { - ActivityMemoCommentPayload.encode(message.memoComment, writer.uint32(10).fork()).ldelim(); - } - if (message.versionUpdate !== undefined) { - ActivityVersionUpdatePayload.encode(message.versionUpdate, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ActivityPayload { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseActivityPayload(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.memoComment = ActivityMemoCommentPayload.decode(reader, reader.uint32()); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.versionUpdate = ActivityVersionUpdatePayload.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): ActivityPayload { - return ActivityPayload.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): ActivityPayload { - const message = createBaseActivityPayload(); - message.memoComment = (object.memoComment !== undefined && object.memoComment !== null) - ? ActivityMemoCommentPayload.fromPartial(object.memoComment) - : undefined; - message.versionUpdate = (object.versionUpdate !== undefined && object.versionUpdate !== null) - ? ActivityVersionUpdatePayload.fromPartial(object.versionUpdate) - : undefined; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/web/src/types/proto/store/common.ts b/web/src/types/proto/store/common.ts deleted file mode 100644 index 2b4af3af27056..0000000000000 --- a/web/src/types/proto/store/common.ts +++ /dev/null @@ -1,3 +0,0 @@ -/* eslint-disable */ - -export const protobufPackage = "memos.store"; diff --git a/web/src/types/proto/store/inbox.ts b/web/src/types/proto/store/inbox.ts deleted file mode 100644 index e21b3c49c737a..0000000000000 --- a/web/src/types/proto/store/inbox.ts +++ /dev/null @@ -1,80 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "memos.store"; - -export interface InboxMessage { - type: InboxMessage_Type; - activityId?: number | undefined; -} - -export enum InboxMessage_Type { - TYPE_UNSPECIFIED = 0, - TYPE_MEMO_COMMENT = 1, - TYPE_VERSION_UPDATE = 2, - UNRECOGNIZED = -1, -} - -function createBaseInboxMessage(): InboxMessage { - return { type: 0, activityId: undefined }; -} - -export const InboxMessage = { - encode(message: InboxMessage, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.type !== 0) { - writer.uint32(8).int32(message.type); - } - if (message.activityId !== undefined) { - writer.uint32(16).int32(message.activityId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): InboxMessage { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseInboxMessage(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.type = reader.int32() as any; - continue; - case 2: - if (tag !== 16) { - break; - } - - message.activityId = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): InboxMessage { - return InboxMessage.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): InboxMessage { - const message = createBaseInboxMessage(); - message.type = object.type ?? 0; - message.activityId = object.activityId ?? undefined; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/web/src/types/proto/store/system_setting.ts b/web/src/types/proto/store/system_setting.ts deleted file mode 100644 index e853f9c5d48ff..0000000000000 --- a/web/src/types/proto/store/system_setting.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "memos.store"; - -export enum SystemSettingKey { - SYSTEM_SETTING_KEY_UNSPECIFIED = 0, - /** BACKUP_CONFIG - BackupConfig is the key for auto-backup configuration. */ - BACKUP_CONFIG = 1, - UNRECOGNIZED = -1, -} - -export interface BackupConfig { - /** enabled indicates whether backup is enabled. */ - enabled: boolean; - /** cron is the cron expression for backup. See https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format */ - cron: string; - /** max_keep is the maximum number of backups to keep. */ - maxKeep: number; -} - -function createBaseBackupConfig(): BackupConfig { - return { enabled: false, cron: "", maxKeep: 0 }; -} - -export const BackupConfig = { - encode(message: BackupConfig, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.enabled === true) { - writer.uint32(8).bool(message.enabled); - } - if (message.cron !== "") { - writer.uint32(18).string(message.cron); - } - if (message.maxKeep !== 0) { - writer.uint32(24).int32(message.maxKeep); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): BackupConfig { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBackupConfig(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.enabled = reader.bool(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.cron = reader.string(); - continue; - case 3: - if (tag !== 24) { - break; - } - - message.maxKeep = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): BackupConfig { - return BackupConfig.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): BackupConfig { - const message = createBaseBackupConfig(); - message.enabled = object.enabled ?? false; - message.cron = object.cron ?? ""; - message.maxKeep = object.maxKeep ?? 0; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; diff --git a/web/src/types/proto/store/user_setting.ts b/web/src/types/proto/store/user_setting.ts deleted file mode 100644 index b2dc6cc4b58da..0000000000000 --- a/web/src/types/proto/store/user_setting.ts +++ /dev/null @@ -1,211 +0,0 @@ -/* eslint-disable */ -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "memos.store"; - -export enum UserSettingKey { - USER_SETTING_KEY_UNSPECIFIED = 0, - /** USER_SETTING_ACCESS_TOKENS - Access tokens for the user. */ - USER_SETTING_ACCESS_TOKENS = 1, - UNRECOGNIZED = -1, -} - -export interface UserSetting { - userId: number; - key: UserSettingKey; - accessTokens?: AccessTokensUserSetting | undefined; -} - -export interface AccessTokensUserSetting { - accessTokens: AccessTokensUserSetting_AccessToken[]; -} - -export interface AccessTokensUserSetting_AccessToken { - /** - * The access token is a JWT token. - * Including expiration time, issuer, etc. - */ - accessToken: string; - /** A description for the access token. */ - description: string; -} - -function createBaseUserSetting(): UserSetting { - return { userId: 0, key: 0, accessTokens: undefined }; -} - -export const UserSetting = { - encode(message: UserSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.userId !== 0) { - writer.uint32(8).int32(message.userId); - } - if (message.key !== 0) { - writer.uint32(16).int32(message.key); - } - if (message.accessTokens !== undefined) { - AccessTokensUserSetting.encode(message.accessTokens, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UserSetting { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUserSetting(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.userId = reader.int32(); - continue; - case 2: - if (tag !== 16) { - break; - } - - message.key = reader.int32() as any; - continue; - case 3: - if (tag !== 26) { - break; - } - - message.accessTokens = AccessTokensUserSetting.decode(reader, reader.uint32()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): UserSetting { - return UserSetting.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): UserSetting { - const message = createBaseUserSetting(); - message.userId = object.userId ?? 0; - message.key = object.key ?? 0; - message.accessTokens = (object.accessTokens !== undefined && object.accessTokens !== null) - ? AccessTokensUserSetting.fromPartial(object.accessTokens) - : undefined; - return message; - }, -}; - -function createBaseAccessTokensUserSetting(): AccessTokensUserSetting { - return { accessTokens: [] }; -} - -export const AccessTokensUserSetting = { - encode(message: AccessTokensUserSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.accessTokens) { - AccessTokensUserSetting_AccessToken.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AccessTokensUserSetting { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAccessTokensUserSetting(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.accessTokens.push(AccessTokensUserSetting_AccessToken.decode(reader, reader.uint32())); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): AccessTokensUserSetting { - return AccessTokensUserSetting.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): AccessTokensUserSetting { - const message = createBaseAccessTokensUserSetting(); - message.accessTokens = object.accessTokens?.map((e) => AccessTokensUserSetting_AccessToken.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseAccessTokensUserSetting_AccessToken(): AccessTokensUserSetting_AccessToken { - return { accessToken: "", description: "" }; -} - -export const AccessTokensUserSetting_AccessToken = { - encode(message: AccessTokensUserSetting_AccessToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.accessToken !== "") { - writer.uint32(10).string(message.accessToken); - } - if (message.description !== "") { - writer.uint32(18).string(message.description); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): AccessTokensUserSetting_AccessToken { - const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseAccessTokensUserSetting_AccessToken(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.accessToken = reader.string(); - continue; - case 2: - if (tag !== 18) { - break; - } - - message.description = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skipType(tag & 7); - } - return message; - }, - - create(base?: DeepPartial): AccessTokensUserSetting_AccessToken { - return AccessTokensUserSetting_AccessToken.fromPartial(base ?? {}); - }, - - fromPartial(object: DeepPartial): AccessTokensUserSetting_AccessToken { - const message = createBaseAccessTokensUserSetting_AccessToken(); - message.accessToken = object.accessToken ?? ""; - message.description = object.description ?? ""; - return message; - }, -}; - -type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; - -export type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; From 363c10735915ae8bf26894a3ac26c3b5025f3f75 Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 6 Nov 2023 21:08:09 +0800 Subject: [PATCH 029/650] chore: update frontend deps --- web/package.json | 24 +-- web/pnpm-lock.yaml | 504 +++++++++++++++++++++++---------------------- 2 files changed, 264 insertions(+), 264 deletions(-) diff --git a/web/package.json b/web/package.json index 7efa7d023a5cb..a5af11fd09ac4 100644 --- a/web/package.json +++ b/web/package.json @@ -13,10 +13,10 @@ "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@matejmazur/react-katex": "^3.1.3", - "@mui/joy": "5.0.0-beta.12", + "@mui/joy": "5.0.0-beta.13", "@reduxjs/toolkit": "^1.9.7", "@tailwindcss/container-queries": "^0.1.1", - "axios": "^0.27.2", + "axios": "^1.6.0", "classnames": "^2.3.2", "copy-to-clipboard": "^3.3.3", "highlight.js": "^11.9.0", @@ -33,38 +33,36 @@ "react-hot-toast": "^2.4.1", "react-i18next": "^11.18.6", "react-redux": "^8.1.3", - "react-router-dom": "^6.17.0", + "react-router-dom": "^6.18.0", "react-use": "^17.4.0", - "semver": "^7.5.4", "tailwindcss": "^3.3.5", "textarea-caret": "^3.1.0", "uuid": "^9.0.1", - "zustand": "^4.4.4" + "zustand": "^4.4.6" }, "devDependencies": { "@bufbuild/buf": "^1.27.2", "@trivago/prettier-plugin-sort-imports": "^3.4.0", "@types/katex": "^0.16.5", "@types/lodash-es": "^4.17.10", - "@types/node": "^18.18.7", + "@types/node": "^18.18.8", "@types/qs": "^6.9.9", - "@types/react": "^18.2.33", + "@types/react": "^18.2.36", "@types/react-dom": "^18.2.14", - "@types/semver": "^7.5.4", "@types/textarea-caret": "^3.0.2", "@types/uuid": "^9.0.6", - "@typescript-eslint/eslint-plugin": "^6.9.0", - "@typescript-eslint/parser": "^6.9.0", - "@vitejs/plugin-react-swc": "^3.4.0", + "@typescript-eslint/eslint-plugin": "^6.9.1", + "@typescript-eslint/parser": "^6.9.1", + "@vitejs/plugin-react-swc": "^3.4.1", "autoprefixer": "^10.4.16", - "eslint": "^8.52.0", + "eslint": "^8.53.0", "eslint-config-prettier": "^8.10.0", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-react": "^7.33.2", "less": "^4.2.0", "postcss": "^8.4.31", "prettier": "2.6.2", - "terser": "^5.22.0", + "terser": "^5.24.0", "typescript": "^5.2.2", "vite": "^4.5.0" } diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 7ac1394794f22..7a20beb24baa9 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -7,16 +7,16 @@ settings: dependencies: '@emotion/react': specifier: ^11.11.1 - version: 11.11.1(@types/react@18.2.33)(react@18.2.0) + version: 11.11.1(@types/react@18.2.36)(react@18.2.0) '@emotion/styled': specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.36)(react@18.2.0) '@matejmazur/react-katex': specifier: ^3.1.3 version: 3.1.3(katex@0.16.9)(react@18.2.0) '@mui/joy': - specifier: 5.0.0-beta.12 - version: 5.0.0-beta.12(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) + specifier: 5.0.0-beta.13 + version: 5.0.0-beta.13(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.36)(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) @@ -24,8 +24,8 @@ dependencies: specifier: ^0.1.1 version: 0.1.1(tailwindcss@3.3.5) axios: - specifier: ^0.27.2 - version: 0.27.2 + specifier: ^1.6.0 + version: 1.6.0 classnames: specifier: ^2.3.2 version: 2.3.2 @@ -73,16 +73,13 @@ dependencies: 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.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + version: 8.1.3(@types/react-dom@18.2.14)(@types/react@18.2.36)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) react-router-dom: - specifier: ^6.17.0 - version: 6.17.0(react-dom@18.2.0)(react@18.2.0) + specifier: ^6.18.0 + version: 6.18.0(react-dom@18.2.0)(react@18.2.0) react-use: specifier: ^17.4.0 version: 17.4.0(react-dom@18.2.0)(react@18.2.0) - semver: - specifier: ^7.5.4 - version: 7.5.4 tailwindcss: specifier: ^3.3.5 version: 3.3.5 @@ -93,8 +90,8 @@ dependencies: specifier: ^9.0.1 version: 9.0.1 zustand: - specifier: ^4.4.4 - version: 4.4.4(@types/react@18.2.33)(react@18.2.0) + specifier: ^4.4.6 + version: 4.4.6(@types/react@18.2.36)(react@18.2.0) devDependencies: '@bufbuild/buf': @@ -110,20 +107,17 @@ devDependencies: specifier: ^4.17.10 version: 4.17.10 '@types/node': - specifier: ^18.18.7 - version: 18.18.7 + specifier: ^18.18.8 + version: 18.18.8 '@types/qs': specifier: ^6.9.9 version: 6.9.9 '@types/react': - specifier: ^18.2.33 - version: 18.2.33 + specifier: ^18.2.36 + version: 18.2.36 '@types/react-dom': specifier: ^18.2.14 version: 18.2.14 - '@types/semver': - specifier: ^7.5.4 - version: 7.5.4 '@types/textarea-caret': specifier: ^3.0.2 version: 3.0.2 @@ -131,29 +125,29 @@ devDependencies: specifier: ^9.0.6 version: 9.0.6 '@typescript-eslint/eslint-plugin': - specifier: ^6.9.0 - version: 6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2) + specifier: ^6.9.1 + version: 6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2) '@typescript-eslint/parser': - specifier: ^6.9.0 - version: 6.9.0(eslint@8.52.0)(typescript@5.2.2) + specifier: ^6.9.1 + version: 6.9.1(eslint@8.53.0)(typescript@5.2.2) '@vitejs/plugin-react-swc': - specifier: ^3.4.0 - version: 3.4.0(vite@4.5.0) + specifier: ^3.4.1 + version: 3.4.1(vite@4.5.0) autoprefixer: specifier: ^10.4.16 version: 10.4.16(postcss@8.4.31) eslint: - specifier: ^8.52.0 - version: 8.52.0 + specifier: ^8.53.0 + version: 8.53.0 eslint-config-prettier: specifier: ^8.10.0 - version: 8.10.0(eslint@8.52.0) + version: 8.10.0(eslint@8.53.0) eslint-plugin-prettier: specifier: ^4.2.1 - version: 4.2.1(eslint-config-prettier@8.10.0)(eslint@8.52.0)(prettier@2.6.2) + version: 4.2.1(eslint-config-prettier@8.10.0)(eslint@8.53.0)(prettier@2.6.2) eslint-plugin-react: specifier: ^7.33.2 - version: 7.33.2(eslint@8.52.0) + version: 7.33.2(eslint@8.53.0) less: specifier: ^4.2.0 version: 4.2.0 @@ -164,14 +158,14 @@ devDependencies: specifier: 2.6.2 version: 2.6.2 terser: - specifier: ^5.22.0 - version: 5.22.0 + specifier: ^5.24.0 + version: 5.24.0 typescript: specifier: ^5.2.2 version: 5.2.2 vite: specifier: ^4.5.0 - version: 4.5.0(@types/node@18.18.7)(less@4.2.0)(terser@5.22.0) + version: 4.5.0(@types/node@18.18.8)(less@4.2.0)(terser@5.24.0) packages: @@ -536,7 +530,7 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.1(@types/react@18.2.33)(react@18.2.0): + /@emotion/react@11.11.1(@types/react@18.2.36)(react@18.2.0): resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} peerDependencies: '@types/react': '*' @@ -552,7 +546,7 @@ packages: '@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.33 + '@types/react': 18.2.36 hoist-non-react-statics: 3.3.2 react: 18.2.0 dev: false @@ -571,7 +565,7 @@ packages: resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0): + /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.36)(react@18.2.0): resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 @@ -584,11 +578,11 @@ packages: '@babel/runtime': 7.23.2 '@emotion/babel-plugin': 11.11.0 '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.36)(react@18.2.0) '@emotion/serialize': 1.1.2 '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@18.2.0) '@emotion/utils': 1.2.1 - '@types/react': 18.2.33 + '@types/react': 18.2.36 react: 18.2.0 dev: false @@ -810,13 +804,13 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.52.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.53.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.52.0 + eslint: 8.53.0 eslint-visitor-keys: 3.4.3 dev: true @@ -825,8 +819,8 @@ packages: engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.1.2: - resolution: {integrity: sha512-+wvgpDsrB1YqAMdEUCcnTlpfVBH7Vqn6A/NT3D8WVXFIaKMlErPIZT3oCIAVCOtarRpMtelZLqJeU3t7WY6X6g==} + /@eslint/eslintrc@2.1.3: + resolution: {integrity: sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 @@ -842,8 +836,8 @@ packages: - supports-color dev: true - /@eslint/js@8.52.0: - resolution: {integrity: sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==} + /@eslint/js@8.53.0: + resolution: {integrity: sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true @@ -938,8 +932,8 @@ packages: react: 18.2.0 dev: false - /@mui/base@5.0.0-beta.21(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-eTKWx3WV/nwmRUK4z4K1MzlMyWCsi3WJ3RtV4DiXZeRh4qd4JCyp1Zzzi8Wv9xM4dEBmqQntFoei716PzwmFfA==} + /@mui/base@5.0.0-beta.22(@types/react@18.2.36)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-l4asGID5tmyerx9emJfXOKLyXzaBtdXNIFE3M+IrSZaFtGFvaQKHhc3+nxxSxPf1+G44psjczM0ekRQCdXx9HA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -951,22 +945,22 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@floating-ui/react-dom': 2.0.2(react-dom@18.2.0)(react@18.2.0) - '@mui/types': 7.2.7(@types/react@18.2.33) - '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) + '@mui/types': 7.2.8(@types/react@18.2.36) + '@mui/utils': 5.14.16(@types/react@18.2.36)(react@18.2.0) '@popperjs/core': 2.11.8 - '@types/react': 18.2.33 + '@types/react': 18.2.36 clsx: 2.0.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.14.15: - resolution: {integrity: sha512-ZCDzBWtCKjAYAlKKM3PA/jG/3uVIDT9ZitOtVixIVmTCQyc5jSV1qhJX8+qIGz4RQZ9KLzPWO2tXd0O5hvzouQ==} + /@mui/core-downloads-tracker@5.14.16: + resolution: {integrity: sha512-97isBjzH2v1K7oB4UH2f4NOkBShOynY6dhnoR2XlUk/g6bb7ZBv2I3D1hvvqPtpEigKu93e7f/jAYr5d9LOc5w==} dev: false - /@mui/joy@5.0.0-beta.12(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-e5G9EGkxiCXWNFbSdo4V4TzqjwDqlgMbCHygzFlBwrgY1pn4jBxC5NZe4btq2CREpAi9nZlCeYgHd3ejKYBGBg==} + /@mui/joy@5.0.0-beta.13(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.36)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-vXoCqGX/rRxAij56gwcId67cax3nv7oIaeIYPqCPz8OZTaCvE6ZxMANXOVPmY9GIWpTAABfqijL/jiF0qkz/eg==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -983,22 +977,22 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) - '@mui/base': 5.0.0-beta.21(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0) - '@mui/core-downloads-tracker': 5.14.15 - '@mui/system': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0) - '@mui/types': 7.2.7(@types/react@18.2.33) - '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) - '@types/react': 18.2.33 + '@emotion/react': 11.11.1(@types/react@18.2.36)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.36)(react@18.2.0) + '@mui/base': 5.0.0-beta.22(@types/react@18.2.36)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.14.16 + '@mui/system': 5.14.16(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.36)(react@18.2.0) + '@mui/types': 7.2.8(@types/react@18.2.36) + '@mui/utils': 5.14.16(@types/react@18.2.36)(react@18.2.0) + '@types/react': 18.2.36 clsx: 2.0.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.14.15(@types/react@18.2.33)(react@18.2.0): - resolution: {integrity: sha512-V2Xh+Tu6A07NoSpup0P9m29GwvNMYl5DegsGWqlOTJyAV7cuuVjmVPqxgvL8xBng4R85xqIQJRMjtYYktoPNuQ==} + /@mui/private-theming@5.14.16(@types/react@18.2.36)(react@18.2.0): + resolution: {integrity: sha512-FNlL0pTSEBh8nXsVWreCHDSHk+jG8cBx1sxRbT8JVtL+PYbYPi802zfV4B00Kkf0LNRVRvAVQwojMWSR/MYGng==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -1008,14 +1002,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) - '@types/react': 18.2.33 + '@mui/utils': 5.14.16(@types/react@18.2.36)(react@18.2.0) + '@types/react': 18.2.36 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/styled-engine@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): - resolution: {integrity: sha512-mbOjRf867BysNpexe5Z/P8s3bWzDPNowmKhi7gtNDP/LPEeqAfiDSuC4WPTXmtvse1dCl30Nl755OLUYuoi7Mw==} + /@mui/styled-engine@5.14.16(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): + resolution: {integrity: sha512-FfvYvTG/Zd+KXMMImbcMYEeQAbONGuX5Vx3gBmmtB6KyA7Mvm9Pma1ly3R0gc44yeoFd+2wBjn1feS8h42HW5w==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.4.1 @@ -1029,15 +1023,15 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) + '@emotion/react': 11.11.1(@types/react@18.2.36)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.36)(react@18.2.0) csstype: 3.1.2 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/system@5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.33)(react@18.2.0): - resolution: {integrity: sha512-zr0Gdk1RgKiEk+tCMB900LaOpEC8NaGvxtkmMdL/CXgkqQZSVZOt2PQsxJWaw7kE4YVkIe4VukFVc43qcq9u3w==} + /@mui/system@5.14.16(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.36)(react@18.2.0): + resolution: {integrity: sha512-uKnPfsDqDs8bbN54TviAuoGWOmFiQLwNZ3Wvj+OBkJCzwA6QnLb/sSeCB7Pk3ilH4h4jQ0BHtbR+Xpjy9wlOuA==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -1053,32 +1047,32 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.2 - '@emotion/react': 11.11.1(@types/react@18.2.33)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.33)(react@18.2.0) - '@mui/private-theming': 5.14.15(@types/react@18.2.33)(react@18.2.0) - '@mui/styled-engine': 5.14.15(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) - '@mui/types': 7.2.7(@types/react@18.2.33) - '@mui/utils': 5.14.15(@types/react@18.2.33)(react@18.2.0) - '@types/react': 18.2.33 + '@emotion/react': 11.11.1(@types/react@18.2.36)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.36)(react@18.2.0) + '@mui/private-theming': 5.14.16(@types/react@18.2.36)(react@18.2.0) + '@mui/styled-engine': 5.14.16(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) + '@mui/types': 7.2.8(@types/react@18.2.36) + '@mui/utils': 5.14.16(@types/react@18.2.36)(react@18.2.0) + '@types/react': 18.2.36 clsx: 2.0.0 csstype: 3.1.2 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/types@7.2.7(@types/react@18.2.33): - resolution: {integrity: sha512-sofpWmcBqOlTzRbr1cLQuUDKaUYVZTw8ENQrtL39TECRNENEzwgnNPh6WMfqMZlMvf1Aj9DLg74XPjnLr0izUQ==} + /@mui/types@7.2.8(@types/react@18.2.36): + resolution: {integrity: sha512-9u0ji+xspl96WPqvrYJF/iO+1tQ1L5GTaDOeG3vCR893yy7VcWwRNiVMmPdPNpMDqx0WV1wtEW9OMwK9acWJzQ==} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 peerDependenciesMeta: '@types/react': optional: true dependencies: - '@types/react': 18.2.33 + '@types/react': 18.2.36 dev: false - /@mui/utils@5.14.15(@types/react@18.2.33)(react@18.2.0): - resolution: {integrity: sha512-QBfHovAvTa0J1jXuYDaXGk+Yyp7+Fm8GSqx6nK2JbezGqzCFfirNdop/+bL9Flh/OQ/64PeXcW4HGDdOge+n3A==} + /@mui/utils@5.14.16(@types/react@18.2.36)(react@18.2.0): + resolution: {integrity: sha512-3xV31GposHkwRbQzwJJuooWpK2ybWdEdeUPtRjv/6vjomyi97F3+68l+QVj9tPTvmfSbr2sx5c/NuvDulrdRmA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -1089,7 +1083,7 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@types/prop-types': 15.7.9 - '@types/react': 18.2.33 + '@types/react': 18.2.36 prop-types: 15.8.1 react: 18.2.0 react-is: 18.2.0 @@ -1173,19 +1167,19 @@ packages: dependencies: immer: 9.0.21 react: 18.2.0 - react-redux: 8.1.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1) + react-redux: 8.1.3(@types/react-dom@18.2.14)(@types/react@18.2.36)(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.10.0: - resolution: {integrity: sha512-Lm+fYpMfZoEucJ7cMxgt4dYt8jLfbpwRCzAjm9UgSLOkmlqo9gupxt6YX3DY0Fk155NT9l17d/ydi+964uS9Lw==} + /@remix-run/router@1.11.0: + resolution: {integrity: sha512-BHdhcWgeiudl91HvVa2wxqZjSHbheSgIiDvxrF1VjFzBzpTtuDPkOdOi3Iqvc08kXtFkLjhbS+ML9aM8mJS+wQ==} engines: {node: '>=14.0.0'} dev: false - /@swc/core-darwin-arm64@1.3.95: - resolution: {integrity: sha512-VAuBAP3MNetO/yBIBzvorUXq7lUBwhfpJxYViSxyluMwtoQDhE/XWN598TWMwMl1ZuImb56d7eUsuFdjgY7pJw==} + /@swc/core-darwin-arm64@1.3.96: + resolution: {integrity: sha512-8hzgXYVd85hfPh6mJ9yrG26rhgzCmcLO0h1TIl8U31hwmTbfZLzRitFQ/kqMJNbIBCwmNH1RU2QcJnL3d7f69A==} engines: {node: '>=10'} cpu: [arm64] os: [darwin] @@ -1193,8 +1187,8 @@ packages: dev: true optional: true - /@swc/core-darwin-x64@1.3.95: - resolution: {integrity: sha512-20vF2rvUsN98zGLZc+dsEdHvLoCuiYq/1B+TDeE4oolgTFDmI1jKO+m44PzWjYtKGU9QR95sZ6r/uec0QC5O4Q==} + /@swc/core-darwin-x64@1.3.96: + resolution: {integrity: sha512-mFp9GFfuPg+43vlAdQZl0WZpZSE8sEzqL7sr/7Reul5McUHP0BaLsEzwjvD035ESfkY8GBZdLpMinblIbFNljQ==} engines: {node: '>=10'} cpu: [x64] os: [darwin] @@ -1202,8 +1196,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm-gnueabihf@1.3.95: - resolution: {integrity: sha512-oEudEM8PST1MRNGs+zu0cx5i9uP8TsLE4/L9HHrS07Ck0RJ3DCj3O2fU832nmLe2QxnAGPwBpSO9FntLfOiWEQ==} + /@swc/core-linux-arm-gnueabihf@1.3.96: + resolution: {integrity: sha512-8UEKkYJP4c8YzYIY/LlbSo8z5Obj4hqcv/fUTHiEePiGsOddgGf7AWjh56u7IoN/0uEmEro59nc1ChFXqXSGyg==} engines: {node: '>=10'} cpu: [arm] os: [linux] @@ -1211,8 +1205,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-gnu@1.3.95: - resolution: {integrity: sha512-pIhFI+cuC1aYg+0NAPxwT/VRb32f2ia8oGxUjQR6aJg65gLkUYQzdwuUmpMtFR2WVf7WVFYxUnjo4UyMuyh3ng==} + /@swc/core-linux-arm64-gnu@1.3.96: + resolution: {integrity: sha512-c/IiJ0s1y3Ymm2BTpyC/xr6gOvoqAVETrivVXHq68xgNms95luSpbYQ28rqaZC8bQC8M5zdXpSc0T8DJu8RJGw==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1220,8 +1214,8 @@ packages: dev: true optional: true - /@swc/core-linux-arm64-musl@1.3.95: - resolution: {integrity: sha512-ZpbTr+QZDT4OPJfjPAmScqdKKaT+wGurvMU5AhxLaf85DuL8HwUwwlL0n1oLieLc47DwIJEMuKQkYhXMqmJHlg==} + /@swc/core-linux-arm64-musl@1.3.96: + resolution: {integrity: sha512-i5/UTUwmJLri7zhtF6SAo/4QDQJDH2fhYJaBIUhrICmIkRO/ltURmpejqxsM/ye9Jqv5zG7VszMC0v/GYn/7BQ==} engines: {node: '>=10'} cpu: [arm64] os: [linux] @@ -1229,8 +1223,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-gnu@1.3.95: - resolution: {integrity: sha512-n9SuHEFtdfSJ+sHdNXNRuIOVprB8nbsz+08apKfdo4lEKq6IIPBBAk5kVhPhkjmg2dFVHVo4Tr/OHXM1tzWCCw==} + /@swc/core-linux-x64-gnu@1.3.96: + resolution: {integrity: sha512-USdaZu8lTIkm4Yf9cogct/j5eqtdZqTgcTib4I+NloUW0E/hySou3eSyp3V2UAA1qyuC72ld1otXuyKBna0YKQ==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1238,8 +1232,8 @@ packages: dev: true optional: true - /@swc/core-linux-x64-musl@1.3.95: - resolution: {integrity: sha512-L1JrVlsXU3LC0WwmVnMK9HrOT2uhHahAoPNMJnZQpc18a0paO9fqifPG8M/HjNRffMUXR199G/phJsf326UvVg==} + /@swc/core-linux-x64-musl@1.3.96: + resolution: {integrity: sha512-QYErutd+G2SNaCinUVobfL7jWWjGTI0QEoQ6hqTp7PxCJS/dmKmj3C5ZkvxRYcq7XcZt7ovrYCTwPTHzt6lZBg==} engines: {node: '>=10'} cpu: [x64] os: [linux] @@ -1247,8 +1241,8 @@ packages: dev: true optional: true - /@swc/core-win32-arm64-msvc@1.3.95: - resolution: {integrity: sha512-YaP4x/aZbUyNdqCBpC2zL8b8n58MEpOUpmOIZK6G1SxGi+2ENht7gs7+iXpWPc0sy7X3YPKmSWMAuui0h8lgAA==} + /@swc/core-win32-arm64-msvc@1.3.96: + resolution: {integrity: sha512-hjGvvAduA3Un2cZ9iNP4xvTXOO4jL3G9iakhFsgVhpkU73SGmK7+LN8ZVBEu4oq2SUcHO6caWvnZ881cxGuSpg==} engines: {node: '>=10'} cpu: [arm64] os: [win32] @@ -1256,8 +1250,8 @@ packages: dev: true optional: true - /@swc/core-win32-ia32-msvc@1.3.95: - resolution: {integrity: sha512-w0u3HI916zT4BC/57gOd+AwAEjXeUlQbGJ9H4p/gzs1zkSHtoDQghVUNy3n/ZKp9KFod/95cA8mbVF9t1+6epQ==} + /@swc/core-win32-ia32-msvc@1.3.96: + resolution: {integrity: sha512-Far2hVFiwr+7VPCM2GxSmbh3ikTpM3pDombE+d69hkedvYHYZxtTF+2LTKl/sXtpbUnsoq7yV/32c9R/xaaWfw==} engines: {node: '>=10'} cpu: [ia32] os: [win32] @@ -1265,8 +1259,8 @@ packages: dev: true optional: true - /@swc/core-win32-x64-msvc@1.3.95: - resolution: {integrity: sha512-5RGnMt0S6gg4Gc6QtPUJ3Qs9Un4sKqccEzgH/tj7V/DVTJwKdnBKxFZfgQ34OR2Zpz7zGOn889xwsFVXspVWNA==} + /@swc/core-win32-x64-msvc@1.3.96: + resolution: {integrity: sha512-4VbSAniIu0ikLf5mBX81FsljnfqjoVGleEkCQv4+zRlyZtO3FHoDPkeLVoy6WRlj7tyrRcfUJ4mDdPkbfTO14g==} engines: {node: '>=10'} cpu: [x64] os: [win32] @@ -1274,8 +1268,8 @@ packages: dev: true optional: true - /@swc/core@1.3.95: - resolution: {integrity: sha512-PMrNeuqIusq9DPDooV3FfNEbZuTu5jKAc04N3Hm6Uk2Fl49cqElLFQ4xvl4qDmVDz97n3n/C1RE0/f6WyGPEiA==} + /@swc/core@1.3.96: + resolution: {integrity: sha512-zwE3TLgoZwJfQygdv2SdCK9mRLYluwDOM53I+dT6Z5ZvrgVENmY3txvWDvduzkV+/8IuvrRbVezMpxcojadRdQ==} engines: {node: '>=10'} requiresBuild: true peerDependencies: @@ -1287,16 +1281,16 @@ packages: '@swc/counter': 0.1.2 '@swc/types': 0.1.5 optionalDependencies: - '@swc/core-darwin-arm64': 1.3.95 - '@swc/core-darwin-x64': 1.3.95 - '@swc/core-linux-arm-gnueabihf': 1.3.95 - '@swc/core-linux-arm64-gnu': 1.3.95 - '@swc/core-linux-arm64-musl': 1.3.95 - '@swc/core-linux-x64-gnu': 1.3.95 - '@swc/core-linux-x64-musl': 1.3.95 - '@swc/core-win32-arm64-msvc': 1.3.95 - '@swc/core-win32-ia32-msvc': 1.3.95 - '@swc/core-win32-x64-msvc': 1.3.95 + '@swc/core-darwin-arm64': 1.3.96 + '@swc/core-darwin-x64': 1.3.96 + '@swc/core-linux-arm-gnueabihf': 1.3.96 + '@swc/core-linux-arm64-gnu': 1.3.96 + '@swc/core-linux-arm64-musl': 1.3.96 + '@swc/core-linux-x64-gnu': 1.3.96 + '@swc/core-linux-x64-musl': 1.3.96 + '@swc/core-win32-arm64-msvc': 1.3.96 + '@swc/core-win32-ia32-msvc': 1.3.96 + '@swc/core-win32-x64-msvc': 1.3.96 dev: true /@swc/counter@0.1.2: @@ -1325,7 +1319,7 @@ packages: '@babel/parser': 7.18.9 '@babel/traverse': 7.17.3 '@babel/types': 7.17.0 - '@vue/compiler-sfc': 3.3.7 + '@vue/compiler-sfc': 3.3.8 javascript-natural-sort: 0.7.1 lodash: 4.17.21 prettier: 2.6.2 @@ -1336,7 +1330,7 @@ packages: /@types/hoist-non-react-statics@3.3.4: resolution: {integrity: sha512-ZchYkbieA+7tnxwX/SCBySx9WwvWR8TaP5tb2jRAzwvLb/rWchGw3v0w3pqUbUvj0GCwW2Xz/AVPSk6kUGctXQ==} dependencies: - '@types/react': 18.2.33 + '@types/react': 18.2.36 hoist-non-react-statics: 3.3.2 dev: false @@ -1362,8 +1356,8 @@ packages: resolution: {integrity: sha512-YI/M/4HRImtNf3pJgbF+W6FrXovqj+T+/HpENLTooK9PnkacBsDpeP3IpHab40CClUfhNmdM2WTNP2sa2dni5Q==} dev: true - /@types/node@18.18.7: - resolution: {integrity: sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ==} + /@types/node@18.18.8: + resolution: {integrity: sha512-OLGBaaK5V3VRBS1bAkMVP2/W9B+H8meUfl866OrMNQqt7wDgdpWPp5o6gmIc9pB+lIQHSq4ZL8ypeH1vPxcPaQ==} dependencies: undici-types: 5.26.5 @@ -1381,10 +1375,10 @@ packages: /@types/react-dom@18.2.14: resolution: {integrity: sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==} dependencies: - '@types/react': 18.2.33 + '@types/react': 18.2.36 - /@types/react@18.2.33: - resolution: {integrity: sha512-v+I7S+hu3PIBoVkKGpSYYpiBT1ijqEzWpzQD62/jm4K74hPpSP7FF9BnKG6+fg2+62weJYkkBWDJlZt5JO/9hg==} + /@types/react@18.2.36: + resolution: {integrity: sha512-o9XFsHYLLZ4+sb9CWUYwHqFVoG61SesydF353vFMMsQziiyRu8np4n2OYMUSDZ8XuImxDr9c5tR7gidlH29Vnw==} dependencies: '@types/prop-types': 15.7.9 '@types/scheduler': 0.16.5 @@ -1409,8 +1403,8 @@ packages: resolution: {integrity: sha512-BT2Krtx4xaO6iwzwMFUYvWBWkV2pr37zD68Vmp1CDV196MzczBRxuEpD6Pr395HAgebC/co7hOphs53r8V7jew==} dev: true - /@typescript-eslint/eslint-plugin@6.9.0(@typescript-eslint/parser@6.9.0)(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-lgX7F0azQwRPB7t7WAyeHWVfW1YJ9NIgd9mvGhfQpRY56X6AVf8mwM8Wol+0z4liE7XX3QOt8MN1rUKCfSjRIA==} + /@typescript-eslint/eslint-plugin@6.9.1(@typescript-eslint/parser@6.9.1)(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1421,13 +1415,13 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.9.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/scope-manager': 6.9.0 - '@typescript-eslint/type-utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/parser': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/type-utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 graphemer: 1.4.0 ignore: 5.2.4 natural-compare: 1.4.0 @@ -1438,8 +1432,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.9.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-GZmjMh4AJ/5gaH4XF2eXA8tMnHWP+Pm1mjQR2QN4Iz+j/zO04b9TOvJYOX2sCNIQHtRStKTxRY1FX7LhpJT4Gw==} + /@typescript-eslint/parser@6.9.1(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1448,27 +1442,27 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.9.0 - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/scope-manager@6.9.0: - resolution: {integrity: sha512-1R8A9Mc39n4pCCz9o79qRO31HGNDvC7UhPhv26TovDsWPBDx+Sg3rOZdCELIA3ZmNoWAuxaMOT7aWtGRSYkQxw==} + /@typescript-eslint/scope-manager@6.9.1: + resolution: {integrity: sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/visitor-keys': 6.9.1 dev: true - /@typescript-eslint/type-utils@6.9.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-XXeahmfbpuhVbhSOROIzJ+b13krFmgtc4GlEuu1WBT+RpyGPIA4Y/eGnXzjbDj5gZLzpAXO/sj+IF/x2GtTMjQ==} + /@typescript-eslint/type-utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1477,23 +1471,23 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) - '@typescript-eslint/utils': 6.9.0(eslint@8.52.0)(typescript@5.2.2) + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + '@typescript-eslint/utils': 6.9.1(eslint@8.53.0)(typescript@5.2.2) debug: 4.3.4 - eslint: 8.52.0 + eslint: 8.53.0 ts-api-utils: 1.0.3(typescript@5.2.2) typescript: 5.2.2 transitivePeerDependencies: - supports-color dev: true - /@typescript-eslint/types@6.9.0: - resolution: {integrity: sha512-+KB0lbkpxBkBSiVCuQvduqMJy+I1FyDbdwSpM3IoBS7APl4Bu15lStPjgBIdykdRqQNYqYNMa8Kuidax6phaEw==} + /@typescript-eslint/types@6.9.1: + resolution: {integrity: sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.9.0(typescript@5.2.2): - resolution: {integrity: sha512-NJM2BnJFZBEAbCfBP00zONKXvMqihZCrmwCaik0UhLr0vAgb6oguXxLX1k00oQyD+vZZ+CJn3kocvv2yxm4awQ==} + /@typescript-eslint/typescript-estree@6.9.1(typescript@5.2.2): + resolution: {integrity: sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1501,8 +1495,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/visitor-keys': 6.9.0 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/visitor-keys': 6.9.1 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1513,30 +1507,30 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.9.0(eslint@8.52.0)(typescript@5.2.2): - resolution: {integrity: sha512-5Wf+Jsqya7WcCO8me504FBigeQKVLAMPmUzYgDbWchINNh1KJbxCgVya3EQ2MjvJMVeXl3pofRmprqX6mfQkjQ==} + /@typescript-eslint/utils@6.9.1(eslint@8.53.0)(typescript@5.2.2): + resolution: {integrity: sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) '@types/json-schema': 7.0.14 '@types/semver': 7.5.4 - '@typescript-eslint/scope-manager': 6.9.0 - '@typescript-eslint/types': 6.9.0 - '@typescript-eslint/typescript-estree': 6.9.0(typescript@5.2.2) - eslint: 8.52.0 + '@typescript-eslint/scope-manager': 6.9.1 + '@typescript-eslint/types': 6.9.1 + '@typescript-eslint/typescript-estree': 6.9.1(typescript@5.2.2) + eslint: 8.53.0 semver: 7.5.4 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@6.9.0: - resolution: {integrity: sha512-dGtAfqjV6RFOtIP8I0B4ZTBRrlTT8NHHlZZSchQx3qReaoDeXhYM++M4So2AgFK9ZB0emRPA6JI1HkafzA2Ibg==} + /@typescript-eslint/visitor-keys@6.9.1: + resolution: {integrity: sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.9.0 + '@typescript-eslint/types': 6.9.1 eslint-visitor-keys: 3.4.3 dev: true @@ -1544,67 +1538,67 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-react-swc@3.4.0(vite@4.5.0): - resolution: {integrity: sha512-m7UaA4Uvz82N/0EOVpZL4XsFIakRqrFKeSNxa1FBLSXGvWrWRBwmZb4qxk+ZIVAZcW3c3dn5YosomDgx62XWcQ==} + /@vitejs/plugin-react-swc@3.4.1(vite@4.5.0): + resolution: {integrity: sha512-7YQOQcVV5x1luD8nkbCDdyYygFvn1hjqJk68UvNAzY2QG4o4N5EwAhLLFNOcd1HrdMwDl0VElP8VutoWf9IvJg==} peerDependencies: vite: ^4 dependencies: - '@swc/core': 1.3.95 - vite: 4.5.0(@types/node@18.18.7)(less@4.2.0)(terser@5.22.0) + '@swc/core': 1.3.96 + vite: 4.5.0(@types/node@18.18.8)(less@4.2.0)(terser@5.24.0) transitivePeerDependencies: - '@swc/helpers' dev: true - /@vue/compiler-core@3.3.7: - resolution: {integrity: sha512-pACdY6YnTNVLXsB86YD8OF9ihwpolzhhtdLVHhBL6do/ykr6kKXNYABRtNMGrsQXpEXXyAdwvWWkuTbs4MFtPQ==} + /@vue/compiler-core@3.3.8: + resolution: {integrity: sha512-hN/NNBUECw8SusQvDSqqcVv6gWq8L6iAktUR0UF3vGu2OhzRqcOiAno0FmBJWwxhYEXRlQJT5XnoKsVq1WZx4g==} dependencies: '@babel/parser': 7.23.0 - '@vue/shared': 3.3.7 + '@vue/shared': 3.3.8 estree-walker: 2.0.2 source-map-js: 1.0.2 dev: true - /@vue/compiler-dom@3.3.7: - resolution: {integrity: sha512-0LwkyJjnUPssXv/d1vNJ0PKfBlDoQs7n81CbO6Q0zdL7H1EzqYRrTVXDqdBVqro0aJjo/FOa1qBAPVI4PGSHBw==} + /@vue/compiler-dom@3.3.8: + resolution: {integrity: sha512-+PPtv+p/nWDd0AvJu3w8HS0RIm/C6VGBIRe24b9hSyNWOAPEUosFZ5diwawwP8ip5sJ8n0Pe87TNNNHnvjs0FQ==} dependencies: - '@vue/compiler-core': 3.3.7 - '@vue/shared': 3.3.7 + '@vue/compiler-core': 3.3.8 + '@vue/shared': 3.3.8 dev: true - /@vue/compiler-sfc@3.3.7: - resolution: {integrity: sha512-7pfldWy/J75U/ZyYIXRVqvLRw3vmfxDo2YLMwVtWVNew8Sm8d6wodM+OYFq4ll/UxfqVr0XKiVwti32PCrruAw==} + /@vue/compiler-sfc@3.3.8: + resolution: {integrity: sha512-WMzbUrlTjfYF8joyT84HfwwXo+8WPALuPxhy+BZ6R4Aafls+jDBnSz8PDz60uFhuqFbl3HxRfxvDzrUf3THwpA==} dependencies: '@babel/parser': 7.23.0 - '@vue/compiler-core': 3.3.7 - '@vue/compiler-dom': 3.3.7 - '@vue/compiler-ssr': 3.3.7 - '@vue/reactivity-transform': 3.3.7 - '@vue/shared': 3.3.7 + '@vue/compiler-core': 3.3.8 + '@vue/compiler-dom': 3.3.8 + '@vue/compiler-ssr': 3.3.8 + '@vue/reactivity-transform': 3.3.8 + '@vue/shared': 3.3.8 estree-walker: 2.0.2 magic-string: 0.30.5 postcss: 8.4.31 source-map-js: 1.0.2 dev: true - /@vue/compiler-ssr@3.3.7: - resolution: {integrity: sha512-TxOfNVVeH3zgBc82kcUv+emNHo+vKnlRrkv8YvQU5+Y5LJGJwSNzcmLUoxD/dNzv0bhQ/F0s+InlgV0NrApJZg==} + /@vue/compiler-ssr@3.3.8: + resolution: {integrity: sha512-hXCqQL/15kMVDBuoBYpUnSYT8doDNwsjvm3jTefnXr+ytn294ySnT8NlsFHmTgKNjwpuFy7XVV8yTeLtNl/P6w==} dependencies: - '@vue/compiler-dom': 3.3.7 - '@vue/shared': 3.3.7 + '@vue/compiler-dom': 3.3.8 + '@vue/shared': 3.3.8 dev: true - /@vue/reactivity-transform@3.3.7: - resolution: {integrity: sha512-APhRmLVbgE1VPGtoLQoWBJEaQk4V8JUsqrQihImVqKT+8U6Qi3t5ATcg4Y9wGAPb3kIhetpufyZ1RhwbZCIdDA==} + /@vue/reactivity-transform@3.3.8: + resolution: {integrity: sha512-49CvBzmZNtcHua0XJ7GdGifM8GOXoUMOX4dD40Y5DxI3R8OUhMlvf2nvgUAcPxaXiV5MQQ1Nwy09ADpnLQUqRw==} dependencies: '@babel/parser': 7.23.0 - '@vue/compiler-core': 3.3.7 - '@vue/shared': 3.3.7 + '@vue/compiler-core': 3.3.8 + '@vue/shared': 3.3.8 estree-walker: 2.0.2 magic-string: 0.30.5 dev: true - /@vue/shared@3.3.7: - resolution: {integrity: sha512-N/tbkINRUDExgcPTBvxNkvHGu504k8lzlNQRITVnm6YjOjwa4r0nnbd4Jb01sNpur5hAllyRJzSK5PvB9PPwRg==} + /@vue/shared@3.3.8: + resolution: {integrity: sha512-8PGwybFwM4x8pcfgqEQFy70NaQxASvOC5DJwLQfpArw1UDfUXrJkdxD3BhVTMS+0Lef/TU7YO0Jvr0jJY8T+mw==} dev: true /@xobotyi/scrollbar-width@1.9.5: @@ -1760,7 +1754,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.22.1 - caniuse-lite: 1.0.30001555 + caniuse-lite: 1.0.30001561 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -1773,11 +1767,12 @@ packages: engines: {node: '>= 0.4'} dev: true - /axios@0.27.2: - resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} + /axios@1.6.0: + resolution: {integrity: sha512-EZ1DYihju9pwVB+jg67ogm+Tmqc6JmhamRN6I4Zt8DfZu5lbcQGw3ozH9lFejSJgs/ibaef3A9PMXPLeefFGJg==} dependencies: follow-redirects: 1.15.3 form-data: 4.0.0 + proxy-from-env: 1.1.0 transitivePeerDependencies: - debug dev: false @@ -1816,8 +1811,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001555 - electron-to-chromium: 1.4.569 + caniuse-lite: 1.0.30001561 + electron-to-chromium: 1.4.576 node-releases: 2.0.13 update-browserslist-db: 1.0.13(browserslist@4.22.1) dev: true @@ -1843,8 +1838,8 @@ packages: engines: {node: '>= 6'} dev: false - /caniuse-lite@1.0.30001555: - resolution: {integrity: sha512-NzbUFKUnJ3DTcq6YyZB6+qqhfD112uR3uoEnkmfzm2wVzUNsFkU7AwBjKQ654Sp5cau0JxhFyRSn/tQZ+XfygA==} + /caniuse-lite@1.0.30001561: + resolution: {integrity: sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==} dev: true /chalk@2.4.2: @@ -2069,8 +2064,8 @@ packages: esutils: 2.0.3 dev: true - /electron-to-chromium@1.4.569: - resolution: {integrity: sha512-LsrJjZ0IbVy12ApW3gpYpcmHS3iRxH4bkKOW98y1/D+3cvDUWGcbzbsFinfUS8knpcZk/PG/2p/RnkMCYN7PVg==} + /electron-to-chromium@1.4.576: + resolution: {integrity: sha512-yXsZyXJfAqzWk1WKryr0Wl0MN2D47xodPvEEwlVePBnhU5E7raevLQR+E6b9JAD3GfL/7MbAL9ZtWQQPcLx7wA==} dev: true /errno@0.1.8: @@ -2225,16 +2220,16 @@ packages: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} - /eslint-config-prettier@8.10.0(eslint@8.52.0): + /eslint-config-prettier@8.10.0(eslint@8.53.0): resolution: {integrity: sha512-SM8AMJdeQqRYT9O9zguiruQZaN7+z+E4eAP9oiLNGKMtomwaB1E9dcgUD6ZAn/eQAb52USbvezbiljfZUhbJcg==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.52.0 + eslint: 8.53.0 dev: true - /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0)(eslint@8.52.0)(prettier@2.6.2): + /eslint-plugin-prettier@4.2.1(eslint-config-prettier@8.10.0)(eslint@8.53.0)(prettier@2.6.2): resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} engines: {node: '>=12.0.0'} peerDependencies: @@ -2245,13 +2240,13 @@ packages: eslint-config-prettier: optional: true dependencies: - eslint: 8.52.0 - eslint-config-prettier: 8.10.0(eslint@8.52.0) + eslint: 8.53.0 + eslint-config-prettier: 8.10.0(eslint@8.53.0) prettier: 2.6.2 prettier-linter-helpers: 1.0.0 dev: true - /eslint-plugin-react@7.33.2(eslint@8.52.0): + /eslint-plugin-react@7.33.2(eslint@8.53.0): resolution: {integrity: sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==} engines: {node: '>=4'} peerDependencies: @@ -2262,7 +2257,7 @@ packages: array.prototype.tosorted: 1.1.2 doctrine: 2.1.0 es-iterator-helpers: 1.0.15 - eslint: 8.52.0 + eslint: 8.53.0 estraverse: 5.3.0 jsx-ast-utils: 3.3.5 minimatch: 3.1.2 @@ -2289,15 +2284,15 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.52.0: - resolution: {integrity: sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==} + /eslint@8.53.0: + resolution: {integrity: sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.52.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@8.53.0) '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 2.1.2 - '@eslint/js': 8.52.0 + '@eslint/eslintrc': 2.1.3 + '@eslint/js': 8.53.0 '@humanwhocodes/config-array': 0.11.13 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 @@ -2380,8 +2375,8 @@ packages: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} dev: true - /fast-glob@3.3.1: - resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} + /fast-glob@3.3.2: + resolution: {integrity: sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -2590,7 +2585,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.3.1 + fast-glob: 3.3.2 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -2953,8 +2948,8 @@ packages: resolution: {integrity: sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==} dev: true - /jiti@1.20.0: - resolution: {integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==} + /jiti@1.21.0: + resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true dev: false @@ -3104,6 +3099,7 @@ packages: engines: {node: '>=10'} dependencies: yallist: 4.0.0 + dev: true /lucide-react@0.263.1(react@18.2.0): resolution: {integrity: sha512-keqxAx97PlaEN89PXZ6ki1N8nRjGWtDa4021GFYLNj0RgruM5odbpl8GHTExj0hhPq3sF6Up0gnxt6TSHu+ovw==} @@ -3206,8 +3202,8 @@ packages: stylis: 4.3.0 dev: false - /nanoid@3.3.6: - resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -3455,7 +3451,7 @@ packages: dependencies: lilconfig: 2.1.0 postcss: 8.4.31 - yaml: 2.3.3 + yaml: 2.3.4 dev: false /postcss-nested@6.0.1(postcss@8.4.31): @@ -3483,7 +3479,7 @@ packages: resolution: {integrity: sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.6 + nanoid: 3.3.7 picocolors: 1.0.0 source-map-js: 1.0.2 @@ -3527,18 +3523,22 @@ packages: '@protobufjs/path': 1.1.2 '@protobufjs/pool': 1.1.0 '@protobufjs/utf8': 1.1.0 - '@types/node': 18.18.7 + '@types/node': 18.18.8 long: 5.2.3 dev: false + /proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + /prr@1.0.1: resolution: {integrity: sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==} requiresBuild: true dev: true optional: true - /punycode@2.3.0: - resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} + /punycode@2.3.1: + resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} dev: true @@ -3596,7 +3596,7 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: false - /react-redux@8.1.3(@types/react-dom@18.2.14)(@types/react@18.2.33)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1): + /react-redux@8.1.3(@types/react-dom@18.2.14)(@types/react@18.2.36)(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 @@ -3619,7 +3619,7 @@ packages: dependencies: '@babel/runtime': 7.23.2 '@types/hoist-non-react-statics': 3.3.4 - '@types/react': 18.2.33 + '@types/react': 18.2.36 '@types/react-dom': 18.2.14 '@types/use-sync-external-store': 0.0.3 hoist-non-react-statics: 3.3.2 @@ -3630,26 +3630,26 @@ packages: use-sync-external-store: 1.2.0(react@18.2.0) dev: false - /react-router-dom@6.17.0(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-qWHkkbXQX+6li0COUUPKAUkxjNNqPJuiBd27dVwQGDNsuFBdMbrS6UZ0CLYc4CsbdLYTckn4oB4tGDuPZpPhaQ==} + /react-router-dom@6.18.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Ubrue4+Ercc/BoDkFQfc6og5zRQ4A8YxSO3Knsne+eRbZ+IepAsK249XBH/XaFuOYOYr3L3r13CXTLvYt5JDjw==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' react-dom: '>=16.8' dependencies: - '@remix-run/router': 1.10.0 + '@remix-run/router': 1.11.0 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - react-router: 6.17.0(react@18.2.0) + react-router: 6.18.0(react@18.2.0) dev: false - /react-router@6.17.0(react@18.2.0): - resolution: {integrity: sha512-YJR3OTJzi3zhqeJYADHANCGPUu9J+6fT5GLv82UWRGSxu6oJYCKVmxUcaBQuGm9udpWmPsvpme/CdHumqgsoaA==} + /react-router@6.18.0(react@18.2.0): + resolution: {integrity: sha512-vk2y7Dsy8wI02eRRaRmOs9g2o+aE72YCx5q9VasT1N9v+lrdB79tIqrjMfByHiY5+6aYkH2rUa5X839nwWGPDg==} engines: {node: '>=14.0.0'} peerDependencies: react: '>=16.8' dependencies: - '@remix-run/router': 1.10.0 + '@remix-run/router': 1.11.0 react: 18.2.0 dev: false @@ -3865,6 +3865,7 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: true /set-function-length@1.1.1: resolution: {integrity: sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==} @@ -4069,10 +4070,10 @@ packages: chokidar: 3.5.3 didyoumean: 1.2.2 dlv: 1.1.3 - fast-glob: 3.3.1 + fast-glob: 3.3.2 glob-parent: 6.0.2 is-glob: 4.0.3 - jiti: 1.20.0 + jiti: 1.21.0 lilconfig: 2.1.0 micromatch: 4.0.5 normalize-path: 3.0.0 @@ -4090,8 +4091,8 @@ packages: - ts-node dev: false - /terser@5.22.0: - resolution: {integrity: sha512-hHZVLgRA2z4NWcN6aS5rQDc+7Dcy58HOf2zbYwmFcQ+ua3h6eEFf5lIDKTzbWwlazPyOZsFQO8V80/IjVNExEw==} + /terser@5.24.0: + resolution: {integrity: sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw==} engines: {node: '>=10'} hasBin: true dependencies: @@ -4247,7 +4248,7 @@ packages: /uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: - punycode: 2.3.0 + punycode: 2.3.1 dev: true /use-sync-external-store@1.2.0(react@18.2.0): @@ -4267,7 +4268,7 @@ packages: hasBin: true dev: false - /vite@4.5.0(@types/node@18.18.7)(less@4.2.0)(terser@5.22.0): + /vite@4.5.0(@types/node@18.18.8)(less@4.2.0)(terser@5.24.0): resolution: {integrity: sha512-ulr8rNLA6rkyFAlVWw2q5YJ91v098AFQ2R0PRFwPzREXOUJQPtFUG0t+/ZikhaOCDqFoDhN6/v8Sq0o4araFAw==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -4295,12 +4296,12 @@ packages: terser: optional: true dependencies: - '@types/node': 18.18.7 + '@types/node': 18.18.8 esbuild: 0.18.20 less: 4.2.0 postcss: 8.4.31 rollup: 3.29.4 - terser: 5.22.0 + terser: 5.24.0 optionalDependencies: fsevents: 2.3.3 dev: true @@ -4388,14 +4389,15 @@ packages: /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true /yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} dev: false - /yaml@2.3.3: - resolution: {integrity: sha512-zw0VAJxgeZ6+++/su5AFoqBbZbrEakwu+X0M5HmcwUiBL7AzcuPKjj5we4xfQLp78LkEMpD0cOnUhmgOVy3KdQ==} + /yaml@2.3.4: + resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} engines: {node: '>= 14'} dev: false @@ -4404,8 +4406,8 @@ packages: engines: {node: '>=10'} dev: true - /zustand@4.4.4(@types/react@18.2.33)(react@18.2.0): - resolution: {integrity: sha512-5UTUIAiHMNf5+mFp7/AnzJXS7+XxktULFN0+D1sCiZWyX7ZG+AQpqs2qpYrynRij4QvoDdCD+U+bmg/cG3Ucxw==} + /zustand@4.4.6(@types/react@18.2.36)(react@18.2.0): + resolution: {integrity: sha512-Rb16eW55gqL4W2XZpJh0fnrATxYEG3Apl2gfHTyDSE965x/zxslTikpNch0JgNjJA9zK6gEFW8Fl6d1rTZaqgg==} engines: {node: '>=12.7.0'} peerDependencies: '@types/react': '>=16.8' @@ -4419,7 +4421,7 @@ packages: react: optional: true dependencies: - '@types/react': 18.2.33 + '@types/react': 18.2.36 react: 18.2.0 use-sync-external-store: 1.2.0(react@18.2.0) dev: false From 342d1aeefb3f96765c776f78167aa39d5d744eab Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 6 Nov 2023 22:33:12 +0800 Subject: [PATCH 030/650] fix: version checker --- server/server.go | 2 +- .../version_checker/version_checker.go | 35 ++++++++----------- .../version_checker/version_checker_test.go | 2 +- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/server/server.go b/server/server.go index 62e89662f45c6..080d3f7415df4 100644 --- a/server/server.go +++ b/server/server.go @@ -110,7 +110,7 @@ func NewServer(ctx context.Context, profile *profile.Profile, store *store.Store } func (s *Server) Start(ctx context.Context) error { - go versionchecker.NewVersionChecker(s.Store).Start(ctx) + go versionchecker.NewVersionChecker(s.Store, s.Profile).Start(ctx) go s.telegramBot.Start(ctx) go s.backupRunner.Run(ctx) diff --git a/server/service/version_checker/version_checker.go b/server/service/version_checker/version_checker.go index 73494261da170..0c3459a2ca045 100644 --- a/server/service/version_checker/version_checker.go +++ b/server/service/version_checker/version_checker.go @@ -11,18 +11,21 @@ import ( "github.com/pkg/errors" storepb "github.com/usememos/memos/proto/gen/store" + "github.com/usememos/memos/server/profile" "github.com/usememos/memos/server/version" "github.com/usememos/memos/store" ) // nolint type VersionChecker struct { - Store *store.Store + Store *store.Store + Profile *profile.Profile } -func NewVersionChecker(store *store.Store) *VersionChecker { +func NewVersionChecker(store *store.Store, profile *profile.Profile) *VersionChecker { return &VersionChecker{ - Store: store, + Store: store, + Profile: profile, } } @@ -47,20 +50,11 @@ func (*VersionChecker) GetLatestVersion() (string, error) { } func (c *VersionChecker) Check(ctx context.Context) { - migrationHistories, err := c.Store.FindMigrationHistoryList(ctx, &store.FindMigrationHistory{}) - if err != nil { - return - } - if len(migrationHistories) == 0 { - return - } - - lastVersion := migrationHistories[0].Version latestVersion, err := c.GetLatestVersion() if err != nil { return } - if !version.IsVersionGreaterThan(latestVersion, lastVersion) { + if !version.IsVersionGreaterThan(latestVersion, version.GetCurrentVersion(c.Profile.Mode)) { return } @@ -71,15 +65,16 @@ func (c *VersionChecker) Check(ctx context.Context) { if err != nil { return } - if len(list) == 0 { - return - } - latestVersionUpdateActivity := list[0] - if latestVersionUpdateActivity.Payload == nil { - return + shouldNotify := true + if len(list) > 0 { + latestVersionUpdateActivity := list[0] + if latestVersionUpdateActivity.Payload != nil && version.IsVersionGreaterOrEqualThan(latestVersionUpdateActivity.Payload.VersionUpdate.Version, latestVersion) { + shouldNotify = false + } } - if version.IsVersionGreaterOrEqualThan(latestVersionUpdateActivity.Payload.VersionUpdate.Version, latestVersion) { + + if !shouldNotify { return } diff --git a/server/service/version_checker/version_checker_test.go b/server/service/version_checker/version_checker_test.go index 9ddde295b688b..19a7dc35b5b43 100644 --- a/server/service/version_checker/version_checker_test.go +++ b/server/service/version_checker/version_checker_test.go @@ -7,6 +7,6 @@ import ( ) func TestGetLatestVersion(t *testing.T) { - _, err := NewVersionChecker(nil).GetLatestVersion() + _, err := NewVersionChecker(nil, nil).GetLatestVersion() require.NoError(t, err) } From 834b58fbbde1b166287b4255d63dd5adc15eb34a Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 6 Nov 2023 22:53:55 +0800 Subject: [PATCH 031/650] feat: add version update inbox message --- api/v2/activity_service .go | 5 + proto/api/v2/activity_service.proto | 5 + proto/api/v2/inbox_service.proto | 1 + proto/gen/api/v2/README.md | 18 ++ proto/gen/api/v2/activity_service.pb.go | 202 ++++++++++++------ proto/gen/api/v2/inbox_service.pb.go | 137 ++++++------ .../components/Inbox/VersionUpdateMessage.tsx | 105 +++++++++ web/src/locales/en.json | 3 +- web/src/pages/Inboxes.tsx | 3 + 9 files changed, 350 insertions(+), 129 deletions(-) create mode 100644 web/src/components/Inbox/VersionUpdateMessage.tsx diff --git a/api/v2/activity_service .go b/api/v2/activity_service .go index 62c499016b43f..468747ed07b75 100644 --- a/api/v2/activity_service .go +++ b/api/v2/activity_service .go @@ -49,5 +49,10 @@ func convertActivityPayloadFromStore(payload *storepb.ActivityPayload) *apiv2pb. RelatedMemoId: payload.MemoComment.RelatedMemoId, } } + if payload.VersionUpdate != nil { + v2Payload.VersionUpdate = &apiv2pb.ActivityVersionUpdatePayload{ + Version: payload.VersionUpdate.Version, + } + } return v2Payload } diff --git a/proto/api/v2/activity_service.proto b/proto/api/v2/activity_service.proto index 8d7ebb49021c9..fb1eb57a645d2 100644 --- a/proto/api/v2/activity_service.proto +++ b/proto/api/v2/activity_service.proto @@ -32,8 +32,13 @@ message ActivityMemoCommentPayload { int32 related_memo_id = 2; } +message ActivityVersionUpdatePayload { + string version = 1; +} + message ActivityPayload { ActivityMemoCommentPayload memo_comment = 1; + ActivityVersionUpdatePayload version_update = 2; } message GetActivityRequest { diff --git a/proto/api/v2/inbox_service.proto b/proto/api/v2/inbox_service.proto index 001a44fb8faba..0e4d397776d10 100644 --- a/proto/api/v2/inbox_service.proto +++ b/proto/api/v2/inbox_service.proto @@ -49,6 +49,7 @@ message Inbox { enum Type { TYPE_UNSPECIFIED = 0; TYPE_MEMO_COMMENT = 1; + TYPE_VERSION_UPDATE = 2; } Type type = 6; diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index 7af9709f55459..f67046e0fec41 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -7,6 +7,7 @@ - [Activity](#memos-api-v2-Activity) - [ActivityMemoCommentPayload](#memos-api-v2-ActivityMemoCommentPayload) - [ActivityPayload](#memos-api-v2-ActivityPayload) + - [ActivityVersionUpdatePayload](#memos-api-v2-ActivityVersionUpdatePayload) - [GetActivityRequest](#memos-api-v2-GetActivityRequest) - [GetActivityResponse](#memos-api-v2-GetActivityResponse) @@ -155,6 +156,22 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | memo_comment | [ActivityMemoCommentPayload](#memos-api-v2-ActivityMemoCommentPayload) | | | +| version_update | [ActivityVersionUpdatePayload](#memos-api-v2-ActivityVersionUpdatePayload) | | | + + + + + + + + +### ActivityVersionUpdatePayload + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [string](#string) | | | @@ -377,6 +394,7 @@ | ---- | ------ | ----------- | | TYPE_UNSPECIFIED | 0 | | | TYPE_MEMO_COMMENT | 1 | | +| TYPE_VERSION_UPDATE | 2 | | diff --git a/proto/gen/api/v2/activity_service.pb.go b/proto/gen/api/v2/activity_service.pb.go index e4c0af225b88a..472742b0a2425 100644 --- a/proto/gen/api/v2/activity_service.pb.go +++ b/proto/gen/api/v2/activity_service.pb.go @@ -164,18 +164,66 @@ func (x *ActivityMemoCommentPayload) GetRelatedMemoId() int32 { return 0 } +type ActivityVersionUpdatePayload struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` +} + +func (x *ActivityVersionUpdatePayload) Reset() { + *x = ActivityVersionUpdatePayload{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_activity_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ActivityVersionUpdatePayload) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ActivityVersionUpdatePayload) ProtoMessage() {} + +func (x *ActivityVersionUpdatePayload) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_activity_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 ActivityVersionUpdatePayload.ProtoReflect.Descriptor instead. +func (*ActivityVersionUpdatePayload) Descriptor() ([]byte, []int) { + return file_api_v2_activity_service_proto_rawDescGZIP(), []int{2} +} + +func (x *ActivityVersionUpdatePayload) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + type ActivityPayload struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - MemoComment *ActivityMemoCommentPayload `protobuf:"bytes,1,opt,name=memo_comment,json=memoComment,proto3" json:"memo_comment,omitempty"` + MemoComment *ActivityMemoCommentPayload `protobuf:"bytes,1,opt,name=memo_comment,json=memoComment,proto3" json:"memo_comment,omitempty"` + VersionUpdate *ActivityVersionUpdatePayload `protobuf:"bytes,2,opt,name=version_update,json=versionUpdate,proto3" json:"version_update,omitempty"` } func (x *ActivityPayload) Reset() { *x = ActivityPayload{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_activity_service_proto_msgTypes[2] + mi := &file_api_v2_activity_service_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -188,7 +236,7 @@ func (x *ActivityPayload) String() string { func (*ActivityPayload) ProtoMessage() {} func (x *ActivityPayload) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_activity_service_proto_msgTypes[2] + mi := &file_api_v2_activity_service_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -201,7 +249,7 @@ func (x *ActivityPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use ActivityPayload.ProtoReflect.Descriptor instead. func (*ActivityPayload) Descriptor() ([]byte, []int) { - return file_api_v2_activity_service_proto_rawDescGZIP(), []int{2} + return file_api_v2_activity_service_proto_rawDescGZIP(), []int{3} } func (x *ActivityPayload) GetMemoComment() *ActivityMemoCommentPayload { @@ -211,6 +259,13 @@ func (x *ActivityPayload) GetMemoComment() *ActivityMemoCommentPayload { return nil } +func (x *ActivityPayload) GetVersionUpdate() *ActivityVersionUpdatePayload { + if x != nil { + return x.VersionUpdate + } + return nil +} + type GetActivityRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -222,7 +277,7 @@ type GetActivityRequest struct { func (x *GetActivityRequest) Reset() { *x = GetActivityRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_activity_service_proto_msgTypes[3] + mi := &file_api_v2_activity_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -235,7 +290,7 @@ func (x *GetActivityRequest) String() string { func (*GetActivityRequest) ProtoMessage() {} func (x *GetActivityRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_activity_service_proto_msgTypes[3] + mi := &file_api_v2_activity_service_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -248,7 +303,7 @@ func (x *GetActivityRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetActivityRequest.ProtoReflect.Descriptor instead. func (*GetActivityRequest) Descriptor() ([]byte, []int) { - return file_api_v2_activity_service_proto_rawDescGZIP(), []int{3} + return file_api_v2_activity_service_proto_rawDescGZIP(), []int{4} } func (x *GetActivityRequest) GetId() int32 { @@ -269,7 +324,7 @@ type GetActivityResponse struct { func (x *GetActivityResponse) Reset() { *x = GetActivityResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_activity_service_proto_msgTypes[4] + mi := &file_api_v2_activity_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -282,7 +337,7 @@ func (x *GetActivityResponse) String() string { func (*GetActivityResponse) ProtoMessage() {} func (x *GetActivityResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_activity_service_proto_msgTypes[4] + mi := &file_api_v2_activity_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -295,7 +350,7 @@ func (x *GetActivityResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetActivityResponse.ProtoReflect.Descriptor instead. func (*GetActivityResponse) Descriptor() ([]byte, []int) { - return file_api_v2_activity_service_proto_rawDescGZIP(), []int{4} + return file_api_v2_activity_service_proto_rawDescGZIP(), []int{5} } func (x *GetActivityResponse) GetActivity() *Activity { @@ -334,39 +389,48 @@ var file_api_v2_activity_service_proto_rawDesc = []byte{ 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, 0x22, 0x5e, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x69, 0x74, 0x79, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x4b, 0x0a, 0x0c, 0x6d, 0x65, - 0x6d, 0x6f, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x28, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, - 0x65, 0x6e, 0x74, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, - 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 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, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x08, - 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x32, 0x7d, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x69, 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x0b, 0x47, - 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, + 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x1c, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 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, 0x22, 0xb1, 0x01, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x4b, 0x0a, 0x0c, 0x6d, 0x65, 0x6d, 0x6f, 0x5f, 0x63, 0x6f, + 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 0x4d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0b, 0x6d, 0x65, 0x6d, 0x6f, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x51, 0x0a, 0x0e, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x75, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x52, 0x0d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x69, 0x74, 0x79, 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, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x32, 0x0a, 0x08, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x08, 0x61, 0x63, + 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x32, 0x7d, 0x0a, 0x0f, 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6a, 0x0a, 0x0b, 0x47, 0x65, 0x74, + 0x41, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x79, 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, 0x41, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x79, 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, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x74, - 0x69, 0x76, 0x69, 0x74, 0x69, 0x65, 0x73, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x41, 0x63, - 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 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, + 0x69, 0x76, 0x69, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x32, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, + 0x69, 0x74, 0x69, 0x65, 0x73, 0x42, 0xac, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, + 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x69, 0x74, 0x79, 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 ( @@ -381,27 +445,29 @@ func file_api_v2_activity_service_proto_rawDescGZIP() []byte { return file_api_v2_activity_service_proto_rawDescData } -var file_api_v2_activity_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_api_v2_activity_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_api_v2_activity_service_proto_goTypes = []interface{}{ - (*Activity)(nil), // 0: memos.api.v2.Activity - (*ActivityMemoCommentPayload)(nil), // 1: memos.api.v2.ActivityMemoCommentPayload - (*ActivityPayload)(nil), // 2: memos.api.v2.ActivityPayload - (*GetActivityRequest)(nil), // 3: memos.api.v2.GetActivityRequest - (*GetActivityResponse)(nil), // 4: memos.api.v2.GetActivityResponse - (*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp + (*Activity)(nil), // 0: memos.api.v2.Activity + (*ActivityMemoCommentPayload)(nil), // 1: memos.api.v2.ActivityMemoCommentPayload + (*ActivityVersionUpdatePayload)(nil), // 2: memos.api.v2.ActivityVersionUpdatePayload + (*ActivityPayload)(nil), // 3: memos.api.v2.ActivityPayload + (*GetActivityRequest)(nil), // 4: memos.api.v2.GetActivityRequest + (*GetActivityResponse)(nil), // 5: memos.api.v2.GetActivityResponse + (*timestamppb.Timestamp)(nil), // 6: google.protobuf.Timestamp } var file_api_v2_activity_service_proto_depIdxs = []int32{ - 5, // 0: memos.api.v2.Activity.create_time:type_name -> google.protobuf.Timestamp - 2, // 1: memos.api.v2.Activity.payload:type_name -> memos.api.v2.ActivityPayload + 6, // 0: memos.api.v2.Activity.create_time:type_name -> google.protobuf.Timestamp + 3, // 1: memos.api.v2.Activity.payload:type_name -> memos.api.v2.ActivityPayload 1, // 2: memos.api.v2.ActivityPayload.memo_comment:type_name -> memos.api.v2.ActivityMemoCommentPayload - 0, // 3: memos.api.v2.GetActivityResponse.activity:type_name -> memos.api.v2.Activity - 3, // 4: memos.api.v2.ActivityService.GetActivity:input_type -> memos.api.v2.GetActivityRequest - 4, // 5: memos.api.v2.ActivityService.GetActivity:output_type -> memos.api.v2.GetActivityResponse - 5, // [5:6] is the sub-list for method output_type - 4, // [4:5] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 2, // 3: memos.api.v2.ActivityPayload.version_update:type_name -> memos.api.v2.ActivityVersionUpdatePayload + 0, // 4: memos.api.v2.GetActivityResponse.activity:type_name -> memos.api.v2.Activity + 4, // 5: memos.api.v2.ActivityService.GetActivity:input_type -> memos.api.v2.GetActivityRequest + 5, // 6: memos.api.v2.ActivityService.GetActivity:output_type -> memos.api.v2.GetActivityResponse + 6, // [6:7] is the sub-list for method output_type + 5, // [5:6] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_api_v2_activity_service_proto_init() } @@ -435,7 +501,7 @@ func file_api_v2_activity_service_proto_init() { } } file_api_v2_activity_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActivityPayload); i { + switch v := v.(*ActivityVersionUpdatePayload); i { case 0: return &v.state case 1: @@ -447,7 +513,7 @@ func file_api_v2_activity_service_proto_init() { } } file_api_v2_activity_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetActivityRequest); i { + switch v := v.(*ActivityPayload); i { case 0: return &v.state case 1: @@ -459,6 +525,18 @@ func file_api_v2_activity_service_proto_init() { } } file_api_v2_activity_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetActivityRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_activity_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetActivityResponse); i { case 0: return &v.state @@ -477,7 +555,7 @@ func file_api_v2_activity_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v2_activity_service_proto_rawDesc, NumEnums: 0, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/api/v2/inbox_service.pb.go b/proto/gen/api/v2/inbox_service.pb.go index ed34959df39c1..fad7faccf4325 100644 --- a/proto/gen/api/v2/inbox_service.pb.go +++ b/proto/gen/api/v2/inbox_service.pb.go @@ -75,8 +75,9 @@ func (Inbox_Status) EnumDescriptor() ([]byte, []int) { type Inbox_Type int32 const ( - Inbox_TYPE_UNSPECIFIED Inbox_Type = 0 - Inbox_TYPE_MEMO_COMMENT Inbox_Type = 1 + Inbox_TYPE_UNSPECIFIED Inbox_Type = 0 + Inbox_TYPE_MEMO_COMMENT Inbox_Type = 1 + Inbox_TYPE_VERSION_UPDATE Inbox_Type = 2 ) // Enum value maps for Inbox_Type. @@ -84,10 +85,12 @@ var ( Inbox_Type_name = map[int32]string{ 0: "TYPE_UNSPECIFIED", 1: "TYPE_MEMO_COMMENT", + 2: "TYPE_VERSION_UPDATE", } Inbox_Type_value = map[string]int32{ - "TYPE_UNSPECIFIED": 0, - "TYPE_MEMO_COMMENT": 1, + "TYPE_UNSPECIFIED": 0, + "TYPE_MEMO_COMMENT": 1, + "TYPE_VERSION_UPDATE": 2, } ) @@ -514,7 +517,7 @@ var file_api_v2_inbox_service_proto_rawDesc = []byte{ 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, 0x95, 0x03, 0x0a, 0x05, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x12, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xae, 0x03, 0x0a, 0x05, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, @@ -535,69 +538,71 @@ var file_api_v2_inbox_service_proto_rawDesc = []byte{ 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x55, 0x4e, 0x52, 0x45, 0x41, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, - 0x48, 0x49, 0x56, 0x45, 0x44, 0x10, 0x02, 0x22, 0x33, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x48, 0x49, 0x56, 0x45, 0x44, 0x10, 0x02, 0x22, 0x4c, 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, 0x15, 0x0a, 0x11, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, - 0x4d, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x42, 0x0e, 0x0a, 0x0c, - 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x12, - 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x44, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, - 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, - 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, - 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, - 0x62, 0x6f, 0x78, 0x52, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x22, 0x7c, 0x0a, 0x12, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 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, 0x40, 0x0a, 0x13, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x29, 0x0a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x22, 0x28, 0x0a, 0x12, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 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, 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf9, 0x02, - 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, - 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x20, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x0b, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, - 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, - 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2e, 0xda, 0x41, 0x11, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x05, 0x69, 0x6e, - 0x62, 0x6f, 0x78, 0x32, 0x0b, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, - 0x12, 0x77, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, - 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f, 0x76, 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, - 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, - 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x11, - 0x49, 0x6e, 0x62, 0x6f, 0x78, 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, + 0x4d, 0x4f, 0x5f, 0x43, 0x4f, 0x4d, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, + 0x41, 0x54, 0x45, 0x10, 0x02, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x69, + 0x74, 0x79, 0x5f, 0x69, 0x64, 0x22, 0x28, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, + 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, + 0x44, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x07, 0x69, 0x6e, + 0x62, 0x6f, 0x78, 0x65, 0x73, 0x22, 0x7c, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x05, 0x69, + 0x6e, 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, + 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 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, 0x40, 0x0a, 0x13, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, + 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x69, 0x6e, + 0x62, 0x6f, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, + 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x05, + 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x22, 0x28, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, + 0x6e, 0x62, 0x6f, 0x78, 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, + 0x15, 0x0a, 0x13, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xf9, 0x02, 0x0a, 0x0c, 0x49, 0x6e, 0x62, 0x6f, 0x78, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6b, 0x0a, 0x0b, 0x4c, 0x69, 0x73, 0x74, 0x49, + 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x65, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x62, 0x6f, + 0x78, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x11, 0x12, 0x0f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x62, + 0x6f, 0x78, 0x65, 0x73, 0x12, 0x82, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, + 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, + 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0xda, 0x41, 0x11, 0x69, 0x6e, + 0x62, 0x6f, 0x78, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x05, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x32, 0x0b, 0x2f, 0x76, + 0x32, 0x2f, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x12, 0x77, 0x0a, 0x0b, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x12, 0x20, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, + 0x62, 0x6f, 0x78, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6d, 0x65, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x49, 0x6e, 0x62, 0x6f, 0x78, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0xda, + 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x2a, 0x14, 0x2f, 0x76, + 0x32, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x69, 0x6e, 0x62, 0x6f, 0x78, 0x65, 0x73, 0x2f, + 0x2a, 0x7d, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x11, 0x49, 0x6e, 0x62, 0x6f, 0x78, 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/web/src/components/Inbox/VersionUpdateMessage.tsx b/web/src/components/Inbox/VersionUpdateMessage.tsx new file mode 100644 index 0000000000000..7f8c2ed2a59ff --- /dev/null +++ b/web/src/components/Inbox/VersionUpdateMessage.tsx @@ -0,0 +1,105 @@ +import { Tooltip } from "@mui/joy"; +import classNames from "classnames"; +import { useEffect, useState } from "react"; +import toast from "react-hot-toast"; +import { activityServiceClient } from "@/grpcweb"; +import { useInboxStore } from "@/store/v1"; +import { Activity } from "@/types/proto/api/v2/activity_service"; +import { Inbox, Inbox_Status } from "@/types/proto/api/v2/inbox_service"; +import { useTranslate } from "@/utils/i18n"; +import Icon from "../Icon"; + +interface Props { + inbox: Inbox; +} + +const VersionUpdateMessage = ({ inbox }: Props) => { + const t = useTranslate(); + const inboxStore = useInboxStore(); + const [activity, setActivity] = useState(undefined); + + useEffect(() => { + if (!inbox.activityId) { + return; + } + + activityServiceClient + .getActivity({ + id: inbox.activityId, + }) + .then(({ activity }) => { + console.log("activity", activity); + setActivity(activity); + }); + }, [inbox.activityId]); + + const handleNavigate = () => { + if (!activity?.payload?.versionUpdate?.version) { + return; + } + window.open(`https://github.com/usememos/memos/releases/tag/v${activity?.payload?.versionUpdate?.version}`); + if (inbox.status === Inbox_Status.UNREAD) { + handleArchiveMessage(true); + } + }; + + const handleArchiveMessage = async (silence = false) => { + await inboxStore.updateInbox( + { + name: inbox.name, + status: Inbox_Status.ARCHIVED, + }, + ["status"] + ); + if (!silence) { + toast.success("Archived"); + } + }; + + return ( +
+
+ + + +
+
+
+ {inbox.createTime?.toLocaleString()} +
+ {inbox.status === Inbox_Status.UNREAD && ( + + handleArchiveMessage()} + /> + + )} +
+
+

+ {t("inbox.version-update", { + version: activity?.payload?.versionUpdate?.version, + })} +

+
+
+ ); +}; + +export default VersionUpdateMessage; diff --git a/web/src/locales/en.json b/web/src/locales/en.json index 75c1f18f8b3c7..3646e5bf65e4d 100644 --- a/web/src/locales/en.json +++ b/web/src/locales/en.json @@ -370,6 +370,7 @@ "password-login-disabled": "Can't remove last identity provider when password login is disabled" }, "inbox": { - "memo-comment": "{{user}} has a comment on your {{memo}}." + "memo-comment": "{{user}} has a comment on your {{memo}}.", + "version-update": "New version {{version}} is available now!" } } diff --git a/web/src/pages/Inboxes.tsx b/web/src/pages/Inboxes.tsx index c0d7ae3826a5e..c72c8dbad4a91 100644 --- a/web/src/pages/Inboxes.tsx +++ b/web/src/pages/Inboxes.tsx @@ -2,6 +2,7 @@ import { useEffect } from "react"; import Empty from "@/components/Empty"; import Icon from "@/components/Icon"; import MemoCommentMessage from "@/components/Inbox/MemoCommentMessage"; +import VersionUpdateMessage from "@/components/Inbox/VersionUpdateMessage"; import MobileHeader from "@/components/MobileHeader"; import { useInboxStore } from "@/store/v1"; import { Inbox_Type } from "@/types/proto/api/v2/inbox_service"; @@ -38,6 +39,8 @@ const Inboxes = () => { {inboxes.map((inbox) => { if (inbox.type === Inbox_Type.TYPE_MEMO_COMMENT) { return ; + } else if (inbox.type === Inbox_Type.TYPE_VERSION_UPDATE) { + return ; } return undefined; })} From 5e4493b22775cad9491a91e048034101dd95966e Mon Sep 17 00:00:00 2001 From: Steven Date: Mon, 6 Nov 2023 23:20:26 +0800 Subject: [PATCH 032/650] chore: remove debug codes --- web/src/components/Inbox/VersionUpdateMessage.tsx | 1 - web/src/components/Memo.tsx | 2 +- web/src/components/MemoEditor/RelationListView.tsx | 2 -- web/src/components/MemoList.tsx | 2 +- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/web/src/components/Inbox/VersionUpdateMessage.tsx b/web/src/components/Inbox/VersionUpdateMessage.tsx index 7f8c2ed2a59ff..42ceb0bd3c914 100644 --- a/web/src/components/Inbox/VersionUpdateMessage.tsx +++ b/web/src/components/Inbox/VersionUpdateMessage.tsx @@ -28,7 +28,6 @@ const VersionUpdateMessage = ({ inbox }: Props) => { id: inbox.activityId, }) .then(({ activity }) => { - console.log("activity", activity); setActivity(activity); }); }, [inbox.activityId]); diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 5bebd0867ab5b..50660289d22bb 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -42,7 +42,7 @@ const Memo: React.FC = (props: Props) => { const [shouldRender, setShouldRender] = useState(lazyRendering ? false : true); const [displayTime, setDisplayTime] = useState(getRelativeTimeString(memo.displayTs)); const memoContainerRef = useRef(null); - const readonly = memo.creatorUsername !== extractUsernameFromName(user?.name); + const readonly = memo.creatorUsername !== extractUsernameFromName(user?.name || ""); const [creator, setCreator] = useState(userV1Store.getUserByUsername(memo.creatorUsername)); const referenceRelations = memo.relationList.filter((relation) => relation.type === "REFERENCE"); const commentRelations = memo.relationList.filter((relation) => relation.relatedMemoId === memo.id && relation.type === "COMMENT"); diff --git a/web/src/components/MemoEditor/RelationListView.tsx b/web/src/components/MemoEditor/RelationListView.tsx index 7915a7b45a493..f9aabcb7de6c2 100644 --- a/web/src/components/MemoEditor/RelationListView.tsx +++ b/web/src/components/MemoEditor/RelationListView.tsx @@ -28,8 +28,6 @@ const RelationListView = (props: Props) => { setRelationList(relationList.filter((relation) => relation.relatedMemoId !== memo.id)); }; - console.log("referencingMemoList", referencingMemoList); - return ( <> {referencingMemoList.length > 0 && ( diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx index c8ef4c12fdc38..f898d7a413ae6 100644 --- a/web/src/components/MemoList.tsx +++ b/web/src/components/MemoList.tsx @@ -22,7 +22,7 @@ const MemoList: React.FC = () => { const user = useCurrentUser(); const { tag: tagQuery, duration, text: textQuery, visibility } = filter; const showMemoFilter = Boolean(tagQuery || (duration && duration.from < duration.to) || textQuery || visibility); - const username = params.username || extractUsernameFromName(user.name) || ""; + const username = params.username || extractUsernameFromName(user.name || ""); const fetchMoreRef = useRef(null); From 9c4f72c96ee1a4263b6e3b5f13d4079454e3574a Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 7 Nov 2023 07:06:38 +0800 Subject: [PATCH 033/650] chore: update tooltips --- web/src/components/Inbox/VersionUpdateMessage.tsx | 2 +- web/src/components/Memo.tsx | 2 +- web/src/components/MemoList.tsx | 2 +- web/src/store/v1/resourceName.ts | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/components/Inbox/VersionUpdateMessage.tsx b/web/src/components/Inbox/VersionUpdateMessage.tsx index 42ceb0bd3c914..dcf0a41dbabe1 100644 --- a/web/src/components/Inbox/VersionUpdateMessage.tsx +++ b/web/src/components/Inbox/VersionUpdateMessage.tsx @@ -65,7 +65,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => { : "border-gray-400 text-gray-400 bg-gray-50 dark:bg-zinc-800" )} > - +
diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 50660289d22bb..5bebd0867ab5b 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -42,7 +42,7 @@ const Memo: React.FC = (props: Props) => { const [shouldRender, setShouldRender] = useState(lazyRendering ? false : true); const [displayTime, setDisplayTime] = useState(getRelativeTimeString(memo.displayTs)); const memoContainerRef = useRef(null); - const readonly = memo.creatorUsername !== extractUsernameFromName(user?.name || ""); + const readonly = memo.creatorUsername !== extractUsernameFromName(user?.name); const [creator, setCreator] = useState(userV1Store.getUserByUsername(memo.creatorUsername)); const referenceRelations = memo.relationList.filter((relation) => relation.type === "REFERENCE"); const commentRelations = memo.relationList.filter((relation) => relation.relatedMemoId === memo.id && relation.type === "COMMENT"); diff --git a/web/src/components/MemoList.tsx b/web/src/components/MemoList.tsx index f898d7a413ae6..6ebdb31d4471d 100644 --- a/web/src/components/MemoList.tsx +++ b/web/src/components/MemoList.tsx @@ -22,7 +22,7 @@ const MemoList: React.FC = () => { const user = useCurrentUser(); const { tag: tagQuery, duration, text: textQuery, visibility } = filter; const showMemoFilter = Boolean(tagQuery || (duration && duration.from < duration.to) || textQuery || visibility); - const username = params.username || extractUsernameFromName(user.name || ""); + const username = params.username || extractUsernameFromName(user.name); const fetchMoreRef = useRef(null); diff --git a/web/src/store/v1/resourceName.ts b/web/src/store/v1/resourceName.ts index 7fc71ce2f1dbd..eb0ab985fbd08 100644 --- a/web/src/store/v1/resourceName.ts +++ b/web/src/store/v1/resourceName.ts @@ -1,5 +1,5 @@ export const UserNamePrefix = "users/"; -export const extractUsernameFromName = (name: string) => { - return name.split("/")[1]; +export const extractUsernameFromName = (name: string = "") => { + return name.slice(UserNamePrefix.length); }; From 32cafbff9b6bb697f9516e62f2938a7652b95f12 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 7 Nov 2023 07:20:17 +0800 Subject: [PATCH 034/650] chore: add OverflowTip kit component --- web/src/components/CreateTagDialog.tsx | 23 ++++++++++--------- web/src/components/TagList.tsx | 2 +- web/src/components/kit/OverflowTip.tsx | 31 ++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 web/src/components/kit/OverflowTip.tsx diff --git a/web/src/components/CreateTagDialog.tsx b/web/src/components/CreateTagDialog.tsx index 4667893afaafe..76cc2223749b5 100644 --- a/web/src/components/CreateTagDialog.tsx +++ b/web/src/components/CreateTagDialog.tsx @@ -8,6 +8,7 @@ import { useTagStore } from "@/store/module"; import { useTranslate } from "@/utils/i18n"; import { generateDialog } from "./Dialog"; import Icon from "./Icon"; +import OverflowTip from "./kit/OverflowTip"; type Props = DialogProps; @@ -108,13 +109,14 @@ const CreateTagDialog: React.FC = (props: Props) => { {Array.from(tagNameList) .sort() .map((tag) => ( - handleDeleteTag(tag)} + className="max-w-[120px] text-sm mr-2 mt-1 font-mono cursor-pointer dark:text-gray-300 hover:opacity-60 hover:line-through" > - #{tag} - + handleDeleteTag(tag)}> + #{tag} + + ))}
@@ -135,13 +137,14 @@ const CreateTagDialog: React.FC = (props: Props) => { <>
{shownSuggestTagNameList.map((tag) => ( - handleUpsertTag(tag)} + className="max-w-[120px] text-sm mr-2 mt-1 font-mono cursor-pointer dark:text-gray-300 hover:opacity-60" > - #{tag} - + handleUpsertTag(tag)}> + #{tag} + + ))}
{hasSubTags ? (
diff --git a/web/src/components/kit/OverflowTip.tsx b/web/src/components/kit/OverflowTip.tsx new file mode 100644 index 0000000000000..b417da0fd2612 --- /dev/null +++ b/web/src/components/kit/OverflowTip.tsx @@ -0,0 +1,31 @@ +import { Tooltip } from "@mui/joy"; +import classNames from "classnames"; +import { useRef, useState, useEffect } from "react"; + +interface Props { + children: React.ReactNode; + className?: string; +} + +const OverflowTip = ({ children, className }: Props) => { + const [isOverflowed, setIsOverflow] = useState(false); + const textElementRef = useRef(null); + + useEffect(() => { + if (!textElementRef.current) { + return; + } + + setIsOverflow(textElementRef.current.scrollWidth > textElementRef.current.clientWidth); + }, []); + + return ( + +
+ {children} +
+
+ ); +}; + +export default OverflowTip; From 7e545533cf79e2b97c9ad9b3aac5527aa8a79f00 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 7 Nov 2023 07:24:41 +0800 Subject: [PATCH 035/650] chore: update resource cache control --- api/resource/resource.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/resource/resource.go b/api/resource/resource.go index 892ea7a7183f0..c6e6beecadb7b 100644 --- a/api/resource/resource.go +++ b/api/resource/resource.go @@ -106,8 +106,9 @@ func (s *Service) streamResource(c echo.Context) error { } } - c.Response().Writer.Header().Set(echo.HeaderCacheControl, "max-age=31536000, immutable") - c.Response().Writer.Header().Set(echo.HeaderContentSecurityPolicy, "default-src 'self'") + c.Response().Writer.Header().Set(echo.HeaderCacheControl, "max-age=3600") + c.Response().Writer.Header().Set(echo.HeaderContentSecurityPolicy, "default-src 'none'; script-src 'none'; img-src 'self'; media-src 'self'; sandbox;") + c.Response().Writer.Header().Set("Content-Disposition", fmt.Sprintf(`filename="%s"`, resource.Filename)) resourceType := strings.ToLower(resource.Type) if strings.HasPrefix(resourceType, "text") { resourceType = echo.MIMETextPlainCharsetUTF8 @@ -115,7 +116,6 @@ func (s *Service) streamResource(c echo.Context) error { http.ServeContent(c.Response(), c.Request(), resource.Filename, time.Unix(resource.UpdatedTs, 0), bytes.NewReader(blob)) return nil } - c.Response().Writer.Header().Set("Content-Disposition", fmt.Sprintf(`filename="%s"`, resource.Filename)) return c.Stream(http.StatusOK, resourceType, bytes.NewReader(blob)) } From c4d27e7a78f0c845c68650082fb453a8013273f2 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 7 Nov 2023 07:36:16 +0800 Subject: [PATCH 036/650] chore: update backend dependencies --- go.mod | 66 +++++++++++++-------------- go.sum | 141 ++++++++++++++++++++++++++++----------------------------- 2 files changed, 102 insertions(+), 105 deletions(-) diff --git a/go.mod b/go.mod index 5343f04844f7f..de49a0093854f 100644 --- a/go.mod +++ b/go.mod @@ -3,36 +3,36 @@ module github.com/usememos/memos go 1.21 require ( - github.com/aws/aws-sdk-go-v2 v1.21.2 - github.com/aws/aws-sdk-go-v2/config v1.19.1 - github.com/aws/aws-sdk-go-v2/credentials v1.13.43 - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.92 - github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2 + github.com/aws/aws-sdk-go-v2 v1.22.1 + github.com/aws/aws-sdk-go-v2/config v1.22.1 + github.com/aws/aws-sdk-go-v2/credentials v1.15.1 + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.2 + github.com/aws/aws-sdk-go-v2/service/s3 v1.42.0 github.com/disintegration/imaging v1.6.2 github.com/go-sql-driver/mysql v1.7.1 github.com/google/cel-go v0.18.1 github.com/google/uuid v1.4.0 - github.com/gorilla/feeds v1.1.1 - github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 + github.com/gorilla/feeds v1.1.2 + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 github.com/improbable-eng/grpc-web v0.15.0 github.com/labstack/echo/v4 v4.11.2 github.com/microcosm-cc/bluemonday v1.0.26 github.com/pkg/errors v0.9.1 - github.com/spf13/cobra v1.7.0 + github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.17.0 github.com/stretchr/testify v1.8.4 github.com/swaggo/echo-swagger v1.4.1 github.com/swaggo/swag v1.16.2 - github.com/yuin/goldmark v1.5.6 + github.com/yuin/goldmark v1.6.0 go.uber.org/zap v1.26.0 golang.org/x/crypto v0.14.0 golang.org/x/exp v0.0.0-20231006140011-7918f672742d - golang.org/x/mod v0.13.0 + golang.org/x/mod v0.14.0 golang.org/x/net v0.17.0 golang.org/x/oauth2 v0.13.0 - google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b + google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 google.golang.org/grpc v1.59.0 - modernc.org/sqlite v1.26.0 + modernc.org/sqlite v1.27.0 ) require ( @@ -47,7 +47,7 @@ require ( 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/gorilla/css v1.0.0 // indirect + github.com/gorilla/css v1.0.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -60,13 +60,13 @@ require ( github.com/swaggo/files/v2 v2.0.0 // indirect golang.org/x/image v0.13.0 // indirect golang.org/x/tools v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b // indirect + google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect lukechampine.com/uint128 v1.3.0 // indirect modernc.org/cc/v3 v3.41.0 // indirect modernc.org/ccgo/v3 v3.16.15 // indirect - modernc.org/libc v1.28.0 // indirect + modernc.org/libc v1.30.0 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.7.2 // indirect modernc.org/opt v0.1.3 // indirect @@ -76,20 +76,20 @@ require ( ) require ( - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect - github.com/aws/smithy-go v1.15.0 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.1 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 // indirect + github.com/aws/smithy-go v1.16.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect @@ -113,9 +113,9 @@ require ( github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/fasttemplate v1.2.2 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - golang.org/x/time v0.3.0 // indirect + golang.org/x/sys v0.14.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.4.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/protobuf v1.31.0 gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 6fc4c5ad7d5a3..4f68aa79bbdae 100644 --- a/go.sum +++ b/go.sum @@ -61,44 +61,44 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.21.2 h1:+LXZ0sgo8quN9UOKXXzAWRT3FWd4NxeXWOZom9pE7GA= -github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14 h1:Sc82v7tDQ/vdU1WtuSyzZ1I7y/68j//HJ6uozND1IDs= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14/go.mod h1:9NCTOURS8OpxvoAVHq79LK81/zC78hfRWFn+aL0SPcY= -github.com/aws/aws-sdk-go-v2/config v1.19.1 h1:oe3vqcGftyk40icfLymhhhNysAwk0NfiwkDi2GTPMXs= -github.com/aws/aws-sdk-go-v2/config v1.19.1/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43 h1:LU8vo40zBlo3R7bAvBVy/ku4nxGEyZe9N8MqAeFTzF8= -github.com/aws/aws-sdk-go-v2/credentials v1.13.43/go.mod h1:zWJBz1Yf1ZtX5NGax9ZdNjhhI4rgjfgsyk6vTY1yfVg= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 h1:PIktER+hwIG286DqXyvVENjgLTAwGgoeriLDD5C+YlQ= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.92 h1:nLA7dGFC6v4P6b+hzqt5GqIGmIuN+jTJzojfdOLXWFE= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.92/go.mod h1:h+ei9z19AhoN+Dac92DwkzfbJ4mFUea92xgl5pKSG0Q= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 h1:nFBQlGtkbPzp/NjZLuFxRqmT91rLJkgvsEQs68h962Y= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 h1:JRVhO25+r3ar2mKGP7E0LDl8K9/G36gjlqca5iQbaqc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 h1:hze8YsjSh8Wl1rYa1CJpRmXP21BvOBuc76YhW0HsuQ4= -github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62Mb/iSdSlCNuj6H5ci7tW7OsE= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6 h1:wmGLw2i8ZTlHLw7a9ULGfQbuccw8uIiNr6sol5bFzc8= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6/go.mod h1:Q0Hq2X/NuL7z8b1Dww8rmOFl+jzusKEcyvkKspwdpyc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15 h1:7R8uRYyXzdD71KWVCL78lJZltah6VVznXBazvKjfH58= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15/go.mod h1:26SQUPcTNgV1Tapwdt4a1rOsYRsnBsJHLMPoxK2b0d8= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38 h1:skaFGzv+3kA+v2BPKhuekeb1Hbb105+44r8ASC+q5SE= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38/go.mod h1:epIZoRSSbRIwLPJU5F+OldHhwZPBdpDeQkRdCeY3+00= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 h1:WWZA/I2K4ptBS1kg0kV1JbBtG/umed0vwHRrmcr9z7k= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6 h1:9ulSU5ClouoPIYhDQdg9tpl83d5Yb91PXTKK+17q+ow= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6/go.mod h1:lnc2taBsR9nTlz9meD+lhFZZ9EWY712QHrRflWpTcOA= -github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2 h1:Ll5/YVCOzRB+gxPqs2uD0R7/MyATC0w85626glSKmp4= -github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2/go.mod h1:Zjfqt7KhQK+PO1bbOsFNzKgaq7TcxzmEoDWN8lM0qzQ= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 h1:JuPGc7IkOP4AaqcZSIcyqLpFSqBWK32rM9+a1g6u73k= -github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 h1:HFiiRkf1SdaAmV3/BHOFZ9DjFynPHj8G/UIO1lQS+fk= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3/go.mod h1:a7bHA82fyUXOm+ZSWKU6PIoBxrjSprdLoM8xPYvzYVg= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 h1:0BkLfgeDjfZnZ+MhB3ONb01u9pwFYTCZVhlsSSBvlbU= -github.com/aws/aws-sdk-go-v2/service/sts v1.23.2/go.mod h1:Eows6e1uQEsc4ZaHANmsPRzAKcVDrcmjjWiih2+HUUQ= -github.com/aws/smithy-go v1.15.0 h1:PS/durmlzvAFpQHDs4wi4sNNP9ExsqZh6IlfdHXgKK8= -github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/aws/aws-sdk-go-v2 v1.22.1 h1:sjnni/AuoTXxHitsIdT0FwmqUuNUuHtufcVDErVFT9U= +github.com/aws/aws-sdk-go-v2 v1.22.1/go.mod h1:Kd0OJtkW3Q0M0lUWGszapWjEvrXDzRW+D21JNsroB+c= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 h1:hHgLiIrTRtddC0AKcJr5s7i/hLgcpTt+q/FKxf1Zayk= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0/go.mod h1:w4I/v3NOWgD+qvs1NPEwhd++1h3XPHFaVxasfY6HlYQ= +github.com/aws/aws-sdk-go-v2/config v1.22.1 h1:UrRYnF7mXCGuKmZWlczOXeH0WUbQpi/gseQIPtrhme8= +github.com/aws/aws-sdk-go-v2/config v1.22.1/go.mod h1:2eWgw5lps8fKI7LZVTrRTYP6HE6k/uEFUuTSHfXwqP0= +github.com/aws/aws-sdk-go-v2/credentials v1.15.1 h1:hmf6lAm9hk7uLCfapZn/jL05lm6Uwdbn1B0fgjyuf4M= +github.com/aws/aws-sdk-go-v2/credentials v1.15.1/go.mod h1:QTcHga3ZbQOneJuxmGBOCxiClxmp+TlvmjFexAnJ790= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2 h1:gIeH4+o1MN/caGBWjoGQTUTIu94xD6fI5B2+TcwBf70= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2/go.mod h1:wLyMIo/zPOhQhPXTddpfdkSleyigtFi8iMnC+2m/SK4= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.2 h1:XmPqt2VLMB7dfZ/cGNXBJOFq+Q+VsnEcPW3MqyKAsvY= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.2/go.mod h1:Y9RO68QWibKfkJpic8lh2G36x1eUJsAznj+1jiyYmsU= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1 h1:fi1ga6WysOyYb5PAf3Exd6B5GiSNpnZim4h1rhlBqx0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1/go.mod h1:V5CY8wNurvPUibTi9mwqUqpiFZ5LnioKWIFUDtIzdI8= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1 h1:ZpaV/j48RlPc4AmOZuPv22pJliXjXq8/reL63YzyFnw= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1/go.mod h1:R8aXraabD2e3qv1csxM14/X9WF4wFMIY0kH4YEtYD5M= +github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0 h1:DqOQvIfmGkXZUVJnl9VRk0AnxyS59tCtX9k1Pyss4Ak= +github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0/go.mod h1:VV/Kbw9Mg1GWJOT9WK+oTL3cWZiXtapnNvDSRqTZLsg= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.1 h1:vzYLDkwTw4CY0vUk84MeSufRf8XIsC/GsoIFXD60sTg= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.1/go.mod h1:ToBFBnjeGR2ruMx8IWp/y7vSK3Irj5/oPwifruiqoOM= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 h1:CJxo7ZBbaIzmXfV3hjcx36n9V87gJsIUPJflwqEHl3Q= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0/go.mod h1:yjVfjuY4nD1EW9i387Kau+I6V5cBA5YnC/mWNopjZrI= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.1 h1:15FUCJzAP9Y25nioTqTrGlZmhOtthaXBWlt4pS+d3Xo= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.1/go.mod h1:5655NW53Un6l7JzkI6AA3rZvf0m532cSnLThA1fVXcA= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1 h1:2OXw3ppu1XsB6rqKEMV4tnecTjIY3PRV2U6IP6KPJQo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1/go.mod h1:FZB4AdakIqW/yERVdGJA6Z9jraax1beXfhBBnK2wwR8= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.1 h1:dnl0klXYX9EKpzZbWlH5LJL+YTcEZcJEMPFFr/rAHUQ= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.1/go.mod h1:Mfk/9Joso4tCQYzM4q4HRUIqwln8lnIIMB/OE8Zebdc= +github.com/aws/aws-sdk-go-v2/service/s3 v1.42.0 h1:u0YoSrxjr3Lm+IqIlRAV+4YTFwkXjyB9db9CfUFge2w= +github.com/aws/aws-sdk-go-v2/service/s3 v1.42.0/go.mod h1:98EIdRu+BNsdqITsXfy+57TZfwlUQC9aDn9a9qoo90U= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 h1:I/Oh3IxGPfHXiGnwM54TD6hNr/8TlUrBXAtTyGhR+zw= +github.com/aws/aws-sdk-go-v2/service/sso v1.17.0/go.mod h1:H6NCMvDBqA+CvIaXzaSqM6LWtzv9BzZrqBOqz+PzRF8= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 h1:irbXQkfVYIRaewYSXcu4yVk0m2T+JzZd0dkop7FjmO0= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0/go.mod h1:4wPNCkM22+oRe71oydP66K50ojDUC33XutSMi2pEF/M= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 h1:sYIFy8tm1xQwRvVQ4CRuBGXKIg9sHNuG6+3UAQuoujk= +github.com/aws/aws-sdk-go-v2/service/sts v1.25.0/go.mod h1:S/LOQUeYDfJeJpFCIJDMjy7dwL4aA33HUdVi+i7uH8k= +github.com/aws/smithy-go v1.16.0 h1:gJZEH/Fqh+RsvlJ1Zt4tVAtV6bKkp3cC+R6FCZMNzik= +github.com/aws/smithy-go v1.16.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= 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= @@ -126,7 +126,7 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= 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.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +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= @@ -208,8 +208,6 @@ github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzq github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo= -github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -254,9 +252,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -284,10 +281,10 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= 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/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= +github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= +github.com/gorilla/feeds v1.1.2 h1:pxzZ5PD3RJdhFH2FsJJ4x6PqMqbgFk1+Vez4XWBW8Iw= +github.com/gorilla/feeds v1.1.2/go.mod h1:WMib8uJP3BbY+X8Szd1rA5Pzhdfh+HCCAYT2z7Fza6Y= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= @@ -296,8 +293,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaDEhniwNedqGo9FuLFzppDr3uwI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 h1:6UKoz5ujsI55KNpsJH3UwCq3T8kKbZwNZBNPuTTje8U= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1/go.mod h1:YvJ2f6MplWDhfxiUC3KpyTy76kYUZA4W3pTv/wdKQ9Y= github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -517,8 +514,8 @@ github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -569,8 +566,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -github.com/yuin/goldmark v1.5.6 h1:COmQAWTCcGetChm3Ig7G/t8AFAN00t+o8Mt4cf7JpwA= -github.com/yuin/goldmark v1.5.6/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= +github.com/yuin/goldmark v1.6.0 h1:boZcn2GTjpsynOsC0iJHnBWa4Bi0qzfJjthwauItG68= +github.com/yuin/goldmark v1.6.0/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= @@ -648,8 +645,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY= -golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -778,8 +775,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= +golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -791,14 +788,14 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.4.0 h1:Z81tqI5ddIoXDPvVQ7/7CC9TnLM7ubaFG2qXYd5BbYY= +golang.org/x/time v0.4.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -928,12 +925,12 @@ google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b h1:+YaDE2r2OG8t/z5qmsh7Y+XXwCbvadxxZ0YY6mTdrVA= -google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b h1:CIC2YMXmIhYw6evmhPxBKJ4fmLbOFtXQN/GV3XOZR8k= -google.golang.org/genproto/googleapis/api v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:IBQ646DjkDkvUIsVq/cc03FUFQ9wbZu7yE396YcL870= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b h1:ZlWIi1wSK56/8hn4QcBp/j9M7Gt3U/3hZw3mC7vDICo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:swOH3j0KzcDDgGUWr+SNpyTen5YrXjS3eyPzFYKc6lc= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= +google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= +google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1020,16 +1017,16 @@ modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v1.28.0 h1:kHB6LtDBV8DEAK7aZT1vWvP92abW9fb8cjb1P9UTpUE= -modernc.org/libc v1.28.0/go.mod h1:DaG/4Q3LRRdqpiLyP0C2m1B8ZMGkQ+cCgOIjEtQlYhQ= +modernc.org/libc v1.30.0 h1:tw+o+UObwSE4Bfu3+Ztz9NW/Olqp7nTL/vcaEY/x4rc= +modernc.org/libc v1.30.0/go.mod h1:SUKVISl2sU6aasM35Y0v4SsSBTt89uDKrvxgXkvsC/4= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.26.0 h1:SocQdLRSYlA8W99V8YH0NES75thx19d9sB/aFc4R8Lw= -modernc.org/sqlite v1.26.0/go.mod h1:FL3pVXie73rg3Rii6V/u5BoHlSoyeZeIgKZEgHARyCU= +modernc.org/sqlite v1.27.0 h1:MpKAHoyYB7xqcwnUwkuD+npwEa0fojF0B5QRbN+auJ8= +modernc.org/sqlite v1.27.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= From 35f0861d6eaa15ab13d5ce9c9220553f2a56954d Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Tue, 7 Nov 2023 13:53:53 +0800 Subject: [PATCH 037/650] fix: prevent copydb to create a fresh memos (#2486) Prevent copydb to create a fresh memos --- cmd/copydb.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/copydb.go b/cmd/copydb.go index fed5c1963ed7a..6f7727b9d861f 100644 --- a/cmd/copydb.go +++ b/cmd/copydb.go @@ -59,6 +59,13 @@ func copydb(fromProfile, toProfile *_profile.Profile) error { return errors.Wrap(err, "fail to create `to` driver") } + // Check if `to` driver has been created before + if history, err := toDriver.FindMigrationHistoryList(ctx, nil); err != nil { + return errors.New("fail to check migration history of `to` driver") + } else if len(history) == 0 { + return errors.New("migration history of `to` driver should not be empty") + } + if err := toDriver.Migrate(ctx); err != nil { return errors.Wrap(err, "fail to migrate db") } From 184f79ef8efb5bf038147e22e3668eacf628aad3 Mon Sep 17 00:00:00 2001 From: zty Date: Tue, 7 Nov 2023 22:38:38 +0800 Subject: [PATCH 038/650] feat: support code in headings (#2488) Co-authored-by: zty --- web/src/labs/marked/parser/Heading.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/labs/marked/parser/Heading.tsx b/web/src/labs/marked/parser/Heading.tsx index 2f4e056863d27..8fa8e1468903b 100644 --- a/web/src/labs/marked/parser/Heading.tsx +++ b/web/src/labs/marked/parser/Heading.tsx @@ -1,5 +1,6 @@ import { marked } from ".."; import { matcher } from "../matcher"; +import InlineCode from "./InlineCode"; import Link from "./Link"; import PlainLink from "./PlainLink"; import PlainText from "./PlainText"; @@ -13,7 +14,7 @@ const renderer = (rawStr: string) => { } const level = matchResult[1].length; - const parsedContent = marked(matchResult[2], [], [Link, PlainLink, PlainText]); + const parsedContent = marked(matchResult[2], [], [InlineCode, Link, PlainLink, PlainText]); if (level === 1) { return

{parsedContent}

; } else if (level === 2) { From 9df05fe0fa2123349e3dd78f4724e834c6202b12 Mon Sep 17 00:00:00 2001 From: boojack Date: Tue, 7 Nov 2023 22:39:27 +0800 Subject: [PATCH 039/650] chore: update i18n from Weblate (#2489) * Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (316 of 316 strings) Translation: memos-i18n/i18n Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/ * Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (316 of 316 strings) Translation: memos-i18n/i18n Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/pt_BR/ --------- Co-authored-by: LibreTranslate Co-authored-by: Lincoln Nogueira --- web/src/locales/pt-BR.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/web/src/locales/pt-BR.json b/web/src/locales/pt-BR.json index 94d71be38005d..6052ca111bb49 100644 --- a/web/src/locales/pt-BR.json +++ b/web/src/locales/pt-BR.json @@ -45,6 +45,7 @@ "fold": "Recolher", "home": "Início", "image": "Imagem", + "inbox": "Caixa de Entrada", "language": "Idioma", "learn-more": "Saiba mais", "link": "Link", @@ -120,6 +121,9 @@ "memos-in": "memos em {{period}}", "memos-on": "{{amount}} memos em {{date}}" }, + "inbox": { + "memo-comment": "{{user}} tem um comentário sobre o seu {{memo}}." + }, "memo": { "archived-at": "Arquivado em", "archived-memos": "Memos arquivados", From 2ee426386aece8c8fbc706b0bb71e7be23a9ecc1 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Wed, 8 Nov 2023 10:06:27 +0800 Subject: [PATCH 040/650] fix: skip system_setting check while copydb (#2490) Skip system_setting check while copydb --- cmd/copydb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/copydb.go b/cmd/copydb.go index 6f7727b9d861f..0c857228eed91 100644 --- a/cmd/copydb.go +++ b/cmd/copydb.go @@ -98,7 +98,7 @@ func copydb(fromProfile, toProfile *_profile.Profile) error { if err != nil { return errors.Wrapf(err, "fail to check '%s'", table) } - if cnt > 0 { + if cnt > 0 && table != "system_setting" { return errors.Errorf("table '%s' is not empty", table) } } From caea0655942b218b8ef17a9789592ce4f7b84181 Mon Sep 17 00:00:00 2001 From: zty Date: Wed, 8 Nov 2023 10:34:07 +0800 Subject: [PATCH 041/650] feat: add share btn in more-action (#2491) Co-authored-by: zty --- web/src/components/Memo.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/web/src/components/Memo.tsx b/web/src/components/Memo.tsx index 5bebd0867ab5b..f2ce01c20d39a 100644 --- a/web/src/components/Memo.tsx +++ b/web/src/components/Memo.tsx @@ -18,6 +18,7 @@ import showMemoEditorDialog from "./MemoEditor/MemoEditorDialog"; import MemoRelationListView from "./MemoRelationListView"; import MemoResourceListView from "./MemoResourceListView"; import showPreviewImageDialog from "./PreviewImageDialog"; +import showShareMemoDialog from "./ShareMemoDialog"; import UserAvatar from "./UserAvatar"; import VisibilityIcon from "./VisibilityIcon"; import "@/less/memo.less"; @@ -263,6 +264,10 @@ const Memo: React.FC = (props: Props) => { {t("common.mark")} )} + showShareMemoDialog(memo)}> + + {t("common.share")} + From 504d1768f2b28c9324cb4d35657ace6f75fe0a21 Mon Sep 17 00:00:00 2001 From: boojack Date: Wed, 8 Nov 2023 13:02:24 +0800 Subject: [PATCH 042/650] chore: update i18n with Weblate (#2492) * Translated using Weblate (Chinese (Traditional)) Currently translated at 91.7% (290 of 316 strings) Translation: memos-i18n/i18n Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/ * Translated using Weblate (Chinese (Traditional)) Currently translated at 100.0% (316 of 316 strings) Translation: memos-i18n/i18n Translate-URL: https://hosted.weblate.org/projects/memos-i18n/english/zh_Hant/ --------- Co-authored-by: dwong33 --- web/src/locales/zh-Hant.json | 111 ++++++++++++++++++++--------------- 1 file changed, 65 insertions(+), 46 deletions(-) diff --git a/web/src/locales/zh-Hant.json b/web/src/locales/zh-Hant.json index 7f42adfa19585..b558472059d74 100644 --- a/web/src/locales/zh-Hant.json +++ b/web/src/locales/zh-Hant.json @@ -1,15 +1,21 @@ { "about": { - "about-memos": "關於 Memos", - "memos-description": "Memos 是一個網頁式的筆記應用程式,您可用它記錄、組織以及分享你的筆記", + "about-memos": "關於 memos", + "memos-description": "memos 是一個網頁式的筆記應用程式,您可用它記錄、組織以及分享你的筆記。", "no-server-description": "此伺服器未設置說明。", "other-projects": "其他專案", - "powered-by": "威力本源" + "powered-by": "Powered By" + }, + "amount-text": { + "memo": "MEMO" }, "auth": { + "create-your-account": "建立您的賬戶", "host-tip": "您註冊為此站台之管理員。", "new-password": "新密碼", - "repeat-new-password": "再次輸入新密碼" + "repeat-new-password": "再次輸入新密碼", + "sign-in-tip": "已有帳戶?", + "sign-up-tip": "還沒有帳戶?" }, "common": { "about": "關於", @@ -37,6 +43,7 @@ "fold": "折疊", "home": "首頁", "image": "圖片", + "inbox": "通知", "language": "語言", "learn-more": "了解", "link": "連結", @@ -49,6 +56,8 @@ "password": "密碼", "pin": "釘選", "preview": "預覽", + "profile": "個人專頁", + "remember-me": "記住賬戶", "rename": "更名", "reset": "重設", "resources": "資源庫", @@ -67,14 +76,14 @@ "unpin": "解除釘選", "update": "更新", "upload": "上傳", - "username": "帳號", + "username": "賬戶", "vacuum": "清理", "version": "版本", "visibility": "可見度", - "yourself": "你自己", - "inbox": "通知" + "yourself": "你自己" }, "daily-review": { + "no-memos": "可惜可惜,是日空空如也。", "title": "每日回顧" }, "days": { @@ -105,20 +114,28 @@ "heatmap": { "day": "天", "days": "天", - "memo-in": "memo in {{period}}", - "memo-on": "{{amount}} memo on {{date}}", - "memos-in": "memos in {{period}}", - "memos-on": "{{amount}} memos on {{date}}" + "memo-in": "條 memo,在過去的 {{period}}", + "memo-on": "在 {{date}} 有 {{amount}} 條 memo", + "memos-in": "條 memo,在過去的 {{period}}", + "memos-on": "在 {{date}} 有 {{amount}} 條 memos" + }, + "inbox": { + "memo-comment": "{{user}} 對您的 {{memo}} 發表了評論。", + "version-update": "新版本 {{version}} 現已推出!" }, "memo": { "archived-at": "封存於", "archived-memos": "封存的備忘錄", + "comment": { + "no-comment": "沒有評論", + "self": "評論" + }, "copy-link": "複製連結", - "delete-confirm": "您確定要刪除此備忘錄?\n\n此動作為不可逆❗", + "delete-confirm": "您確定要刪除此備忘錄?\n\n此操作無法逆轉", "delete-memo": "刪除備忘錄", "embed": "內嵌", "fetch-more": "點此以載入更多", - "fetching-data": "抓取資料中...", + "fetching-data": "抓取資料中…", "no-archived-memos": "無封存的備忘錄。", "search-placeholder": "搜尋備忘錄", "view-detail": "查看詳情", @@ -139,7 +156,7 @@ "fill-all": "請填寫所有欄位。", "fill-form": "請填寫此表單", "fill-server-name": "請填寫伺服器名稱", - "generating-the-screenshot": "正在產生截圖...", + "generating-the-screenshot": "正在產生截圖…", "image-load-failed": "圖片讀取失敗", "invalid-created-datetime": "建立的日期時間無效。", "invalid-resource-filename": "無效的檔名。", @@ -147,25 +164,25 @@ "maximum-upload-size-is": "最大允許檔案上傳大小 {{size}} MiB", "memo-not-found": "找不到備忘錄。", "memo-updated-datetime": "備忘錄建立日期時間已變更。", - "memos-ready": "所有備忘錄已就緒 🎉", + "memos-ready": "所有備忘錄已就緒", "new-password-not-match": "新密碼不一致。", "no-data": "或許尋覓虛空,或者改換選擇之軌跡。", - "page-not-found": "404 - 網頁無法顯示 😥", + "page-not-found": "404 - 網頁無法顯示", "password-changed": "密碼變更完成", "password-login-disabled": "在禁用密碼登入時無法移除最後一個身份識別提供者", "password-not-match": "密碼不一致。", "private-only": "此備忘錄僅自己可見。", "resource-filename-updated": "資源檔名變更成功。", - "resource-ready": "所有資源已就緒 🎉", + "resource-ready": "所有資源已就緒", "restored-successfully": "還原成功", "signup-failed": "註冊失敗", "succeed-copy-code": "複製程式碼到剪貼簿成功。", - "succeed-copy-content": "複製內容到剪貼板成功。", + "succeed-copy-content": "複製內容到剪貼簿成功。", "succeed-copy-link": "複製連結到剪貼簿成功。", "succeed-copy-resource-link": "複製資源連結到剪貼簿成功。", "succeed-update-additional-script": "更新附加腳本成功。", "succeed-update-additional-style": "更新附加樣式成功。", - "succeed-update-customized-profile": "更新自訂配置文件成功。", + "succeed-update-customized-profile": "更新自訂設定文件成功。", "succeed-vacuum-database": "清理資料庫成功。", "update-succeed": "更新成功", "updating-setting-failed": "更新設定失敗", @@ -185,7 +202,7 @@ "type-placeholder": "檔案類型" }, "local-file": { - "choose": "選擇檔案...", + "choose": "選擇檔案…", "option": "本機檔案" }, "title": "新增資源", @@ -193,21 +210,22 @@ }, "delete-resource": "刪除資源", "delete-selected-resources": "刪除所選的資源", - "fetching-data": "抓取資料...", + "fetching-data": "抓取資料…", "file-drag-drop-prompt": "拖曳您的檔案到此處以上傳檔案", "linked-amount": "連結的數量", - "no-files-selected": "沒有檔案被選取❗", + "no-files-selected": "沒有選取檔案", "no-resources": "沒有資源。", "no-unused-resources": "無未使用的資源", "reset-link": "重設連結", - "reset-link-prompt": "您確定要重設連結?\n這將會破壞所有目前的使用中的連結。\n\n此動作為不可逆❗", + "reset-link-prompt": "您確定要重設連結?\n這將會破壞所有目前的使用中的連結。\n\n此操作無法逆轉", "reset-resource-link": "重設資源連結", "search-bar-placeholder": "搜尋資源", "upload-successfully": "上傳成功", - "warning-text": "您確定要刪除此資源?\n\n此動作為不可逆❗", - "warning-text-unused": "您確定要刪除這些未使用的資源?\n\n此動作為不可逆❗" + "warning-text": "您確定要刪除此資源?\n\n此操作無法逆轉", + "warning-text-unused": "您確定要刪除這些未使用的資源?\n\n此操作無法逆轉" }, "router": { + "back-to-top": "回到頂部", "go-to-home": "回到首頁" }, "setting": { @@ -219,7 +237,7 @@ "openapi-sample-post": "哈囉 來自 {{url}} 的 #memos", "openapi-title": "OpenAPI", "reset-api": "重設 API", - "title": "帳號資訊", + "title": "賬戶資訊", "update-information": "更新個人資訊", "username-note": "為登入用途" }, @@ -232,12 +250,12 @@ "member-list": "使用者列表", "member-section": { "archive-member": "封存使用者", - "archive-warning": "❗ 您確定要封存 {{username}}?", + "archive-warning": "您確定要封存 {{username}}?", "create-a-member": "新增使用者", "delete-member": "刪除使用者", - "delete-warning": "❗ A您確定要刪除 {{username}}?\n\n此動作為不可逆❗" + "delete-warning": "A您確定要刪除 {{username}}?\n\n此操作無法逆轉" }, - "my-account": "我的帳號", + "my-account": "我的賬戶", "preference": "偏好設定", "preference-section": { "auto-collapse": "自動摺疊", @@ -257,29 +275,30 @@ }, "sso": "SSO", "sso-section": { - "authorization-endpoint": "驗證端點", - "client-id": "客戶端 ID", - "client-secret": "客戶端密鑰", - "confirm-delete": "您確定要刪除 \"{{name}}\" SSO 設定?\n\n此動作為不可逆❗", + "authorization-endpoint": "驗證端點(Authorization Endpoint)", + "client-id": "客戶端 ID(Client ID)", + "client-secret": "客戶端金鑰(Client Secret)", + "confirm-delete": "您確定要刪除 \"{{name}}\" SSO 設定?\n\n此操作無法逆轉", "create-sso": "新增 SSO", "custom": "自訂", "delete-sso": "確認刪除", + "disabled-password-login-warning": "已停用密碼登入,删除身份提供程式時,請格外小心", "display-name": "顯示名稱", - "identifier": "識別碼", - "identifier-filter": "識別碼過濾器", + "identifier": "識別碼(Identifier)", + "identifier-filter": "識別碼過濾器(Identifier Filter)", "redirect-url": "重新導向網址", "scopes": "範圍", "sso-created": "SSO {{name}} 新增成功", "sso-list": "SSO 列表", "sso-updated": "SSO {{name}} 更新成功", "template": "範本", - "token-endpoint": "權杖端點", + "token-endpoint": "權杖端點(Token Endpoint)", "update-sso": "更新 SSO", - "user-endpoint": "使用者端點" + "user-endpoint": "使用者端點(User Endpoint)" }, "storage": "儲存空間", "storage-section": { - "accesskey": "存取金鑰", + "accesskey": "存取金鑰(Access key)", "accesskey-placeholder": "存取金鑰 / 存取 ID", "bucket": "Bucket", "bucket-placeholder": "Bucket 名稱", @@ -287,7 +306,7 @@ "create-storage": "新增儲存空間", "current-storage": "目前的儲存空間", "delete-storage": "刪除儲存", - "endpoint": "端點", + "endpoint": "端點(Endpoint)", "local-storage-path": "本機儲存空間路徑", "path": "儲存空間路徑", "path-description": "您可以使用與本機儲存空間相同的動態變數,如 {filename}", @@ -295,8 +314,8 @@ "region": "地區", "region-placeholder": "地區名稱", "s3-compatible-url": "S3 相容網址", - "secretkey": "密鑰", - "secretkey-placeholder": "密鑰 / 存取金鑰", + "secretkey": "金鑰", + "secretkey-placeholder": "金鑰 / 存取金鑰", "storage-services-list": "儲存服務列表", "type-database": "資料庫", "type-local": "本機", @@ -308,7 +327,7 @@ "url-prefix-placeholder": "自訂網址前綴,選填", "url-suffix": "網址後綴", "url-suffix-placeholder": "自訂網址後綴,選填", - "warning-text": "您確定要刪除儲存服務 \"{{name}}\"嗎?\n\n此動作為不可逆❗" + "warning-text": "您確定要刪除儲存服務「{{name}}」嗎?\n\n此操作無法逆轉" }, "system": "系統", "system-section": { @@ -318,7 +337,7 @@ "additional-style-placeholder": "自訂 CSS 代碼", "allow-user-signup": "允許使用者註冊", "auto-backup-interval": "自動備份間隔(單位:秒)", - "auto-backup-interval-hint": "設定為0禁止自動備份,重新啟動後生效", + "auto-backup-interval-hint": "設定為 0 則禁止自動備份,需重新啟動後生效。", "customize-server": { "appearance": "伺服器外觀", "default": "預設為 memos", @@ -329,12 +348,12 @@ }, "database-file-size": "資料庫檔案大小", "disable-password-login": "禁用密碼登入", - "disable-password-login-final-warning": "如果你知道自己在做什麼,請輸入 \"CONFIRM\"", - "disable-password-login-warning": "所有使用者將無法使用密碼登入。如果配置的身份識別提供者失效,不在資料庫中恢復此設定將無法登入。刪除身分識別提供者時也要特別小心❗", + "disable-password-login-final-warning": "如果你知道自己在做什麼,請輸入「CONFIRM」。", + "disable-password-login-warning": "所有使用者將無法使用密碼登入。如果設定的身份識別提供者失效,不在資料庫中恢復此設定將無法登入。刪除身分識別提供者時也要特別小心❗", "disable-public-memos": "停用公共備忘錄", "display-with-updated-time": "顯示更新時間", "enable-password-login": "啟用密碼登入", - "enable-password-login-warning": "啟用所有使用者的密碼登入。如果希望使用者同時使用 SSO 和密碼登入,請開啟密碼登入❗", + "enable-password-login-warning": "啟用所有使用者的密碼登入。如果希望使用者同時使用 SSO 和密碼登入,請開啟密碼登入", "max-upload-size": "最大上傳檔案大小 (MiB)", "max-upload-size-hint": "建議值為 32 MiB。", "server-name": "伺服器名稱", From 4499f45b67c9903cce440bafa8d9dd172d566f5e Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 8 Nov 2023 21:49:03 +0800 Subject: [PATCH 043/650] chore: deprecate daily review offset local setting --- .../Settings/PreferencesSection.tsx | 35 ------------------- web/src/components/TagList.tsx | 2 +- web/src/pages/DailyReview.tsx | 6 ++-- web/src/store/module/user.ts | 1 - web/src/types/modules/setting.d.ts | 1 - 5 files changed, 3 insertions(+), 42 deletions(-) diff --git a/web/src/components/Settings/PreferencesSection.tsx b/web/src/components/Settings/PreferencesSection.tsx index 349a8dd5035a3..4ab9792b3ed90 100644 --- a/web/src/components/Settings/PreferencesSection.tsx +++ b/web/src/components/Settings/PreferencesSection.tsx @@ -18,8 +18,6 @@ const PreferencesSection = () => { const { setting, localSetting } = userStore.state.user as User; const [telegramUserId, setTelegramUserId] = useState(setting.telegramUserId); - const dailyReviewTimeOffsetOptions: number[] = [...Array(24).keys()]; - const handleLocaleSelectChange = async (locale: Locale) => { await userStore.upsertUserSetting("locale", locale); globalStore.setLocale(locale); @@ -38,10 +36,6 @@ const PreferencesSection = () => { userStore.upsertLocalSetting({ ...localSetting, enableDoubleClickEditing: event.target.checked }); }; - const handleDailyReviewTimeOffsetChanged = (value: number) => { - userStore.upsertLocalSetting({ ...localSetting, dailyReviewTimeOffset: value }); - }; - const handleSaveTelegramUserId = async () => { try { await userStore.upsertUserSetting("telegram-user-id", telegramUserId); @@ -87,35 +81,6 @@ const PreferencesSection = () => { ))}
-
- {t("setting.preference-section.daily-review-time-offset")} - - - -
diff --git a/web/src/pages/DailyReview.tsx b/web/src/pages/DailyReview.tsx index 2d48893bce013..66ff44cc75452 100644 --- a/web/src/pages/DailyReview.tsx +++ b/web/src/pages/DailyReview.tsx @@ -14,23 +14,21 @@ import DatePicker from "@/components/kit/DatePicker"; import { DAILY_TIMESTAMP, DEFAULT_MEMO_LIMIT } from "@/helpers/consts"; import { getDateStampByDate, getNormalizedDateString, getTimeStampByDate, getTimeString } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { useMemoStore, useUserStore } from "@/store/module"; +import { useMemoStore } from "@/store/module"; import { extractUsernameFromName } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; const DailyReview = () => { const t = useTranslate(); const memoStore = useMemoStore(); - const userStore = useUserStore(); const user = useCurrentUser(); - const { localSetting } = userStore.state.user as User; const currentDateStamp = getDateStampByDate(getNormalizedDateString()) as number; const [selectedDateStamp, setSelectedDateStamp] = useState(currentDateStamp as number); const [showDatePicker, toggleShowDatePicker] = useToggle(false); const dailyMemos = memoStore.state.memos .filter((m) => { const displayTimestamp = getTimeStampByDate(m.displayTs); - const selectedDateStampWithOffset = selectedDateStamp + localSetting.dailyReviewTimeOffset * 60 * 60 * 1000; + const selectedDateStampWithOffset = selectedDateStamp; return ( m.rowStatus === "NORMAL" && m.creatorUsername === extractUsernameFromName(user.name) && diff --git a/web/src/store/module/user.ts b/web/src/store/module/user.ts index 23b281108add6..f4ad3e3d86828 100644 --- a/web/src/store/module/user.ts +++ b/web/src/store/module/user.ts @@ -15,7 +15,6 @@ const defaultSetting: Setting = { const defaultLocalSetting: LocalSetting = { enableDoubleClickEditing: false, - dailyReviewTimeOffset: 0, }; export const convertResponseModelUser = (user: User): User => { diff --git a/web/src/types/modules/setting.d.ts b/web/src/types/modules/setting.d.ts index 0bd58d1b9deec..0254240015afd 100644 --- a/web/src/types/modules/setting.d.ts +++ b/web/src/types/modules/setting.d.ts @@ -13,7 +13,6 @@ interface Setting { interface LocalSetting { enableDoubleClickEditing: boolean; - dailyReviewTimeOffset: number; } interface UserLocaleSetting { From e76509a577a45ca80f424b9635706b4cbcc0149f Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 8 Nov 2023 22:00:49 +0800 Subject: [PATCH 044/650] chore: update header menu style in mobile view --- web/src/components/Header.tsx | 83 ++++++++--------------------- web/src/components/HeaderDrawer.tsx | 37 +++++++++++++ web/src/components/MobileHeader.tsx | 6 ++- web/src/layouts/Root.tsx | 4 +- web/src/store/module/layout.ts | 5 +- web/src/store/reducer/layout.ts | 10 +--- 6 files changed, 69 insertions(+), 76 deletions(-) create mode 100644 web/src/components/HeaderDrawer.tsx diff --git a/web/src/components/Header.tsx b/web/src/components/Header.tsx index 07fa39803d300..fe4905cc1e212 100644 --- a/web/src/components/Header.tsx +++ b/web/src/components/Header.tsx @@ -1,12 +1,10 @@ import classNames from "classnames"; import { useEffect } from "react"; -import { NavLink, useLocation } from "react-router-dom"; +import { NavLink } from "react-router-dom"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { useLayoutStore } from "@/store/module"; import { useInboxStore } from "@/store/v1"; import { Inbox_Status } from "@/types/proto/api/v2/inbox_service"; import { useTranslate } from "@/utils/i18n"; -import { resolution } from "@/utils/layout"; import Icon from "./Icon"; import UserBanner from "./UserBanner"; @@ -19,11 +17,8 @@ interface NavLinkItem { const Header = () => { const t = useTranslate(); - const location = useLocation(); - const layoutStore = useLayoutStore(); const user = useCurrentUser(); const inboxStore = useInboxStore(); - const showHeader = layoutStore.state.showHeader; const hasUnreadInbox = inboxStore.inboxes.some((inbox) => inbox.status === Inbox_Status.UNREAD); useEffect(() => { @@ -42,22 +37,6 @@ const Header = () => { }; }, []); - useEffect(() => { - const handleWindowResize = () => { - if (window.innerWidth < resolution.sm) { - layoutStore.setHeaderStatus(false); - } else { - layoutStore.setHeaderStatus(true); - } - }; - handleWindowResize(); - window.addEventListener("resize", handleWindowResize); - - return () => { - window.removeEventListener("resize", handleWindowResize); - }; - }, [location]); - const homeNavLink: NavLinkItem = { id: "header-home", path: "/", @@ -119,44 +98,28 @@ const Header = () => { : [exploreNavLink, signInNavLink]; return ( -
-
layoutStore.setHeaderStatus(false)} - >
-
- -
- {navLinks.map((navLink) => ( - - classNames( - "px-4 pr-5 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-600 dark:hover:bg-zinc-700", - isActive ? "bg-white drop-shadow-sm dark:bg-zinc-700 border-gray-200 dark:border-zinc-600" : "border-transparent" - ) - } - > - <> - {navLink.icon} {navLink.title} - - - ))} -
-
-
+
+ +
+ {navLinks.map((navLink) => ( + + classNames( + "px-4 pr-5 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-600 dark:hover:bg-zinc-700", + isActive ? "bg-white drop-shadow-sm dark:bg-zinc-700 border-gray-200 dark:border-zinc-600" : "border-transparent" + ) + } + > + <> + {navLink.icon} {navLink.title} + + + ))} +
+
); }; diff --git a/web/src/components/HeaderDrawer.tsx b/web/src/components/HeaderDrawer.tsx new file mode 100644 index 0000000000000..99671315a9643 --- /dev/null +++ b/web/src/components/HeaderDrawer.tsx @@ -0,0 +1,37 @@ +import { Drawer, IconButton } from "@mui/joy"; +import { useEffect, useState } from "react"; +import { useLocation } from "react-router-dom"; +import Header from "./Header"; +import Icon from "./Icon"; + +const HeaderDrawer = () => { + const location = useLocation(); + const [open, setOpen] = useState(false); + + useEffect(() => { + setOpen(false); + }, [location.pathname]); + + const toggleDrawer = (inOpen: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => { + if (event.type === "keydown" && ((event as React.KeyboardEvent).key === "Tab" || (event as React.KeyboardEvent).key === "Shift")) { + return; + } + + setOpen(inOpen); + }; + + return ( +
+ + + + +
+
+
+
+
+ ); +}; + +export default HeaderDrawer; diff --git a/web/src/components/MobileHeader.tsx b/web/src/components/MobileHeader.tsx index aeb8fe6676e3a..2cf61f6b46598 100644 --- a/web/src/components/MobileHeader.tsx +++ b/web/src/components/MobileHeader.tsx @@ -1,5 +1,6 @@ import { useState } from "react"; import { useLayoutStore } from "@/store/module"; +import HeaderDrawer from "./HeaderDrawer"; import Icon from "./Icon"; interface Props { @@ -14,12 +15,13 @@ const MobileHeader = (props: Props) => { return (
-
layoutStore.setHeaderStatus(true)} > -
+
*/} + location.reload()} diff --git a/web/src/layouts/Root.tsx b/web/src/layouts/Root.tsx index d7631439e9829..73380b1c6807d 100644 --- a/web/src/layouts/Root.tsx +++ b/web/src/layouts/Root.tsx @@ -9,7 +9,9 @@ function Root() {
-
+
+
+
diff --git a/web/src/store/module/layout.ts b/web/src/store/module/layout.ts index 7158a7b1649dd..1437ab9c13ac7 100644 --- a/web/src/store/module/layout.ts +++ b/web/src/store/module/layout.ts @@ -1,5 +1,5 @@ import store, { useAppSelector } from ".."; -import { setHeaderStatus, setHomeSidebarStatus } from "../reducer/layout"; +import { setHomeSidebarStatus } from "../reducer/layout"; export const useLayoutStore = () => { const state = useAppSelector((state) => state.layout); @@ -8,9 +8,6 @@ export const useLayoutStore = () => { getState: () => { return store.getState().tag; }, - setHeaderStatus: (showHeader: boolean) => { - store.dispatch(setHeaderStatus(showHeader)); - }, setHomeSidebarStatus: (showHomeSidebar: boolean) => { store.dispatch(setHomeSidebarStatus(showHomeSidebar)); }, diff --git a/web/src/store/reducer/layout.ts b/web/src/store/reducer/layout.ts index 7d7e7951eafb4..5af9fd0fed33c 100644 --- a/web/src/store/reducer/layout.ts +++ b/web/src/store/reducer/layout.ts @@ -1,23 +1,15 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; interface State { - showHeader: boolean; showHomeSidebar: boolean; } const layoutSlice = createSlice({ name: "layout", initialState: { - showHeader: false, showHomeSidebar: false, } as State, reducers: { - setHeaderStatus: (state, action: PayloadAction) => { - return { - ...state, - showHeader: action.payload, - }; - }, setHomeSidebarStatus: (state, action: PayloadAction) => { return { ...state, @@ -27,6 +19,6 @@ const layoutSlice = createSlice({ }, }); -export const { setHeaderStatus, setHomeSidebarStatus } = layoutSlice.actions; +export const { setHomeSidebarStatus } = layoutSlice.actions; export default layoutSlice.reducer; From 5ff0234c714bf3ec51233ee365ae24a087d407ef Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 8 Nov 2023 22:10:15 +0800 Subject: [PATCH 045/650] chore: update response styles --- web/package.json | 1 - web/pnpm-lock.yaml | 11 ----------- web/src/components/HeaderDrawer.tsx | 2 +- web/src/components/HomeSidebar.tsx | 6 +++--- web/src/components/MobileHeader.tsx | 8 +------- web/src/pages/Home.tsx | 4 ++-- web/tailwind.config.js | 2 +- 7 files changed, 8 insertions(+), 26 deletions(-) diff --git a/web/package.json b/web/package.json index a5af11fd09ac4..677934095ba07 100644 --- a/web/package.json +++ b/web/package.json @@ -15,7 +15,6 @@ "@matejmazur/react-katex": "^3.1.3", "@mui/joy": "5.0.0-beta.13", "@reduxjs/toolkit": "^1.9.7", - "@tailwindcss/container-queries": "^0.1.1", "axios": "^1.6.0", "classnames": "^2.3.2", "copy-to-clipboard": "^3.3.3", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 7a20beb24baa9..2b01e9bfc05fa 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -20,9 +20,6 @@ dependencies: '@reduxjs/toolkit': specifier: ^1.9.7 version: 1.9.7(react-redux@8.1.3)(react@18.2.0) - '@tailwindcss/container-queries': - specifier: ^0.1.1 - version: 0.1.1(tailwindcss@3.3.5) axios: specifier: ^1.6.0 version: 1.6.0 @@ -1301,14 +1298,6 @@ packages: resolution: {integrity: sha512-myfUej5naTBWnqOCc/MdVOLVjXUXtIA+NpDrDBKJtLLg2shUjBu3cZmB/85RyitKc55+lUUyl7oRfLOvkr2hsw==} dev: true - /@tailwindcss/container-queries@0.1.1(tailwindcss@3.3.5): - resolution: {integrity: sha512-p18dswChx6WnTSaJCSGx6lTmrGzNNvm2FtXmiO6AuA1V4U5REyoqwmT6kgAsIMdjo07QdAfYXHJ4hnMtfHzWgA==} - peerDependencies: - tailwindcss: '>=3.2.0' - dependencies: - tailwindcss: 3.3.5 - dev: false - /@trivago/prettier-plugin-sort-imports@3.4.0(prettier@2.6.2): resolution: {integrity: sha512-485Iailw8X5f7KetzRka20RF1kPBEINR5LJMNwlBZWY1gRAlVnv5dZzyNPnLxSP0Qcia8HETa9Cdd8LlX9o+pg==} peerDependencies: diff --git a/web/src/components/HeaderDrawer.tsx b/web/src/components/HeaderDrawer.tsx index 99671315a9643..d71b38136e35d 100644 --- a/web/src/components/HeaderDrawer.tsx +++ b/web/src/components/HeaderDrawer.tsx @@ -21,7 +21,7 @@ const HeaderDrawer = () => { }; return ( -
+
diff --git a/web/src/components/HomeSidebar.tsx b/web/src/components/HomeSidebar.tsx index 86dff6a78d450..c339ced773468 100644 --- a/web/src/components/HomeSidebar.tsx +++ b/web/src/components/HomeSidebar.tsx @@ -9,18 +9,18 @@ const HomeSidebar = () => { return (
layoutStore.setHomeSidebarStatus(false)} >
); diff --git a/web/src/components/UsageHeatMap.tsx b/web/src/components/MemoCreationHeatMap.tsx similarity index 75% rename from web/src/components/UsageHeatMap.tsx rename to web/src/components/MemoCreationHeatMap.tsx index 17b4e0d38c7d6..81766e06f24f9 100644 --- a/web/src/components/UsageHeatMap.tsx +++ b/web/src/components/MemoCreationHeatMap.tsx @@ -1,21 +1,26 @@ import { useCallback, useEffect, useRef, useState } from "react"; -import { getMemoStats } from "@/helpers/api"; +import { memoServiceClient } from "@/grpcweb"; import { DAILY_TIMESTAMP } from "@/helpers/consts"; import { getDateStampByDate, getDateString, getTimeStampByDate } from "@/helpers/datetime"; import * as utils from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; import { useGlobalStore } from "@/store/module"; -import { useUserStore, extractUsernameFromName, useMemoStore } from "@/store/v1"; +import { useMemoStore } from "@/store/v1"; import { useTranslate, Translations } from "@/utils/i18n"; import "@/less/usage-heat-map.less"; +interface DailyUsageStat { + timestamp: number; + count: number; +} + const tableConfig = { width: 10, height: 7, }; -const getInitialUsageStat = (usedDaysAmount: number, beginDayTimestamp: number): DailyUsageStat[] => { +const getInitialCreationStats = (usedDaysAmount: number, beginDayTimestamp: number): DailyUsageStat[] => { const initialUsageStat: DailyUsageStat[] = []; for (let i = 1; i <= usedDaysAmount; i++) { initialUsageStat.push({ @@ -26,15 +31,9 @@ const getInitialUsageStat = (usedDaysAmount: number, beginDayTimestamp: number): return initialUsageStat; }; -interface DailyUsageStat { - timestamp: number; - count: number; -} - -const UsageHeatMap = () => { +const MemoCreationHeatMap = () => { const t = useTranslate(); const navigateTo = useNavigateTo(); - const userStore = useUserStore(); const user = useCurrentUser(); const memoStore = useMemoStore(); const todayTimeStamp = getDateStampByDate(Date.now()); @@ -46,44 +45,30 @@ const UsageHeatMap = () => { const usedDaysAmount = (tableConfig.width - 1) * tableConfig.height + todayDay; const beginDayTimestamp = todayTimeStamp - usedDaysAmount * DAILY_TIMESTAMP; const [memoAmount, setMemoAmount] = useState(0); - const [createdDays, setCreatedDays] = useState(0); - const [allStat, setAllStat] = useState(getInitialUsageStat(usedDaysAmount, beginDayTimestamp)); + const [creationStatus, setCreationStatus] = useState(getInitialCreationStats(usedDaysAmount, beginDayTimestamp)); const containerElRef = useRef(null); const memos = Object.values(memoStore.getState().memoMapById); - - useEffect(() => { - userStore.getOrFetchUserByUsername(extractUsernameFromName(user.name)).then((user) => { - if (!user) { - return; - } - setCreatedDays(Math.ceil((Date.now() - getTimeStampByDate(user.createTime)) / 1000 / 3600 / 24)); - }); - }, [user.name]); + const createdDays = Math.ceil((Date.now() - getTimeStampByDate(user.createTime)) / 1000 / 3600 / 24); useEffect(() => { if (memos.length === 0) { return; } - getMemoStats(extractUsernameFromName(user.name)) - .then(({ data }) => { - setMemoAmount(data.length); - const newStat: DailyUsageStat[] = getInitialUsageStat(usedDaysAmount, beginDayTimestamp); - for (const record of data) { - const index = (getDateStampByDate(record * 1000) - beginDayTimestamp) / (1000 * 3600 * 24) - 1; - if (index >= 0) { - // because of dailight savings, some days may be 23 hours long instead of 24 hours long - // this causes the calculations to yield weird indices such as 40.93333333333 - // rounding them may not give you the exact day on the heat map, but it's not too bad - const exactIndex = +index.toFixed(0); - newStat[exactIndex].count += 1; - } + (async () => { + const { memoCreationStats } = await memoServiceClient.getUserMemosStats({ + name: user.name, + }); + const tempStats = getInitialCreationStats(usedDaysAmount, beginDayTimestamp); + Object.entries(memoCreationStats).forEach(([k, v]) => { + const dayIndex = Math.floor((getDateStampByDate(k) - beginDayTimestamp) / DAILY_TIMESTAMP) - 1; + if (tempStats[dayIndex]) { + tempStats[dayIndex].count = v; } - setAllStat([...newStat]); - }) - .catch((error) => { - console.error(error); }); + setCreationStatus(tempStats); + setMemoAmount(Object.values(memoCreationStats).reduce((acc, cur) => acc + cur, 0)); + })(); }, [memos.length, user.name]); const handleUsageStatItemMouseEnter = useCallback((event: React.MouseEvent, item: DailyUsageStat) => { @@ -118,7 +103,8 @@ const UsageHeatMap = () => { <>
- {allStat.map((v, i) => { + {} + {creationStatus.map((v, i) => { const count = v.count; const colorLevel = count <= 0 @@ -167,4 +153,4 @@ const UsageHeatMap = () => { ); }; -export default UsageHeatMap; +export default MemoCreationHeatMap; diff --git a/web/src/components/kit/DatePicker.tsx b/web/src/components/kit/DatePicker.tsx index 328f3582df738..ce7dc0256e45e 100644 --- a/web/src/components/kit/DatePicker.tsx +++ b/web/src/components/kit/DatePicker.tsx @@ -2,11 +2,10 @@ import { Badge, Button } from "@mui/joy"; import classNames from "classnames"; import { useEffect, useRef, useState } from "react"; import useClickAway from "react-use/lib/useClickAway"; -import { getMemoStats } from "@/helpers/api"; +import { memoServiceClient } from "@/grpcweb"; import { DAILY_TIMESTAMP } from "@/helpers/consts"; import { getDateStampByDate, isFutureDate } from "@/helpers/datetime"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { extractUsernameFromName } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; import Icon from "../Icon"; import "@/less/common/date-picker.less"; @@ -36,14 +35,17 @@ const DatePicker: React.FC = (props: DatePickerProps) => { }, [datestamp]); useEffect(() => { - getMemoStats(extractUsernameFromName(user.name)).then(({ data }) => { + (async () => { + const { memoCreationStats } = await memoServiceClient.getUserMemosStats({ + name: user.name, + }); const m = new Map(); - for (const record of data) { - const date = getDateStampByDate(record * 1000); + Object.entries(memoCreationStats).forEach(([k]) => { + const date = getDateStampByDate(k); m.set(date, true); - } + }); setCountByDate(m); - }); + })(); }, [user.name]); const firstDate = new Date(currentDateStamp); diff --git a/web/src/helpers/api.ts b/web/src/helpers/api.ts index 96ced34cc61cd..18384b819648f 100644 --- a/web/src/helpers/api.ts +++ b/web/src/helpers/api.ts @@ -44,10 +44,6 @@ export function signout() { return axios.post("/api/v1/auth/signout"); } -export function getMemoStats(username: string) { - return axios.get(`/api/v1/memo/stats?creatorUsername=${username}`); -} - export function createResource(resourceCreate: ResourceCreate) { return axios.post("/api/v1/resource", resourceCreate); } From 8e325f998651eaaa2c7f9e4c3fa6d4acdb60fbb6 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 23 Dec 2023 19:23:39 +0800 Subject: [PATCH 251/650] chore: return username in user response --- api/v2/user_service.go | 7 +- proto/api/v2/user_service.proto | 16 +- proto/gen/api/v2/README.md | 1 + proto/gen/api/v2/user_service.pb.go | 490 +++++++++--------- web/src/components/ChangePasswordDialog.tsx | 27 +- web/src/components/MemoView.tsx | 56 +- .../Settings/AccessTokenSection.tsx | 9 +- web/src/components/Settings/MemberSection.tsx | 4 +- .../components/Settings/MyAccountSection.tsx | 3 +- web/src/components/ShareMemoDialog.tsx | 2 +- web/src/components/UpdateAccountDialog.tsx | 15 +- web/src/components/UserBanner.tsx | 5 +- web/src/hooks/useCurrentUser.ts | 3 +- web/src/pages/Explore.tsx | 2 +- web/src/pages/Home.tsx | 7 +- web/src/pages/Timeline.tsx | 12 +- web/src/pages/UserProfile.tsx | 8 +- web/src/store/v1/user.ts | 14 +- 18 files changed, 333 insertions(+), 348 deletions(-) diff --git a/api/v2/user_service.go b/api/v2/user_service.go index 5d145e8dd7cf3..4a9341f9481d3 100644 --- a/api/v2/user_service.go +++ b/api/v2/user_service.go @@ -141,10 +141,10 @@ func (s *APIV2Service) UpdateUser(ctx context.Context, request *apiv2pb.UpdateUs } for _, field := range request.UpdateMask.Paths { if field == "username" { - if !usernameMatcher.MatchString(strings.ToLower(username)) { - return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", username) + if !usernameMatcher.MatchString(strings.ToLower(request.User.Username)) { + return nil, status.Errorf(codes.InvalidArgument, "invalid username: %s", request.User.Username) } - update.Username = &username + update.Username = &request.User.Username } else if field == "nickname" { update.Nickname = &request.User.Nickname } else if field == "email" { @@ -501,6 +501,7 @@ func convertUserFromStore(user *store.User) *apiv2pb.User { 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, diff --git a/proto/api/v2/user_service.proto b/proto/api/v2/user_service.proto index a1b746ea94eb6..6b41f3de04ab7 100644 --- a/proto/api/v2/user_service.proto +++ b/proto/api/v2/user_service.proto @@ -88,19 +88,21 @@ message User { } Role role = 3; - string email = 4; + string username = 4; - string nickname = 5; + string email = 5; - string avatar_url = 6; + string nickname = 6; - string password = 7 [(google.api.field_behavior) = INPUT_ONLY]; + string avatar_url = 7; - RowStatus row_status = 8; + string password = 8 [(google.api.field_behavior) = INPUT_ONLY]; - google.protobuf.Timestamp create_time = 9; + RowStatus row_status = 9; - google.protobuf.Timestamp update_time = 10; + google.protobuf.Timestamp create_time = 10; + + google.protobuf.Timestamp update_time = 11; } message ListUsersRequest {} diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index a3bd5b38dcf17..3fef6ec2fd98b 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -644,6 +644,7 @@ | name | [string](#string) | | The name of the user. Format: users/{username} | | id | [int32](#int32) | | | | role | [User.Role](#memos-api-v2-User-Role) | | | +| username | [string](#string) | | | | email | [string](#string) | | | | nickname | [string](#string) | | | | avatar_url | [string](#string) | | | diff --git a/proto/gen/api/v2/user_service.pb.go b/proto/gen/api/v2/user_service.pb.go index dafc6f9d444f5..252af6e8309b3 100644 --- a/proto/gen/api/v2/user_service.pb.go +++ b/proto/gen/api/v2/user_service.pb.go @@ -85,13 +85,14 @@ type User struct { 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"` - Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` - Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname,omitempty"` - AvatarUrl string `protobuf:"bytes,6,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` - Password string `protobuf:"bytes,7,opt,name=password,proto3" json:"password,omitempty"` - RowStatus RowStatus `protobuf:"varint,8,opt,name=row_status,json=rowStatus,proto3,enum=memos.api.v2.RowStatus" json:"row_status,omitempty"` - CreateTime *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=update_time,json=updateTime,proto3" json:"update_time,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"` } func (x *User) Reset() { @@ -147,6 +148,13 @@ func (x *User) GetRole() User_Role { return User_ROLE_UNSPECIFIED } +func (x *User) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + func (x *User) GetEmail() string { if x != nil { return x.Email @@ -1334,251 +1342,253 @@ 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, 0xb8, 0x03, 0x0a, 0x04, 0x55, 0x73, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd4, 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, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6d, 0x65, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, - 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, - 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 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, 0x06, 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, 0x07, 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, 0x08, 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, 0x09, 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, 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, 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, + 0x6f, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, + 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, 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, + 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, 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, 0xb1, 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, 0x6f, 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, 0x1e, 0xda, 0x41, 0x04, 0x75, - 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, - 0x09, 0x2f, 0x76, 0x31, 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, + 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, 0xb1, 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, 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, + 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, 0x6f, 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, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, + 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, 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, + 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, 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, 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 ( diff --git a/web/src/components/ChangePasswordDialog.tsx b/web/src/components/ChangePasswordDialog.tsx index 9b377f6cce1a2..3e88495412601 100644 --- a/web/src/components/ChangePasswordDialog.tsx +++ b/web/src/components/ChangePasswordDialog.tsx @@ -1,3 +1,4 @@ +import { Button, Input } from "@mui/joy"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import useCurrentUser from "@/hooks/useCurrentUser"; @@ -30,13 +31,11 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => { }; const handleNewPasswordChanged = (e: React.ChangeEvent) => { - const text = e.target.value as string; - setNewPassword(text); + setNewPassword(e.target.value); }; const handleNewPasswordAgainChanged = (e: React.ChangeEvent) => { - const text = e.target.value as string; - setNewPasswordAgain(text); + setNewPasswordAgain(e.target.value); }; const handleSaveBtnClick = async () => { @@ -77,30 +76,28 @@ const ChangePasswordDialog: React.FC = ({ destroy }: Props) => {

{t("auth.new-password")}

-

{t("auth.repeat-new-password")}

- -
- +
+ +
diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx index a23a100ca9d56..129be935dc703 100644 --- a/web/src/components/MemoView.tsx +++ b/web/src/components/MemoView.tsx @@ -33,11 +33,10 @@ interface Props { showParent?: boolean; showVisibility?: boolean; showPinnedStyle?: boolean; - lazyRendering?: boolean; } const MemoView: React.FC = (props: Props) => { - const { memo, lazyRendering } = props; + const { memo } = props; const t = useTranslate(); const navigateTo = useNavigateTo(); const { i18n } = useTranslation(); @@ -45,7 +44,6 @@ const MemoView: React.FC = (props: Props) => { const memoStore = useMemoStore(); const userStore = useUserStore(); const user = useCurrentUser(); - const [shouldRender, setShouldRender] = useState(lazyRendering ? false : true); const [displayTime, setDisplayTime] = useState(getRelativeTimeString(getTimeStampByDate(memo.displayTime))); const [creator, setCreator] = useState(userStore.getUserByUsername(extractUsernameFromName(memo.creator))); const [parentMemo, setParentMemo] = useState(undefined); @@ -53,15 +51,21 @@ const MemoView: React.FC = (props: Props) => { const referenceRelations = memo.relations.filter((relation) => relation.type === MemoRelation_Type.REFERENCE); const readonly = memo.creator !== user?.name; - // Prepare memo creator. useEffect(() => { - if (creator) return; - (async () => { const user = await userStore.getOrFetchUserByUsername(extractUsernameFromName(memo.creator)); setCreator(user); })(); - }, [memo.creator]); + + const parentMemoId = memo.relations.find( + (relation) => relation.memoId === memo.id && relation.type === MemoRelation_Type.COMMENT + )?.relatedMemoId; + if (parentMemoId) { + memoStore.getOrFetchMemoById(parentMemoId, { skipStore: true }).then((memo: Memo) => { + setParentMemo(memo); + }); + } + }, []); // Update display time string. useEffect(() => { @@ -77,42 +81,6 @@ const MemoView: React.FC = (props: Props) => { }; }, [i18n.language]); - // Lazy rendering. - useEffect(() => { - if (shouldRender) return; - if (!memoContainerRef.current) return; - - const observer = new IntersectionObserver(([entry]) => { - if (!entry.isIntersecting) return; - observer.disconnect(); - - setShouldRender(true); - }); - observer.observe(memoContainerRef.current); - - return () => observer.disconnect(); - }, [lazyRendering, filterStore.state]); - - useEffect(() => { - if (!shouldRender) { - return; - } - - const parentMemoId = memo.relations.find( - (relation) => relation.memoId === memo.id && relation.type === MemoRelation_Type.COMMENT - )?.relatedMemoId; - if (parentMemoId) { - memoStore.getOrFetchMemoById(parentMemoId, { skipStore: true }).then((memo: Memo) => { - setParentMemo(memo); - }); - } - }, [shouldRender]); - - if (!shouldRender) { - // Render a placeholder to occupy the space. - return
; - } - const handleGotoMemoDetailPage = (event: React.MouseEvent) => { if (event.altKey) { showChangeMemoCreatedTsDialog(memo.id); @@ -223,7 +191,7 @@ const MemoView: React.FC = (props: Props) => { - {creator.nickname || extractUsernameFromName(creator.name)} + {creator.nickname || creator.username} diff --git a/web/src/components/Settings/AccessTokenSection.tsx b/web/src/components/Settings/AccessTokenSection.tsx index 2e09c2a3be59c..fe1349234b2ca 100644 --- a/web/src/components/Settings/AccessTokenSection.tsx +++ b/web/src/components/Settings/AccessTokenSection.tsx @@ -4,7 +4,6 @@ import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { userServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { UserNamePrefix, extractUsernameFromName } from "@/store/v1"; import { UserAccessToken } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import showCreateAccessTokenDialog from "../CreateAccessTokenDialog"; @@ -12,8 +11,8 @@ import { showCommonDialog } from "../Dialog/CommonDialog"; import Icon from "../Icon"; import LearnMore from "../LearnMore"; -const listAccessTokens = async (username: string) => { - const { accessTokens } = await userServiceClient.listUserAccessTokens({ name: `${UserNamePrefix}${username}` }); +const listAccessTokens = async (name: string) => { + const { accessTokens } = await userServiceClient.listUserAccessTokens({ name }); return accessTokens; }; @@ -23,13 +22,13 @@ const AccessTokenSection = () => { const [userAccessTokens, setUserAccessTokens] = useState([]); useEffect(() => { - listAccessTokens(extractUsernameFromName(currentUser.name)).then((accessTokens) => { + listAccessTokens(currentUser.name).then((accessTokens) => { setUserAccessTokens(accessTokens); }); }, []); const handleCreateAccessTokenDialogConfirm = async () => { - const accessTokens = await listAccessTokens(extractUsernameFromName(currentUser.name)); + const accessTokens = await listAccessTokens(currentUser.name); setUserAccessTokens(accessTokens); }; diff --git a/web/src/components/Settings/MemberSection.tsx b/web/src/components/Settings/MemberSection.tsx index ab7aac8285094..29d29f00a1345 100644 --- a/web/src/components/Settings/MemberSection.tsx +++ b/web/src/components/Settings/MemberSection.tsx @@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import { userServiceClient } from "@/grpcweb"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { UserNamePrefix, extractUsernameFromName, useUserStore } from "@/store/v1"; +import { UserNamePrefix, 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"; @@ -164,7 +164,7 @@ const MemberSection = () => { {user.id} - {extractUsernameFromName(user.name)} + {user.username} {user.rowStatus === RowStatus.ARCHIVED && "(Archived)"} {user.nickname} diff --git a/web/src/components/Settings/MyAccountSection.tsx b/web/src/components/Settings/MyAccountSection.tsx index e3b330b88c06d..31b9ae91bb6d4 100644 --- a/web/src/components/Settings/MyAccountSection.tsx +++ b/web/src/components/Settings/MyAccountSection.tsx @@ -1,6 +1,5 @@ import { Button } from "@mui/joy"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { extractUsernameFromName } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; import showChangePasswordDialog from "../ChangePasswordDialog"; import showUpdateAccountDialog from "../UpdateAccountDialog"; @@ -19,7 +18,7 @@ const MyAccountSection = () => {
{user.nickname} - ({extractUsernameFromName(user.name)}) + ({user.username})
diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index 438b7544faaef..4212f5f8e1484 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -108,7 +108,7 @@ const ShareMemoDialog: React.FC = (props: Props) => {
- {user.nickname || extractUsernameFromName(user.name)} + {user.nickname || user.username}
diff --git a/web/src/components/UpdateAccountDialog.tsx b/web/src/components/UpdateAccountDialog.tsx index 9b7fc5fa33ecd..b4b34e3fe1185 100644 --- a/web/src/components/UpdateAccountDialog.tsx +++ b/web/src/components/UpdateAccountDialog.tsx @@ -1,3 +1,4 @@ +import { Button } from "@mui/joy"; import { isEqual } from "lodash-es"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; @@ -110,8 +111,8 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { } await userStore.updateUser( UserPb.fromPartial({ - name: `${UserNamePrefix}${state.username}`, - id: currentUser.id, + name: currentUser.name, + username: state.username, nickname: state.nickname, email: state.email, avatarUrl: state.avatarUrl, @@ -167,13 +168,13 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { {t("setting.account-section.email-note")}

-
- +
+ +
diff --git a/web/src/components/UserBanner.tsx b/web/src/components/UserBanner.tsx index 0aa8829166dd5..b1a88c51dcbcd 100644 --- a/web/src/components/UserBanner.tsx +++ b/web/src/components/UserBanner.tsx @@ -2,7 +2,6 @@ import * as api from "@/helpers/api"; import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; import { useGlobalStore } from "@/store/module"; -import { extractUsernameFromName } from "@/store/v1"; import { User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import showAboutSiteDialog from "./AboutSiteDialog"; @@ -16,10 +15,10 @@ const UserBanner = () => { const globalStore = useGlobalStore(); const { systemStatus } = globalStore.state; const user = useCurrentUser(); - const title = user ? user.nickname || extractUsernameFromName(user.name) : systemStatus.customizedProfile.name || "memos"; + const title = user ? user.nickname || user.username : systemStatus.customizedProfile.name || "memos"; const handleMyAccountClick = () => { - navigateTo(`/u/${encodeURIComponent(extractUsernameFromName(user.name))}`); + navigateTo(`/u/${encodeURIComponent(user.username)}`); }; const handleAboutBtnClick = () => { diff --git a/web/src/hooks/useCurrentUser.ts b/web/src/hooks/useCurrentUser.ts index 43f55697cd817..02b0e7504216b 100644 --- a/web/src/hooks/useCurrentUser.ts +++ b/web/src/hooks/useCurrentUser.ts @@ -1,9 +1,8 @@ import { useUserStore } from "@/store/v1"; -import { User } from "@/types/proto/api/v2/user_service"; const useCurrentUser = () => { const userStore = useUserStore(); - return userStore.currentUser as User; + return userStore.getUserByUsername(userStore.currentUser?.username || ""); }; export default useCurrentUser; diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsx index 3e53deb30ea20..5cdc9aba5b66f 100644 --- a/web/src/pages/Explore.tsx +++ b/web/src/pages/Explore.tsx @@ -54,7 +54,7 @@ const Explore = () => {
{sortedMemos.map((memo) => ( - + ))} {isRequesting ? ( diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index fcaba4050dd98..e3e003cb5833c 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -1,3 +1,4 @@ +import classNames from "classnames"; import { useEffect, useState } from "react"; import Empty from "@/components/Empty"; import HomeSidebar from "@/components/HomeSidebar"; @@ -57,14 +58,14 @@ const Home = () => { return (
-
+
{!md && }
{sortedMemos.map((memo) => ( - + ))} {isRequesting ? (
@@ -88,7 +89,7 @@ const Home = () => {
{md && ( -
+
)} diff --git a/web/src/pages/Timeline.tsx b/web/src/pages/Timeline.tsx index 457ec6263d216..0a61d2dc29e26 100644 --- a/web/src/pages/Timeline.tsx +++ b/web/src/pages/Timeline.tsx @@ -107,18 +107,18 @@ const Timeline = () => {
))} + {!isRequesting && sortedMemos.length === 0 && ( +
+ +

{t("message.no-data")}

+
+ )} {selectedDateStamp === currentDateStamp && (
)}
- {!isRequesting && sortedMemos.length === 0 && ( -
- -

{t("message.no-data")}

-
- )}
diff --git a/web/src/pages/UserProfile.tsx b/web/src/pages/UserProfile.tsx index 378ca4ff486ad..5ef85a1c3fce7 100644 --- a/web/src/pages/UserProfile.tsx +++ b/web/src/pages/UserProfile.tsx @@ -57,7 +57,11 @@ const UserProfile = () => { }, [user, tagQuery, textQuery]); const fetchMemos = async () => { - const filters = [`creator == "${user!.name}"`, `row_status == "NORMAL"`, `order_by_pinned == true`]; + if (!user) { + return; + } + + const filters = [`creator == "${user.name}"`, `row_status == "NORMAL"`, `order_by_pinned == true`]; const contentSearch: string[] = []; if (tagQuery) { contentSearch.push(`"#${tagQuery}"`); @@ -90,7 +94,7 @@ const UserProfile = () => {

{user?.nickname}

{sortedMemos.map((memo) => ( - + ))} {isRequesting ? (
diff --git a/web/src/store/v1/user.ts b/web/src/store/v1/user.ts index fd1a222606eea..135a516554333 100644 --- a/web/src/store/v1/user.ts +++ b/web/src/store/v1/user.ts @@ -33,8 +33,7 @@ export const useUserStore = create( const { users } = await userServiceClient.listUsers({}); const userMap = get().userMapByUsername; for (const user of users) { - const username = extractUsernameFromName(user.name); - userMap[username] = user; + userMap[user.username] = user; } set({ userMapByUsername: userMap }); return users; @@ -75,9 +74,8 @@ export const useUserStore = create( if (!updatedUser) { throw new Error("User not found"); } - const username = extractUsernameFromName(updatedUser.name); const userMap = get().userMapByUsername; - userMap[username] = updatedUser; + userMap[updatedUser.username] = updatedUser; set({ userMapByUsername: userMap }); return updatedUser; }, @@ -85,13 +83,19 @@ export const useUserStore = create( await userServiceClient.deleteUser({ name, }); + const username = extractUsernameFromName(name); + const userMap = get().userMapByUsername; + delete userMap[username]; + set({ userMapByUsername: userMap }); }, fetchCurrentUser: async () => { const { user } = await authServiceClient.getAuthStatus({}); if (!user) { throw new Error("User not found"); } - set({ currentUser: user }); + const userMap = get().userMapByUsername; + userMap[user.username] = user; + set({ currentUser: user, userMapByUsername: userMap }); const { setting } = await userServiceClient.getUserSetting({}); set({ userSetting: UserSetting.fromPartial({ From fcfb76a103a0b4a0bb66bd764af66ed07d2caa22 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 23 Dec 2023 19:35:46 +0800 Subject: [PATCH 252/650] chore: remove user urlsets in sitemap --- server/frontend/frontend.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/server/frontend/frontend.go b/server/frontend/frontend.go index 3cc7ea91567ac..da80adb1eb985 100644 --- a/server/frontend/frontend.go +++ b/server/frontend/frontend.go @@ -118,15 +118,6 @@ Sitemap: %s/sitemap.xml`, instanceURL, instanceURL) for _, memo := range memoList { urlsets = append(urlsets, fmt.Sprintf(`%s`, fmt.Sprintf("%s/m/%d", instanceURL, memo.ID))) } - // Append user list. - userList, err := s.Store.ListUsers(ctx, &store.FindUser{}) - if err != nil { - return err - } - for _, user := range userList { - urlsets = append(urlsets, fmt.Sprintf(`%s`, fmt.Sprintf("%s/u/%s", instanceURL, user.Username))) - } - sitemap := fmt.Sprintf(`%s`, strings.Join(urlsets, "\n")) return c.XMLBlob(http.StatusOK, []byte(sitemap)) }) From bd5a0679eee422e4fb1d21f5de033370805bcb92 Mon Sep 17 00:00:00 2001 From: subks <154797479+subks@users.noreply.github.com> Date: Tue, 26 Dec 2023 15:20:09 +0530 Subject: [PATCH 253/650] fix: date format in share memo dialog (#2672) fix: Date format in shareable Memo Images (#2668) --- web/src/components/ShareMemoDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index 4212f5f8e1484..275042d73ebe8 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -98,7 +98,7 @@ const ShareMemoDialog: React.FC = (props: Props) => { className="w-full h-auto select-none relative flex flex-col justify-start items-start bg-white dark:bg-zinc-800" ref={memoElRef} > - {getTimeString(memo.displayTime)} + {getDateTimeString(memo.displayTime)}
From f48ff102c9390031c026d447354c1a91f7b210d8 Mon Sep 17 00:00:00 2001 From: subks <154797479+subks@users.noreply.github.com> Date: Tue, 26 Dec 2023 19:16:26 +0530 Subject: [PATCH 254/650] fix: eslint check failure after fixing #2672 (#2673) --- web/src/components/ShareMemoDialog.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index 275042d73ebe8..c5c732699f26a 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -2,7 +2,7 @@ import { Button } from "@mui/joy"; import copy from "copy-to-clipboard"; import React, { useEffect, useRef } from "react"; import { toast } from "react-hot-toast"; -import { getDateTimeString, getTimeString } from "@/helpers/datetime"; +import { getDateTimeString } from "@/helpers/datetime"; import useLoading from "@/hooks/useLoading"; import toImage from "@/labs/html2image"; import { useUserStore, extractUsernameFromName } from "@/store/v1"; From 6fac116d8c2d02a17277ebba329de23ed4d67196 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 26 Dec 2023 23:05:33 +0800 Subject: [PATCH 255/650] chore: update user store --- web/src/components/UpdateAccountDialog.tsx | 34 ++++++++++------------ web/src/hooks/useCurrentUser.ts | 4 +-- web/src/store/v1/user.ts | 14 +++++---- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/web/src/components/UpdateAccountDialog.tsx b/web/src/components/UpdateAccountDialog.tsx index b4b34e3fe1185..cedbb6eede393 100644 --- a/web/src/components/UpdateAccountDialog.tsx +++ b/web/src/components/UpdateAccountDialog.tsx @@ -1,6 +1,6 @@ -import { Button } from "@mui/joy"; +import { Button, Input } from "@mui/joy"; import { isEqual } from "lodash-es"; -import { useEffect, useState } from "react"; +import { useState } from "react"; import { toast } from "react-hot-toast"; import { convertFileToBase64 } from "@/helpers/utils"; import useCurrentUser from "@/hooks/useCurrentUser"; @@ -31,10 +31,6 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { email: currentUser.email, }); - useEffect(() => { - // do nth - }, []); - const handleCloseBtnClick = () => { destroy(); }; @@ -97,18 +93,18 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { try { const updateMask = []; - if (!isEqual(currentUser.avatarUrl, state.avatarUrl)) { - updateMask.push("avatar_url"); + if (!isEqual(currentUser.name.replace(UserNamePrefix, ""), state.username)) { + updateMask.push("username"); } if (!isEqual(currentUser.nickname, state.nickname)) { updateMask.push("nickname"); } - if (!isEqual(currentUser.name.replace(UserNamePrefix, ""), state.username)) { - updateMask.push("username"); - } if (!isEqual(currentUser.email, state.email)) { updateMask.push("email"); } + if (!isEqual(currentUser.avatarUrl, state.avatarUrl)) { + updateMask.push("avatar_url"); + } await userStore.updateUser( UserPb.fromPartial({ name: currentUser.name, @@ -123,7 +119,7 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => { handleCloseBtnClick(); } catch (error: any) { console.error(error); - toast.error(error.response.data.error); + toast.error(error.details); } }; @@ -139,7 +135,7 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => {
{t("common.avatar")} {state.avatarUrl && ( @@ -155,19 +151,19 @@ const UpdateAccountDialog: React.FC = ({ destroy }: Props) => {

{t("common.username")} - {t("setting.account-section.username-note")} + ({t("setting.account-section.username-note")})

- +

{t("common.nickname")} - {t("setting.account-section.nickname-note")} + ({t("setting.account-section.nickname-note")})

- +

{t("common.email")} - {t("setting.account-section.email-note")} + ({t("setting.account-section.email-note")})

- +
+ + +

{t("about.memos-description")}

diff --git a/web/src/components/Inbox/VersionUpdateMessage.tsx b/web/src/components/Inbox/VersionUpdateMessage.tsx index dcf0a41dbabe1..f8baaee912bf5 100644 --- a/web/src/components/Inbox/VersionUpdateMessage.tsx +++ b/web/src/components/Inbox/VersionUpdateMessage.tsx @@ -36,6 +36,7 @@ const VersionUpdateMessage = ({ inbox }: Props) => { if (!activity?.payload?.versionUpdate?.version) { return; } + window.open(`https://github.com/usememos/memos/releases/tag/v${activity?.payload?.versionUpdate?.version}`); if (inbox.status === Inbox_Status.UNREAD) { handleArchiveMessage(true); diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx index 129be935dc703..7ee3f206993c6 100644 --- a/web/src/components/MemoView.tsx +++ b/web/src/components/MemoView.tsx @@ -46,7 +46,6 @@ const MemoView: React.FC = (props: Props) => { const user = useCurrentUser(); const [displayTime, setDisplayTime] = useState(getRelativeTimeString(getTimeStampByDate(memo.displayTime))); const [creator, setCreator] = useState(userStore.getUserByUsername(extractUsernameFromName(memo.creator))); - const [parentMemo, setParentMemo] = useState(undefined); const memoContainerRef = useRef(null); const referenceRelations = memo.relations.filter((relation) => relation.type === MemoRelation_Type.REFERENCE); const readonly = memo.creator !== user?.name; @@ -56,15 +55,6 @@ const MemoView: React.FC = (props: Props) => { const user = await userStore.getOrFetchUserByUsername(extractUsernameFromName(memo.creator)); setCreator(user); })(); - - const parentMemoId = memo.relations.find( - (relation) => relation.memoId === memo.id && relation.type === MemoRelation_Type.COMMENT - )?.relatedMemoId; - if (parentMemoId) { - memoStore.getOrFetchMemoById(parentMemoId, { skipStore: true }).then((memo: Memo) => { - setParentMemo(memo); - }); - } }, []); // Update display time string. @@ -210,16 +200,11 @@ const MemoView: React.FC = (props: Props) => { )} +
+
- - - - #{memo.id} - - {props.showVisibility && memo.visibility !== Visibility.PRIVATE && ( <> - @@ -228,8 +213,6 @@ const MemoView: React.FC = (props: Props) => { )}
-
-
{!readonly && ( <> @@ -237,22 +220,18 @@ const MemoView: React.FC = (props: Props) => {
- {!parentMemo && ( - - {memo.pinned ? : } - {memo.pinned ? t("common.unpin") : t("common.pin")} - - )} + + {memo.pinned ? : } + {memo.pinned ? t("common.unpin") : t("common.pin")} + {t("common.edit")} - {!parentMemo && ( - - - {t("common.mark")} - - )} + + + {t("common.mark")} + showShareMemoDialog(memo)}> {t("common.share")} @@ -272,19 +251,6 @@ const MemoView: React.FC = (props: Props) => { )}
- {props.showParent && parentMemo && ( -
- - - #{parentMemo.id} - {parentMemo.content} - -
- )} diff --git a/web/src/components/UserBanner.tsx b/web/src/components/UserBanner.tsx index b1a88c51dcbcd..efb06eb6a10ce 100644 --- a/web/src/components/UserBanner.tsx +++ b/web/src/components/UserBanner.tsx @@ -2,7 +2,6 @@ import * as api from "@/helpers/api"; import useCurrentUser from "@/hooks/useCurrentUser"; import useNavigateTo from "@/hooks/useNavigateTo"; import { useGlobalStore } from "@/store/module"; -import { User_Role } from "@/types/proto/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import showAboutSiteDialog from "./AboutSiteDialog"; import Icon from "./Icon"; @@ -36,12 +35,9 @@ const UserBanner = () => { - - {title} - {user?.role === User_Role.HOST ? ( - MOD - ) : null} +
+ + {title}
} actionsClassName="min-w-[128px] max-w-full" diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx index 3b45524968eb4..15cae66ff6565 100644 --- a/web/src/pages/MemoDetail.tsx +++ b/web/src/pages/MemoDetail.tsx @@ -74,6 +74,8 @@ const MemoDetail = () => { memoStore.getOrFetchMemoById(parentMemoId).then((memo: Memo) => { setParentMemo(memo); }); + } else { + setParentMemo(undefined); } await Promise.all(commentRelations.map((relation) => memoStore.getOrFetchMemoById(relation.memoId))); })(); @@ -114,60 +116,52 @@ const MemoDetail = () => {
+
+ + + +
+ {creator?.nickname} + {getDateTimeString(memo.displayTime)} +
+
+ +
{parentMemo && (
- - #{parentMemo.id} + {parentMemo.content}
)} -
- {getDateTimeString(memo.displayTime)} -
-
+
- - #{memo.id} - - - - - - - {creator?.nickname} - - - {allowEdit && ( - <> - - - + )}
diff --git a/web/src/pages/Resources.tsx b/web/src/pages/Resources.tsx index 422e3ab5b17b3..910ca6d75c839 100644 --- a/web/src/pages/Resources.tsx +++ b/web/src/pages/Resources.tsx @@ -77,7 +77,6 @@ const Resources = () => {
} value={state.searchQuery} From 2ae6d94e2c5c5cbf6f986f695d15314b6b09348d Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 28 Dec 2023 08:27:06 +0800 Subject: [PATCH 261/650] chore: update frontend dependencies --- web/package.json | 12 +-- web/pnpm-lock.yaml | 219 ++++++++++++++++++++++----------------------- 2 files changed, 115 insertions(+), 116 deletions(-) diff --git a/web/package.json b/web/package.json index 1d9d42d7fa317..68eded29a92be 100644 --- a/web/package.json +++ b/web/package.json @@ -10,12 +10,12 @@ }, "packageManager": "pnpm@8.7.0", "dependencies": { - "@emotion/react": "^11.11.1", + "@emotion/react": "^11.11.3", "@emotion/styled": "^11.11.0", - "@mui/joy": "5.0.0-beta.19", + "@mui/joy": "5.0.0-beta.20", "@reduxjs/toolkit": "^1.9.7", - "axios": "^1.6.2", - "classnames": "^2.3.2", + "axios": "^1.6.3", + "classnames": "^2.4.0", "copy-to-clipboard": "^3.3.3", "highlight.js": "^11.9.0", "i18next": "^21.10.0", @@ -47,8 +47,8 @@ "@types/react-dom": "^18.2.18", "@types/textarea-caret": "^3.0.3", "@types/uuid": "^9.0.7", - "@typescript-eslint/eslint-plugin": "^6.15.0", - "@typescript-eslint/parser": "^6.15.0", + "@typescript-eslint/eslint-plugin": "^6.16.0", + "@typescript-eslint/parser": "^6.16.0", "@vitejs/plugin-react-swc": "^3.5.0", "autoprefixer": "^10.4.16", "eslint": "^8.56.0", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index 5ad721d3a5a4b..b4c5ffd3df1ec 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -9,23 +9,23 @@ overrides: dependencies: '@emotion/react': - specifier: ^11.11.1 - version: 11.11.1(@types/react@18.2.45)(react@18.2.0) + specifier: ^11.11.3 + version: 11.11.3(@types/react@18.2.45)(react@18.2.0) '@emotion/styled': specifier: ^11.11.0 - version: 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) + version: 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.45)(react@18.2.0) '@mui/joy': - specifier: 5.0.0-beta.19 - version: 5.0.0-beta.19(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0) + specifier: 5.0.0-beta.20 + version: 5.0.0-beta.20(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.45)(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.2 - version: 1.6.2 + specifier: ^1.6.3 + version: 1.6.3 classnames: - specifier: ^2.3.2 - version: 2.3.2 + specifier: ^2.4.0 + version: 2.4.0 copy-to-clipboard: specifier: ^3.3.3 version: 3.3.3 @@ -49,7 +49,7 @@ dependencies: version: 0.263.1(react@18.2.0) nice-grpc-web: specifier: ^3.3.2 - version: 3.3.2(ws@8.15.1) + version: 3.3.2(ws@8.16.0) protobufjs: specifier: ^7.2.5 version: 7.2.5 @@ -116,11 +116,11 @@ devDependencies: specifier: ^9.0.7 version: 9.0.7 '@typescript-eslint/eslint-plugin': - specifier: ^6.15.0 - version: 6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.16.0 + version: 6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3) '@typescript-eslint/parser': - specifier: ^6.15.0 - version: 6.15.0(eslint@8.56.0)(typescript@5.3.3) + specifier: ^6.16.0 + version: 6.16.0(eslint@8.56.0)(typescript@5.3.3) '@vitejs/plugin-react-swc': specifier: ^3.5.0 version: 3.5.0(vite@5.0.10) @@ -485,7 +485,7 @@ packages: '@babel/runtime': 7.23.6 '@emotion/hash': 0.9.1 '@emotion/memoize': 0.8.1 - '@emotion/serialize': 1.1.2 + '@emotion/serialize': 1.1.3 babel-plugin-macros: 3.1.0 convert-source-map: 1.9.0 escape-string-regexp: 4.0.0 @@ -518,8 +518,8 @@ packages: resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} dev: false - /@emotion/react@11.11.1(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==} + /@emotion/react@11.11.3(@types/react@18.2.45)(react@18.2.0): + resolution: {integrity: sha512-Cnn0kuq4DoONOMcnoVsTOR8E+AdnKFf//6kUWc4LCdnxj31pZWn7rIULd6Y7/Js1PiPHzn7SKCM9vB/jBni8eA==} peerDependencies: '@types/react': '*' react: '>=16.8.0' @@ -530,7 +530,7 @@ packages: '@babel/runtime': 7.23.6 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 - '@emotion/serialize': 1.1.2 + '@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 @@ -539,8 +539,8 @@ packages: react: 18.2.0 dev: false - /@emotion/serialize@1.1.2: - resolution: {integrity: sha512-zR6a/fkFP4EAcCMQtLOhIgpprZOwNmCldtpaISpvz348+DP4Mz8ZoKaGGCQpbzepNIUWbq4w6hNZkwDyKoS+HA==} + /@emotion/serialize@1.1.3: + resolution: {integrity: sha512-iD4D6QVZFDhcbH0RAG1uVu1CwVLMWUkCvAqqlewO/rxf8+87yIBAlt4+AxMiiKPLs5hFc0owNk/sLLAOROw3cA==} dependencies: '@emotion/hash': 0.9.1 '@emotion/memoize': 0.8.1 @@ -553,7 +553,7 @@ packages: resolution: {integrity: sha512-0QBtGvaqtWi+nx6doRwDdBIzhNdZrXUppvTM4dtZZWEGTXL/XE/yJxLMGlDT1Gt+UHH5IX1n+jkXyytE/av7OA==} dev: false - /@emotion/styled@11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0): + /@emotion/styled@11.11.0(@emotion/react@11.11.3)(@types/react@18.2.45)(react@18.2.0): resolution: {integrity: sha512-hM5Nnvu9P3midq5aaXj4I+lnSfNi7Pmd4EWk1fOZ3pxookaQTNew6bp4JaCBYM4HVFZF9g7UjJmsUmC2JlxOng==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 @@ -566,8 +566,8 @@ packages: '@babel/runtime': 7.23.6 '@emotion/babel-plugin': 11.11.0 '@emotion/is-prop-valid': 1.2.1 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) - '@emotion/serialize': 1.1.2 + '@emotion/react': 11.11.3(@types/react@18.2.45)(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.45 @@ -923,8 +923,8 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 - /@mui/base@5.0.0-beta.28(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-KIoSc5sUFceeCaZTq5MQBapFzhHqMo4kj+4azWaCAjorduhcRQtN+BCgVHmo+gvEjix74bUfxwTqGifnu2fNTg==} + /@mui/base@5.0.0-beta.29(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-OXfUssYrB6ch/xpBVHMKAjThPlI9VyGGKdvQLMXef2j39wXfcxPlUVQlwia/lmE3rxWIGvbwkZsDtNYzLMsDUg==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -937,7 +937,7 @@ packages: '@babel/runtime': 7.23.6 '@floating-ui/react-dom': 2.0.4(react-dom@18.2.0)(react@18.2.0) '@mui/types': 7.2.11(@types/react@18.2.45) - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) + '@mui/utils': 5.15.2(@types/react@18.2.45)(react@18.2.0) '@popperjs/core': 2.11.8 '@types/react': 18.2.45 clsx: 2.0.0 @@ -946,12 +946,12 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/core-downloads-tracker@5.15.1: - resolution: {integrity: sha512-y/nUEsWHyBzaKYp9zLtqJKrLod/zMNEWpMj488FuQY9QTmqBiyUhI2uh7PVaLqLewXRtdmG6JV0b6T5exyuYRw==} + /@mui/core-downloads-tracker@5.15.2: + resolution: {integrity: sha512-0vk4ckS2w1F5PmkSXSd7F/QuRlNcPqWTJ8CPl+HQRLTIhJVS/VKEI+3dQufOdKfn2wS+ecnvlvXerbugs+xZ8Q==} dev: false - /@mui/joy@5.0.0-beta.19(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0): - resolution: {integrity: sha512-L3tutkCsJ4pI20LCiQthnXKMIv6GCJqbjPmzCjLvIUwp8kNhgQzauWc4ToYHP7FzZSoDt4HjwY52mvKhVrtytw==} + /@mui/joy@5.0.0-beta.20(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-w0BjmY8XKdca0s7yRZiURhSlhiqDtSnhNFl6GHixYytNB5u8Al6GMdYH0aLB2w5+QP8ojPueYQ7oXkS/qo0skQ==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -968,13 +968,13 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.6 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) - '@mui/base': 5.0.0-beta.28(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0) - '@mui/core-downloads-tracker': 5.15.1 - '@mui/system': 5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react@18.2.0) + '@emotion/react': 11.11.3(@types/react@18.2.45)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.45)(react@18.2.0) + '@mui/base': 5.0.0-beta.29(@types/react@18.2.45)(react-dom@18.2.0)(react@18.2.0) + '@mui/core-downloads-tracker': 5.15.2 + '@mui/system': 5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react@18.2.0) '@mui/types': 7.2.11(@types/react@18.2.45) - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) + '@mui/utils': 5.15.2(@types/react@18.2.45)(react@18.2.0) '@types/react': 18.2.45 clsx: 2.0.0 prop-types: 15.8.1 @@ -982,8 +982,8 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@mui/private-theming@5.15.1(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-wTbzuy5KjSvCPE9UVJktWHJ0b/tD5biavY9wvF+OpYDLPpdXK52vc1hTDxSbdkHIFMkJExzrwO9GvpVAHZBnFQ==} + /@mui/private-theming@5.15.2(@types/react@18.2.45)(react@18.2.0): + resolution: {integrity: sha512-KlXx5TH1Mw9omSY+Q6rz5TA/P71meSYaAOeopiW8s6o433+fnOxS17rZbmd1RnDZGCo+j24TfCavQuCMBAZnQA==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -993,14 +993,14 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.6 - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) + '@mui/utils': 5.15.2(@types/react@18.2.45)(react@18.2.0) '@types/react': 18.2.45 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/styled-engine@5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0): - resolution: {integrity: sha512-7WDZTJLqGexWDjqE9oAgjU8ak6hEtUw2yQU7SIYID5kLVO2Nj/Wi/KicbLsXnTsJNvSqePIlUIWTBSXwWJCPZw==} + /@mui/styled-engine@5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0): + resolution: {integrity: sha512-fYEN3IZzbebeHwAmQHhxwruiOIi8W74709qXg/7tgtHV4byQSmPgnnKsZkg0hFlzjEbcJIRZyZI0qEecgpR2cg==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.4.1 @@ -1014,15 +1014,15 @@ packages: dependencies: '@babel/runtime': 7.23.6 '@emotion/cache': 11.11.0 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) + '@emotion/react': 11.11.3(@types/react@18.2.45)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.45)(react@18.2.0) csstype: 3.1.2 prop-types: 15.8.1 react: 18.2.0 dev: false - /@mui/system@5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-LAnP0ls69rqW9eBgI29phIx/lppv+WDGI7b3EJN7VZIqw0RezA0GD7NRpV12BgEYJABEii6z5Q9B5tg7dsX0Iw==} + /@mui/system@5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(@types/react@18.2.45)(react@18.2.0): + resolution: {integrity: sha512-I7CzLiHDtU/BTobJgSk+wPGGWG95K8lYfdFEnq//wOgSrLDAdOVvl2gleDxJWO+yAbGz4RKEOnR9KuD+xQZH4A==} engines: {node: '>=12.0.0'} peerDependencies: '@emotion/react': ^11.5.0 @@ -1038,12 +1038,12 @@ packages: optional: true dependencies: '@babel/runtime': 7.23.6 - '@emotion/react': 11.11.1(@types/react@18.2.45)(react@18.2.0) - '@emotion/styled': 11.11.0(@emotion/react@11.11.1)(@types/react@18.2.45)(react@18.2.0) - '@mui/private-theming': 5.15.1(@types/react@18.2.45)(react@18.2.0) - '@mui/styled-engine': 5.15.1(@emotion/react@11.11.1)(@emotion/styled@11.11.0)(react@18.2.0) + '@emotion/react': 11.11.3(@types/react@18.2.45)(react@18.2.0) + '@emotion/styled': 11.11.0(@emotion/react@11.11.3)(@types/react@18.2.45)(react@18.2.0) + '@mui/private-theming': 5.15.2(@types/react@18.2.45)(react@18.2.0) + '@mui/styled-engine': 5.15.2(@emotion/react@11.11.3)(@emotion/styled@11.11.0)(react@18.2.0) '@mui/types': 7.2.11(@types/react@18.2.45) - '@mui/utils': 5.15.1(@types/react@18.2.45)(react@18.2.0) + '@mui/utils': 5.15.2(@types/react@18.2.45)(react@18.2.0) '@types/react': 18.2.45 clsx: 2.0.0 csstype: 3.1.2 @@ -1062,8 +1062,8 @@ packages: '@types/react': 18.2.45 dev: false - /@mui/utils@5.15.1(@types/react@18.2.45)(react@18.2.0): - resolution: {integrity: sha512-V1/d0E3Bju5YdB59HJf2G0tnHrFEvWLN+f8hAXp9+JSNy/LC2zKyqUfPPahflR6qsI681P8G9r4mEZte/SrrYA==} + /@mui/utils@5.15.2(@types/react@18.2.45)(react@18.2.0): + resolution: {integrity: sha512-6dGM9/guFKBlFRHA7/mbM+E7wE7CYDy9Ny4JLtD3J+NTyhi8nd8YxlzgAgTaTVqY0BpdQ2zdfB/q6+p2EdGM0w==} engines: {node: '>=12.0.0'} peerDependencies: '@types/react': ^17.0.0 || ^18.0.0 @@ -1493,8 +1493,8 @@ packages: resolution: {integrity: sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g==} dev: true - /@typescript-eslint/eslint-plugin@6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-j5qoikQqPccq9QoBAupOP+CBu8BaJ8BLjaXSioDISeTZkVO3ig7oSIKh3H+rEpee7xCXtWwSB4KIL5l6hWZzpg==} + /@typescript-eslint/eslint-plugin@6.16.0(@typescript-eslint/parser@6.16.0)(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-O5f7Kv5o4dLWQtPX4ywPPa+v9G+1q1x8mz0Kr0pXUtKsevo+gIJHLkGc8RxaZWtP8RrhwhSNIWThnW42K9/0rQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: '@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha @@ -1505,11 +1505,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 6.15.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/scope-manager': 6.15.0 - '@typescript-eslint/type-utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/parser': 6.16.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.16.0 + '@typescript-eslint/type-utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.16.0 debug: 4.3.4 eslint: 8.56.0 graphemer: 1.4.0 @@ -1522,8 +1522,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.15.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA==} + /@typescript-eslint/parser@6.16.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-H2GM3eUo12HpKZU9njig3DF5zJ58ja6ahj1GoHEHOgQvYxzoFJJEvC1MQ7T2l9Ha+69ZSOn7RTxOdpC/y3ikMw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1532,10 +1532,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.15.0 - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/scope-manager': 6.16.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) + '@typescript-eslint/visitor-keys': 6.16.0 debug: 4.3.4 eslint: 8.56.0 typescript: 5.3.3 @@ -1543,16 +1543,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@6.15.0: - resolution: {integrity: sha512-+BdvxYBltqrmgCNu4Li+fGDIkW9n//NrruzG9X1vBzaNK+ExVXPoGB71kneaVw/Jp+4rH/vaMAGC6JfMbHstVg==} + /@typescript-eslint/scope-manager@6.16.0: + resolution: {integrity: sha512-0N7Y9DSPdaBQ3sqSCwlrm9zJwkpOuc6HYm7LpzLAPqBL7dmzAUimr4M29dMkOP/tEwvOCC/Cxo//yOfJD3HUiw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/visitor-keys': 6.16.0 dev: true - /@typescript-eslint/type-utils@6.15.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-CnmHKTfX6450Bo49hPg2OkIm/D/TVYV7jO1MCfPYGwf6x3GO0VU8YMO5AYMn+u3X05lRRxA4fWCz87GFQV6yVQ==} + /@typescript-eslint/type-utils@6.16.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-ThmrEOcARmOnoyQfYkHw/DX2SEYBalVECmoldVuH6qagKROp/jMnfXpAU/pAIWub9c4YTxga+XwgAkoA0pxfmg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1561,8 +1561,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) - '@typescript-eslint/utils': 6.15.0(eslint@8.56.0)(typescript@5.3.3) + '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) + '@typescript-eslint/utils': 6.16.0(eslint@8.56.0)(typescript@5.3.3) debug: 4.3.4 eslint: 8.56.0 ts-api-utils: 1.0.3(typescript@5.3.3) @@ -1571,13 +1571,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@6.15.0: - resolution: {integrity: sha512-yXjbt//E4T/ee8Ia1b5mGlbNj9fB9lJP4jqLbZualwpP2BCQ5is6BcWwxpIsY4XKAhmdv3hrW92GdtJbatC6dQ==} + /@typescript-eslint/types@6.16.0: + resolution: {integrity: sha512-hvDFpLEvTJoHutVl87+MG/c5C8I6LOgEx05zExTSJDEVU7hhR3jhV8M5zuggbdFCw98+HhZWPHZeKS97kS3JoQ==} engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/typescript-estree@6.15.0(typescript@5.3.3): - resolution: {integrity: sha512-7mVZJN7Hd15OmGuWrp2T9UvqR2Ecg+1j/Bp1jXUEY2GZKV6FXlOIoqVDmLpBiEiq3katvj/2n2mR0SDwtloCew==} + /@typescript-eslint/typescript-estree@6.16.0(typescript@5.3.3): + resolution: {integrity: sha512-VTWZuixh/vr7nih6CfrdpmFNLEnoVBF1skfjdyGnNwXOH1SLeHItGdZDHhhAIzd3ACazyY2Fg76zuzOVTaknGA==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -1585,11 +1585,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/visitor-keys': 6.15.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/visitor-keys': 6.16.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 + minimatch: 9.0.3 semver: 7.5.4 ts-api-utils: 1.0.3(typescript@5.3.3) typescript: 5.3.3 @@ -1597,8 +1598,8 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@6.15.0(eslint@8.56.0)(typescript@5.3.3): - resolution: {integrity: sha512-eF82p0Wrrlt8fQSRL0bGXzK5nWPRV2dYQZdajcfzOD9+cQz9O7ugifrJxclB+xVOvWvagXfqS4Es7vpLP4augw==} + /@typescript-eslint/utils@6.16.0(eslint@8.56.0)(typescript@5.3.3): + resolution: {integrity: sha512-T83QPKrBm6n//q9mv7oiSvy/Xq/7Hyw9SzSEhMHJwznEmQayfBM87+oAlkNAMEO7/MjIwKyOHgBJbxB0s7gx2A==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -1606,9 +1607,9 @@ packages: '@eslint-community/eslint-utils': 4.4.0(eslint@8.56.0) '@types/json-schema': 7.0.15 '@types/semver': 7.5.6 - '@typescript-eslint/scope-manager': 6.15.0 - '@typescript-eslint/types': 6.15.0 - '@typescript-eslint/typescript-estree': 6.15.0(typescript@5.3.3) + '@typescript-eslint/scope-manager': 6.16.0 + '@typescript-eslint/types': 6.16.0 + '@typescript-eslint/typescript-estree': 6.16.0(typescript@5.3.3) eslint: 8.56.0 semver: 7.5.4 transitivePeerDependencies: @@ -1616,11 +1617,11 @@ packages: - typescript dev: true - /@typescript-eslint/visitor-keys@6.15.0: - resolution: {integrity: sha512-1zvtdC1a9h5Tb5jU9x3ADNXO9yjP8rXlaoChu0DQX40vf5ACVpYIVIZhIMZ6d5sDXH7vq4dsZBT1fEGj8D2n2w==} + /@typescript-eslint/visitor-keys@6.16.0: + resolution: {integrity: sha512-QSFQLruk7fhs91a/Ep/LqRdbJCZ1Rq03rqBdKT5Ky17Sz8zRLUksqIe9DW0pKtg/Z35/ztbLQ6qpOCN6rOC11A==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.15.0 + '@typescript-eslint/types': 6.16.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1852,7 +1853,7 @@ packages: postcss: ^8.1.0 dependencies: browserslist: 4.22.2 - caniuse-lite: 1.0.30001571 + caniuse-lite: 1.0.30001572 fraction.js: 4.3.7 normalize-range: 0.1.2 picocolors: 1.0.0 @@ -1865,8 +1866,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} + /axios@1.6.3: + resolution: {integrity: sha512-fWyNdeawGam70jXSVlKl+SUNVcL6j6W79CuSIPfi6HnDUmSCH6gyUys/HrqHeA/wU0Az41rRgean494d0Jb+ww==} dependencies: follow-redirects: 1.15.3 form-data: 4.0.0 @@ -1903,7 +1904,6 @@ packages: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 - dev: false /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} @@ -1916,7 +1916,7 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001571 + caniuse-lite: 1.0.30001572 electron-to-chromium: 1.4.616 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) @@ -1939,8 +1939,8 @@ packages: engines: {node: '>= 6'} dev: false - /caniuse-lite@1.0.30001571: - resolution: {integrity: sha512-tYq/6MoXhdezDLFZuCO/TKboTzuQ/xR5cFdgXPfDtM7/kchBO3b4VWghE/OAi/DV7tTdhmLjZiZBZi1fA/GheQ==} + /caniuse-lite@1.0.30001572: + resolution: {integrity: sha512-1Pbh5FLmn5y4+QhNyJE9j3/7dK44dGB83/ZMjv/qJk86TvDbjk0LosiZo0i0WB0Vx607qMX9jYrn1VLHCkN4rw==} dev: true /chalk@2.4.2: @@ -1974,8 +1974,8 @@ packages: fsevents: 2.3.3 dev: false - /classnames@2.3.2: - resolution: {integrity: sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==} + /classnames@2.4.0: + resolution: {integrity: sha512-lWxiIlphgAhTLN657pwU/ofFxsUTOWc2CRIFeoV5st0MGRJHStUnWIUJgDHxjUO/F0mXzGufXIM4Lfu/8h+MpA==} dev: false /clsx@2.0.0: @@ -3032,12 +3032,12 @@ packages: /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - /isomorphic-ws@5.0.0(ws@8.15.1): + /isomorphic-ws@5.0.0(ws@8.16.0): resolution: {integrity: sha512-muId7Zzn9ywDsyXgTIafTry2sV3nySZeUDe6YedVd1Hvuuep5AsIlqK+XefWpYTyJG5e503F2xIuT2lcU6rCSw==} peerDependencies: ws: '*' dependencies: - ws: 8.15.1 + ws: 8.16.0 dev: false /iterator.prototype@1.1.2: @@ -3288,7 +3288,6 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 - dev: false /minipass@7.0.4: resolution: {integrity: sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==} @@ -3322,7 +3321,7 @@ packages: react-dom: 18.2.0(react@18.2.0) rtl-css-js: 1.16.1 stacktrace-js: 2.0.2 - stylis: 4.3.0 + stylis: 4.3.1 dev: false /nanoid@3.3.7: @@ -3351,11 +3350,11 @@ packages: ts-error: 1.0.6 dev: false - /nice-grpc-web@3.3.2(ws@8.15.1): + /nice-grpc-web@3.3.2(ws@8.16.0): resolution: {integrity: sha512-qetU+H6y6jVvI5NZdtTls9UdqdCNwhr4UxqL5SfH6v8ISxucxDVPRYxnZaoZyWjMRvRgAKiQDIMu0bB0oedD0A==} dependencies: abort-controller-x: 0.4.3 - isomorphic-ws: 5.0.0(ws@8.15.1) + isomorphic-ws: 5.0.0(ws@8.16.0) js-base64: 3.7.5 nice-grpc-common: 2.0.2 transitivePeerDependencies: @@ -3590,11 +3589,11 @@ packages: postcss: ^8.2.14 dependencies: postcss: 8.4.32 - postcss-selector-parser: 6.0.13 + postcss-selector-parser: 6.0.14 dev: false - /postcss-selector-parser@6.0.13: - resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} + /postcss-selector-parser@6.0.14: + resolution: {integrity: sha512-65xXYsT40i9GyWzlHQ5ShZoK7JZdySeOozi/tz2EezDo6c04q6+ckYMeoY7idaie1qp2dT5KoYQ2yky6JuoHnA==} engines: {node: '>=4'} dependencies: cssesc: 3.0.0 @@ -4182,8 +4181,8 @@ packages: resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} dev: false - /stylis@4.3.0: - resolution: {integrity: sha512-E87pIogpwUsUwXw7dNyU4QDjdgVMy52m+XEOPEKUn161cCzWjjhPSQhByfd1CcNvrOLnXQ6OnnZDwnJrz/Z4YQ==} + /stylis@4.3.1: + resolution: {integrity: sha512-EQepAV+wMsIaGVGX1RECzgrcqRRU/0sYOHkeLsZ3fzHaHXZy4DaOOX0vOlGQdlsjkh3mFHAIlVimpwAs4dslyQ==} dev: false /sucrase@3.35.0: @@ -4241,7 +4240,7 @@ packages: postcss-js: 4.0.1(postcss@8.4.32) postcss-load-config: 4.0.2(postcss@8.4.32) postcss-nested: 6.0.1(postcss@8.4.32) - postcss-selector-parser: 6.0.13 + postcss-selector-parser: 6.0.14 resolve: 1.22.8 sucrase: 3.35.0 transitivePeerDependencies: @@ -4533,8 +4532,8 @@ packages: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true - /ws@8.15.1: - resolution: {integrity: sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==} + /ws@8.16.0: + resolution: {integrity: sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 From 09c195c752fa1b26862790a2dce4ec3fcc638fa9 Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 28 Dec 2023 08:28:50 +0800 Subject: [PATCH 262/650] chore: update backend dependencies --- go.mod | 84 +++++----- go.sum | 480 +++++++++++---------------------------------------------- 2 files changed, 132 insertions(+), 432 deletions(-) diff --git a/go.mod b/go.mod index ac3df71729faf..e983dc5ead1aa 100644 --- a/go.mod +++ b/go.mod @@ -4,15 +4,15 @@ go 1.21 require ( github.com/Masterminds/squirrel v1.5.4 - github.com/aws/aws-sdk-go-v2 v1.22.1 - github.com/aws/aws-sdk-go-v2/config v1.22.1 - github.com/aws/aws-sdk-go-v2/credentials v1.15.1 - github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.2 - github.com/aws/aws-sdk-go-v2/service/s3 v1.42.0 + github.com/aws/aws-sdk-go-v2 v1.24.0 + github.com/aws/aws-sdk-go-v2/config v1.26.2 + github.com/aws/aws-sdk-go-v2/credentials v1.16.13 + github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.9 + github.com/aws/aws-sdk-go-v2/service/s3 v1.47.7 github.com/disintegration/imaging v1.6.2 github.com/go-sql-driver/mysql v1.7.1 - github.com/google/cel-go v0.18.1 - github.com/google/uuid v1.4.0 + github.com/google/cel-go v0.18.2 + github.com/google/uuid v1.5.0 github.com/gorilla/feeds v1.1.2 github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.1 github.com/improbable-eng/grpc-web v0.15.0 @@ -21,31 +21,31 @@ require ( 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.17.0 + github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 github.com/swaggo/swag v1.16.2 go.uber.org/zap v1.26.0 golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231006140011-7918f672742d + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b golang.org/x/mod v0.14.0 golang.org/x/net v0.19.0 - golang.org/x/oauth2 v0.13.0 - google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 - google.golang.org/grpc v1.59.0 - modernc.org/sqlite v1.27.0 + golang.org/x/oauth2 v0.15.0 + google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 + google.golang.org/grpc v1.60.1 + modernc.org/sqlite v1.28.0 ) 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/antlr4-go/antlr/v4 v4.13.0 // 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.13 // indirect + github.com/go-openapi/swag v0.22.7 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect @@ -54,18 +54,18 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/rs/cors v1.10.1 // indirect - github.com/sagikazarmark/locafero v0.3.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect 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/image v0.13.0 // indirect - golang.org/x/tools v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect + golang.org/x/image v0.14.0 // indirect + golang.org/x/tools v0.16.1 // indirect + google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect lukechampine.com/uint128 v1.3.0 // indirect modernc.org/cc/v3 v3.41.0 // indirect modernc.org/ccgo/v3 v3.16.15 // indirect - modernc.org/libc v1.30.0 // indirect + modernc.org/libc v1.38.0 // indirect modernc.org/mathutil v1.6.0 // indirect modernc.org/memory v1.7.2 // indirect modernc.org/opt v0.1.3 // indirect @@ -75,20 +75,20 @@ require ( ) require ( - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1 // indirect - github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.1 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 // indirect - github.com/aws/smithy-go v1.16.0 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 // indirect + github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.9 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.9 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.9 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.26.6 // indirect + github.com/aws/smithy-go v1.19.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect @@ -102,11 +102,11 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/pelletier/go-toml/v2 v2.1.0 // indirect + github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/posthog/posthog-go v0.0.0-20230801140217-d607812dee69 - github.com/spf13/afero v1.10.0 // indirect - github.com/spf13/cast v1.5.1 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect @@ -116,7 +116,7 @@ require ( golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 5ffe9cfb7daa4..50d8596be6b48 100644 --- a/go.sum +++ b/go.sum @@ -1,40 +1,5 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= -cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= -cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= -cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= -cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= -cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= -cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= -cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= -cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= -cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= -cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= -cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= -cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= -cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= -cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= -cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= -cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= -cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= -cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= -cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= -cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= -cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -52,8 +17,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df h1:7RFfzj4SSt6nnvCPbCqijJi1nWCd+TqAT3bYCStRC18= -github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df/go.mod h1:pSwJ0fSY5KhvocuWSx4fz3BA8OrA1bQn+K1Eli3BRwM= +github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI= +github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -63,44 +28,44 @@ github.com/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6l github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= -github.com/aws/aws-sdk-go-v2 v1.22.1 h1:sjnni/AuoTXxHitsIdT0FwmqUuNUuHtufcVDErVFT9U= -github.com/aws/aws-sdk-go-v2 v1.22.1/go.mod h1:Kd0OJtkW3Q0M0lUWGszapWjEvrXDzRW+D21JNsroB+c= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0 h1:hHgLiIrTRtddC0AKcJr5s7i/hLgcpTt+q/FKxf1Zayk= -github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.0/go.mod h1:w4I/v3NOWgD+qvs1NPEwhd++1h3XPHFaVxasfY6HlYQ= -github.com/aws/aws-sdk-go-v2/config v1.22.1 h1:UrRYnF7mXCGuKmZWlczOXeH0WUbQpi/gseQIPtrhme8= -github.com/aws/aws-sdk-go-v2/config v1.22.1/go.mod h1:2eWgw5lps8fKI7LZVTrRTYP6HE6k/uEFUuTSHfXwqP0= -github.com/aws/aws-sdk-go-v2/credentials v1.15.1 h1:hmf6lAm9hk7uLCfapZn/jL05lm6Uwdbn1B0fgjyuf4M= -github.com/aws/aws-sdk-go-v2/credentials v1.15.1/go.mod h1:QTcHga3ZbQOneJuxmGBOCxiClxmp+TlvmjFexAnJ790= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2 h1:gIeH4+o1MN/caGBWjoGQTUTIu94xD6fI5B2+TcwBf70= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.2/go.mod h1:wLyMIo/zPOhQhPXTddpfdkSleyigtFi8iMnC+2m/SK4= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.2 h1:XmPqt2VLMB7dfZ/cGNXBJOFq+Q+VsnEcPW3MqyKAsvY= -github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.13.2/go.mod h1:Y9RO68QWibKfkJpic8lh2G36x1eUJsAznj+1jiyYmsU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1 h1:fi1ga6WysOyYb5PAf3Exd6B5GiSNpnZim4h1rhlBqx0= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.1/go.mod h1:V5CY8wNurvPUibTi9mwqUqpiFZ5LnioKWIFUDtIzdI8= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1 h1:ZpaV/j48RlPc4AmOZuPv22pJliXjXq8/reL63YzyFnw= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.1/go.mod h1:R8aXraabD2e3qv1csxM14/X9WF4wFMIY0kH4YEtYD5M= -github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0 h1:DqOQvIfmGkXZUVJnl9VRk0AnxyS59tCtX9k1Pyss4Ak= -github.com/aws/aws-sdk-go-v2/internal/ini v1.5.0/go.mod h1:VV/Kbw9Mg1GWJOT9WK+oTL3cWZiXtapnNvDSRqTZLsg= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.1 h1:vzYLDkwTw4CY0vUk84MeSufRf8XIsC/GsoIFXD60sTg= -github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.1/go.mod h1:ToBFBnjeGR2ruMx8IWp/y7vSK3Irj5/oPwifruiqoOM= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0 h1:CJxo7ZBbaIzmXfV3hjcx36n9V87gJsIUPJflwqEHl3Q= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.0/go.mod h1:yjVfjuY4nD1EW9i387Kau+I6V5cBA5YnC/mWNopjZrI= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.1 h1:15FUCJzAP9Y25nioTqTrGlZmhOtthaXBWlt4pS+d3Xo= -github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.1/go.mod h1:5655NW53Un6l7JzkI6AA3rZvf0m532cSnLThA1fVXcA= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1 h1:2OXw3ppu1XsB6rqKEMV4tnecTjIY3PRV2U6IP6KPJQo= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.1/go.mod h1:FZB4AdakIqW/yERVdGJA6Z9jraax1beXfhBBnK2wwR8= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.1 h1:dnl0klXYX9EKpzZbWlH5LJL+YTcEZcJEMPFFr/rAHUQ= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.1/go.mod h1:Mfk/9Joso4tCQYzM4q4HRUIqwln8lnIIMB/OE8Zebdc= -github.com/aws/aws-sdk-go-v2/service/s3 v1.42.0 h1:u0YoSrxjr3Lm+IqIlRAV+4YTFwkXjyB9db9CfUFge2w= -github.com/aws/aws-sdk-go-v2/service/s3 v1.42.0/go.mod h1:98EIdRu+BNsdqITsXfy+57TZfwlUQC9aDn9a9qoo90U= -github.com/aws/aws-sdk-go-v2/service/sso v1.17.0 h1:I/Oh3IxGPfHXiGnwM54TD6hNr/8TlUrBXAtTyGhR+zw= -github.com/aws/aws-sdk-go-v2/service/sso v1.17.0/go.mod h1:H6NCMvDBqA+CvIaXzaSqM6LWtzv9BzZrqBOqz+PzRF8= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0 h1:irbXQkfVYIRaewYSXcu4yVk0m2T+JzZd0dkop7FjmO0= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.19.0/go.mod h1:4wPNCkM22+oRe71oydP66K50ojDUC33XutSMi2pEF/M= -github.com/aws/aws-sdk-go-v2/service/sts v1.25.0 h1:sYIFy8tm1xQwRvVQ4CRuBGXKIg9sHNuG6+3UAQuoujk= -github.com/aws/aws-sdk-go-v2/service/sts v1.25.0/go.mod h1:S/LOQUeYDfJeJpFCIJDMjy7dwL4aA33HUdVi+i7uH8k= -github.com/aws/smithy-go v1.16.0 h1:gJZEH/Fqh+RsvlJ1Zt4tVAtV6bKkp3cC+R6FCZMNzik= -github.com/aws/smithy-go v1.16.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= +github.com/aws/aws-sdk-go-v2 v1.24.0 h1:890+mqQ+hTpNuw0gGP6/4akolQkSToDJgHfQE7AwGuk= +github.com/aws/aws-sdk-go-v2 v1.24.0/go.mod h1:LNh45Br1YAkEKaAqvmE1m8FUx6a5b/V0oAKV7of29b4= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4 h1:OCs21ST2LrepDfD3lwlQiOqIGp6JiEUqG84GzTDoyJs= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.5.4/go.mod h1:usURWEKSNNAcAZuzRn/9ZYPT8aZQkR7xcCtunK/LkJo= +github.com/aws/aws-sdk-go-v2/config v1.26.2 h1:+RWLEIWQIGgrz2pBPAUoGgNGs1TOyF4Hml7hCnYj2jc= +github.com/aws/aws-sdk-go-v2/config v1.26.2/go.mod h1:l6xqvUxt0Oj7PI/SUXYLNyZ9T/yBPn3YTQcJLLOdtR8= +github.com/aws/aws-sdk-go-v2/credentials v1.16.13 h1:WLABQ4Cp4vXtXfOWOS3MEZKr6AAYUpMczLhgKtAjQ/8= +github.com/aws/aws-sdk-go-v2/credentials v1.16.13/go.mod h1:Qg6x82FXwW0sJHzYruxGiuApNo31UEtJvXVSZAXeWiw= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10 h1:w98BT5w+ao1/r5sUuiH6JkVzjowOKeOJRHERyy1vh58= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.10/go.mod h1:K2WGI7vUvkIv1HoNbfBA1bvIZ+9kL3YVmWxeKuLQsiw= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.9 h1:5zA8qVCXMPGt6YneFnll5B157SfdK2SewU85PH9/yM0= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.15.9/go.mod h1:t4gy210hPxkbtYM8xOzrWdxVq1PyekR76OOKXy3s0Vs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9 h1:v+HbZaCGmOwnTTVS86Fleq0vPzOd7tnJGbFhP0stNLs= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.9/go.mod h1:Xjqy+Nyj7VDLBtCMkQYOw1QYfAEZCVLrfI0ezve8wd4= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9 h1:N94sVhRACtXyVcjXxrwK1SKFIJrA9pOJ5yu2eSHnmls= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.9/go.mod h1:hqamLz7g1/4EJP+GH5NBhcUMLjW+gKLQabgyz6/7WAU= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2 h1:GrSw8s0Gs/5zZ0SX+gX4zQjRnRsMJDJ2sLur1gRBhEM= +github.com/aws/aws-sdk-go-v2/internal/ini v1.7.2/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.9 h1:ugD6qzjYtB7zM5PN/ZIeaAIyefPaD82G8+SJopgvUpw= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.2.9/go.mod h1:YD0aYBWCrPENpHolhKw2XDlTIWae2GKXT1T4o6N6hiM= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4 h1:/b31bi3YVNlkzkBrm9LfpaKoaYZUxIAj4sHfOTmLfqw= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.4/go.mod h1:2aGXHFmbInwgP9ZfpmdIfOELL79zhdNYNmReK8qDfdQ= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.9 h1:/90OR2XbSYfXucBMJ4U14wrjlfleq/0SB6dZDPncgmo= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.2.9/go.mod h1:dN/Of9/fNZet7UrQQ6kTDo/VSwKPIq94vjlU16bRARc= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9 h1:Nf2sHxjMJR8CSImIVCONRi4g0Su3J+TSTbS7G0pUeMU= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.9/go.mod h1:idky4TER38YIjr2cADF1/ugFMKvZV7p//pVeV5LZbF0= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.9 h1:iEAeF6YC3l4FzlJPP9H3Ko1TXpdjdqWffxXjp8SY6uk= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.16.9/go.mod h1:kjsXoK23q9Z/tLBrckZLLyvjhZoS+AGrzqzUfEClvMM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.47.7 h1:o0ASbVwUAIrfp/WcCac+6jioZt4Hd8k/1X8u7GJ/QeM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.47.7/go.mod h1:vADO6Jn+Rq4nDtfwNjhgR84qkZwiC6FqCaXdw/kYwjA= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5 h1:ldSFWz9tEHAwHNmjx2Cvy1MjP5/L9kNoR0skc6wyOOM= +github.com/aws/aws-sdk-go-v2/service/sso v1.18.5/go.mod h1:CaFfXLYL376jgbP7VKC96uFcU8Rlavak0UlAwk1Dlhc= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5 h1:2k9KmFawS63euAkY4/ixVNsYYwrwnd5fIvgEKkfZFNM= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.21.5/go.mod h1:W+nd4wWDVkSUIox9bacmkBP5NMFQeTJ/xqNabpzSR38= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.6 h1:HJeiuZ2fldpd0WqngyMR6KW7ofkXNLyOaHwEIGm39Cs= +github.com/aws/aws-sdk-go-v2/service/sts v1.26.6/go.mod h1:XX5gh4CB7wAs4KhcF46G6C8a2i7eupU19dcAAE+EydU= +github.com/aws/smithy-go v1.19.0 h1:KWFKQV80DpP3vJrrA9sVAHQ5gc2z8i4EzrLhLlWXcBM= +github.com/aws/smithy-go v1.19.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= 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= @@ -114,14 +79,9 @@ github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqy github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= @@ -130,7 +90,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= @@ -151,22 +110,18 @@ github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4s github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= -github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= +github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= @@ -174,21 +129,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.13 h1:XJDIN+dLH6vqXgafnl5SUIMnzaChQ6QTo0/UPMbkIaE= +github.com/go-openapi/spec v0.20.13/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw= +github.com/go-openapi/swag v0.22.7 h1:JWrc1uc/P9cSomxfnsFSVWoE1FW6bNbrVPmpQYpCcR8= +github.com/go-openapi/swag v0.22.7/go.mod h1:Gl91UqO+btAM0plGGxHqJcQZ1ZTy6jbmridBTsDy8A0= 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= @@ -211,20 +159,11 @@ github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= @@ -241,45 +180,24 @@ github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/cel-go v0.18.1 h1:V/lAXKq4C3BYLDy/ARzMtpkEEYfHQpZzVyzy69nEUjs= -github.com/google/cel-go v0.18.1/go.mod h1:PVAybmSnWkNMUZR/tEWFUiJ1Np4Hz0MHsZJcgC4zln4= +github.com/google/cel-go v0.18.2 h1:L0B6sNBSVmt0OyECi8v6VOS74KOc9W/tLiWKfZABvf4= +github.com/google/cel-go v0.18.2/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ= github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= -github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/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.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= @@ -320,8 +238,6 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= -github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ= github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -342,8 +258,6 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -355,10 +269,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= 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= @@ -381,9 +293,6 @@ github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0U 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= @@ -426,7 +335,6 @@ github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzE github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -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= @@ -445,8 +353,8 @@ github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnh github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4= -github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= +github.com/pelletier/go-toml/v2 v2.1.1 h1:LWAJwfNvjQZCFIDKWYQaM62NcYeYViCmWIwmOStowAI= +github.com/pelletier/go-toml/v2 v2.1.1/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -455,7 +363,6 @@ github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -489,16 +396,16 @@ 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= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sagikazarmark/locafero v0.3.0 h1:zT7VEGWC2DTflmccN/5T1etyKvxSxpHsjb9cJvm4SvQ= -github.com/sagikazarmark/locafero v0.3.0/go.mod h1:w+v7UsPNFwzF1cHuOajOOzoq4U7v/ig1mpRjqV+Bu1U= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= @@ -514,18 +421,18 @@ github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4k github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/sourcegraph/conc v0.3.0 h1:OQTbbt6P72L20UqAkXXuLOj79LfEanQ+YQFNpLA9ySo= github.com/sourcegraph/conc v0.3.0/go.mod h1:Sdozi7LEKbFPqYX2/J+iBAM6HpqSLTASQIKqDmF7Mt0= -github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY= -github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ= -github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= -github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.17.0 h1:I5txKw7MJasPL/BrfkbA0Jyo/oELqVmux4pR/UxOMfI= -github.com/spf13/viper v1.17.0/go.mod h1:BmMMMLQXSbcHK6KAOiFLz0l5JHrU89OdIRHvsk0+yVI= +github.com/spf13/viper v1.18.2 h1:LUXCnvUvSM6FXAsj6nnfc8Q2tp1dIgUfY9Kc8GsSOiQ= +github.com/spf13/viper v1.18.2/go.mod h1:EKmWIqdnk5lOcmR72yw6hS+8OPYcwD0jteitLMVB+yk= github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs= github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= @@ -538,8 +445,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.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -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= @@ -561,21 +466,12 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= -go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= -go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -594,54 +490,31 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= -golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= -golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= -golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= -golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.13.0 h1:3cge/F/QTkNLauhf2QoE9zp+7sr+ZcL4HnoZmdwg9sg= -golang.org/x/image v0.13.0/go.mod h1:6mmbMOeV28HuMTgA6OSRkdXKYw/t5W9Uwn2Yv1r3Yxk= +golang.org/x/image v0.14.0 h1:tNgSxAFe3jC4uYqvZdTr84SZoM1KfwdC9SKIFrLjFn4= +golang.org/x/image v0.14.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= @@ -657,63 +530,30 @@ golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.13.0 h1:jDDenyj+WgFtmV3zYVoi8aE2BwtXFLWOA67ZfNWftiY= -golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ= -golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -727,43 +567,19 @@ golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -774,20 +590,15 @@ golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -797,159 +608,57 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= -golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc= -golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= +golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA= +golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= -google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= -google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= -google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= -google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= -google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= -google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= -google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 h1:wpZ8pe2x1Q3f2KyT5f8oP/fa9rHAKgFPr/HZdNuS+PQ= -google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:J7XzRzVy1+IPwWHZUzoD0IccYZIrXILAQpc+Qy9CMhY= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo= -google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0 h1:YJ5pD9rF8o9Qtta0Cmy9rdBwkSjrTCT6XTiUQVOtIos= +google.golang.org/genproto v0.0.0-20231212172506-995d672761c0/go.mod h1:l/k7rMz0vFTBPy+tFSGvXEd3z+BcoG1k7EHbqm+YBsY= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0 h1:s1w3X6gQxwrLEpxnLd/qXTVLgQE2yXwaOaoa6IlY/+o= +google.golang.org/genproto/googleapis/api v0.0.0-20231212172506-995d672761c0/go.mod h1:CAny0tYF+0/9rmDB9fahA9YLzX3+AEVl1qXbv5hhj6c= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= -google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -962,13 +671,12 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/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= @@ -990,18 +698,13 @@ 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= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= lukechampine.com/uint128 v1.3.0 h1:cDdUVfRwDUDovz610ABgFD17nXD4/uDgVHl2sC3+sbo= lukechampine.com/uint128 v1.3.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= modernc.org/cc/v3 v3.41.0 h1:QoR1Sn3YWlmA1T4vLaKZfawdVtSiGx8H+cEojbC7v1Q= @@ -1012,16 +715,16 @@ modernc.org/ccorpus v1.11.6 h1:J16RXiiqiCgua6+ZvQot4yUuUy8zxgqbqEEUuGPlISk= modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ= modernc.org/httpfs v1.0.6 h1:AAgIpFZRXuYnkjftxTAZwMIiwEqAfk8aVB2/oA6nAeM= modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM= -modernc.org/libc v1.30.0 h1:tw+o+UObwSE4Bfu3+Ztz9NW/Olqp7nTL/vcaEY/x4rc= -modernc.org/libc v1.30.0/go.mod h1:SUKVISl2sU6aasM35Y0v4SsSBTt89uDKrvxgXkvsC/4= +modernc.org/libc v1.38.0 h1:o4Lpk0zNDSdsjfEXnF1FGXWQ9PDi1NOdWcLP5n13FGo= +modernc.org/libc v1.38.0/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/opt v0.1.3 h1:3XOZf2yznlhC+ibLltsDGzABUGVx8J6pnFMS3E4dcq4= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= -modernc.org/sqlite v1.27.0 h1:MpKAHoyYB7xqcwnUwkuD+npwEa0fojF0B5QRbN+auJ8= -modernc.org/sqlite v1.27.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= +modernc.org/sqlite v1.28.0 h1:Zx+LyDDmXczNnEQdvPuEfcFVA2ZPyaD7UCZDjef3BHQ= +modernc.org/sqlite v1.28.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA= modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0= modernc.org/tcl v1.15.2 h1:C4ybAYCGJw968e+Me18oW55kD/FexcHbqH2xak1ROSY= @@ -1033,8 +736,5 @@ modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE= nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q= nhooyr.io/websocket v1.8.10/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= -rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= -rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= From 30dca18b79c47e365a5bba252d9d61a4c465628e Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 28 Dec 2023 08:34:06 +0800 Subject: [PATCH 263/650] chore: fix suspense wrapper --- web/src/layouts/SuspenseWrapper.tsx | 13 +++++++++++++ web/src/router/index.tsx | 27 +++++++++++++++++---------- 2 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 web/src/layouts/SuspenseWrapper.tsx diff --git a/web/src/layouts/SuspenseWrapper.tsx b/web/src/layouts/SuspenseWrapper.tsx new file mode 100644 index 0000000000000..886ac61340b70 --- /dev/null +++ b/web/src/layouts/SuspenseWrapper.tsx @@ -0,0 +1,13 @@ +import { Suspense } from "react"; +import { Outlet } from "react-router-dom"; +import Loading from "@/pages/Loading"; + +function SuspenseWrapper() { + return ( + }> + + + ); +} + +export default SuspenseWrapper; diff --git a/web/src/router/index.tsx b/web/src/router/index.tsx index 39c23cea611b3..8c7369b76935f 100644 --- a/web/src/router/index.tsx +++ b/web/src/router/index.tsx @@ -1,6 +1,7 @@ import { lazy } from "react"; import { createBrowserRouter } from "react-router-dom"; import App from "@/App"; +import SuspenseWrapper from "@/layouts/SuspenseWrapper"; import { initialGlobalState } from "@/store/module"; import AuthStatusProvider from "./AuthStatusProvider"; @@ -36,16 +37,22 @@ const router = createBrowserRouter([ loader: () => initialGlobalStateLoader(), children: [ { - path: "/auth", - element: , - }, - { - path: "/auth/signup", - element: , - }, - { - path: "/auth/callback", - element: , + path: "/auth/", + element: , + children: [ + { + path: "", + element: , + }, + { + path: "signup", + element: , + }, + { + path: "callback", + element: , + }, + ], }, { path: "/", From 2a6f054876c9d5462cdc27e3631544fe71ece63b Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 28 Dec 2023 21:32:44 +0800 Subject: [PATCH 264/650] chore: update auto link parser --- plugin/gomark/parser/auto_link.go | 38 ++++++++++++++++++-------- plugin/gomark/parser/auto_link_test.go | 7 +++++ 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/plugin/gomark/parser/auto_link.go b/plugin/gomark/parser/auto_link.go index ec47eb0bc12db..7acd7e20b8a79 100644 --- a/plugin/gomark/parser/auto_link.go +++ b/plugin/gomark/parser/auto_link.go @@ -2,6 +2,7 @@ package parser import ( "errors" + "net/url" "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" @@ -17,24 +18,36 @@ func (*AutoLinkParser) Match(tokens []*tokenizer.Token) (int, bool) { if len(tokens) < 3 { return 0, false } - if tokens[0].Type != tokenizer.LessThan { - return 0, false + + hasAngleBrackets := false + if tokens[0].Type == tokenizer.LessThan { + hasAngleBrackets = true } - urlTokens := []*tokenizer.Token{} - for _, token := range tokens[1:] { + + contentTokens := []*tokenizer.Token{} + for _, token := range tokens { if token.Type == tokenizer.Newline || token.Type == tokenizer.Space { - return 0, false + break } - if token.Type == tokenizer.GreaterThan { + contentTokens = append(contentTokens, token) + if hasAngleBrackets && token.Type == tokenizer.GreaterThan { break } - urlTokens = append(urlTokens, token) } - if 2+len(urlTokens) > len(tokens) { + + if hasAngleBrackets && contentTokens[len(contentTokens)-1].Type != tokenizer.GreaterThan { return 0, false } - return 2 + len(urlTokens), true + content := tokenizer.Stringify(contentTokens) + if !hasAngleBrackets { + u, err := url.Parse(content) + if err != nil || u.Scheme == "" || u.Host == "" { + return 0, false + } + } + + return len(contentTokens), true } func (p *AutoLinkParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { @@ -43,8 +56,11 @@ func (p *AutoLinkParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { return nil, errors.New("not matched") } - urlTokens := tokens[1 : size-1] + url := tokenizer.Stringify(tokens[:size]) + if tokens[0].Type == tokenizer.LessThan && tokens[len(tokens)-1].Type == tokenizer.GreaterThan { + url = tokenizer.Stringify(tokens[1 : len(tokens)-1]) + } return &ast.AutoLink{ - URL: tokenizer.Stringify(urlTokens), + URL: url, }, nil } diff --git a/plugin/gomark/parser/auto_link_test.go b/plugin/gomark/parser/auto_link_test.go index 4f3e315ce9957..582a26bdac9e3 100644 --- a/plugin/gomark/parser/auto_link_test.go +++ b/plugin/gomark/parser/auto_link_test.go @@ -24,7 +24,14 @@ func TestAutoLinkParser(t *testing.T) { URL: "https://example.com", }, }, + { + text: "https://example.com", + link: &ast.AutoLink{ + URL: "https://example.com", + }, + }, } + for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewAutoLinkParser().Parse(tokens) From 46f7cffc7b4265a7fba3effd91db9246dcb15d4a Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 28 Dec 2023 22:35:39 +0800 Subject: [PATCH 265/650] feat: implement restore nodes --- plugin/gomark/ast/ast.go | 59 ++++------------ plugin/gomark/ast/block.go | 70 +++++++++++++++++++ plugin/gomark/ast/inline.go | 58 ++++++++++++++- plugin/gomark/parser/auto_link.go | 5 +- plugin/gomark/parser/auto_link_test.go | 6 +- plugin/gomark/parser/blockquote.go | 2 +- plugin/gomark/parser/blockquote_test.go | 3 +- plugin/gomark/parser/bold_italic_test.go | 3 +- plugin/gomark/parser/bold_test.go | 3 +- plugin/gomark/parser/code_block.go | 5 +- plugin/gomark/parser/code_block_test.go | 3 +- plugin/gomark/parser/code_test.go | 3 +- .../gomark/parser/escaping_character_test.go | 3 +- plugin/gomark/parser/heading.go | 5 +- plugin/gomark/parser/heading_test.go | 3 +- plugin/gomark/parser/horizontal_rule_test.go | 3 +- plugin/gomark/parser/image_test.go | 3 +- plugin/gomark/parser/italic_test.go | 3 +- plugin/gomark/parser/link_test.go | 3 +- plugin/gomark/parser/ordered_list.go | 5 +- plugin/gomark/parser/ordered_list_test.go | 3 +- plugin/gomark/parser/paragraph.go | 8 +-- plugin/gomark/parser/paragraph_test.go | 3 +- plugin/gomark/parser/parser.go | 10 +++ plugin/gomark/parser/parser_test.go | 60 +--------------- plugin/gomark/parser/strikethrough_test.go | 3 +- plugin/gomark/parser/tag_test.go | 3 +- plugin/gomark/parser/task_list.go | 5 +- plugin/gomark/parser/task_list_test.go | 3 +- plugin/gomark/parser/unordered_list.go | 5 +- plugin/gomark/parser/unordered_list_test.go | 3 +- plugin/gomark/renderer/html/html.go | 2 +- plugin/gomark/restore/restore.go | 14 ++++ plugin/gomark/restore/restore_test.go | 48 +++++++++++++ 34 files changed, 264 insertions(+), 154 deletions(-) create mode 100644 plugin/gomark/restore/restore.go create mode 100644 plugin/gomark/restore/restore_test.go diff --git a/plugin/gomark/ast/ast.go b/plugin/gomark/ast/ast.go index 8f136a3c6ec10..5c7d5f2c8909a 100644 --- a/plugin/gomark/ast/ast.go +++ b/plugin/gomark/ast/ast.go @@ -28,57 +28,13 @@ const ( EscapingCharacterNode ) -func (t NodeType) String() string { - switch t { - case LineBreakNode: - return "LineBreakNode" - case ParagraphNode: - return "ParagraphNode" - case CodeBlockNode: - return "CodeBlockNode" - case HeadingNode: - return "HeadingNode" - case HorizontalRuleNode: - return "HorizontalRuleNode" - case BlockquoteNode: - return "BlockquoteNode" - case OrderedListNode: - return "OrderedListNode" - case UnorderedListNode: - return "UnorderedListNode" - case TaskListNode: - return "TaskListNode" - case TextNode: - return "TextNode" - case BoldNode: - return "BoldNode" - case ItalicNode: - return "ItalicNode" - case BoldItalicNode: - return "BoldItalicNode" - case CodeNode: - return "CodeNode" - case ImageNode: - return "ImageNode" - case LinkNode: - return "LinkNode" - case AutoLinkNode: - return "AutoLinkNode" - case TagNode: - return "TagNode" - case StrikethroughNode: - return "StrikethroughNode" - case EscapingCharacterNode: - return "EscapingCharacterNode" - default: - return "UnknownNode" - } -} - type Node interface { // Type returns a node type. Type() NodeType + // Restore returns a string representation of this node. + Restore() string + // PrevSibling returns a previous sibling node of this node. PrevSibling() Node @@ -113,3 +69,12 @@ func (n *BaseNode) SetPrevSibling(node Node) { func (n *BaseNode) SetNextSibling(node Node) { n.nextSibling = node } + +func IsBlockNode(node Node) bool { + switch node.Type() { + case ParagraphNode, CodeBlockNode, HeadingNode, HorizontalRuleNode, BlockquoteNode, OrderedListNode, UnorderedListNode, TaskListNode: + return true + default: + return false + } +} diff --git a/plugin/gomark/ast/block.go b/plugin/gomark/ast/block.go index 2b3ec4c7ebddb..d292cc2dca68a 100644 --- a/plugin/gomark/ast/block.go +++ b/plugin/gomark/ast/block.go @@ -1,5 +1,7 @@ package ast +import "fmt" + type BaseBlock struct { BaseNode } @@ -12,6 +14,10 @@ func (*LineBreak) Type() NodeType { return LineBreakNode } +func (*LineBreak) Restore() string { + return "\n" +} + type Paragraph struct { BaseBlock @@ -22,6 +28,14 @@ func (*Paragraph) Type() NodeType { return ParagraphNode } +func (n *Paragraph) Restore() string { + var result string + for _, child := range n.Children { + result += child.Restore() + } + return result +} + type CodeBlock struct { BaseBlock @@ -33,6 +47,10 @@ func (*CodeBlock) Type() NodeType { return CodeBlockNode } +func (n *CodeBlock) Restore() string { + return fmt.Sprintf("```%s\n%s\n```", n.Language, n.Content) +} + type Heading struct { BaseBlock @@ -44,6 +62,18 @@ func (*Heading) Type() NodeType { return HeadingNode } +func (n *Heading) Restore() string { + var result string + for _, child := range n.Children { + result += child.Restore() + } + symbol := "" + for i := 0; i < n.Level; i++ { + symbol += "#" + } + return fmt.Sprintf("%s %s", symbol, result) +} + type HorizontalRule struct { BaseBlock @@ -55,6 +85,10 @@ func (*HorizontalRule) Type() NodeType { return HorizontalRuleNode } +func (n *HorizontalRule) Restore() string { + return n.Symbol + n.Symbol + n.Symbol +} + type Blockquote struct { BaseBlock @@ -65,6 +99,14 @@ func (*Blockquote) Type() NodeType { return BlockquoteNode } +func (n *Blockquote) Restore() string { + var result string + for _, child := range n.Children { + result += child.Restore() + } + return fmt.Sprintf("> %s", result) +} + type OrderedList struct { BaseBlock @@ -76,6 +118,14 @@ func (*OrderedList) Type() NodeType { return OrderedListNode } +func (n *OrderedList) Restore() string { + var result string + for _, child := range n.Children { + result += child.Restore() + } + return fmt.Sprintf("%s. %s", n.Number, result) +} + type UnorderedList struct { BaseBlock @@ -88,6 +138,14 @@ func (*UnorderedList) Type() NodeType { return UnorderedListNode } +func (n *UnorderedList) Restore() string { + var result string + for _, child := range n.Children { + result += child.Restore() + } + return fmt.Sprintf("%s %s", n.Symbol, result) +} + type TaskList struct { BaseBlock @@ -100,3 +158,15 @@ type TaskList struct { func (*TaskList) Type() NodeType { return TaskListNode } + +func (n *TaskList) Restore() string { + var result string + for _, child := range n.Children { + result += child.Restore() + } + complete := " " + if n.Complete { + complete = "x" + } + return fmt.Sprintf("%s [%s] %s", n.Symbol, complete, result) +} diff --git a/plugin/gomark/ast/inline.go b/plugin/gomark/ast/inline.go index 4e8dfe62af224..af1d065b06a2a 100644 --- a/plugin/gomark/ast/inline.go +++ b/plugin/gomark/ast/inline.go @@ -1,5 +1,7 @@ package ast +import "fmt" + type BaseInline struct { BaseNode } @@ -14,6 +16,10 @@ func (*Text) Type() NodeType { return TextNode } +func (n *Text) Restore() string { + return n.Content +} + type Bold struct { BaseInline @@ -26,6 +32,15 @@ func (*Bold) Type() NodeType { return BoldNode } +func (n *Bold) Restore() string { + symbol := n.Symbol + n.Symbol + children := "" + for _, child := range n.Children { + children += child.Restore() + } + return fmt.Sprintf("%s%s%s", symbol, children, symbol) +} + type Italic struct { BaseInline @@ -38,6 +53,10 @@ func (*Italic) Type() NodeType { return ItalicNode } +func (n *Italic) Restore() string { + return fmt.Sprintf("%s%s%s", n.Symbol, n.Content, n.Symbol) +} + type BoldItalic struct { BaseInline @@ -50,6 +69,11 @@ func (*BoldItalic) Type() NodeType { return BoldItalicNode } +func (n *BoldItalic) Restore() string { + symbol := n.Symbol + n.Symbol + n.Symbol + return fmt.Sprintf("%s%s%s", symbol, n.Content, symbol) +} + type Code struct { BaseInline @@ -60,6 +84,10 @@ func (*Code) Type() NodeType { return CodeNode } +func (n *Code) Restore() string { + return fmt.Sprintf("`%s`", n.Content) +} + type Image struct { BaseInline @@ -71,6 +99,10 @@ func (*Image) Type() NodeType { return ImageNode } +func (n *Image) Restore() string { + return fmt.Sprintf("![%s](%s)", n.AltText, n.URL) +} + type Link struct { BaseInline @@ -82,16 +114,28 @@ func (*Link) Type() NodeType { return LinkNode } +func (n *Link) Restore() string { + return fmt.Sprintf("[%s](%s)", n.Text, n.URL) +} + type AutoLink struct { BaseInline - URL string + URL string + IsRawText bool } func (*AutoLink) Type() NodeType { return AutoLinkNode } +func (n *AutoLink) Restore() string { + if n.IsRawText { + return n.URL + } + return fmt.Sprintf("<%s>", n.URL) +} + type Tag struct { BaseInline @@ -102,6 +146,10 @@ func (*Tag) Type() NodeType { return TagNode } +func (n *Tag) Restore() string { + return fmt.Sprintf("<%s>", n.Content) +} + type Strikethrough struct { BaseInline @@ -112,6 +160,10 @@ func (*Strikethrough) Type() NodeType { return StrikethroughNode } +func (n *Strikethrough) Restore() string { + return fmt.Sprintf("~~%s~~", n.Content) +} + type EscapingCharacter struct { BaseInline @@ -121,3 +173,7 @@ type EscapingCharacter struct { func (*EscapingCharacter) Type() NodeType { return EscapingCharacterNode } + +func (n *EscapingCharacter) Restore() string { + return fmt.Sprintf("\\%s", n.Symbol) +} diff --git a/plugin/gomark/parser/auto_link.go b/plugin/gomark/parser/auto_link.go index 7acd7e20b8a79..48ba22ffb1ed6 100644 --- a/plugin/gomark/parser/auto_link.go +++ b/plugin/gomark/parser/auto_link.go @@ -57,10 +57,13 @@ func (p *AutoLinkParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { } url := tokenizer.Stringify(tokens[:size]) + isRawText := true if tokens[0].Type == tokenizer.LessThan && tokens[len(tokens)-1].Type == tokenizer.GreaterThan { + isRawText = false url = tokenizer.Stringify(tokens[1 : len(tokens)-1]) } return &ast.AutoLink{ - URL: url, + URL: url, + IsRawText: isRawText, }, nil } diff --git a/plugin/gomark/parser/auto_link_test.go b/plugin/gomark/parser/auto_link_test.go index 582a26bdac9e3..1fd529c06ebdf 100644 --- a/plugin/gomark/parser/auto_link_test.go +++ b/plugin/gomark/parser/auto_link_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestAutoLinkParser(t *testing.T) { @@ -27,7 +28,8 @@ func TestAutoLinkParser(t *testing.T) { { text: "https://example.com", link: &ast.AutoLink{ - URL: "https://example.com", + URL: "https://example.com", + IsRawText: true, }, }, } @@ -35,6 +37,6 @@ func TestAutoLinkParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewAutoLinkParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.link}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.link}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/blockquote.go b/plugin/gomark/parser/blockquote.go index 479c7ace0c177..f318bfc402b49 100644 --- a/plugin/gomark/parser/blockquote.go +++ b/plugin/gomark/parser/blockquote.go @@ -23,10 +23,10 @@ func (*BlockquoteParser) Match(tokens []*tokenizer.Token) (int, bool) { contentTokens := []*tokenizer.Token{} for _, token := range tokens[2:] { - contentTokens = append(contentTokens, token) if token.Type == tokenizer.Newline { break } + contentTokens = append(contentTokens, token) } if len(contentTokens) == 0 { return 0, false diff --git a/plugin/gomark/parser/blockquote_test.go b/plugin/gomark/parser/blockquote_test.go index c7568074a47cb..d786f9434cd4b 100644 --- a/plugin/gomark/parser/blockquote_test.go +++ b/plugin/gomark/parser/blockquote_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestBlockquoteParser(t *testing.T) { @@ -51,6 +52,6 @@ func TestBlockquoteParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewBlockquoteParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.blockquote}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.blockquote}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/bold_italic_test.go b/plugin/gomark/parser/bold_italic_test.go index b31790e56d78a..83cf91b6728f7 100644 --- a/plugin/gomark/parser/bold_italic_test.go +++ b/plugin/gomark/parser/bold_italic_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestBoldItalicParser(t *testing.T) { @@ -45,6 +46,6 @@ func TestBoldItalicParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewBoldItalicParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.boldItalic}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.boldItalic}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/bold_test.go b/plugin/gomark/parser/bold_test.go index 418ce719024c4..02872049463b8 100644 --- a/plugin/gomark/parser/bold_test.go +++ b/plugin/gomark/parser/bold_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestBoldParser(t *testing.T) { @@ -53,6 +54,6 @@ func TestBoldParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewBoldParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.bold}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.bold}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/code_block.go b/plugin/gomark/parser/code_block.go index 4eaf3a74d3149..534b693fdae6e 100644 --- a/plugin/gomark/parser/code_block.go +++ b/plugin/gomark/parser/code_block.go @@ -40,7 +40,7 @@ func (*CodeBlockParser) Match(tokens []*tokenizer.Token) (int, bool) { matched = true break } else if tokens[cursor+4].Type == tokenizer.Newline { - cursor += 5 + cursor += 4 matched = true break } @@ -65,9 +65,6 @@ func (p *CodeBlockParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { languageToken = nil contentStart = 4 } - if tokens[size-1].Type == tokenizer.Newline { - contentEnd = size - 5 - } codeBlock := &ast.CodeBlock{ Content: tokenizer.Stringify(tokens[contentStart:contentEnd]), diff --git a/plugin/gomark/parser/code_block_test.go b/plugin/gomark/parser/code_block_test.go index 4a46b9aaf8603..bc5b13fdf6e71 100644 --- a/plugin/gomark/parser/code_block_test.go +++ b/plugin/gomark/parser/code_block_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestCodeBlockParser(t *testing.T) { @@ -59,6 +60,6 @@ func TestCodeBlockParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewCodeBlockParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.codeBlock}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.codeBlock}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/code_test.go b/plugin/gomark/parser/code_test.go index 8c4822d8533d0..6dc28d43746b9 100644 --- a/plugin/gomark/parser/code_test.go +++ b/plugin/gomark/parser/code_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestCodeParser(t *testing.T) { @@ -33,6 +34,6 @@ func TestCodeParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewCodeParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.code}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.code}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/escaping_character_test.go b/plugin/gomark/parser/escaping_character_test.go index da6b2d313e2b5..7c66db8b578f2 100644 --- a/plugin/gomark/parser/escaping_character_test.go +++ b/plugin/gomark/parser/escaping_character_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestEscapingCharacterParser(t *testing.T) { @@ -25,6 +26,6 @@ func TestEscapingCharacterParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewEscapingCharacterParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.node}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.node}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/heading.go b/plugin/gomark/parser/heading.go index 9e6754a0da51f..0c98afb955eec 100644 --- a/plugin/gomark/parser/heading.go +++ b/plugin/gomark/parser/heading.go @@ -34,10 +34,10 @@ func (*HeadingParser) Match(tokens []*tokenizer.Token) (int, bool) { contentTokens := []*tokenizer.Token{} for _, token := range tokens[level+1:] { - contentTokens = append(contentTokens, token) if token.Type == tokenizer.Newline { break } + contentTokens = append(contentTokens, token) } if len(contentTokens) == 0 { return 0, false @@ -62,9 +62,6 @@ func (p *HeadingParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { } contentTokens := tokens[level+1 : size] - if contentTokens[len(contentTokens)-1].Type == tokenizer.Newline { - contentTokens = contentTokens[:len(contentTokens)-1] - } children, err := ParseInline(contentTokens) if err != nil { return nil, err diff --git a/plugin/gomark/parser/heading_test.go b/plugin/gomark/parser/heading_test.go index a68bb46078323..df3aacccba257 100644 --- a/plugin/gomark/parser/heading_test.go +++ b/plugin/gomark/parser/heading_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestHeadingParser(t *testing.T) { @@ -80,6 +81,6 @@ Hello World`, for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewHeadingParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.heading}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.heading}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/horizontal_rule_test.go b/plugin/gomark/parser/horizontal_rule_test.go index d191ae8f5e648..3822f80f600b9 100644 --- a/plugin/gomark/parser/horizontal_rule_test.go +++ b/plugin/gomark/parser/horizontal_rule_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestHorizontalRuleParser(t *testing.T) { @@ -51,6 +52,6 @@ func TestHorizontalRuleParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewHorizontalRuleParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.horizontalRule}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.horizontalRule}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/image_test.go b/plugin/gomark/parser/image_test.go index f88e2a699a0b6..7bbf1fae5d2bb 100644 --- a/plugin/gomark/parser/image_test.go +++ b/plugin/gomark/parser/image_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestImageParser(t *testing.T) { @@ -40,6 +41,6 @@ func TestImageParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewImageParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.image}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.image}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/italic_test.go b/plugin/gomark/parser/italic_test.go index f3627f71b37e0..5c60c442e7ac9 100644 --- a/plugin/gomark/parser/italic_test.go +++ b/plugin/gomark/parser/italic_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestItalicParser(t *testing.T) { @@ -44,6 +45,6 @@ func TestItalicParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewItalicParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.italic}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.italic}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/link_test.go b/plugin/gomark/parser/link_test.go index 24287bdcacda1..f7565094ac414 100644 --- a/plugin/gomark/parser/link_test.go +++ b/plugin/gomark/parser/link_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestLinkParser(t *testing.T) { @@ -47,6 +48,6 @@ func TestLinkParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewLinkParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.link}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.link}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/ordered_list.go b/plugin/gomark/parser/ordered_list.go index d0d4343a46a47..da3f71736ea0b 100644 --- a/plugin/gomark/parser/ordered_list.go +++ b/plugin/gomark/parser/ordered_list.go @@ -23,10 +23,10 @@ func (*OrderedListParser) Match(tokens []*tokenizer.Token) (int, bool) { contentTokens := []*tokenizer.Token{} for _, token := range tokens[3:] { - contentTokens = append(contentTokens, token) if token.Type == tokenizer.Newline { break } + contentTokens = append(contentTokens, token) } if len(contentTokens) == 0 { @@ -43,9 +43,6 @@ func (p *OrderedListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { } contentTokens := tokens[3:size] - if contentTokens[len(contentTokens)-1].Type == tokenizer.Newline { - contentTokens = contentTokens[:len(contentTokens)-1] - } children, err := ParseInline(contentTokens) if err != nil { return nil, err diff --git a/plugin/gomark/parser/ordered_list_test.go b/plugin/gomark/parser/ordered_list_test.go index 374c317afd83c..4b1bcbcf5c186 100644 --- a/plugin/gomark/parser/ordered_list_test.go +++ b/plugin/gomark/parser/ordered_list_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestOrderedListParser(t *testing.T) { @@ -53,6 +54,6 @@ func TestOrderedListParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewOrderedListParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.node}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.node}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/paragraph.go b/plugin/gomark/parser/paragraph.go index 8ac5a5a10db43..40a6fe42a6f4e 100644 --- a/plugin/gomark/parser/paragraph.go +++ b/plugin/gomark/parser/paragraph.go @@ -18,10 +18,10 @@ func NewParagraphParser() *ParagraphParser { func (*ParagraphParser) Match(tokens []*tokenizer.Token) (int, bool) { contentTokens := []*tokenizer.Token{} for _, token := range tokens { - contentTokens = append(contentTokens, token) if token.Type == tokenizer.Newline { break } + contentTokens = append(contentTokens, token) } if len(contentTokens) == 0 { return 0, false @@ -38,11 +38,7 @@ func (p *ParagraphParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { return nil, errors.New("not matched") } - contentTokens := tokens[:size] - if contentTokens[len(contentTokens)-1].Type == tokenizer.Newline { - contentTokens = contentTokens[:len(contentTokens)-1] - } - children, err := ParseInline(contentTokens) + children, err := ParseInline(tokens[:size]) if err != nil { return nil, err } diff --git a/plugin/gomark/parser/paragraph_test.go b/plugin/gomark/parser/paragraph_test.go index cf154dd2e5eff..60a972f408351 100644 --- a/plugin/gomark/parser/paragraph_test.go +++ b/plugin/gomark/parser/paragraph_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestParagraphParser(t *testing.T) { @@ -57,6 +58,6 @@ func TestParagraphParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewParagraphParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.paragraph}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.paragraph}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/parser.go b/plugin/gomark/parser/parser.go index c3e7633cd3d6b..133bbad36aeb9 100644 --- a/plugin/gomark/parser/parser.go +++ b/plugin/gomark/parser/parser.go @@ -48,6 +48,7 @@ func ParseBlock(tokens []*tokenizer.Token) ([]ast.Node, error) { func ParseBlockWithParsers(tokens []*tokenizer.Token, blockParsers []BlockParser) ([]ast.Node, error) { nodes := []ast.Node{} var prevNode ast.Node + var skipNextLineBreakFlag bool for len(tokens) > 0 { for _, blockParser := range blockParsers { size, matched := blockParser.Match(tokens) @@ -57,12 +58,21 @@ func ParseBlockWithParsers(tokens []*tokenizer.Token, blockParsers []BlockParser return nil, errors.New("parse error") } + if node.Type() == ast.LineBreakNode && skipNextLineBreakFlag { + if prevNode != nil && ast.IsBlockNode(prevNode) { + tokens = tokens[size:] + skipNextLineBreakFlag = false + break + } + } + tokens = tokens[size:] if prevNode != nil { prevNode.SetNextSibling(node) node.SetPrevSibling(prevNode) } prevNode = node + skipNextLineBreakFlag = true nodes = append(nodes, node) break } diff --git a/plugin/gomark/parser/parser_test.go b/plugin/gomark/parser/parser_test.go index 827e6dadc6e83..2d5effaba416c 100644 --- a/plugin/gomark/parser/parser_test.go +++ b/plugin/gomark/parser/parser_test.go @@ -1,13 +1,13 @@ package parser import ( - "strconv" "testing" "github.com/stretchr/testify/require" "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestParser(t *testing.T) { @@ -202,62 +202,6 @@ func TestParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) nodes, _ := Parse(tokens) - require.Equal(t, StringifyNodes(test.nodes), StringifyNodes(nodes)) + require.Equal(t, restore.Restore(test.nodes), restore.Restore(nodes)) } } - -func StringifyNodes(nodes []ast.Node) string { - var result string - for _, node := range nodes { - if node != nil { - result += StringifyNode(node) - } - } - return result -} - -func StringifyNode(node ast.Node) string { - switch n := node.(type) { - case *ast.LineBreak: - return "LineBreak()" - case *ast.CodeBlock: - return "CodeBlock(" + n.Language + ", " + n.Content + ")" - case *ast.Paragraph: - return "Paragraph(" + StringifyNodes(n.Children) + ")" - case *ast.Heading: - return "Heading(" + StringifyNodes(n.Children) + ")" - case *ast.HorizontalRule: - return "HorizontalRule(" + n.Symbol + ")" - case *ast.Blockquote: - return "Blockquote(" + StringifyNodes(n.Children) + ")" - case *ast.OrderedList: - return "OrderedList(" + n.Number + ", " + StringifyNodes(n.Children) + ")" - case *ast.UnorderedList: - return "UnorderedList(" + n.Symbol + ", " + StringifyNodes(n.Children) + ")" - case *ast.TaskList: - return "TaskList(" + n.Symbol + ", " + strconv.FormatBool(n.Complete) + ", " + StringifyNodes(n.Children) + ")" - case *ast.Text: - return "Text(" + n.Content + ")" - case *ast.Bold: - return "Bold(" + n.Symbol + StringifyNodes(n.Children) + n.Symbol + ")" - case *ast.Italic: - return "Italic(" + n.Symbol + n.Content + n.Symbol + ")" - case *ast.BoldItalic: - return "BoldItalic(" + n.Symbol + n.Content + n.Symbol + ")" - case *ast.Code: - return "Code(" + n.Content + ")" - case *ast.Image: - return "Image(" + n.URL + ", " + n.AltText + ")" - case *ast.Link: - return "Link(" + n.Text + ", " + n.URL + ")" - case *ast.AutoLink: - return "AutoLink(" + n.URL + ")" - case *ast.Tag: - return "Tag(" + n.Content + ")" - case *ast.Strikethrough: - return "Strikethrough(" + n.Content + ")" - case *ast.EscapingCharacter: - return "EscapingCharacter(" + n.Symbol + ")" - } - return "" -} diff --git a/plugin/gomark/parser/strikethrough_test.go b/plugin/gomark/parser/strikethrough_test.go index 7e9efe6f928ac..9a67a9ace4bd9 100644 --- a/plugin/gomark/parser/strikethrough_test.go +++ b/plugin/gomark/parser/strikethrough_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestStrikethroughParser(t *testing.T) { @@ -41,6 +42,6 @@ func TestStrikethroughParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewStrikethroughParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.strikethrough}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.strikethrough}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/tag_test.go b/plugin/gomark/parser/tag_test.go index cc74674290408..7dbb1bc019806 100644 --- a/plugin/gomark/parser/tag_test.go +++ b/plugin/gomark/parser/tag_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestTagParser(t *testing.T) { @@ -39,6 +40,6 @@ func TestTagParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewTagParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.tag}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.tag}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/task_list.go b/plugin/gomark/parser/task_list.go index abb62399af626..b46c1910bcb36 100644 --- a/plugin/gomark/parser/task_list.go +++ b/plugin/gomark/parser/task_list.go @@ -34,10 +34,10 @@ func (*TaskListParser) Match(tokens []*tokenizer.Token) (int, bool) { contentTokens := []*tokenizer.Token{} for _, token := range tokens[6:] { - contentTokens = append(contentTokens, token) if token.Type == tokenizer.Newline { break } + contentTokens = append(contentTokens, token) } if len(contentTokens) == 0 { return 0, false @@ -54,9 +54,6 @@ func (p *TaskListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) { symbolToken := tokens[0] contentTokens := tokens[6:size] - if contentTokens[len(contentTokens)-1].Type == tokenizer.Newline { - contentTokens = contentTokens[:len(contentTokens)-1] - } children, err := ParseInline(contentTokens) if err != nil { return nil, err diff --git a/plugin/gomark/parser/task_list_test.go b/plugin/gomark/parser/task_list_test.go index 3676264b2441b..d92775e479430 100644 --- a/plugin/gomark/parser/task_list_test.go +++ b/plugin/gomark/parser/task_list_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestTaskListParser(t *testing.T) { @@ -52,6 +53,6 @@ func TestTaskListParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewTaskListParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.node}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.node}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/parser/unordered_list.go b/plugin/gomark/parser/unordered_list.go index 95e02cfd6aca9..c64daeb1768c9 100644 --- a/plugin/gomark/parser/unordered_list.go +++ b/plugin/gomark/parser/unordered_list.go @@ -24,10 +24,10 @@ func (*UnorderedListParser) Match(tokens []*tokenizer.Token) (int, bool) { contentTokens := []*tokenizer.Token{} for _, token := range tokens[2:] { - contentTokens = append(contentTokens, token) if token.Type == tokenizer.Newline { break } + contentTokens = append(contentTokens, token) } if len(contentTokens) == 0 { return 0, false @@ -44,9 +44,6 @@ func (p *UnorderedListParser) Parse(tokens []*tokenizer.Token) (ast.Node, error) symbolToken := tokens[0] contentTokens := tokens[2:size] - if contentTokens[len(contentTokens)-1].Type == tokenizer.Newline { - contentTokens = contentTokens[:len(contentTokens)-1] - } children, err := ParseInline(contentTokens) if err != nil { return nil, err diff --git a/plugin/gomark/parser/unordered_list_test.go b/plugin/gomark/parser/unordered_list_test.go index e3a7174c646a3..0d4b111291edb 100644 --- a/plugin/gomark/parser/unordered_list_test.go +++ b/plugin/gomark/parser/unordered_list_test.go @@ -7,6 +7,7 @@ import ( "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" + "github.com/usememos/memos/plugin/gomark/restore" ) func TestUnorderedListParser(t *testing.T) { @@ -50,6 +51,6 @@ func TestUnorderedListParser(t *testing.T) { for _, test := range tests { tokens := tokenizer.Tokenize(test.text) node, _ := NewUnorderedListParser().Parse(tokens) - require.Equal(t, StringifyNodes([]ast.Node{test.node}), StringifyNodes([]ast.Node{node})) + require.Equal(t, restore.Restore([]ast.Node{test.node}), restore.Restore([]ast.Node{node})) } } diff --git a/plugin/gomark/renderer/html/html.go b/plugin/gomark/renderer/html/html.go index 5422f28648583..4a4fd8bed631c 100644 --- a/plugin/gomark/renderer/html/html.go +++ b/plugin/gomark/renderer/html/html.go @@ -83,7 +83,7 @@ func (r *HTMLRenderer) Render(astRoot []ast.Node) string { return r.output.String() } -func (r *HTMLRenderer) renderLineBreak(_ *ast.LineBreak) { +func (r *HTMLRenderer) renderLineBreak(*ast.LineBreak) { r.output.WriteString("
") } diff --git a/plugin/gomark/restore/restore.go b/plugin/gomark/restore/restore.go new file mode 100644 index 0000000000000..cdf91bdcada97 --- /dev/null +++ b/plugin/gomark/restore/restore.go @@ -0,0 +1,14 @@ +package restore + +import "github.com/usememos/memos/plugin/gomark/ast" + +func Restore(nodes []ast.Node) string { + var result string + for _, node := range nodes { + if node == nil { + continue + } + result += node.Restore() + } + return result +} diff --git a/plugin/gomark/restore/restore_test.go b/plugin/gomark/restore/restore_test.go new file mode 100644 index 0000000000000..ad3dc0b867080 --- /dev/null +++ b/plugin/gomark/restore/restore_test.go @@ -0,0 +1,48 @@ +package restore + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/usememos/memos/plugin/gomark/ast" +) + +func TestRestore(t *testing.T) { + tests := []struct { + nodes []ast.Node + rawText string + }{ + { + nodes: nil, + rawText: "", + }, + { + nodes: []ast.Node{ + &ast.Text{ + Content: "Hello world!", + }, + }, + rawText: "Hello world!", + }, + { + nodes: []ast.Node{ + &ast.Paragraph{ + Children: []ast.Node{ + &ast.Text{ + Content: "Here: ", + }, + &ast.Code{ + Content: "Hello world!", + }, + }, + }, + }, + rawText: "Here: `Hello world!`", + }, + } + + for _, test := range tests { + require.Equal(t, Restore(test.nodes), test.rawText) + } +} From ea87a1dc0c4a55a0393b7db629db2e254c394f5e Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 28 Dec 2023 22:57:51 +0800 Subject: [PATCH 266/650] chore: update memo content props --- web/src/components/MemoContent/index.tsx | 26 ++++-------------------- web/src/components/MemoView.tsx | 4 ++-- web/src/components/ShareMemoDialog.tsx | 2 +- web/src/components/TimelineMemo.tsx | 2 +- web/src/pages/Archived.tsx | 2 +- web/src/pages/MemoDetail.tsx | 2 +- 6 files changed, 10 insertions(+), 28 deletions(-) diff --git a/web/src/components/MemoContent/index.tsx b/web/src/components/MemoContent/index.tsx index 735b73fd84b31..a3f114871c45c 100644 --- a/web/src/components/MemoContent/index.tsx +++ b/web/src/components/MemoContent/index.tsx @@ -1,35 +1,17 @@ -import { isUndefined } from "lodash-es"; -import { useEffect, useRef, useState } from "react"; -import { markdownServiceClient } from "@/grpcweb"; +import { useRef } from "react"; import { Node } from "@/types/proto/api/v2/markdown_service"; import Renderer from "./Renderer"; interface Props { - content: string; - nodes?: Node[]; + nodes: Node[]; className?: string; onMemoContentClick?: (e: React.MouseEvent) => void; } const MemoContent: React.FC = (props: Props) => { - const { className, content, onMemoContentClick } = props; - const [nodes, setNodes] = useState(props.nodes ?? []); + const { className, onMemoContentClick } = props; const memoContentContainerRef = useRef(null); - useEffect(() => { - if (!isUndefined(props.nodes)) { - return; - } - - markdownServiceClient - .parseMarkdown({ - markdown: content, - }) - .then(({ nodes }) => { - setNodes(nodes); - }); - }, [content, props.nodes]); - const handleMemoContentClick = async (e: React.MouseEvent) => { if (onMemoContentClick) { onMemoContentClick(e); @@ -43,7 +25,7 @@ const MemoContent: React.FC = (props: Props) => { className="w-full max-w-full word-break text-base leading-6 space-y-1" onClick={handleMemoContentClick} > - {nodes.map((node, index) => ( + {props.nodes.map((node, index) => ( ))}
diff --git a/web/src/components/MemoView.tsx b/web/src/components/MemoView.tsx index 7ee3f206993c6..29f514676bbe2 100644 --- a/web/src/components/MemoView.tsx +++ b/web/src/components/MemoView.tsx @@ -205,7 +205,7 @@ const MemoView: React.FC = (props: Props) => {
{props.showVisibility && memo.visibility !== Visibility.PRIVATE && ( <> - + @@ -251,7 +251,7 @@ const MemoView: React.FC = (props: Props) => { )}
- +
diff --git a/web/src/components/ShareMemoDialog.tsx b/web/src/components/ShareMemoDialog.tsx index c5c732699f26a..7ac4eb0039bea 100644 --- a/web/src/components/ShareMemoDialog.tsx +++ b/web/src/components/ShareMemoDialog.tsx @@ -100,7 +100,7 @@ const ShareMemoDialog: React.FC = (props: Props) => { > {getDateTimeString(memo.displayTime)}
- +
diff --git a/web/src/components/TimelineMemo.tsx b/web/src/components/TimelineMemo.tsx index d637e08e47a0f..e3558564ba2b4 100644 --- a/web/src/components/TimelineMemo.tsx +++ b/web/src/components/TimelineMemo.tsx @@ -21,7 +21,7 @@ const TimelineMemo = (props: Props) => { #{memo.id}
- +
diff --git a/web/src/pages/Archived.tsx b/web/src/pages/Archived.tsx index e795aedc9b0cb..6126b7dfc322b 100644 --- a/web/src/pages/Archived.tsx +++ b/web/src/pages/Archived.tsx @@ -105,7 +105,7 @@ const Archived = () => {
- +
))}
diff --git a/web/src/pages/MemoDetail.tsx b/web/src/pages/MemoDetail.tsx index 15cae66ff6565..5dbfbbbc6b7a3 100644 --- a/web/src/pages/MemoDetail.tsx +++ b/web/src/pages/MemoDetail.tsx @@ -139,7 +139,7 @@ const MemoDetail = () => {
)} - +
From 411e807dcc018afbe9a495767ac4a3700912be6e Mon Sep 17 00:00:00 2001 From: Lincoln Nogueira Date: Thu, 28 Dec 2023 20:49:55 -0300 Subject: [PATCH 267/650] chore: use consistent relative paths for resources (#2683) - always store resources with a relative path with forward slashes, which will be transformed as needed when the file is accessed - fix an issue with thumbnail generation on Windows - add several validations for local storage setting - improve front-end error feedback when changing local storage - add migrations to make existing resource paths relative (not needed, but improves database consistency) --- api/resource/resource.go | 9 ++++++--- api/v1/resource.go | 20 ++++++++++++------- api/v1/system_setting.go | 19 ++++++++++++++++++ .../mysql/migration/prod/0.19/00_resource.sql | 19 ++++++++++++++++++ .../migration/prod/0.19/00_resource.sql | 19 ++++++++++++++++++ .../migration/prod/0.19/00_resource.sql | 19 ++++++++++++++++++ store/resource.go | 6 +++++- .../components/UpdateLocalStorageDialog.tsx | 13 ++++++++++-- 8 files changed, 111 insertions(+), 13 deletions(-) create mode 100644 store/db/mysql/migration/prod/0.19/00_resource.sql create mode 100644 store/db/postgres/migration/prod/0.19/00_resource.sql create mode 100644 store/db/sqlite/migration/prod/0.19/00_resource.sql diff --git a/api/resource/resource.go b/api/resource/resource.go index c6e6beecadb7b..5c94cc0d1e21b 100644 --- a/api/resource/resource.go +++ b/api/resource/resource.go @@ -6,7 +6,6 @@ import ( "io" "net/http" "os" - "path" "path/filepath" "strings" "sync/atomic" @@ -83,7 +82,11 @@ func (s *Service) streamResource(c echo.Context) error { blob := resource.Blob if resource.InternalPath != "" { - resourcePath := resource.InternalPath + resourcePath := filepath.FromSlash(resource.InternalPath) + if !filepath.IsAbs(resourcePath) { + resourcePath = filepath.Join(s.Profile.Data, resourcePath) + } + src, err := os.Open(resourcePath) if err != nil { return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to open the local resource: %s", resourcePath)).SetInternal(err) @@ -142,7 +145,7 @@ func getOrGenerateThumbnailImage(srcBlob []byte, dstPath string) ([]byte, error) } thumbnailImage := imaging.Resize(src, 512, 0, imaging.Lanczos) - dstDir := path.Dir(dstPath) + dstDir := filepath.Dir(dstPath) if err := os.MkdirAll(dstDir, os.ModePerm); err != nil { return nil, errors.Wrap(err, "failed to create thumbnail dir") } diff --git a/api/v1/resource.go b/api/v1/resource.go index 1abb295e57d1d..f8935d1be6275 100644 --- a/api/v1/resource.go +++ b/api/v1/resource.go @@ -416,17 +416,24 @@ func SaveResourceBlob(ctx context.Context, s *store.Store, create *store.Resourc return errors.Wrap(err, "Failed to unmarshal SystemSettingLocalStoragePathName") } } - filePath := filepath.FromSlash(localStoragePath) - if !strings.Contains(filePath, "{filename}") { - filePath = filepath.Join(filePath, "{filename}") + + internalPath := localStoragePath + if !strings.Contains(internalPath, "{filename}") { + internalPath = filepath.Join(internalPath, "{filename}") } - filePath = filepath.Join(s.Profile.Data, replacePathTemplate(filePath, create.Filename)) + internalPath = replacePathTemplate(internalPath, create.Filename) + internalPath = filepath.ToSlash(internalPath) + create.InternalPath = internalPath - dir := filepath.Dir(filePath) + osPath := filepath.FromSlash(internalPath) + if !filepath.IsAbs(osPath) { + osPath = filepath.Join(s.Profile.Data, osPath) + } + dir := filepath.Dir(osPath) if err = os.MkdirAll(dir, os.ModePerm); err != nil { return errors.Wrap(err, "Failed to create directory") } - dst, err := os.Create(filePath) + dst, err := os.Create(osPath) if err != nil { return errors.Wrap(err, "Failed to create file") } @@ -436,7 +443,6 @@ func SaveResourceBlob(ctx context.Context, s *store.Store, create *store.Resourc return errors.Wrap(err, "Failed to copy file") } - create.InternalPath = filePath return nil } diff --git a/api/v1/system_setting.go b/api/v1/system_setting.go index 505376e549569..bd05a0cc61c87 100644 --- a/api/v1/system_setting.go +++ b/api/v1/system_setting.go @@ -3,6 +3,7 @@ package v1 import ( "encoding/json" "net/http" + "path/filepath" "strings" "github.com/labstack/echo/v4" @@ -242,6 +243,24 @@ func (upsert UpsertSystemSettingRequest) Validate() error { if err := json.Unmarshal([]byte(upsert.Value), &value); err != nil { return errors.Errorf(systemSettingUnmarshalError, settingName) } + + trimmedValue := strings.TrimSpace(value) + switch { + case trimmedValue != value: + return errors.New("local storage path must not contain leading or trailing whitespace") + case trimmedValue == "": + return errors.New("local storage path can't be empty") + case strings.Contains(trimmedValue, "\\"): + return errors.New("local storage path must use forward slashes `/`") + case strings.Contains(trimmedValue, "../"): + return errors.New("local storage path is not allowed to contain `../`") + case strings.HasPrefix(trimmedValue, "./"): + return errors.New("local storage path is not allowed to start with `./`") + case filepath.IsAbs(trimmedValue) || trimmedValue[0] == '/': + return errors.New("local storage path must be a relative path") + case !strings.Contains(trimmedValue, "{filename}"): + return errors.New("local storage path must contain `{filename}`") + } case SystemSettingTelegramBotTokenName: if upsert.Value == "" { return nil diff --git a/store/db/mysql/migration/prod/0.19/00_resource.sql b/store/db/mysql/migration/prod/0.19/00_resource.sql new file mode 100644 index 0000000000000..14ce267a8aab8 --- /dev/null +++ b/store/db/mysql/migration/prod/0.19/00_resource.sql @@ -0,0 +1,19 @@ +-- Make resource internal_path relative (to MEMOS_DATA) and replace backslash with slash +-- This is a best-effort approach, but even if it fails, it won't break assets from loading +UPDATE resource +SET + internal_path = REPLACE (internal_path, '\\', '/') +WHERE + internal_path LIKE '%assets\\\%'; + +UPDATE resource +SET + internal_path = REPLACE ( + internal_path, + SUBSTR ( + internal_path, + 1, + INSTR (internal_path, '/assets') + ), + '' + ); diff --git a/store/db/postgres/migration/prod/0.19/00_resource.sql b/store/db/postgres/migration/prod/0.19/00_resource.sql new file mode 100644 index 0000000000000..fb4c1e7db3479 --- /dev/null +++ b/store/db/postgres/migration/prod/0.19/00_resource.sql @@ -0,0 +1,19 @@ +-- Make resource internal_path relative (to MEMOS_DATA) and replace backslash with slash +-- This is a best-effort approach, but even if it fails, it won't break assets from loading +UPDATE resource +SET + internal_path = REPLACE (internal_path, '\', '/') +WHERE + internal_path LIKE '%assets\\%'; + +UPDATE resource +SET + internal_path = REPLACE ( + internal_path, + SUBSTRING( + internal_path + FROM + 1 FOR POSITION('/assets' IN internal_path) + ), + '' + ); diff --git a/store/db/sqlite/migration/prod/0.19/00_resource.sql b/store/db/sqlite/migration/prod/0.19/00_resource.sql new file mode 100644 index 0000000000000..7cdd0c101e73b --- /dev/null +++ b/store/db/sqlite/migration/prod/0.19/00_resource.sql @@ -0,0 +1,19 @@ +-- Make resource internal_path relative (to MEMOS_DATA) and replace backslash with slash +-- This is a best-effort approach, but even if it fails, it won't break assets from loading +UPDATE resource +SET + internal_path = REPLACE (internal_path, '\', '/') +WHERE + internal_path LIKE '%assets\%'; + +UPDATE resource +SET + internal_path = REPLACE ( + internal_path, + SUBSTR ( + internal_path, + 1, + INSTR (internal_path, '/assets') + ), + '' + ); diff --git a/store/resource.go b/store/resource.go index 4d9979455b3f6..c2e2b21fffcfa 100644 --- a/store/resource.go +++ b/store/resource.go @@ -95,7 +95,11 @@ func (s *Store) DeleteResource(ctx context.Context, delete *DeleteResource) erro // Delete the local file. if resource.InternalPath != "" { - _ = os.Remove(resource.InternalPath) + resourcePath := filepath.FromSlash(resource.InternalPath) + if !filepath.IsAbs(resourcePath) { + resourcePath = filepath.Join(s.Profile.Data, resourcePath) + } + _ = os.Remove(resourcePath) } // Delete the thumbnail. if util.HasPrefixes(resource.Type, "image/png", "image/jpeg") { diff --git a/web/src/components/UpdateLocalStorageDialog.tsx b/web/src/components/UpdateLocalStorageDialog.tsx index cd4f8ccd55d30..25e24b6fa1394 100644 --- a/web/src/components/UpdateLocalStorageDialog.tsx +++ b/web/src/components/UpdateLocalStorageDialog.tsx @@ -27,12 +27,21 @@ const UpdateLocalStorageDialog: React.FC = (props: Props) => { try { await api.upsertSystemSetting({ name: "local-storage-path", - value: JSON.stringify(path), + value: JSON.stringify(path.trim()), }); await globalStore.fetchSystemStatus(); } catch (error: any) { console.error(error); - toast.error(error.response.data.message); + if (error.response.data.error) { + const errorText = error.response.data.error as string; + const internalIndex = errorText.indexOf("internal="); + if (internalIndex !== -1) { + const internalError = errorText.substring(internalIndex + 9); + toast.error(internalError); + } + } else { + toast.error(error.response.data.message); + } } if (confirmCallback) { confirmCallback(); From 14b34edca36ef09aabe2723f655af6ea597e4506 Mon Sep 17 00:00:00 2001 From: Lincoln Nogueira Date: Thu, 28 Dec 2023 20:50:15 -0300 Subject: [PATCH 268/650] chore: fix misuse of package path instead of filepath.path (#2684) As stated by https://pkg.go.dev/path, "path" is mainly for URLs, "path.filepath" for file systems --- plugin/telegram/attachment.go | 4 ++-- server/integration/telegram.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/telegram/attachment.go b/plugin/telegram/attachment.go index e252f3f06b52f..b7ed7cb1530ba 100644 --- a/plugin/telegram/attachment.go +++ b/plugin/telegram/attachment.go @@ -1,7 +1,7 @@ package telegram import ( - "path" + "path/filepath" "go.uber.org/zap" @@ -27,7 +27,7 @@ func (b Attachment) GetMimeType() string { return b.MimeType } - mime, ok := mimeTypes[path.Ext(b.FileName)] + mime, ok := mimeTypes[filepath.Ext(b.FileName)] if !ok { // Handle unknown file extension log.Warn("Unknown file type for ", zap.String("filename", b.FileName)) diff --git a/server/integration/telegram.go b/server/integration/telegram.go index fe423865f5818..b7ee939086820 100644 --- a/server/integration/telegram.go +++ b/server/integration/telegram.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "fmt" - "path" + "path/filepath" "strconv" "unicode/utf16" @@ -85,7 +85,7 @@ func (t *TelegramHandler) MessageHandle(ctx context.Context, bot *telegram.Bot, // Fill the common field of create create := store.Resource{ CreatorID: creatorID, - Filename: path.Base(attachment.FileName), + Filename: filepath.Base(attachment.FileName), Type: attachment.GetMimeType(), Size: attachment.FileSize, MemoID: &memoMessage.ID, From 4cd01ece30923efd0f17a75c1bf131aa1e1c9c67 Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 29 Dec 2023 08:19:32 +0800 Subject: [PATCH 269/650] chore: update frontend metadata --- server/frontend/frontend.go | 62 +++++++++++++++++++++++-------------- web/index.html | 2 +- 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/server/frontend/frontend.go b/server/frontend/frontend.go index da80adb1eb985..e100e269a2261 100644 --- a/server/frontend/frontend.go +++ b/server/frontend/frontend.go @@ -3,7 +3,6 @@ package frontend import ( "context" "fmt" - "html/template" "net/http" "os" "strings" @@ -80,7 +79,7 @@ func (s *FrontendService) registerRoutes(e *echo.Echo) { } // Inject memo metadata into `index.html`. - indexHTML := strings.ReplaceAll(rawIndexHTML, "", generateMemoMetadata(memo, creator)) + indexHTML := strings.ReplaceAll(rawIndexHTML, "", generateMemoMetadata(memo, creator).String()) return c.HTML(http.StatusOK, indexHTML) }) } @@ -123,40 +122,57 @@ Sitemap: %s/sitemap.xml`, instanceURL, instanceURL) }) } -func generateMemoMetadata(memo *store.Memo, creator *store.User) string { - description := "" - if memo.Visibility == store.Private { - description = "This memo is private." - } else if memo.Visibility == store.Protected { - description = "This memo is protected." - } else { +func generateMemoMetadata(memo *store.Memo, creator *store.User) *Metadata { + metadata := getDefaultMetadata() + metadata.Title = fmt.Sprintf("%s(@%s) on Memos", creator.Nickname, creator.Username) + if memo.Visibility == store.Public { tokens := tokenizer.Tokenize(memo.Content) nodes, _ := parser.Parse(tokens) - description = renderer.NewStringRenderer().Render(nodes) + description := renderer.NewStringRenderer().Render(nodes) if len(description) == 0 { description = memo.Content } if len(description) > maxMetadataDescriptionLength { description = description[:maxMetadataDescriptionLength] + "..." } + metadata.Description = description } - metadataList := []string{ - fmt.Sprintf(``, template.HTMLEscapeString(description)), - fmt.Sprintf(``, template.HTMLEscapeString(fmt.Sprintf("%s(@%s) on Memos", creator.Nickname, creator.Username))), - fmt.Sprintf(``, template.HTMLEscapeString(description)), - fmt.Sprintf(``, "https://www.usememos.com/logo.png"), - ``, - // Twitter related metadata. - fmt.Sprintf(``, template.HTMLEscapeString(fmt.Sprintf("%s(@%s) on Memos", creator.Nickname, creator.Username))), - fmt.Sprintf(``, template.HTMLEscapeString(description)), - fmt.Sprintf(``, "https://www.usememos.com/logo.png"), - ``, - } - return strings.Join(metadataList, "\n") + return metadata } func getRawIndexHTML() string { bytes, _ := os.ReadFile("dist/index.html") return string(bytes) } + +type Metadata struct { + Title string + Description string + ImageURL string +} + +func getDefaultMetadata() *Metadata { + return &Metadata{ + Title: "Memos", + Description: "A privacy-first, lightweight note-taking service. Easily capture and share your great thoughts.", + ImageURL: "https://www.usememos.com/logo.png", + } +} + +func (m *Metadata) String() string { + metadataList := []string{ + fmt.Sprintf(``, m.Description), + fmt.Sprintf(``, m.Title), + fmt.Sprintf(``, m.Description), + fmt.Sprintf(``, m.ImageURL), + ``, + // Twitter related fields. + fmt.Sprintf(``, m.Title), + fmt.Sprintf(``, m.Description), + fmt.Sprintf(``, m.ImageURL), + ``, + ``, + } + return strings.Join(metadataList, "\n") +} diff --git a/web/index.html b/web/index.html index 12b6dc93a8ed7..e657174e403b6 100644 --- a/web/index.html +++ b/web/index.html @@ -6,8 +6,8 @@ - Memos + Memos
From 0f8bfb6328c97dc0555d553761c5272056ebdcda Mon Sep 17 00:00:00 2001 From: Steven Date: Fri, 29 Dec 2023 08:28:17 +0800 Subject: [PATCH 270/650] chore: update index.html --- server/frontend/frontend.go | 3 ++- web/index.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/server/frontend/frontend.go b/server/frontend/frontend.go index e100e269a2261..35b25f811cd66 100644 --- a/server/frontend/frontend.go +++ b/server/frontend/frontend.go @@ -79,7 +79,8 @@ func (s *FrontendService) registerRoutes(e *echo.Echo) { } // Inject memo metadata into `index.html`. - indexHTML := strings.ReplaceAll(rawIndexHTML, "", generateMemoMetadata(memo, creator).String()) + indexHTML := strings.ReplaceAll(rawIndexHTML, "", generateMemoMetadata(memo, creator).String()) + indexHTML = strings.ReplaceAll(indexHTML, "", fmt.Sprintf("", memo.ID)) return c.HTML(http.StatusOK, indexHTML) }) } diff --git a/web/index.html b/web/index.html index e657174e403b6..5196590751e2d 100644 --- a/web/index.html +++ b/web/index.html @@ -6,11 +6,12 @@ - + Memos
+ From c7970999504f3d03e016b8a2abec6fc6955f06ce Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 2 Jan 2024 08:29:18 +0800 Subject: [PATCH 271/650] chore: update resource internal path migrator --- bin/memos/main.go | 6 +++ .../mysql/migration/prod/0.19/00_resource.sql | 19 -------- .../migration/prod/0.19/00_resource.sql | 19 -------- .../migration/prod/0.19/00_resource.sql | 19 -------- store/migrator.go | 44 +++++++++++++++++++ store/store.go | 2 +- 6 files changed, 51 insertions(+), 58 deletions(-) delete mode 100644 store/db/mysql/migration/prod/0.19/00_resource.sql delete mode 100644 store/db/postgres/migration/prod/0.19/00_resource.sql delete mode 100644 store/db/sqlite/migration/prod/0.19/00_resource.sql create mode 100644 store/migrator.go diff --git a/bin/memos/main.go b/bin/memos/main.go index 3720b276495b2..4c67e76b769c0 100644 --- a/bin/memos/main.go +++ b/bin/memos/main.go @@ -59,6 +59,12 @@ var ( } store := store.New(dbDriver, profile) + if err := store.MigrateResourceInternalPath(ctx); err != nil { + cancel() + log.Error("failed to migrate resource internal path", zap.Error(err)) + return + } + s, err := server.NewServer(ctx, profile, store) if err != nil { cancel() diff --git a/store/db/mysql/migration/prod/0.19/00_resource.sql b/store/db/mysql/migration/prod/0.19/00_resource.sql deleted file mode 100644 index 14ce267a8aab8..0000000000000 --- a/store/db/mysql/migration/prod/0.19/00_resource.sql +++ /dev/null @@ -1,19 +0,0 @@ --- Make resource internal_path relative (to MEMOS_DATA) and replace backslash with slash --- This is a best-effort approach, but even if it fails, it won't break assets from loading -UPDATE resource -SET - internal_path = REPLACE (internal_path, '\\', '/') -WHERE - internal_path LIKE '%assets\\\%'; - -UPDATE resource -SET - internal_path = REPLACE ( - internal_path, - SUBSTR ( - internal_path, - 1, - INSTR (internal_path, '/assets') - ), - '' - ); diff --git a/store/db/postgres/migration/prod/0.19/00_resource.sql b/store/db/postgres/migration/prod/0.19/00_resource.sql deleted file mode 100644 index fb4c1e7db3479..0000000000000 --- a/store/db/postgres/migration/prod/0.19/00_resource.sql +++ /dev/null @@ -1,19 +0,0 @@ --- Make resource internal_path relative (to MEMOS_DATA) and replace backslash with slash --- This is a best-effort approach, but even if it fails, it won't break assets from loading -UPDATE resource -SET - internal_path = REPLACE (internal_path, '\', '/') -WHERE - internal_path LIKE '%assets\\%'; - -UPDATE resource -SET - internal_path = REPLACE ( - internal_path, - SUBSTRING( - internal_path - FROM - 1 FOR POSITION('/assets' IN internal_path) - ), - '' - ); diff --git a/store/db/sqlite/migration/prod/0.19/00_resource.sql b/store/db/sqlite/migration/prod/0.19/00_resource.sql deleted file mode 100644 index 7cdd0c101e73b..0000000000000 --- a/store/db/sqlite/migration/prod/0.19/00_resource.sql +++ /dev/null @@ -1,19 +0,0 @@ --- Make resource internal_path relative (to MEMOS_DATA) and replace backslash with slash --- This is a best-effort approach, but even if it fails, it won't break assets from loading -UPDATE resource -SET - internal_path = REPLACE (internal_path, '\', '/') -WHERE - internal_path LIKE '%assets\%'; - -UPDATE resource -SET - internal_path = REPLACE ( - internal_path, - SUBSTR ( - internal_path, - 1, - INSTR (internal_path, '/assets') - ), - '' - ); diff --git a/store/migrator.go b/store/migrator.go new file mode 100644 index 0000000000000..9caa4615dee06 --- /dev/null +++ b/store/migrator.go @@ -0,0 +1,44 @@ +package store + +import ( + "context" + "path/filepath" + "strings" + + "github.com/pkg/errors" +) + +// MigrateResourceInternalPath migrates resource internal path from absolute path to relative path. +func (s *Store) MigrateResourceInternalPath(ctx context.Context) error { + resources, err := s.ListResources(ctx, &FindResource{}) + if err != nil { + return errors.Wrap(err, "failed to list resources") + } + + for _, resource := range resources { + if resource.InternalPath == "" { + continue + } + + internalPath := resource.InternalPath + if filepath.IsAbs(internalPath) { + if !strings.HasPrefix(internalPath, s.Profile.Data) { + // Invalid internal path, skip. + continue + } + internalPath = strings.TrimPrefix(internalPath, s.Profile.Data) + for strings.HasPrefix(internalPath, "/") { + internalPath = strings.TrimPrefix(internalPath, "/") + } + _, err := s.UpdateResource(ctx, &UpdateResource{ + ID: resource.ID, + InternalPath: &internalPath, + }) + if err != nil { + return errors.Wrap(err, "failed to update resource") + } + } + } + + return nil +} diff --git a/store/store.go b/store/store.go index 03f785f2f3025..dcaf36b67ee84 100644 --- a/store/store.go +++ b/store/store.go @@ -20,8 +20,8 @@ type Store struct { // New creates a new instance of Store. func New(driver Driver, profile *profile.Profile) *Store { return &Store{ - Profile: profile, driver: driver, + Profile: profile, } } From f74fa97b4aff79ba5f3486b6d801e62ac43e1007 Mon Sep 17 00:00:00 2001 From: Steven Date: Tue, 2 Jan 2024 08:56:30 +0800 Subject: [PATCH 272/650] chore: traverse nodes to upsert tags --- api/v2/markdown_service.go | 22 +++++++++ api/v2/memo_service.go | 34 +++++++++++++ web/src/components/MemoEditor/index.tsx | 64 +++---------------------- web/src/components/TagList.tsx | 4 +- web/src/pages/Explore.tsx | 4 +- web/src/pages/Home.tsx | 4 +- web/src/pages/UserProfile.tsx | 4 +- 7 files changed, 71 insertions(+), 65 deletions(-) diff --git a/api/v2/markdown_service.go b/api/v2/markdown_service.go index d61ea15e4648f..0b720cbf4aedb 100644 --- a/api/v2/markdown_service.go +++ b/api/v2/markdown_service.go @@ -90,3 +90,25 @@ func convertFromASTNode(rawNode ast.Node) *apiv2pb.Node { return node } + +func traverseASTNodes(nodes []ast.Node, fn func(ast.Node)) { + for _, node := range nodes { + fn(node) + switch n := node.(type) { + case *ast.Paragraph: + traverseASTNodes(n.Children, fn) + case *ast.Heading: + traverseASTNodes(n.Children, fn) + case *ast.Blockquote: + traverseASTNodes(n.Children, fn) + case *ast.OrderedList: + traverseASTNodes(n.Children, fn) + case *ast.UnorderedList: + traverseASTNodes(n.Children, fn) + case *ast.TaskList: + traverseASTNodes(n.Children, fn) + case *ast.Bold: + traverseASTNodes(n.Children, fn) + } + } +} diff --git a/api/v2/memo_service.go b/api/v2/memo_service.go index f515cf782b936..2045ebd1a5b2c 100644 --- a/api/v2/memo_service.go +++ b/api/v2/memo_service.go @@ -16,6 +16,7 @@ import ( apiv1 "github.com/usememos/memos/api/v1" "github.com/usememos/memos/internal/log" + "github.com/usememos/memos/plugin/gomark/ast" "github.com/usememos/memos/plugin/gomark/parser" "github.com/usememos/memos/plugin/gomark/parser/tokenizer" "github.com/usememos/memos/plugin/webhook" @@ -34,6 +35,11 @@ func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMe return nil, status.Errorf(codes.PermissionDenied, "permission denied") } + nodes, err := parser.Parse(tokenizer.Tokenize(request.Content)) + if err != nil { + return nil, errors.Wrap(err, "failed to parse memo content") + } + create := &store.Memo{ CreatorID: user.ID, Content: request.Content, @@ -45,6 +51,18 @@ func (s *APIV2Service) CreateMemo(ctx context.Context, request *apiv2pb.CreateMe } metric.Enqueue("memo create") + // Dynamically upsert tags from memo content. + traverseASTNodes(nodes, func(node ast.Node) { + if tag, ok := node.(*ast.Tag); ok { + if _, err := s.Store.UpsertTag(ctx, &store.Tag{ + Name: tag.Content, + CreatorID: user.ID, + }); err != nil { + log.Warn("Failed to create tag", zap.Error(err)) + } + } + }) + memoMessage, err := s.convertMemoFromStore(ctx, memo) if err != nil { return nil, errors.Wrap(err, "failed to convert memo") @@ -198,6 +216,22 @@ func (s *APIV2Service) UpdateMemo(ctx context.Context, request *apiv2pb.UpdateMe for _, path := range request.UpdateMask.Paths { if path == "content" { update.Content = &request.Memo.Content + nodes, err := parser.Parse(tokenizer.Tokenize(*update.Content)) + if err != nil { + return nil, errors.Wrap(err, "failed to parse memo content") + } + + // Dynamically upsert tags from memo content. + traverseASTNodes(nodes, func(node ast.Node) { + if tag, ok := node.(*ast.Tag); ok { + if _, err := s.Store.UpsertTag(ctx, &store.Tag{ + Name: tag.Content, + CreatorID: user.ID, + }); err != nil { + log.Warn("Failed to create tag", zap.Error(err)) + } + } + }) } else if path == "visibility" { visibility := convertVisibilityToStore(request.Memo.Visibility) update.Visibility = &visibility diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index b26c61b3e6fef..65457cb1ffd7d 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -281,6 +281,7 @@ const MemoEditor = (props: Props) => { id: memo.id, relations: state.relationList, }); + await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); if (onConfirm) { onConfirm(memo.id); } @@ -310,6 +311,7 @@ const MemoEditor = (props: Props) => { id: memo.id, relations: state.relationList, }); + await memoStore.getOrFetchMemoById(memo.id, { skipCache: true }); if (onConfirm) { onConfirm(memo.id); } @@ -319,57 +321,15 @@ const MemoEditor = (props: Props) => { console.error(error); toast.error(error.response.data.message); } + setState((state) => { return { ...state, isRequesting: false, + resourceList: [], + relationList: [], }; }); - - setState((prevState) => ({ - ...prevState, - resourceList: [], - })); - }; - - const handleCheckBoxBtnClick = () => { - if (!editorRef.current) { - return; - } - const currentPosition = editorRef.current?.getCursorPosition(); - const currentLineNumber = editorRef.current?.getCursorLineNumber(); - const currentLine = editorRef.current?.getLine(currentLineNumber); - let newLine = ""; - let cursorChange = 0; - if (/^- \[( |x|X)\] /.test(currentLine)) { - newLine = currentLine.replace(/^- \[( |x|X)\] /, ""); - cursorChange = -6; - } else if (/^\d+\. |- /.test(currentLine)) { - const match = currentLine.match(/^\d+\. |- /) ?? [""]; - newLine = currentLine.replace(/^\d+\. |- /, "- [ ] "); - cursorChange = -match[0].length + 6; - } else { - newLine = "- [ ] " + currentLine; - cursorChange = 6; - } - editorRef.current?.setLine(currentLineNumber, newLine); - editorRef.current.setCursorPosition(currentPosition + cursorChange); - editorRef.current?.scrollToCursor(); - }; - - const handleCodeBlockBtnClick = () => { - if (!editorRef.current) { - return; - } - - const cursorPosition = editorRef.current.getCursorPosition(); - const prevValue = editorRef.current.getContent().slice(0, cursorPosition); - if (prevValue === "" || prevValue.endsWith("\n")) { - editorRef.current?.insertText("", "```\n", "\n```"); - } else { - editorRef.current?.insertText("", "\n```\n", "\n```"); - } - editorRef.current?.scrollToCursor(); }; const handleTagSelectorClick = useCallback((tag: string) => { @@ -419,18 +379,6 @@ const MemoEditor = (props: Props) => { > - - - - - -
@@ -456,7 +404,7 @@ const MemoEditor = (props: Props) => {
-
diff --git a/web/src/components/TagList.tsx b/web/src/components/TagList.tsx index bed7313fd10e3..123dc250c3fba 100644 --- a/web/src/components/TagList.tsx +++ b/web/src/components/TagList.tsx @@ -1,6 +1,7 @@ import { useEffect, useState } from "react"; import useToggle from "react-use/lib/useToggle"; import { useFilterStore, useTagStore } from "@/store/module"; +import { useMemoList } from "@/store/v1"; import { useTranslate } from "@/utils/i18n"; import showCreateTagDialog from "./CreateTagDialog"; import Icon from "./Icon"; @@ -15,13 +16,14 @@ const TagList = () => { const t = useTranslate(); const filterStore = useFilterStore(); const tagStore = useTagStore(); + const memoList = useMemoList(); const tagsText = tagStore.state.tags; const filter = filterStore.state; const [tags, setTags] = useState([]); useEffect(() => { tagStore.fetchTags(); - }, []); + }, [memoList.size()]); useEffect(() => { const sortedTags = Array.from(tagsText).sort(); diff --git a/web/src/pages/Explore.tsx b/web/src/pages/Explore.tsx index 5cdc9aba5b66f..9cdcf417caef7 100644 --- a/web/src/pages/Explore.tsx +++ b/web/src/pages/Explore.tsx @@ -58,7 +58,7 @@ const Explore = () => { ))} {isRequesting ? ( -
+

{t("memo.fetching-data")}

) : isComplete ? ( @@ -69,7 +69,7 @@ const Explore = () => {
) ) : ( -
+
{t("memo.fetch-more")} diff --git a/web/src/pages/Home.tsx b/web/src/pages/Home.tsx index e3e003cb5833c..e78cae1766a64 100644 --- a/web/src/pages/Home.tsx +++ b/web/src/pages/Home.tsx @@ -68,7 +68,7 @@ const Home = () => { ))} {isRequesting ? ( -
+

{t("memo.fetching-data")}

) : isComplete ? ( @@ -79,7 +79,7 @@ const Home = () => {
) ) : ( -
+
{t("memo.fetch-more")} diff --git a/web/src/pages/UserProfile.tsx b/web/src/pages/UserProfile.tsx index 4d38b64d1c2be..c719adabaa3ef 100644 --- a/web/src/pages/UserProfile.tsx +++ b/web/src/pages/UserProfile.tsx @@ -97,7 +97,7 @@ const UserProfile = () => { ))} {isRequesting ? ( -
+

{t("memo.fetching-data")}

) : isComplete ? ( @@ -108,7 +108,7 @@ const UserProfile = () => {
) ) : ( -
+
{t("memo.fetch-more")} From 673809e07d5cf44f78569e8f21eb0ed6288ecbf0 Mon Sep 17 00:00:00 2001 From: Noah Alderton Date: Tue, 2 Jan 2024 02:33:19 -0800 Subject: [PATCH 273/650] fix: docker-compose.dev.yaml (#2695) * Fix docker-compose.dev.yaml * Add newline to .gitignore --- .gitignore | 5 ++++- scripts/docker-compose.dev.yaml | 25 ++++++++++++++----------- web/.gitignore | 1 + 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index ba1958d418d87..17f64ee21ad8a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,9 @@ build # Jetbrains .idea +# Docker Compose Environment File +.env + bin/air -dev-dist \ No newline at end of file +dev-dist diff --git a/scripts/docker-compose.dev.yaml b/scripts/docker-compose.dev.yaml index 6e4039dbb6a1e..b72a47684cf72 100644 --- a/scripts/docker-compose.dev.yaml +++ b/scripts/docker-compose.dev.yaml @@ -1,8 +1,13 @@ +version: "3.0" +name: memos-dev services: db: image: mysql volumes: - - ./.air/mysql:/var/lib/mysql + - ./../.air/mysql:/var/lib/mysql + environment: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + MYSQL_DATABASE: memos api: image: cosmtrek/air working_dir: /work @@ -11,8 +16,8 @@ services: - "MEMOS_DSN=root@tcp(db)/memos" - "MEMOS_DRIVER=mysql" volumes: - - .:/work/ - - .air/go-build:/root/.cache/go-build + - ./..:/work/ + - ./../.air/go-build:/root/.cache/go-build - $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host web: image: node:20-alpine @@ -23,8 +28,7 @@ services: entrypoint: ["/bin/sh", "-c"] command: ["corepack enable && pnpm install && pnpm dev"] volumes: - - ./web:/work - - ./.air/node_modules/:/work/node_modules/ # Cache for Node Modules + - ./../web:/work # Services below are used for developers to run once # @@ -43,8 +47,8 @@ services: working_dir: /work/proto command: generate volumes: - - ./proto:/work/proto - - ./web/src/types/:/work/web/src/types/ + - ./../proto:/work/proto + - ./../web/src/types/:/work/web/src/types/ # Do golang static code check before create PR golangci-lint: @@ -55,8 +59,8 @@ services: command: run -v volumes: - $HOME/go/pkg/:/go/pkg/ # Cache for go mod shared with the host - - .air/go-build:/root/.cache/go-build - - .:/work/ + - ./../.air/go-build:/root/.cache/go-build + - ./..:/work/ # run npm npm: @@ -66,5 +70,4 @@ services: environment: ["NPM_CONFIG_UPDATE_NOTIFIER=false"] entrypoint: "npm" volumes: - - ./web:/work - - ./.air/node_modules/:/work/node_modules/ + - ./../web:/work diff --git a/web/.gitignore b/web/.gitignore index f4e178b9b5bd0..77f1076b8dbec 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -1,4 +1,5 @@ node_modules +.pnpm-store .DS_Store dist dist-ssr From 3181c076b25421fc10c21145d31e60007d6e5d0f Mon Sep 17 00:00:00 2001 From: Elliot Chen Date: Tue, 2 Jan 2024 20:57:55 +0800 Subject: [PATCH 274/650] feat: add {uuid} in path template when using local storage or S3 (#2696) Add {uuid} in path template when using local storage or S3 Add an addition tag `{uuid}` to the `replacePathTemplate`. It is a workaround to leak the public links of a resource when using S3-based object storage. Currently, all resource blobs stored in S3 (R2, OSS) are set to be public. It is insecure as the resources for the private memos are also accessible on the Internet. Using an additional {uuid} might reduce this risk. Meanwhile, it is also possible to avoid filename conflict --- api/v1/resource.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/v1/resource.go b/api/v1/resource.go index f8935d1be6275..4297819c8c076 100644 --- a/api/v1/resource.go +++ b/api/v1/resource.go @@ -354,6 +354,8 @@ func replacePathTemplate(path, filename string) string { return fmt.Sprintf("%02d", t.Minute()) case "{second}": return fmt.Sprintf("%02d", t.Second()) + case "{uuid}": + return util.GenUUID() } return s }) From 138b69e36eef1a8bdae0d3ac84b8f549732e5259 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 3 Jan 2024 08:19:38 +0800 Subject: [PATCH 275/650] chore: fix memo comment --- api/v2/memo_service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/v2/memo_service.go b/api/v2/memo_service.go index 2045ebd1a5b2c..3655e77c79572 100644 --- a/api/v2/memo_service.go +++ b/api/v2/memo_service.go @@ -324,7 +324,7 @@ func (s *APIV2Service) CreateMemoComment(ctx context.Context, request *apiv2pb.C if err != nil { return nil, status.Errorf(codes.Internal, "failed to create memo relation") } - if memo.Visibility != apiv2pb.Visibility_PRIVATE { + if memo.Visibility != apiv2pb.Visibility_PRIVATE && memo.CreatorId != relatedMemo.CreatorID { activity, err := s.Store.CreateActivity(ctx, &store.Activity{ CreatorID: memo.CreatorId, Type: store.ActivityTypeMemoComment, From 914c0620c4f22bb7813b19b49e8d2e54d4b7f133 Mon Sep 17 00:00:00 2001 From: Steven Date: Wed, 3 Jan 2024 08:22:32 +0800 Subject: [PATCH 276/650] chore: add statistics view --- web/src/components/HomeSidebar.tsx | 13 +- web/src/components/HomeSidebarDrawer.tsx | 2 +- web/src/components/MemoCreationHeatMap.tsx | 156 -------------------- web/src/components/MemoResourceListView.tsx | 9 +- web/src/components/PersonalStatistics.tsx | 69 +++++++++ web/src/components/SearchBar.tsx | 15 +- web/src/components/TagList.tsx | 14 +- web/src/components/TimelineMemo.tsx | 3 - web/src/less/usage-heat-map.less | 73 --------- web/src/pages/Home.tsx | 4 +- 10 files changed, 98 insertions(+), 260 deletions(-) delete mode 100644 web/src/components/MemoCreationHeatMap.tsx create mode 100644 web/src/components/PersonalStatistics.tsx delete mode 100644 web/src/less/usage-heat-map.less diff --git a/web/src/components/HomeSidebar.tsx b/web/src/components/HomeSidebar.tsx index 5976e8ae76580..863d768824d59 100644 --- a/web/src/components/HomeSidebar.tsx +++ b/web/src/components/HomeSidebar.tsx @@ -1,14 +1,15 @@ -import MemoCreationHeatMap from "./MemoCreationHeatMap"; +import useCurrentUser from "@/hooks/useCurrentUser"; +import PersonalStatistics from "./PersonalStatistics"; import SearchBar from "./SearchBar"; import TagList from "./TagList"; const HomeSidebar = () => { + const currentUser = useCurrentUser(); + return ( -