diff --git a/api/v2/shortcut_service.go b/api/v2/shortcut_service.go index b9fec04..7365ca0 100644 --- a/api/v2/shortcut_service.go +++ b/api/v2/shortcut_service.go @@ -110,6 +110,37 @@ func (s *ShortcutService) CreateShortcut(ctx context.Context, request *apiv2pb.C return response, nil } +func (s *ShortcutService) DeleteShortcut(ctx context.Context, request *apiv2pb.DeleteShortcutRequest) (*apiv2pb.DeleteShortcutResponse, error) { + userID := ctx.Value(UserIDContextKey).(int32) + currentUser, err := s.Store.GetUser(ctx, &store.FindUser{ + ID: &userID, + }) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get current user, err: %v", err) + } + shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{ + Name: &request.Name, + }) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get shortcut by name: %v", err) + } + if shortcut == nil { + return nil, status.Errorf(codes.NotFound, "shortcut not found") + } + if shortcut.CreatorId != userID && currentUser.Role != store.RoleAdmin { + return nil, status.Errorf(codes.PermissionDenied, "Permission denied") + } + + err = s.Store.DeleteShortcut(ctx, &store.DeleteShortcut{ + ID: shortcut.Id, + }) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to delete shortcut, err: %v", err) + } + response := &apiv2pb.DeleteShortcutResponse{} + return response, nil +} + func (s *ShortcutService) createShortcutCreateActivity(ctx context.Context, shortcut *storepb.Shortcut) error { payload := &storepb.ActivityShorcutCreatePayload{ ShortcutId: shortcut.Id, diff --git a/extension/src/types/proto/api/v2/shortcut_service_pb.d.ts b/extension/src/types/proto/api/v2/shortcut_service_pb.d.ts index aebf175..0afa074 100644 --- a/extension/src/types/proto/api/v2/shortcut_service_pb.d.ts +++ b/extension/src/types/proto/api/v2/shortcut_service_pb.d.ts @@ -284,3 +284,46 @@ export declare class CreateShortcutResponse extends Message | undefined, b: CreateShortcutResponse | PlainMessage | undefined): boolean; } +/** + * @generated from message slash.api.v2.DeleteShortcutRequest + */ +export declare class DeleteShortcutRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.DeleteShortcutRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteShortcutRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteShortcutRequest; + + static fromJsonString(jsonString: string, options?: Partial): DeleteShortcutRequest; + + static equals(a: DeleteShortcutRequest | PlainMessage | undefined, b: DeleteShortcutRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.api.v2.DeleteShortcutResponse + */ +export declare class DeleteShortcutResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.DeleteShortcutResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteShortcutResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteShortcutResponse; + + static fromJsonString(jsonString: string, options?: Partial): DeleteShortcutResponse; + + static equals(a: DeleteShortcutResponse | PlainMessage | undefined, b: DeleteShortcutResponse | PlainMessage | undefined): boolean; +} + diff --git a/extension/src/types/proto/api/v2/shortcut_service_pb.js b/extension/src/types/proto/api/v2/shortcut_service_pb.js index 418e677..1b1ffbe 100644 --- a/extension/src/types/proto/api/v2/shortcut_service_pb.js +++ b/extension/src/types/proto/api/v2/shortcut_service_pb.js @@ -110,3 +110,21 @@ export const CreateShortcutResponse = proto3.makeMessageType( ], ); +/** + * @generated from message slash.api.v2.DeleteShortcutRequest + */ +export const DeleteShortcutRequest = proto3.makeMessageType( + "slash.api.v2.DeleteShortcutRequest", + () => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * @generated from message slash.api.v2.DeleteShortcutResponse + */ +export const DeleteShortcutResponse = proto3.makeMessageType( + "slash.api.v2.DeleteShortcutResponse", + [], +); + diff --git a/proto/api/v2/shortcut_service.proto b/proto/api/v2/shortcut_service.proto index 02540c2..d4c3919 100644 --- a/proto/api/v2/shortcut_service.proto +++ b/proto/api/v2/shortcut_service.proto @@ -25,6 +25,11 @@ service ShortcutService { body: "shortcut" }; } + // DeleteShortcut deletes a shortcut by name. + rpc DeleteShortcut(DeleteShortcutRequest) returns (DeleteShortcutResponse) { + option (google.api.http) = {delete: "/api/v2/shortcuts/{name}"}; + option (google.api.method_signature) = "name"; + } } message Shortcut { @@ -92,3 +97,9 @@ message CreateShortcutRequest { message CreateShortcutResponse { Shortcut shortcut = 1; } + +message DeleteShortcutRequest { + string name = 1; +} + +message DeleteShortcutResponse {} diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index c8f8a0c..0f6b4c9 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -9,6 +9,8 @@ - [api/v2/shortcut_service.proto](#api_v2_shortcut_service-proto) - [CreateShortcutRequest](#slash-api-v2-CreateShortcutRequest) - [CreateShortcutResponse](#slash-api-v2-CreateShortcutResponse) + - [DeleteShortcutRequest](#slash-api-v2-DeleteShortcutRequest) + - [DeleteShortcutResponse](#slash-api-v2-DeleteShortcutResponse) - [GetShortcutRequest](#slash-api-v2-GetShortcutRequest) - [GetShortcutResponse](#slash-api-v2-GetShortcutResponse) - [ListShortcutsRequest](#slash-api-v2-ListShortcutsRequest) @@ -112,6 +114,31 @@ + + +### DeleteShortcutRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | | + + + + + + + + +### DeleteShortcutResponse + + + + + + + ### GetShortcutRequest @@ -240,6 +267,7 @@ | ListShortcuts | [ListShortcutsRequest](#slash-api-v2-ListShortcutsRequest) | [ListShortcutsResponse](#slash-api-v2-ListShortcutsResponse) | ListShortcuts returns a list of shortcuts. | | GetShortcut | [GetShortcutRequest](#slash-api-v2-GetShortcutRequest) | [GetShortcutResponse](#slash-api-v2-GetShortcutResponse) | GetShortcut returns a shortcut by name. | | CreateShortcut | [CreateShortcutRequest](#slash-api-v2-CreateShortcutRequest) | [CreateShortcutResponse](#slash-api-v2-CreateShortcutResponse) | CreateShortcut creates a shortcut. | +| DeleteShortcut | [DeleteShortcutRequest](#slash-api-v2-DeleteShortcutRequest) | [DeleteShortcutResponse](#slash-api-v2-DeleteShortcutResponse) | DeleteShortcut deletes a shortcut by name. | diff --git a/proto/gen/api/v2/shortcut_service.pb.go b/proto/gen/api/v2/shortcut_service.pb.go index 085f5ba..4c71a7b 100644 --- a/proto/gen/api/v2/shortcut_service.pb.go +++ b/proto/gen/api/v2/shortcut_service.pb.go @@ -544,6 +544,91 @@ func (x *CreateShortcutResponse) GetShortcut() *Shortcut { return nil } +type DeleteShortcutRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *DeleteShortcutRequest) Reset() { + *x = DeleteShortcutRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_shortcut_service_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteShortcutRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteShortcutRequest) ProtoMessage() {} + +func (x *DeleteShortcutRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_shortcut_service_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteShortcutRequest.ProtoReflect.Descriptor instead. +func (*DeleteShortcutRequest) Descriptor() ([]byte, []int) { + return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteShortcutRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type DeleteShortcutResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteShortcutResponse) Reset() { + *x = DeleteShortcutResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_shortcut_service_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteShortcutResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteShortcutResponse) ProtoMessage() {} + +func (x *DeleteShortcutResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_shortcut_service_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use DeleteShortcutResponse.ProtoReflect.Descriptor instead. +func (*DeleteShortcutResponse) Descriptor() ([]byte, []int) { + return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{9} +} + var File_api_v2_shortcut_service_proto protoreflect.FileDescriptor var file_api_v2_shortcut_service_proto_rawDesc = []byte{ @@ -610,48 +695,61 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{ 0x65, 0x12, 0x32, 0x0a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x63, 0x75, 0x74, 0x2a, 0x50, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, - 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, - 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, - 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, - 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0x86, 0x03, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x72, - 0x74, 0x63, 0x75, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0d, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, - 0x12, 0x7b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, - 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, - 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, - 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, - 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x80, 0x01, - 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, - 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, - 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1d, 0x3a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x11, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, - 0x42, 0xab, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x14, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, - 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 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, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, - 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, - 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, - 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x2b, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, + 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x18, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, + 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x50, 0x0a, 0x0a, + 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, + 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, + 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, + 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x03, 0x32, 0x8d, + 0x04, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, + 0x75, 0x74, 0x73, 0x12, 0x22, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, + 0x63, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, + 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0x7b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x53, 0x68, + 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, + 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0xda, 0x41, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x6e, + 0x61, 0x6d, 0x65, 0x7d, 0x12, 0x80, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, + 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, + 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x08, 0x73, 0x68, 0x6f, 0x72, + 0x74, 0x63, 0x75, 0x74, 0x22, 0x11, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, + 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0x84, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x27, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x1a, 0x2a, 0x18, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x73, 0x68, + 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x7d, 0x42, 0xab, + 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x32, 0x42, 0x14, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b, 0x2f, + 0x73, 0x6c, 0x61, 0x73, 0x68, 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, 0x53, + 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, + 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, + 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, + 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -667,7 +765,7 @@ func file_api_v2_shortcut_service_proto_rawDescGZIP() []byte { } var file_api_v2_shortcut_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_api_v2_shortcut_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_api_v2_shortcut_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_api_v2_shortcut_service_proto_goTypes = []interface{}{ (Visibility)(0), // 0: slash.api.v2.Visibility (*Shortcut)(nil), // 1: slash.api.v2.Shortcut @@ -678,10 +776,12 @@ var file_api_v2_shortcut_service_proto_goTypes = []interface{}{ (*GetShortcutResponse)(nil), // 6: slash.api.v2.GetShortcutResponse (*CreateShortcutRequest)(nil), // 7: slash.api.v2.CreateShortcutRequest (*CreateShortcutResponse)(nil), // 8: slash.api.v2.CreateShortcutResponse - (RowStatus)(0), // 9: slash.api.v2.RowStatus + (*DeleteShortcutRequest)(nil), // 9: slash.api.v2.DeleteShortcutRequest + (*DeleteShortcutResponse)(nil), // 10: slash.api.v2.DeleteShortcutResponse + (RowStatus)(0), // 11: slash.api.v2.RowStatus } var file_api_v2_shortcut_service_proto_depIdxs = []int32{ - 9, // 0: slash.api.v2.Shortcut.row_status:type_name -> slash.api.v2.RowStatus + 11, // 0: slash.api.v2.Shortcut.row_status:type_name -> slash.api.v2.RowStatus 0, // 1: slash.api.v2.Shortcut.visibility:type_name -> slash.api.v2.Visibility 2, // 2: slash.api.v2.Shortcut.og_metadata:type_name -> slash.api.v2.OpenGraphMetadata 1, // 3: slash.api.v2.ListShortcutsResponse.shortcuts:type_name -> slash.api.v2.Shortcut @@ -691,11 +791,13 @@ var file_api_v2_shortcut_service_proto_depIdxs = []int32{ 3, // 7: slash.api.v2.ShortcutService.ListShortcuts:input_type -> slash.api.v2.ListShortcutsRequest 5, // 8: slash.api.v2.ShortcutService.GetShortcut:input_type -> slash.api.v2.GetShortcutRequest 7, // 9: slash.api.v2.ShortcutService.CreateShortcut:input_type -> slash.api.v2.CreateShortcutRequest - 4, // 10: slash.api.v2.ShortcutService.ListShortcuts:output_type -> slash.api.v2.ListShortcutsResponse - 6, // 11: slash.api.v2.ShortcutService.GetShortcut:output_type -> slash.api.v2.GetShortcutResponse - 8, // 12: slash.api.v2.ShortcutService.CreateShortcut:output_type -> slash.api.v2.CreateShortcutResponse - 10, // [10:13] is the sub-list for method output_type - 7, // [7:10] is the sub-list for method input_type + 9, // 10: slash.api.v2.ShortcutService.DeleteShortcut:input_type -> slash.api.v2.DeleteShortcutRequest + 4, // 11: slash.api.v2.ShortcutService.ListShortcuts:output_type -> slash.api.v2.ListShortcutsResponse + 6, // 12: slash.api.v2.ShortcutService.GetShortcut:output_type -> slash.api.v2.GetShortcutResponse + 8, // 13: slash.api.v2.ShortcutService.CreateShortcut:output_type -> slash.api.v2.CreateShortcutResponse + 10, // 14: slash.api.v2.ShortcutService.DeleteShortcut:output_type -> slash.api.v2.DeleteShortcutResponse + 11, // [11:15] is the sub-list for method output_type + 7, // [7:11] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name 7, // [7:7] is the sub-list for extension extendee 0, // [0:7] is the sub-list for field type_name @@ -804,6 +906,30 @@ func file_api_v2_shortcut_service_proto_init() { return nil } } + file_api_v2_shortcut_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteShortcutRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_api_v2_shortcut_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteShortcutResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -811,7 +937,7 @@ func file_api_v2_shortcut_service_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v2_shortcut_service_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 10, NumExtensions: 0, NumServices: 1, }, diff --git a/proto/gen/api/v2/shortcut_service.pb.gw.go b/proto/gen/api/v2/shortcut_service.pb.gw.go index b69ca4a..7f7e14b 100644 --- a/proto/gen/api/v2/shortcut_service.pb.gw.go +++ b/proto/gen/api/v2/shortcut_service.pb.gw.go @@ -135,6 +135,58 @@ func local_request_ShortcutService_CreateShortcut_0(ctx context.Context, marshal } +func request_ShortcutService_DeleteShortcut_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteShortcutRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.DeleteShortcut(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ShortcutService_DeleteShortcut_0(ctx context.Context, marshaler runtime.Marshaler, server ShortcutServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq DeleteShortcutRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.DeleteShortcut(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterShortcutServiceHandlerServer registers the http handlers for service ShortcutService to "mux". // UnaryRPC :call ShortcutServiceServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -216,6 +268,31 @@ func RegisterShortcutServiceHandlerServer(ctx context.Context, mux *runtime.Serv }) + mux.Handle("DELETE", pattern_ShortcutService_DeleteShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ShortcutService_DeleteShortcut_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ShortcutService_DeleteShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -323,6 +400,28 @@ func RegisterShortcutServiceHandlerClient(ctx context.Context, mux *runtime.Serv }) + mux.Handle("DELETE", pattern_ShortcutService_DeleteShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.ShortcutService/DeleteShortcut", runtime.WithHTTPPathPattern("/api/v2/shortcuts/{name}")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ShortcutService_DeleteShortcut_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_ShortcutService_DeleteShortcut_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -332,6 +431,8 @@ var ( pattern_ShortcutService_GetShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "shortcuts", "name"}, "")) pattern_ShortcutService_CreateShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "shortcuts"}, "")) + + pattern_ShortcutService_DeleteShortcut_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"api", "v2", "shortcuts", "name"}, "")) ) var ( @@ -340,4 +441,6 @@ var ( forward_ShortcutService_GetShortcut_0 = runtime.ForwardResponseMessage forward_ShortcutService_CreateShortcut_0 = runtime.ForwardResponseMessage + + forward_ShortcutService_DeleteShortcut_0 = runtime.ForwardResponseMessage ) diff --git a/proto/gen/api/v2/shortcut_service_grpc.pb.go b/proto/gen/api/v2/shortcut_service_grpc.pb.go index 35458ba..efa72bb 100644 --- a/proto/gen/api/v2/shortcut_service_grpc.pb.go +++ b/proto/gen/api/v2/shortcut_service_grpc.pb.go @@ -22,6 +22,7 @@ const ( ShortcutService_ListShortcuts_FullMethodName = "/slash.api.v2.ShortcutService/ListShortcuts" ShortcutService_GetShortcut_FullMethodName = "/slash.api.v2.ShortcutService/GetShortcut" ShortcutService_CreateShortcut_FullMethodName = "/slash.api.v2.ShortcutService/CreateShortcut" + ShortcutService_DeleteShortcut_FullMethodName = "/slash.api.v2.ShortcutService/DeleteShortcut" ) // ShortcutServiceClient is the client API for ShortcutService service. @@ -34,6 +35,8 @@ type ShortcutServiceClient interface { GetShortcut(ctx context.Context, in *GetShortcutRequest, opts ...grpc.CallOption) (*GetShortcutResponse, error) // CreateShortcut creates a shortcut. CreateShortcut(ctx context.Context, in *CreateShortcutRequest, opts ...grpc.CallOption) (*CreateShortcutResponse, error) + // DeleteShortcut deletes a shortcut by name. + DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*DeleteShortcutResponse, error) } type shortcutServiceClient struct { @@ -71,6 +74,15 @@ func (c *shortcutServiceClient) CreateShortcut(ctx context.Context, in *CreateSh return out, nil } +func (c *shortcutServiceClient) DeleteShortcut(ctx context.Context, in *DeleteShortcutRequest, opts ...grpc.CallOption) (*DeleteShortcutResponse, error) { + out := new(DeleteShortcutResponse) + err := c.cc.Invoke(ctx, ShortcutService_DeleteShortcut_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // ShortcutServiceServer is the server API for ShortcutService service. // All implementations must embed UnimplementedShortcutServiceServer // for forward compatibility @@ -81,6 +93,8 @@ type ShortcutServiceServer interface { GetShortcut(context.Context, *GetShortcutRequest) (*GetShortcutResponse, error) // CreateShortcut creates a shortcut. CreateShortcut(context.Context, *CreateShortcutRequest) (*CreateShortcutResponse, error) + // DeleteShortcut deletes a shortcut by name. + DeleteShortcut(context.Context, *DeleteShortcutRequest) (*DeleteShortcutResponse, error) mustEmbedUnimplementedShortcutServiceServer() } @@ -97,6 +111,9 @@ func (UnimplementedShortcutServiceServer) GetShortcut(context.Context, *GetShort func (UnimplementedShortcutServiceServer) CreateShortcut(context.Context, *CreateShortcutRequest) (*CreateShortcutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CreateShortcut not implemented") } +func (UnimplementedShortcutServiceServer) DeleteShortcut(context.Context, *DeleteShortcutRequest) (*DeleteShortcutResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteShortcut not implemented") +} func (UnimplementedShortcutServiceServer) mustEmbedUnimplementedShortcutServiceServer() {} // UnsafeShortcutServiceServer may be embedded to opt out of forward compatibility for this service. @@ -164,6 +181,24 @@ func _ShortcutService_CreateShortcut_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _ShortcutService_DeleteShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteShortcutRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ShortcutServiceServer).DeleteShortcut(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ShortcutService_DeleteShortcut_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ShortcutServiceServer).DeleteShortcut(ctx, req.(*DeleteShortcutRequest)) + } + return interceptor(ctx, in, info, handler) +} + // ShortcutService_ServiceDesc is the grpc.ServiceDesc for ShortcutService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -183,6 +218,10 @@ var ShortcutService_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateShortcut", Handler: _ShortcutService_CreateShortcut_Handler, }, + { + MethodName: "DeleteShortcut", + Handler: _ShortcutService_DeleteShortcut_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "api/v2/shortcut_service.proto", diff --git a/web/src/types/proto/api/v2/shortcut_service_pb.d.ts b/web/src/types/proto/api/v2/shortcut_service_pb.d.ts index aebf175..0afa074 100644 --- a/web/src/types/proto/api/v2/shortcut_service_pb.d.ts +++ b/web/src/types/proto/api/v2/shortcut_service_pb.d.ts @@ -284,3 +284,46 @@ export declare class CreateShortcutResponse extends Message | undefined, b: CreateShortcutResponse | PlainMessage | undefined): boolean; } +/** + * @generated from message slash.api.v2.DeleteShortcutRequest + */ +export declare class DeleteShortcutRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.DeleteShortcutRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteShortcutRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteShortcutRequest; + + static fromJsonString(jsonString: string, options?: Partial): DeleteShortcutRequest; + + static equals(a: DeleteShortcutRequest | PlainMessage | undefined, b: DeleteShortcutRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.api.v2.DeleteShortcutResponse + */ +export declare class DeleteShortcutResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.DeleteShortcutResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteShortcutResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteShortcutResponse; + + static fromJsonString(jsonString: string, options?: Partial): DeleteShortcutResponse; + + static equals(a: DeleteShortcutResponse | PlainMessage | undefined, b: DeleteShortcutResponse | PlainMessage | undefined): boolean; +} + diff --git a/web/src/types/proto/api/v2/shortcut_service_pb.js b/web/src/types/proto/api/v2/shortcut_service_pb.js index 418e677..1b1ffbe 100644 --- a/web/src/types/proto/api/v2/shortcut_service_pb.js +++ b/web/src/types/proto/api/v2/shortcut_service_pb.js @@ -110,3 +110,21 @@ export const CreateShortcutResponse = proto3.makeMessageType( ], ); +/** + * @generated from message slash.api.v2.DeleteShortcutRequest + */ +export const DeleteShortcutRequest = proto3.makeMessageType( + "slash.api.v2.DeleteShortcutRequest", + () => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * @generated from message slash.api.v2.DeleteShortcutResponse + */ +export const DeleteShortcutResponse = proto3.makeMessageType( + "slash.api.v2.DeleteShortcutResponse", + [], +); +