diff --git a/api/v2/shortcut_service.go b/api/v2/shortcut_service.go index 014517c3..0bf115c6 100644 --- a/api/v2/shortcut_service.go +++ b/api/v2/shortcut_service.go @@ -25,6 +25,34 @@ func NewShortcutService(secret string, store *store.Store) *ShortcutService { } } +func (s *ShortcutService) ListShortcuts(ctx context.Context, _ *apiv2pb.ListShortcutsRequest) (*apiv2pb.ListShortcutsResponse, error) { + userID := ctx.Value(UserIDContextKey).(int32) + find := &store.FindShortcut{} + find.VisibilityList = []store.Visibility{store.VisibilityWorkspace, store.VisibilityPublic} + visibleShortcutList, err := s.Store.ListShortcuts(ctx, find) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to fetch visible shortcut list, err: %v", err) + } + + find.VisibilityList = []store.Visibility{store.VisibilityPrivate} + find.CreatorID = &userID + shortcutList, err := s.Store.ListShortcuts(ctx, find) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to fetch private shortcut list, err: %v", err) + } + + shortcutList = append(shortcutList, visibleShortcutList...) + shortcuts := []*apiv2pb.Shortcut{} + for _, shortcut := range shortcutList { + shortcuts = append(shortcuts, convertShortcutFromStorepb(shortcut)) + } + + response := &apiv2pb.ListShortcutsResponse{ + Shortcuts: shortcuts, + } + return response, nil +} + func (s *ShortcutService) GetShortcut(ctx context.Context, request *apiv2pb.GetShortcutRequest) (*apiv2pb.GetShortcutResponse, error) { shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{ Name: &request.Name, diff --git a/extension/src/components/PullShortcutsButton.tsx b/extension/src/components/PullShortcutsButton.tsx index 0b10d8c2..c05e2bb0 100644 --- a/extension/src/components/PullShortcutsButton.tsx +++ b/extension/src/components/PullShortcutsButton.tsx @@ -3,7 +3,7 @@ import { useStorage } from "@plasmohq/storage/hook"; import axios from "axios"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; -import { Shortcut } from "@/types/proto/api/v2/shortcut_service_pb"; +import { ListShortcutsResponse } from "@/types/proto/api/v2/shortcut_service_pb"; import "../style.css"; import Icon from "./Icon"; @@ -22,12 +22,14 @@ const PullShortcutsButton = () => { const handlePullShortcuts = async (silence = false) => { try { setIsPulling(true); - const { data } = await axios.get(`${domain}/api/v1/shortcut`, { + const { + data: { shortcuts }, + } = await axios.get(`${domain}/api/v2/shortcut`, { headers: { Authorization: `Bearer ${accessToken}`, }, }); - setShortcuts(data); + setShortcuts(shortcuts); if (!silence) { toast.success("Shortcuts pulled"); } 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 90e4662f..cf58f562 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 @@ -145,6 +145,49 @@ export declare class OpenGraphMetadata extends Message { static equals(a: OpenGraphMetadata | PlainMessage | undefined, b: OpenGraphMetadata | PlainMessage | undefined): boolean; } +/** + * @generated from message slash.api.v2.ListShortcutsRequest + */ +export declare class ListShortcutsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.ListShortcutsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ListShortcutsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): ListShortcutsRequest; + + static fromJsonString(jsonString: string, options?: Partial): ListShortcutsRequest; + + static equals(a: ListShortcutsRequest | PlainMessage | undefined, b: ListShortcutsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.api.v2.ListShortcutsResponse + */ +export declare class ListShortcutsResponse extends Message { + /** + * @generated from field: repeated slash.api.v2.Shortcut shortcuts = 1; + */ + shortcuts: Shortcut[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.ListShortcutsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ListShortcutsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): ListShortcutsResponse; + + static fromJsonString(jsonString: string, options?: Partial): ListShortcutsResponse; + + static equals(a: ListShortcutsResponse | PlainMessage | undefined, b: ListShortcutsResponse | PlainMessage | undefined): boolean; +} + /** * @generated from message slash.api.v2.GetShortcutRequest */ 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 66d60649..1043b7f1 100644 --- a/extension/src/types/proto/api/v2/shortcut_service_pb.js +++ b/extension/src/types/proto/api/v2/shortcut_service_pb.js @@ -52,6 +52,24 @@ export const OpenGraphMetadata = proto3.makeMessageType( ], ); +/** + * @generated from message slash.api.v2.ListShortcutsRequest + */ +export const ListShortcutsRequest = proto3.makeMessageType( + "slash.api.v2.ListShortcutsRequest", + [], +); + +/** + * @generated from message slash.api.v2.ListShortcutsResponse + */ +export const ListShortcutsResponse = proto3.makeMessageType( + "slash.api.v2.ListShortcutsResponse", + () => [ + { no: 1, name: "shortcuts", kind: "message", T: Shortcut, repeated: true }, + ], +); + /** * @generated from message slash.api.v2.GetShortcutRequest */ diff --git a/proto/api/v2/shortcut_service.proto b/proto/api/v2/shortcut_service.proto index cd73796b..01927022 100644 --- a/proto/api/v2/shortcut_service.proto +++ b/proto/api/v2/shortcut_service.proto @@ -9,6 +9,9 @@ import "google/api/client.proto"; option go_package = "gen/api/v2"; service ShortcutService { + rpc ListShortcuts(ListShortcutsRequest) returns (ListShortcutsResponse) { + option (google.api.http) = {get: "/api/v2/shortcuts"}; + } // GetShortcut returns a shortcut by name. rpc GetShortcut(GetShortcutRequest) returns (GetShortcutResponse) { option (google.api.http) = {get: "/api/v2/shortcuts/{name}"}; @@ -60,6 +63,12 @@ enum Visibility { PUBLIC = 3; } +message ListShortcutsRequest {} + +message ListShortcutsResponse { + repeated Shortcut shortcuts = 1; +} + message GetShortcutRequest { string name = 1; } diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index 7276e56e..5f3509a8 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) - [GetShortcutRequest](#slash-api-v2-GetShortcutRequest) - [GetShortcutResponse](#slash-api-v2-GetShortcutResponse) + - [ListShortcutsRequest](#slash-api-v2-ListShortcutsRequest) + - [ListShortcutsResponse](#slash-api-v2-ListShortcutsResponse) - [OpenGraphMetadata](#slash-api-v2-OpenGraphMetadata) - [Shortcut](#slash-api-v2-Shortcut) @@ -102,6 +104,31 @@ + + +### ListShortcutsRequest + + + + + + + + + +### ListShortcutsResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| shortcuts | [Shortcut](#slash-api-v2-Shortcut) | repeated | | + + + + + + ### OpenGraphMetadata @@ -172,6 +199,7 @@ | Method Name | Request Type | Response Type | Description | | ----------- | ------------ | ------------- | ------------| +| ListShortcuts | [ListShortcutsRequest](#slash-api-v2-ListShortcutsRequest) | [ListShortcutsResponse](#slash-api-v2-ListShortcutsResponse) | | | GetShortcut | [GetShortcutRequest](#slash-api-v2-GetShortcutRequest) | [GetShortcutResponse](#slash-api-v2-GetShortcutResponse) | GetShortcut returns 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 446feeed..98cf8814 100644 --- a/proto/gen/api/v2/shortcut_service.pb.go +++ b/proto/gen/api/v2/shortcut_service.pb.go @@ -271,6 +271,91 @@ func (x *OpenGraphMetadata) GetImage() string { return "" } +type ListShortcutsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ListShortcutsRequest) Reset() { + *x = ListShortcutsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_shortcut_service_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListShortcutsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListShortcutsRequest) ProtoMessage() {} + +func (x *ListShortcutsRequest) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_shortcut_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 ListShortcutsRequest.ProtoReflect.Descriptor instead. +func (*ListShortcutsRequest) Descriptor() ([]byte, []int) { + return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{2} +} + +type ListShortcutsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Shortcuts []*Shortcut `protobuf:"bytes,1,rep,name=shortcuts,proto3" json:"shortcuts,omitempty"` +} + +func (x *ListShortcutsResponse) Reset() { + *x = ListShortcutsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_api_v2_shortcut_service_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListShortcutsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListShortcutsResponse) ProtoMessage() {} + +func (x *ListShortcutsResponse) ProtoReflect() protoreflect.Message { + mi := &file_api_v2_shortcut_service_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListShortcutsResponse.ProtoReflect.Descriptor instead. +func (*ListShortcutsResponse) Descriptor() ([]byte, []int) { + return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{3} +} + +func (x *ListShortcutsResponse) GetShortcuts() []*Shortcut { + if x != nil { + return x.Shortcuts + } + return nil +} + type GetShortcutRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -282,7 +367,7 @@ type GetShortcutRequest struct { func (x *GetShortcutRequest) Reset() { *x = GetShortcutRequest{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_shortcut_service_proto_msgTypes[2] + mi := &file_api_v2_shortcut_service_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -295,7 +380,7 @@ func (x *GetShortcutRequest) String() string { func (*GetShortcutRequest) ProtoMessage() {} func (x *GetShortcutRequest) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_shortcut_service_proto_msgTypes[2] + mi := &file_api_v2_shortcut_service_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -308,7 +393,7 @@ func (x *GetShortcutRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetShortcutRequest.ProtoReflect.Descriptor instead. func (*GetShortcutRequest) Descriptor() ([]byte, []int) { - return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{2} + return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{4} } func (x *GetShortcutRequest) GetName() string { @@ -329,7 +414,7 @@ type GetShortcutResponse struct { func (x *GetShortcutResponse) Reset() { *x = GetShortcutResponse{} if protoimpl.UnsafeEnabled { - mi := &file_api_v2_shortcut_service_proto_msgTypes[3] + mi := &file_api_v2_shortcut_service_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -342,7 +427,7 @@ func (x *GetShortcutResponse) String() string { func (*GetShortcutResponse) ProtoMessage() {} func (x *GetShortcutResponse) ProtoReflect() protoreflect.Message { - mi := &file_api_v2_shortcut_service_proto_msgTypes[3] + mi := &file_api_v2_shortcut_service_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -355,7 +440,7 @@ func (x *GetShortcutResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetShortcutResponse.ProtoReflect.Descriptor instead. func (*GetShortcutResponse) Descriptor() ([]byte, []int) { - return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{3} + return file_api_v2_shortcut_service_proto_rawDescGZIP(), []int{5} } func (x *GetShortcutResponse) GetShortcut() *Shortcut { @@ -407,40 +492,54 @@ var file_api_v2_shortcut_service_proto_rawDesc = []byte{ 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x28, - 0x0a, 0x12, 0x47, 0x65, 0x74, 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, 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, - 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 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, 0x8e, 0x01, 0x0a, 0x0f, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, - 0x75, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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, 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, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x16, + 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4d, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x68, + 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x34, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 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, 0x09, 0x73, 0x68, 0x6f, 0x72, + 0x74, 0x63, 0x75, 0x74, 0x73, 0x22, 0x28, 0x0a, 0x12, 0x47, 0x65, 0x74, 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, + 0x49, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 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, 0x83, 0x02, 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, 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 ( @@ -456,27 +555,32 @@ 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, 4) +var file_api_v2_shortcut_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_api_v2_shortcut_service_proto_goTypes = []interface{}{ - (Visibility)(0), // 0: slash.api.v2.Visibility - (*Shortcut)(nil), // 1: slash.api.v2.Shortcut - (*OpenGraphMetadata)(nil), // 2: slash.api.v2.OpenGraphMetadata - (*GetShortcutRequest)(nil), // 3: slash.api.v2.GetShortcutRequest - (*GetShortcutResponse)(nil), // 4: slash.api.v2.GetShortcutResponse - (RowStatus)(0), // 5: slash.api.v2.RowStatus + (Visibility)(0), // 0: slash.api.v2.Visibility + (*Shortcut)(nil), // 1: slash.api.v2.Shortcut + (*OpenGraphMetadata)(nil), // 2: slash.api.v2.OpenGraphMetadata + (*ListShortcutsRequest)(nil), // 3: slash.api.v2.ListShortcutsRequest + (*ListShortcutsResponse)(nil), // 4: slash.api.v2.ListShortcutsResponse + (*GetShortcutRequest)(nil), // 5: slash.api.v2.GetShortcutRequest + (*GetShortcutResponse)(nil), // 6: slash.api.v2.GetShortcutResponse + (RowStatus)(0), // 7: slash.api.v2.RowStatus } var file_api_v2_shortcut_service_proto_depIdxs = []int32{ - 5, // 0: slash.api.v2.Shortcut.row_status:type_name -> slash.api.v2.RowStatus + 7, // 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.GetShortcutResponse.shortcut:type_name -> slash.api.v2.Shortcut - 3, // 4: slash.api.v2.ShortcutService.GetShortcut:input_type -> slash.api.v2.GetShortcutRequest - 4, // 5: slash.api.v2.ShortcutService.GetShortcut:output_type -> slash.api.v2.GetShortcutResponse - 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 + 1, // 3: slash.api.v2.ListShortcutsResponse.shortcuts:type_name -> slash.api.v2.Shortcut + 1, // 4: slash.api.v2.GetShortcutResponse.shortcut:type_name -> slash.api.v2.Shortcut + 3, // 5: slash.api.v2.ShortcutService.ListShortcuts:input_type -> slash.api.v2.ListShortcutsRequest + 5, // 6: slash.api.v2.ShortcutService.GetShortcut:input_type -> slash.api.v2.GetShortcutRequest + 4, // 7: slash.api.v2.ShortcutService.ListShortcuts:output_type -> slash.api.v2.ListShortcutsResponse + 6, // 8: slash.api.v2.ShortcutService.GetShortcut:output_type -> slash.api.v2.GetShortcutResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] 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_shortcut_service_proto_init() } @@ -511,7 +615,7 @@ func file_api_v2_shortcut_service_proto_init() { } } file_api_v2_shortcut_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetShortcutRequest); i { + switch v := v.(*ListShortcutsRequest); i { case 0: return &v.state case 1: @@ -523,6 +627,30 @@ func file_api_v2_shortcut_service_proto_init() { } } file_api_v2_shortcut_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListShortcutsResponse); 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[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetShortcutRequest); 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[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetShortcutResponse); i { case 0: return &v.state @@ -541,7 +669,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: 4, + NumMessages: 6, 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 83fcc12e..5ae9fa3f 100644 --- a/proto/gen/api/v2/shortcut_service.pb.gw.go +++ b/proto/gen/api/v2/shortcut_service.pb.gw.go @@ -31,6 +31,24 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = metadata.Join +func request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListShortcutsRequest + var metadata runtime.ServerMetadata + + msg, err := client.ListShortcuts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_ShortcutService_ListShortcuts_0(ctx context.Context, marshaler runtime.Marshaler, server ShortcutServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ListShortcutsRequest + var metadata runtime.ServerMetadata + + msg, err := server.ListShortcuts(ctx, &protoReq) + return msg, metadata, err + +} + func request_ShortcutService_GetShortcut_0(ctx context.Context, marshaler runtime.Marshaler, client ShortcutServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq GetShortcutRequest var metadata runtime.ServerMetadata @@ -89,6 +107,31 @@ func local_request_ShortcutService_GetShortcut_0(ctx context.Context, marshaler // Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterShortcutServiceHandlerFromEndpoint instead. func RegisterShortcutServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShortcutServiceServer) error { + mux.Handle("GET", pattern_ShortcutService_ListShortcuts_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/ListShortcuts", runtime.WithHTTPPathPattern("/api/v2/shortcuts")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_ShortcutService_ListShortcuts_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_ListShortcuts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_ShortcutService_GetShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -155,6 +198,28 @@ func RegisterShortcutServiceHandler(ctx context.Context, mux *runtime.ServeMux, // "ShortcutServiceClient" to call the correct interceptors. func RegisterShortcutServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShortcutServiceClient) error { + mux.Handle("GET", pattern_ShortcutService_ListShortcuts_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/ListShortcuts", runtime.WithHTTPPathPattern("/api/v2/shortcuts")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_ShortcutService_ListShortcuts_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_ListShortcuts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_ShortcutService_GetShortcut_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -181,9 +246,13 @@ func RegisterShortcutServiceHandlerClient(ctx context.Context, mux *runtime.Serv } var ( + pattern_ShortcutService_ListShortcuts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "shortcuts"}, "")) + 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"}, "")) ) var ( + forward_ShortcutService_ListShortcuts_0 = runtime.ForwardResponseMessage + forward_ShortcutService_GetShortcut_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 ec060761..79efc7a2 100644 --- a/proto/gen/api/v2/shortcut_service_grpc.pb.go +++ b/proto/gen/api/v2/shortcut_service_grpc.pb.go @@ -19,13 +19,15 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - ShortcutService_GetShortcut_FullMethodName = "/slash.api.v2.ShortcutService/GetShortcut" + ShortcutService_ListShortcuts_FullMethodName = "/slash.api.v2.ShortcutService/ListShortcuts" + ShortcutService_GetShortcut_FullMethodName = "/slash.api.v2.ShortcutService/GetShortcut" ) // ShortcutServiceClient is the client API for ShortcutService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type ShortcutServiceClient interface { + ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error) // GetShortcut returns a shortcut by name. GetShortcut(ctx context.Context, in *GetShortcutRequest, opts ...grpc.CallOption) (*GetShortcutResponse, error) } @@ -38,6 +40,15 @@ func NewShortcutServiceClient(cc grpc.ClientConnInterface) ShortcutServiceClient return &shortcutServiceClient{cc} } +func (c *shortcutServiceClient) ListShortcuts(ctx context.Context, in *ListShortcutsRequest, opts ...grpc.CallOption) (*ListShortcutsResponse, error) { + out := new(ListShortcutsResponse) + err := c.cc.Invoke(ctx, ShortcutService_ListShortcuts_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *shortcutServiceClient) GetShortcut(ctx context.Context, in *GetShortcutRequest, opts ...grpc.CallOption) (*GetShortcutResponse, error) { out := new(GetShortcutResponse) err := c.cc.Invoke(ctx, ShortcutService_GetShortcut_FullMethodName, in, out, opts...) @@ -51,6 +62,7 @@ func (c *shortcutServiceClient) GetShortcut(ctx context.Context, in *GetShortcut // All implementations must embed UnimplementedShortcutServiceServer // for forward compatibility type ShortcutServiceServer interface { + ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error) // GetShortcut returns a shortcut by name. GetShortcut(context.Context, *GetShortcutRequest) (*GetShortcutResponse, error) mustEmbedUnimplementedShortcutServiceServer() @@ -60,6 +72,9 @@ type ShortcutServiceServer interface { type UnimplementedShortcutServiceServer struct { } +func (UnimplementedShortcutServiceServer) ListShortcuts(context.Context, *ListShortcutsRequest) (*ListShortcutsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListShortcuts not implemented") +} func (UnimplementedShortcutServiceServer) GetShortcut(context.Context, *GetShortcutRequest) (*GetShortcutResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetShortcut not implemented") } @@ -76,6 +91,24 @@ func RegisterShortcutServiceServer(s grpc.ServiceRegistrar, srv ShortcutServiceS s.RegisterService(&ShortcutService_ServiceDesc, srv) } +func _ShortcutService_ListShortcuts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListShortcutsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ShortcutServiceServer).ListShortcuts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ShortcutService_ListShortcuts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ShortcutServiceServer).ListShortcuts(ctx, req.(*ListShortcutsRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _ShortcutService_GetShortcut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetShortcutRequest) if err := dec(in); err != nil { @@ -101,6 +134,10 @@ var ShortcutService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "slash.api.v2.ShortcutService", HandlerType: (*ShortcutServiceServer)(nil), Methods: []grpc.MethodDesc{ + { + MethodName: "ListShortcuts", + Handler: _ShortcutService_ListShortcuts_Handler, + }, { MethodName: "GetShortcut", Handler: _ShortcutService_GetShortcut_Handler, 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 90e4662f..cf58f562 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 @@ -145,6 +145,49 @@ export declare class OpenGraphMetadata extends Message { static equals(a: OpenGraphMetadata | PlainMessage | undefined, b: OpenGraphMetadata | PlainMessage | undefined): boolean; } +/** + * @generated from message slash.api.v2.ListShortcutsRequest + */ +export declare class ListShortcutsRequest extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.ListShortcutsRequest"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ListShortcutsRequest; + + static fromJson(jsonValue: JsonValue, options?: Partial): ListShortcutsRequest; + + static fromJsonString(jsonString: string, options?: Partial): ListShortcutsRequest; + + static equals(a: ListShortcutsRequest | PlainMessage | undefined, b: ListShortcutsRequest | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.api.v2.ListShortcutsResponse + */ +export declare class ListShortcutsResponse extends Message { + /** + * @generated from field: repeated slash.api.v2.Shortcut shortcuts = 1; + */ + shortcuts: Shortcut[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.api.v2.ListShortcutsResponse"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): ListShortcutsResponse; + + static fromJson(jsonValue: JsonValue, options?: Partial): ListShortcutsResponse; + + static fromJsonString(jsonString: string, options?: Partial): ListShortcutsResponse; + + static equals(a: ListShortcutsResponse | PlainMessage | undefined, b: ListShortcutsResponse | PlainMessage | undefined): boolean; +} + /** * @generated from message slash.api.v2.GetShortcutRequest */ 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 66d60649..1043b7f1 100644 --- a/web/src/types/proto/api/v2/shortcut_service_pb.js +++ b/web/src/types/proto/api/v2/shortcut_service_pb.js @@ -52,6 +52,24 @@ export const OpenGraphMetadata = proto3.makeMessageType( ], ); +/** + * @generated from message slash.api.v2.ListShortcutsRequest + */ +export const ListShortcutsRequest = proto3.makeMessageType( + "slash.api.v2.ListShortcutsRequest", + [], +); + +/** + * @generated from message slash.api.v2.ListShortcutsResponse + */ +export const ListShortcutsResponse = proto3.makeMessageType( + "slash.api.v2.ListShortcutsResponse", + () => [ + { no: 1, name: "shortcuts", kind: "message", T: Shortcut, repeated: true }, + ], +); + /** * @generated from message slash.api.v2.GetShortcutRequest */