diff --git a/perxis-proto b/perxis-proto index 6e55b78ebc551eb6f3ee9be1b1c7464749091e68..b0b20c34b7b106bf6704a78fdaf8b808459bda14 160000 --- a/perxis-proto +++ b/perxis-proto @@ -1 +1 @@ -Subproject commit 6e55b78ebc551eb6f3ee9be1b1c7464749091e68 +Subproject commit b0b20c34b7b106bf6704a78fdaf8b808459bda14 diff --git a/pkg/action/action.go b/pkg/action/action.go deleted file mode 100644 index 4233d986f5cf0ecd199f64c42b5f6453e0533fce..0000000000000000000000000000000000000000 --- a/pkg/action/action.go +++ /dev/null @@ -1,40 +0,0 @@ -package action - -import ( - "net/url" - "strings" -) - -// URL структура для хранения данных о переданном действии. -type URL struct { - *url.URL -} - -// NewURL возвращает структуру ActionURL -func NewURL(action string) (*URL, error) { - u, err := url.Parse(action) - if err != nil { - return nil, err - } - return &URL{URL: u}, nil -} - -func (u *URL) actionParts() (string, string) { - if u.URL != nil && u.URL.Scheme == "grpc" { - splitPath := strings.Split(strings.TrimLeft(u.Path, "/"), "/") - if len(splitPath) >= 2 { - return splitPath[0], splitPath[1] - } - } - return "", "" -} - -func (u *URL) Action() string { - _, action := u.actionParts() - return action -} - -func (u *URL) Extension() string { - ext, _ := u.actionParts() - return ext -} diff --git a/pkg/extension/action_handler.go b/pkg/extension/action_handler.go new file mode 100644 index 0000000000000000000000000000000000000000..3079b88582a8c392b948bb5d46ff2bbbb7d91e06 --- /dev/null +++ b/pkg/extension/action_handler.go @@ -0,0 +1,39 @@ +package extension + +import ( + "context" + + "git.perx.ru/perxis/perxis-go/pkg/errors" +) + +var ( + ErrInvalidAction = errors.New("invalid action") +) + +// ActionHandler выполняет действие в url +type ActionHandler func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) + +// ActionRouter возвращает ActionHandler для указанного действия +type ActionRouter func(ctx context.Context, url *ActionURL, req *ActionRequest) (ActionHandler, error) + +// Chain возвращает ActionRouter, который последовательно вызывает переданные ActionRouter +func Chain(chain ...ActionRouter) ActionRouter { + return func(ctx context.Context, url *ActionURL, req *ActionRequest) (ActionHandler, error) { + for _, f := range chain { + if h, err := f(ctx, url, req); err == nil && h != nil { + return h, nil + } + } + return nil, ErrInvalidAction + } +} + +// Named возвращает ActionRouter, который возвращает ActionHandler для указанного действия по имени +func Named(name string, handler ActionHandler) ActionRouter { + return func(ctx context.Context, url *ActionURL, req *ActionRequest) (ActionHandler, error) { + if url.Action() == name { + return handler, nil + } + return nil, ErrInvalidAction + } +} diff --git a/pkg/extension/action_handler_test.go b/pkg/extension/action_handler_test.go new file mode 100644 index 0000000000000000000000000000000000000000..c73a3b87c5e4a372e7a67858ab508cbe7ec93cfc --- /dev/null +++ b/pkg/extension/action_handler_test.go @@ -0,0 +1,99 @@ +package extension + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestActionHandler(t *testing.T) { + tests := []struct { + name string + request *ActionRequest + router ActionRouter + want string + wantErr bool + }{ + { + name: "No named action call", + request: &ActionRequest{Action: "grpc:///ext/action/"}, + router: func(ctx context.Context, url *ActionURL, req *ActionRequest) (ActionHandler, error) { + return func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) { + return &ActionResponse{State: 0, Msg: "Called - action"}, nil + }, nil + }, + want: "Called - action", + wantErr: false, + }, + { + name: "Named action call", + request: &ActionRequest{Action: "grpc:///ext/action/"}, + router: Named("action", func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) { + return &ActionResponse{State: 0, Msg: "Called named action"}, nil + }), + want: "Called named action", + wantErr: false, + }, + { + name: "Named action chain call", + request: &ActionRequest{Action: "grpc:///ext/action1/"}, + router: Chain( + Named("action1", func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) { + return &ActionResponse{State: 0, Msg: "Called named action1"}, nil + }), + Named("action2", func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) { + return &ActionResponse{State: 0, Msg: "Called named action2"}, nil + }), + ), + want: "Called named action1", + wantErr: false, + }, + { + name: "Error (no action in router)", + request: &ActionRequest{Action: "grpc:///ext/action3/"}, + router: Chain( + Named("action1", func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) { + return &ActionResponse{State: 0, Msg: "Called named action1"}, nil + }), + Named("action2", func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) { + return &ActionResponse{State: 0, Msg: "Called named action2"}, nil + }), + ), + wantErr: true, + }, + { + name: "Named action call with deprecated request", + request: &ActionRequest{Action: "action"}, + router: Named("action", func(ctx context.Context, url *ActionURL, req *ActionRequest) (*ActionResponse, error) { + return &ActionResponse{State: 0, Msg: "Called named deprecated action"}, nil + }), + want: "Called named deprecated action", + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + url, err := NewActionURL(tt.request.Action) + require.NoError(t, err) + + handler, err := tt.router(context.Background(), url, tt.request) + if tt.wantErr { + require.Error(t, err) + return + } else { + require.NoError(t, err) + } + + resp, err := handler(context.Background(), url, tt.request) + if tt.wantErr { + require.Error(t, err) + } else { + require.NoError(t, err) + } + + assert.Equal(t, tt.want, resp.Msg) + }) + } +} diff --git a/pkg/extension/action_url.go b/pkg/extension/action_url.go new file mode 100644 index 0000000000000000000000000000000000000000..ec03375f840bcd3889cba680e5b9087dd89c7f80 --- /dev/null +++ b/pkg/extension/action_url.go @@ -0,0 +1,42 @@ +package extension + +import ( + "net/url" + "strings" +) + +// URL структура для хранения данных о переданном действии. +type ActionURL struct { + *url.URL +} + +// NewURL возвращает структуру ActionURL +func NewActionURL(action string) (*ActionURL, error) { + u, err := url.Parse(action) + if err != nil { + return nil, err + } + return &ActionURL{URL: u}, nil +} + +func (u *ActionURL) actionParts() (string, string) { + splitPath := strings.Split(strings.TrimLeft(u.Path, "/"), "/") + if u.URL != nil && u.URL.Scheme == "grpc" && len(splitPath) >= 2 { + return splitPath[0], splitPath[1] + } + // for backwards compatibility + if len(splitPath) == 1 { + return "", splitPath[0] + } + return "", "" +} + +func (u *ActionURL) Action() string { + _, action := u.actionParts() + return action +} + +func (u *ActionURL) Extension() string { + ext, _ := u.actionParts() + return ext +} diff --git a/pkg/action/action_test.go b/pkg/extension/action_url_test.go similarity index 71% rename from pkg/action/action_test.go rename to pkg/extension/action_url_test.go index 2988744f4b88b734c4085b5aa20ceb95fe0657da..e4545b39a21922222ff7a0f140f8488007168f22 100644 --- a/pkg/action/action_test.go +++ b/pkg/extension/action_url_test.go @@ -1,4 +1,4 @@ -package action +package extension import ( "fmt" @@ -12,13 +12,13 @@ func TestActionURL_New(t *testing.T) { tests := []struct { name string action string - want *URL + want *ActionURL url string wantErr assert.ErrorAssertionFunc }{ { name: "Without action", - want: &URL{ + want: &ActionURL{ URL: &url.URL{}, }, wantErr: assert.NoError, @@ -26,7 +26,7 @@ func TestActionURL_New(t *testing.T) { { name: "Without deprecated action call", action: "build-site", - want: &URL{ + want: &ActionURL{ URL: &url.URL{ Path: "build-site", }, @@ -37,7 +37,7 @@ func TestActionURL_New(t *testing.T) { { name: "With grpc action", action: "grpc:///perxisweb/build-site", - want: &URL{ + want: &ActionURL{ URL: &url.URL{ Scheme: "grpc", Path: "/perxisweb/build-site", @@ -49,7 +49,7 @@ func TestActionURL_New(t *testing.T) { { name: "With ui action", action: "ui:///space/env/coll", - want: &URL{ + want: &ActionURL{ URL: &url.URL{ Scheme: "ui", Path: "/space/env/coll", @@ -61,7 +61,7 @@ func TestActionURL_New(t *testing.T) { { name: "With http action", action: "https://perx.ru", - want: &URL{ + want: &ActionURL{ URL: &url.URL{ Scheme: "https", Host: "perx.ru", @@ -79,7 +79,7 @@ func TestActionURL_New(t *testing.T) { { name: "With no action id", action: "grpc:///perxisweb", - want: &URL{ + want: &ActionURL{ URL: &url.URL{ Scheme: "grpc", Path: "/perxisweb", @@ -90,7 +90,7 @@ func TestActionURL_New(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got, err := NewURL(tt.action) + got, err := NewActionURL(tt.action) if !tt.wantErr(t, err, fmt.Sprintf("NewURL(%v)", tt.action)) { return } @@ -128,8 +128,45 @@ func TestActionURL_String(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - p, _ := NewURL(tt.url) + p, _ := NewActionURL(tt.url) assert.Equalf(t, tt.url, p.String(), "String()") }) } } + +func TestActionURL_Action(t *testing.T) { + tests := []struct { + name string + url string + want string + }{ + { + name: "GRPC action", + url: "grpc:///perxisweb/build-site", + want: "build-site", + }, + { + name: "UI action #1", + url: "ui:///space/env/coll", + }, + { + name: "UI action deprecated call #2", + url: "space/env/coll", + }, + { + name: "Https action", + url: "https://perx.ru", + }, + { + name: "With action deprecated call", + url: "extension-id", + want: "extension-id", + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + p, _ := NewActionURL(tt.url) + assert.Equalf(t, tt.want, p.Action(), "Action()") + }) + } +} diff --git a/pkg/extension/server.go b/pkg/extension/server.go index f9b603f50ffb6109f89551a7e3b92b5c355761d4..467b4396c743d1d6bbdbcf3cf444199a6ecaf192 100644 --- a/pkg/extension/server.go +++ b/pkg/extension/server.go @@ -3,7 +3,6 @@ package extension import ( "context" - "git.perx.ru/perxis/perxis-go/pkg/action" "git.perx.ru/perxis/perxis-go/pkg/errors" pb "git.perx.ru/perxis/perxis-go/proto/extensions" ) @@ -80,25 +79,36 @@ func (srv *Server) Update(ctx context.Context, request *UpdateRequest) (*UpdateR return &UpdateResponse{Results: res}, nil } -func (srv *Server) Action(ctx context.Context, in *pb.ActionRequest) (*pb.ActionResponse, error) { - actionURL, err := action.NewURL(in.Action) +func (srv *Server) getExtensionService(ctx context.Context, in *pb.ActionRequest) (Extension, error) { + actionURL, err := NewActionURL(in.Action) + if err != nil { - return nil, err + return nil, ErrInvalidAction } + ext := actionURL.Extension() if ext == "" { ext = in.Extension } if ext == "" { - return nil, errors.New("extension ID required") + return nil, ErrInvalidAction } svc, ok := srv.services[ext] - if !ok { - return nil, ErrUnknownExtension + if ok { + return svc, nil + } + + return nil, ErrInvalidAction +} + +func (srv *Server) Action(ctx context.Context, in *pb.ActionRequest) (out *pb.ActionResponse, err error) { + svc, err := srv.getExtensionService(ctx, in) + if err != nil { + return nil, err } - out, err := svc.Action(ctx, in) + out, err = svc.Action(ctx, in) if out == nil { out = &ActionResponse{} diff --git a/pkg/extension/server_test.go b/pkg/extension/server_test.go index bee68b1a8e3f8ca90beae259ceda2a933e3f6b3e..64f10e98705bc6e299e0c957d1deaa337e12f22d 100644 --- a/pkg/extension/server_test.go +++ b/pkg/extension/server_test.go @@ -142,7 +142,7 @@ func TestServer_Action(t *testing.T) { EnvId: "env", }, want: &ActionResponse{State: ResponseDone}, - wantErr: "extension ID required", + wantErr: "invalid action", }, { name: "Deprecated call", @@ -164,7 +164,7 @@ func TestServer_Action(t *testing.T) { EnvId: "env", }, want: nil, - wantErr: ErrUnknownExtension.Error(), + wantErr: "invalid action", }, { name: "Deprecated call, without extension", @@ -175,7 +175,7 @@ func TestServer_Action(t *testing.T) { EnvId: "env", }, want: nil, - wantErr: "extension ID required", + wantErr: "invalid action", }, { name: "Deprecated call, without action and extension)", @@ -185,7 +185,7 @@ func TestServer_Action(t *testing.T) { EnvId: "env", }, want: nil, - wantErr: "extension ID required", + wantErr: "invalid action", }, } for _, tt := range tests { diff --git a/pkg/extension/service/extension.go b/pkg/extension/service/extension.go index 6d9608ab6877acdc94bfcad0bd62e5fa21eef181..951a00bd487bc5c14253e8d7ca4c1c49b78f0120 100644 --- a/pkg/extension/service/extension.go +++ b/pkg/extension/service/extension.go @@ -4,10 +4,8 @@ import ( "context" "fmt" - "git.perx.ru/perxis/perxis-go/pkg/action" "git.perx.ru/perxis/perxis-go/pkg/clients" "git.perx.ru/perxis/perxis-go/pkg/content" - "git.perx.ru/perxis/perxis-go/pkg/errors" "git.perx.ru/perxis/perxis-go/pkg/extension" "git.perx.ru/perxis/perxis-go/pkg/roles" "git.perx.ru/perxis/perxis-go/pkg/setup" @@ -32,6 +30,7 @@ type Extension struct { Content *content.Content Logger *zap.Logger manager extension.Manager + router extension.ActionRouter withClient bool role *roles.Role @@ -39,12 +38,13 @@ type Extension struct { keyFn extension.KeyFunc } -func NewExtension(desc *extension.ExtensionDescriptor, cnt *content.Content, setupFunc SetupFunc, logger *zap.Logger) *Extension { +func NewExtension(desc *extension.ExtensionDescriptor, cnt *content.Content, setupFunc SetupFunc, router extension.ActionRouter, logger *zap.Logger) *Extension { if logger == nil { logger = zap.NewNop() } return &Extension{ desc: desc, + router: router, setupFunc: setupFunc, Content: cnt, Logger: logger, @@ -155,25 +155,36 @@ func (s *Extension) Uninstall(ctx context.Context, in *extension.UninstallReques return s.GetSetup(in.SpaceId, in.EnvId).WithForce(in.Force).WithRemove(in.Remove).Uninstall(ctx) } -func (s *Extension) Action(ctx context.Context, in *extension.ActionRequest) (*extension.ActionResponse, error) { - actionURL, err := action.NewURL(in.Action) - if err != nil { - return nil, err - } - ext := actionURL.Extension() +// isCorrectExtension проверяет что расширение в url совпадает с расширением расширения +func (s *Extension) isCorrectExtension(ctx context.Context, url *extension.ActionURL, in *extension.ActionRequest) bool { + ext := url.Extension() if ext == "" { ext = in.Extension } - if ext == "" { - return nil, errors.New("extension ID required") - } - ok, err := extension.CheckInstalled(ctx, s.Content, in.SpaceId, in.EnvId, ext) - if err != nil { - return nil, errors.Wrap(err, "check extension installed") + if ext == s.desc.Extension { + return true } - if !ok { - return nil, errors.New("extension not installed") + return false +} + +func (s *Extension) Action(ctx context.Context, in *extension.ActionRequest) (*extension.ActionResponse, error) { + // TBD: нужно ли проверять что действие установлено в пространство + // мы так и не договорились, но проверка появилась + // пусть решает каждое расширение само + // + //ok, err := extension.CheckInstalled(ctx, s.Content, in.SpaceId, in.EnvId, ext) + //if err != nil { + // return nil, errors.Wrap(err, "check extension installed") + //} + //if !ok { + // return nil, errors.New("extension not installed") + //} + + if url, err := extension.NewActionURL(in.Action); s.router != nil && err == nil && url != nil && s.isCorrectExtension(ctx, url, in) { + if h, err := s.router(ctx, url, in); err == nil && h != nil { + return h(ctx, url, in) + } } - return &extension.ActionResponse{}, nil + return nil, extension.ErrInvalidAction } diff --git a/pkg/extension/service/extension_test.go b/pkg/extension/service/extension_test.go new file mode 100644 index 0000000000000000000000000000000000000000..e0582966ae25186f6ddef5014fdd972544521f8a --- /dev/null +++ b/pkg/extension/service/extension_test.go @@ -0,0 +1,68 @@ +package service + +import ( + "context" + "testing" + + "git.perx.ru/perxis/perxis-go/pkg/extension" + "github.com/stretchr/testify/require" +) + +func TestExtension_Action(t *testing.T) { + tests := []struct { + name string + desc *extension.ExtensionDescriptor + in *extension.ActionRequest + router extension.ActionRouter + want string + wantErr bool + }{ + { + name: "Router with 1 named action", + desc: &extension.ExtensionDescriptor{Extension: "test", Title: "Test Extension", Description: "desc", Version: "v.0.0.1"}, + in: &extension.ActionRequest{Action: "grpc:///test/action", SpaceId: "sp", EnvId: "env", CollectionId: "coll"}, + want: "Called action", + router: extension.Named("action", func(ctx context.Context, url *extension.ActionURL, req *extension.ActionRequest) (*extension.ActionResponse, error) { + return &extension.ActionResponse{State: extension.ResponseDone, Msg: "Called action"}, nil + }), + wantErr: false, + }, + { + name: "Router with 2 named actions", + desc: &extension.ExtensionDescriptor{Extension: "test", Title: "Test Extension", Description: "desc", Version: "v.0.0.1"}, + in: &extension.ActionRequest{Action: "grpc:///test/action2", SpaceId: "sp", EnvId: "env", CollectionId: "coll"}, + want: "Called action2", + router: extension.Chain(extension.Named("action", func(ctx context.Context, url *extension.ActionURL, req *extension.ActionRequest) (*extension.ActionResponse, error) { + return &extension.ActionResponse{State: extension.ResponseDone}, nil + }), extension.Named("action2", func(ctx context.Context, url *extension.ActionURL, req *extension.ActionRequest) (*extension.ActionResponse, error) { + return &extension.ActionResponse{State: extension.ResponseDone, Msg: "Called action2"}, nil + })), + wantErr: false, + }, + { + name: "Error (no extension)", + desc: &extension.ExtensionDescriptor{Extension: "test", Title: "Test Extension", Description: "desc", Version: "v.0.0.1"}, + in: &extension.ActionRequest{Action: "grpc:///test2/action2", SpaceId: "sp", EnvId: "env", CollectionId: "coll"}, + router: extension.Chain(extension.Named("action", func(ctx context.Context, url *extension.ActionURL, req *extension.ActionRequest) (*extension.ActionResponse, error) { + return &extension.ActionResponse{State: extension.ResponseDone}, nil + }), extension.Named("action2", func(ctx context.Context, url *extension.ActionURL, req *extension.ActionRequest) (*extension.ActionResponse, error) { + return &extension.ActionResponse{State: extension.ResponseParametersRequired}, nil + })), + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + s := &Extension{ + desc: tt.desc, + router: tt.router, + } + got, err := s.Action(context.Background(), tt.in) + if tt.wantErr { + require.Error(t, err) + return + } + require.Equal(t, tt.want, got.Msg) + }) + } +} diff --git a/proto/extensions/extension.pb.go b/proto/extensions/extension.pb.go index a74f1cea28680560beea1a8e6a08db8c70342ecf..a518aed78f7fe6901bbffbb5d1d3760c9acf21b8 100644 --- a/proto/extensions/extension.pb.go +++ b/proto/extensions/extension.pb.go @@ -10,7 +10,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.30.0 // protoc v4.23.4 // source: extensions/extension.proto @@ -260,43 +260,37 @@ func (ActionResponse_Format) EnumDescriptor() ([]byte, []int) { type Action_Kind int32 const ( - Action_DEFAULT Action_Kind = 0 // Действие не отображается в интерфейсе и могут используется для выполнения дополнительных запросов (см. `ActionResponse.next`) или напрямую из сторонних приложений. - Action_SPACE Action_Kind = 1 // Действие связано с пространством (требуется передача space_id). Отображается в меню "Действия". - Action_ENVIRONMENT Action_Kind = 2 // Действие связано с окружением (требуется передача space_id, env_id). Отображается в меню "Действия". - Action_COLLECTION Action_Kind = 3 // Действие связано с коллекцией (требуется передача space_id, env_id, collection_id). Отображается на экране списка записей. - Action_ITEM Action_Kind = 4 // Действие связано с записью (требуется передача space_id, env_id, collection_id, item_id). Отображается на экране редактирования записи. - Action_ITEMS Action_Kind = 5 // Действие связано с несколькими записями (требуется передача space_id, env_id, collection_id, item_ids). Отображается на экране списка записей. - Action_REVISION Action_Kind = 6 // Действие связано с ревизией записи (требуется передача space_id, env_id, collection_id, item_id, rev_id). На данный момент не используется. - Action_CREATE Action_Kind = 7 // Действие создание записи (требуется передача space_id, env_id, collection_id). - Action_MAIN_MENU Action_Kind = 10000 // Действие отображается в главном меню (требуется передача space_id, env_id) - Action_MAIN_MENU_BOTTOM Action_Kind = 10010 // Действие отображается в главном меню внизу (требуется передача space_id, env_id) + Action_DEFAULT Action_Kind = 0 // Действие не отображается в интерфейсе и могут используется для выполнения дополнительных запросов (см. `ActionResponse.next`) или напрямую из сторонних приложений. + Action_SPACE Action_Kind = 1 // Действие связано с пространством (требуется передача space_id). Отображается в меню "Действия". + Action_ENVIRONMENT Action_Kind = 2 // Действие связано с окружением (требуется передача space_id, env_id). Отображается в меню "Действия". + Action_COLLECTION Action_Kind = 3 // Действие связано с коллекцией (требуется передача space_id, env_id, collection_id). Отображается на экране списка записей. + Action_ITEM Action_Kind = 4 // Действие связано с записью (требуется передача space_id, env_id, collection_id, item_id). Отображается на экране редактирования записи. + Action_ITEMS Action_Kind = 5 // Действие связано с несколькими записями (требуется передача space_id, env_id, collection_id, item_ids). Отображается на экране списка записей. + Action_REVISION Action_Kind = 6 // Действие связано с ревизией записи (требуется передача space_id, env_id, collection_id, item_id, rev_id). На данный момент не используется. + Action_CREATE Action_Kind = 7 // Действие создание записи (требуется передача space_id, env_id, collection_id). ) // Enum value maps for Action_Kind. var ( Action_Kind_name = map[int32]string{ - 0: "DEFAULT", - 1: "SPACE", - 2: "ENVIRONMENT", - 3: "COLLECTION", - 4: "ITEM", - 5: "ITEMS", - 6: "REVISION", - 7: "CREATE", - 10000: "MAIN_MENU", - 10010: "MAIN_MENU_BOTTOM", + 0: "DEFAULT", + 1: "SPACE", + 2: "ENVIRONMENT", + 3: "COLLECTION", + 4: "ITEM", + 5: "ITEMS", + 6: "REVISION", + 7: "CREATE", } Action_Kind_value = map[string]int32{ - "DEFAULT": 0, - "SPACE": 1, - "ENVIRONMENT": 2, - "COLLECTION": 3, - "ITEM": 4, - "ITEMS": 5, - "REVISION": 6, - "CREATE": 7, - "MAIN_MENU": 10000, - "MAIN_MENU_BOTTOM": 10010, + "DEFAULT": 0, + "SPACE": 1, + "ENVIRONMENT": 2, + "COLLECTION": 3, + "ITEM": 4, + "ITEMS": 5, + "REVISION": 6, + "CREATE": 7, } ) @@ -327,6 +321,58 @@ func (Action_Kind) EnumDescriptor() ([]byte, []int) { return file_extensions_extension_proto_rawDescGZIP(), []int{11, 0} } +type Action_View int32 + +const ( + Action_DEFAULT_VIEW Action_View = 0 // Отображать в интерфейсе по умолчанию + Action_HIDDEN_VIEW Action_View = 1 // Не отображать в интерфейсе + Action_MAIN_MENU_VIEW Action_View = 2 // Отображать в главном меню + Action_MAIN_MENU_BOTTOM_VIEW Action_View = 3 // Отображать в главном меню внизу +) + +// Enum value maps for Action_View. +var ( + Action_View_name = map[int32]string{ + 0: "DEFAULT_VIEW", + 1: "HIDDEN_VIEW", + 2: "MAIN_MENU_VIEW", + 3: "MAIN_MENU_BOTTOM_VIEW", + } + Action_View_value = map[string]int32{ + "DEFAULT_VIEW": 0, + "HIDDEN_VIEW": 1, + "MAIN_MENU_VIEW": 2, + "MAIN_MENU_BOTTOM_VIEW": 3, + } +) + +func (x Action_View) Enum() *Action_View { + p := new(Action_View) + *p = x + return p +} + +func (x Action_View) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Action_View) Descriptor() protoreflect.EnumDescriptor { + return file_extensions_extension_proto_enumTypes[5].Descriptor() +} + +func (Action_View) Type() protoreflect.EnumType { + return &file_extensions_extension_proto_enumTypes[5] +} + +func (x Action_View) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Action_View.Descriptor instead. +func (Action_View) EnumDescriptor() ([]byte, []int) { + return file_extensions_extension_proto_rawDescGZIP(), []int{11, 1} +} + type InstallRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1216,7 +1262,9 @@ type Action struct { Autorun bool `protobuf:"varint,10520,opt,name=autorun,proto3" json:"autorun,omitempty"` // Параметр указывающий что действие требует подтверждения пользователя // Перед выполнением действия пользователю отображается информация о действии и кнопки подтверждения/отмены - Confirm bool `protobuf:"varint,10530,opt,name=confirm,proto3" json:"confirm,omitempty"` + Confirm bool `protobuf:"varint,10530,opt,name=confirm,proto3" json:"confirm,omitempty"` + View Action_View `protobuf:"varint,10540,opt,name=view,proto3,enum=extensions.Action_View" json:"view,omitempty"` // Отображение действия в интерфейсе + Order int32 `protobuf:"varint,10550,opt,name=order,proto3" json:"order,omitempty"` // Порядок отображения действия в интерфейсе (Для пунктов меню) } func (x *Action) Reset() { @@ -1377,6 +1425,20 @@ func (x *Action) GetConfirm() bool { return false } +func (x *Action) GetView() Action_View { + if x != nil { + return x.View + } + return Action_DEFAULT_VIEW +} + +func (x *Action) GetOrder() int32 { + if x != nil { + return x.Order + } + return 0 +} + var File_extensions_extension_proto protoreflect.FileDescriptor var file_extensions_extension_proto_rawDesc = []byte{ @@ -1523,7 +1585,7 @@ var file_extensions_extension_proto_rawDesc = []byte{ 0x54, 0x45, 0x52, 0x53, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x04, 0x22, 0x2b, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x09, 0x0a, 0x05, 0x50, 0x4c, 0x41, 0x49, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x54, 0x4d, 0x4c, 0x10, 0x01, 0x12, 0x0c, - 0x0a, 0x08, 0x4d, 0x41, 0x52, 0x4b, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x22, 0xab, 0x06, 0x0a, + 0x0a, 0x08, 0x4d, 0x41, 0x52, 0x4b, 0x44, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x22, 0xa2, 0x07, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x90, 0x4e, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, @@ -1565,49 +1627,57 @@ var file_extensions_extension_proto_rawDesc = []byte{ 0x61, 0x75, 0x74, 0x6f, 0x72, 0x75, 0x6e, 0x18, 0x98, 0x52, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x61, 0x75, 0x74, 0x6f, 0x72, 0x75, 0x6e, 0x12, 0x19, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x18, 0xa2, 0x52, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x72, 0x6d, 0x22, 0x95, 0x01, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x0b, 0x0a, 0x07, 0x44, - 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x50, 0x41, 0x43, - 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x56, 0x49, 0x52, 0x4f, 0x4e, 0x4d, 0x45, - 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x4c, 0x4c, 0x45, 0x43, 0x54, 0x49, - 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x54, 0x45, 0x4d, 0x10, 0x04, 0x12, 0x09, - 0x0a, 0x05, 0x49, 0x54, 0x45, 0x4d, 0x53, 0x10, 0x05, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x45, 0x56, - 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x52, 0x45, 0x41, 0x54, - 0x45, 0x10, 0x07, 0x12, 0x0e, 0x0a, 0x09, 0x4d, 0x41, 0x49, 0x4e, 0x5f, 0x4d, 0x45, 0x4e, 0x55, - 0x10, 0x90, 0x4e, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x41, 0x49, 0x4e, 0x5f, 0x4d, 0x45, 0x4e, 0x55, - 0x5f, 0x42, 0x4f, 0x54, 0x54, 0x4f, 0x4d, 0x10, 0x9a, 0x4e, 0x2a, 0x67, 0x0a, 0x06, 0x54, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, - 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x4f, 0x44, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, - 0x57, 0x49, 0x44, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x41, 0x49, 0x4e, 0x10, 0x04, - 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x52, 0x41, 0x57, 0x45, 0x52, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, - 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x09, - 0x0a, 0x05, 0x42, 0x4c, 0x41, 0x4e, 0x4b, 0x10, 0x07, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, - 0x45, 0x10, 0x64, 0x32, 0xe3, 0x02, 0x0a, 0x09, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x44, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x1a, 0x2e, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, - 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x12, 0x18, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x68, - 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x12, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4a, 0x0a, 0x09, 0x55, 0x6e, - 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, - 0x2e, 0x70, 0x65, 0x72, 0x78, 0x2e, 0x72, 0x75, 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2f, - 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3b, 0x65, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6d, 0x12, 0x2c, 0x0a, 0x04, 0x76, 0x69, 0x65, 0x77, 0x18, 0xac, 0x52, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x17, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x04, 0x76, 0x69, 0x65, 0x77, + 0x12, 0x15, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0xb6, 0x52, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x22, 0x6e, 0x0a, 0x04, 0x4b, 0x69, 0x6e, 0x64, 0x12, + 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, + 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x56, 0x49, 0x52, + 0x4f, 0x4e, 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x4f, 0x4c, 0x4c, + 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x49, 0x54, 0x45, 0x4d, + 0x10, 0x04, 0x12, 0x09, 0x0a, 0x05, 0x49, 0x54, 0x45, 0x4d, 0x53, 0x10, 0x05, 0x12, 0x0c, 0x0a, + 0x08, 0x52, 0x45, 0x56, 0x49, 0x53, 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x0a, 0x0a, 0x06, 0x43, + 0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x07, 0x22, 0x58, 0x0a, 0x04, 0x56, 0x69, 0x65, 0x77, 0x12, + 0x10, 0x0a, 0x0c, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x10, + 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4e, 0x5f, 0x56, 0x49, 0x45, 0x57, + 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4d, 0x41, 0x49, 0x4e, 0x5f, 0x4d, 0x45, 0x4e, 0x55, 0x5f, + 0x56, 0x49, 0x45, 0x57, 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x4d, 0x41, 0x49, 0x4e, 0x5f, 0x4d, + 0x45, 0x4e, 0x55, 0x5f, 0x42, 0x4f, 0x54, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x49, 0x45, 0x57, 0x10, + 0x03, 0x2a, 0x67, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x0b, 0x0a, 0x07, 0x44, + 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4d, 0x4f, 0x44, 0x41, + 0x4c, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x57, 0x49, 0x44, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, + 0x04, 0x4d, 0x41, 0x49, 0x4e, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x44, 0x52, 0x41, 0x57, 0x45, + 0x52, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x4e, 0x4f, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x49, 0x4f, 0x4e, 0x10, 0x06, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x4c, 0x41, 0x4e, 0x4b, 0x10, 0x07, + 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x64, 0x32, 0xe3, 0x02, 0x0a, 0x09, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x44, 0x0a, 0x07, 0x49, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x12, 0x1a, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1b, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x6e, 0x73, + 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, + 0x0a, 0x05, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x18, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, + 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, + 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x4a, 0x0a, 0x09, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x1c, + 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x55, 0x6e, 0x69, 0x6e, + 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x65, + 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x41, 0x0a, + 0x06, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x42, 0x3a, 0x5a, 0x38, 0x67, 0x69, 0x74, 0x2e, 0x70, 0x65, 0x72, 0x78, 0x2e, 0x72, 0x75, 0x2f, + 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2f, 0x70, 0x65, 0x72, 0x78, 0x69, 0x73, 0x2d, 0x67, 0x6f, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x3b, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1622,7 +1692,7 @@ func file_extensions_extension_proto_rawDescGZIP() []byte { return file_extensions_extension_proto_rawDescData } -var file_extensions_extension_proto_enumTypes = make([]protoimpl.EnumInfo, 5) +var file_extensions_extension_proto_enumTypes = make([]protoimpl.EnumInfo, 6) var file_extensions_extension_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_extensions_extension_proto_goTypes = []interface{}{ (Target)(0), // 0: extensions.Target @@ -1630,57 +1700,59 @@ var file_extensions_extension_proto_goTypes = []interface{}{ (ActionResponse_State)(0), // 2: extensions.ActionResponse.State (ActionResponse_Format)(0), // 3: extensions.ActionResponse.Format (Action_Kind)(0), // 4: extensions.Action.Kind - (*InstallRequest)(nil), // 5: extensions.InstallRequest - (*ExtensionRequestResult)(nil), // 6: extensions.ExtensionRequestResult - (*InstallResponse)(nil), // 7: extensions.InstallResponse - (*UninstallRequest)(nil), // 8: extensions.UninstallRequest - (*UninstallResponse)(nil), // 9: extensions.UninstallResponse - (*UpdateRequest)(nil), // 10: extensions.UpdateRequest - (*UpdateResponse)(nil), // 11: extensions.UpdateResponse - (*CheckRequest)(nil), // 12: extensions.CheckRequest - (*CheckResponse)(nil), // 13: extensions.CheckResponse - (*ActionRequest)(nil), // 14: extensions.ActionRequest - (*ActionResponse)(nil), // 15: extensions.ActionResponse - (*Action)(nil), // 16: extensions.Action - nil, // 17: extensions.ActionRequest.MetadataEntry - nil, // 18: extensions.ActionResponse.MetadataEntry - (*references.Reference)(nil), // 19: content.references.Reference + (Action_View)(0), // 5: extensions.Action.View + (*InstallRequest)(nil), // 6: extensions.InstallRequest + (*ExtensionRequestResult)(nil), // 7: extensions.ExtensionRequestResult + (*InstallResponse)(nil), // 8: extensions.InstallResponse + (*UninstallRequest)(nil), // 9: extensions.UninstallRequest + (*UninstallResponse)(nil), // 10: extensions.UninstallResponse + (*UpdateRequest)(nil), // 11: extensions.UpdateRequest + (*UpdateResponse)(nil), // 12: extensions.UpdateResponse + (*CheckRequest)(nil), // 13: extensions.CheckRequest + (*CheckResponse)(nil), // 14: extensions.CheckResponse + (*ActionRequest)(nil), // 15: extensions.ActionRequest + (*ActionResponse)(nil), // 16: extensions.ActionResponse + (*Action)(nil), // 17: extensions.Action + nil, // 18: extensions.ActionRequest.MetadataEntry + nil, // 19: extensions.ActionResponse.MetadataEntry + (*references.Reference)(nil), // 20: content.references.Reference } var file_extensions_extension_proto_depIdxs = []int32{ 1, // 0: extensions.ExtensionRequestResult.state:type_name -> extensions.ExtensionRequestResult.State - 6, // 1: extensions.InstallResponse.results:type_name -> extensions.ExtensionRequestResult - 6, // 2: extensions.UninstallResponse.results:type_name -> extensions.ExtensionRequestResult - 6, // 3: extensions.UpdateResponse.results:type_name -> extensions.ExtensionRequestResult - 6, // 4: extensions.CheckResponse.results:type_name -> extensions.ExtensionRequestResult - 17, // 5: extensions.ActionRequest.metadata:type_name -> extensions.ActionRequest.MetadataEntry - 19, // 6: extensions.ActionRequest.refs:type_name -> content.references.Reference - 19, // 7: extensions.ActionRequest.params:type_name -> content.references.Reference + 7, // 1: extensions.InstallResponse.results:type_name -> extensions.ExtensionRequestResult + 7, // 2: extensions.UninstallResponse.results:type_name -> extensions.ExtensionRequestResult + 7, // 3: extensions.UpdateResponse.results:type_name -> extensions.ExtensionRequestResult + 7, // 4: extensions.CheckResponse.results:type_name -> extensions.ExtensionRequestResult + 18, // 5: extensions.ActionRequest.metadata:type_name -> extensions.ActionRequest.MetadataEntry + 20, // 6: extensions.ActionRequest.refs:type_name -> content.references.Reference + 20, // 7: extensions.ActionRequest.params:type_name -> content.references.Reference 2, // 8: extensions.ActionResponse.state:type_name -> extensions.ActionResponse.State 0, // 9: extensions.ActionResponse.target:type_name -> extensions.Target 3, // 10: extensions.ActionResponse.format:type_name -> extensions.ActionResponse.Format - 16, // 11: extensions.ActionResponse.next:type_name -> extensions.Action - 18, // 12: extensions.ActionResponse.metadata:type_name -> extensions.ActionResponse.MetadataEntry - 19, // 13: extensions.ActionResponse.refs:type_name -> content.references.Reference + 17, // 11: extensions.ActionResponse.next:type_name -> extensions.Action + 19, // 12: extensions.ActionResponse.metadata:type_name -> extensions.ActionResponse.MetadataEntry + 20, // 13: extensions.ActionResponse.refs:type_name -> content.references.Reference 0, // 14: extensions.Action.target:type_name -> extensions.Target - 19, // 15: extensions.Action.image:type_name -> content.references.Reference + 20, // 15: extensions.Action.image:type_name -> content.references.Reference 4, // 16: extensions.Action.kind:type_name -> extensions.Action.Kind - 19, // 17: extensions.Action.refs:type_name -> content.references.Reference - 14, // 18: extensions.Action.request:type_name -> extensions.ActionRequest - 5, // 19: extensions.Extension.Install:input_type -> extensions.InstallRequest - 12, // 20: extensions.Extension.Check:input_type -> extensions.CheckRequest - 10, // 21: extensions.Extension.Update:input_type -> extensions.UpdateRequest - 8, // 22: extensions.Extension.Uninstall:input_type -> extensions.UninstallRequest - 14, // 23: extensions.Extension.Action:input_type -> extensions.ActionRequest - 7, // 24: extensions.Extension.Install:output_type -> extensions.InstallResponse - 13, // 25: extensions.Extension.Check:output_type -> extensions.CheckResponse - 11, // 26: extensions.Extension.Update:output_type -> extensions.UpdateResponse - 9, // 27: extensions.Extension.Uninstall:output_type -> extensions.UninstallResponse - 15, // 28: extensions.Extension.Action:output_type -> extensions.ActionResponse - 24, // [24:29] is the sub-list for method output_type - 19, // [19:24] is the sub-list for method input_type - 19, // [19:19] is the sub-list for extension type_name - 19, // [19:19] is the sub-list for extension extendee - 0, // [0:19] is the sub-list for field type_name + 20, // 17: extensions.Action.refs:type_name -> content.references.Reference + 15, // 18: extensions.Action.request:type_name -> extensions.ActionRequest + 5, // 19: extensions.Action.view:type_name -> extensions.Action.View + 6, // 20: extensions.Extension.Install:input_type -> extensions.InstallRequest + 13, // 21: extensions.Extension.Check:input_type -> extensions.CheckRequest + 11, // 22: extensions.Extension.Update:input_type -> extensions.UpdateRequest + 9, // 23: extensions.Extension.Uninstall:input_type -> extensions.UninstallRequest + 15, // 24: extensions.Extension.Action:input_type -> extensions.ActionRequest + 8, // 25: extensions.Extension.Install:output_type -> extensions.InstallResponse + 14, // 26: extensions.Extension.Check:output_type -> extensions.CheckResponse + 12, // 27: extensions.Extension.Update:output_type -> extensions.UpdateResponse + 10, // 28: extensions.Extension.Uninstall:output_type -> extensions.UninstallResponse + 16, // 29: extensions.Extension.Action:output_type -> extensions.ActionResponse + 25, // [25:30] is the sub-list for method output_type + 20, // [20:25] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_extensions_extension_proto_init() } @@ -1839,7 +1911,7 @@ func file_extensions_extension_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_extensions_extension_proto_rawDesc, - NumEnums: 5, + NumEnums: 6, NumMessages: 14, NumExtensions: 0, NumServices: 1, diff --git a/proto/extensions/manager.pb.go b/proto/extensions/manager.pb.go index cb5b209259d642794eb201b9bb60bbf60c87d3f9..0cffc9ab790950d5ac7383c30f0f08d5b1ae85d5 100644 --- a/proto/extensions/manager.pb.go +++ b/proto/extensions/manager.pb.go @@ -27,7 +27,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.30.0 // protoc v4.23.4 // source: extensions/manager.proto