From b74e4f90c1bb2c72f549ffdf000812140b1c64a5 Mon Sep 17 00:00:00 2001 From: Steven Date: Sat, 31 Aug 2024 22:04:24 +0800 Subject: [PATCH] refactor: update visibilities --- .../src/components/CreateCollectionDrawer.tsx | 4 +- .../src/components/CreateShortcutDrawer.tsx | 4 +- frontend/web/src/components/FilterView.tsx | 3 +- frontend/web/src/components/ShortcutCard.tsx | 10 +- .../web/src/components/VisibilityIcon.tsx | 4 +- .../WorkspaceGeneralSettingSection.tsx | 1 - .../setting/WorkspaceMembersSection.tsx | 3 +- frontend/web/src/pages/ShortcutDetail.tsx | 10 +- frontend/web/src/utils/user.ts | 11 - frontend/web/src/utils/visibility.ts | 13 - proto/api/v1/common.proto | 12 +- proto/api/v1/shortcut_service.proto | 2 - proto/api/v1/user_service.proto | 2 +- proto/gen/api/v1/README.md | 19 +- proto/gen/api/v1/common.pb.go | 124 ++++-- proto/gen/api/v1/shortcut_service.pb.go | 359 +++++++++--------- proto/gen/api/v1/user_service.pb.go | 321 ++++++++-------- proto/gen/apidocs.swagger.yaml | 26 +- proto/gen/store/README.md | 6 +- proto/gen/store/common.pb.go | 44 +-- proto/gen/store/shortcut.pb.go | 96 ++--- proto/store/common.proto | 6 +- proto/store/shortcut.proto | 2 - server/route/api/v1/acl.go | 2 +- server/route/api/v1/auth_service.go | 6 +- server/route/api/v1/collection_service.go | 53 +-- server/route/api/v1/common.go | 57 ++- server/route/api/v1/shortcut_service.go | 71 ++-- server/route/api/v1/user_service.go | 12 +- server/route/api/v1/user_setting_service.go | 2 +- server/route/api/v1/workspace_service.go | 6 +- store/collection.go | 8 +- store/common.go | 48 +-- store/db/postgres/collection.go | 4 +- store/db/postgres/shortcut.go | 33 +- store/db/postgres/user.go | 14 +- store/db/sqlite/collection.go | 5 +- store/db/sqlite/shortcut.go | 32 +- store/db/sqlite/user.go | 15 +- store/shortcut.go | 6 +- store/user.go | 8 +- test/store/collection_test.go | 2 +- test/store/shortcut_test.go | 2 +- 43 files changed, 693 insertions(+), 775 deletions(-) delete mode 100644 frontend/web/src/utils/user.ts delete mode 100644 frontend/web/src/utils/visibility.ts diff --git a/frontend/web/src/components/CreateCollectionDrawer.tsx b/frontend/web/src/components/CreateCollectionDrawer.tsx index a04b8ff..7e729cf 100644 --- a/frontend/web/src/components/CreateCollectionDrawer.tsx +++ b/frontend/web/src/components/CreateCollectionDrawer.tsx @@ -8,7 +8,6 @@ import { useCollectionStore, useShortcutStore, useWorkspaceStore } from "@/store import { Collection } from "@/types/proto/api/v1/collection_service"; import { Visibility } from "@/types/proto/api/v1/common"; import { Shortcut } from "@/types/proto/api/v1/shortcut_service"; -import { convertVisibilityFromPb } from "@/utils/visibility"; import Icon from "./Icon"; import ShortcutView from "./ShortcutView"; @@ -213,13 +212,12 @@ const CreateCollectionDrawer: React.FC = (props: Props) => { Visibility
-

- {t(`shortcut.visibility.${convertVisibilityFromPb(state.collectionCreate.visibility).toLowerCase()}.description`)} + {t(`shortcut.visibility.${state.collectionCreate.visibility.toLowerCase()}.description`)}

diff --git a/frontend/web/src/components/CreateShortcutDrawer.tsx b/frontend/web/src/components/CreateShortcutDrawer.tsx index 36caed9..7869fee 100644 --- a/frontend/web/src/components/CreateShortcutDrawer.tsx +++ b/frontend/web/src/components/CreateShortcutDrawer.tsx @@ -21,7 +21,6 @@ import { useShortcutStore, useWorkspaceStore } from "@/stores"; import { getShortcutUpdateMask } from "@/stores/shortcut"; import { Visibility } from "@/types/proto/api/v1/common"; import { Shortcut } from "@/types/proto/api/v1/shortcut_service"; -import { convertVisibilityFromPb } from "@/utils/visibility"; import Icon from "./Icon"; interface Props { @@ -295,13 +294,12 @@ const CreateShortcutDrawer: React.FC = (props: Props) => { Visibility
-

- {t(`shortcut.visibility.${convertVisibilityFromPb(state.shortcutCreate.visibility).toLowerCase()}.description`)} + {t(`shortcut.visibility.${state.shortcutCreate.visibility.toLowerCase()}.description`)}

More diff --git a/frontend/web/src/components/FilterView.tsx b/frontend/web/src/components/FilterView.tsx index 69e8d68..e01367b 100644 --- a/frontend/web/src/components/FilterView.tsx +++ b/frontend/web/src/components/FilterView.tsx @@ -1,6 +1,5 @@ import { useTranslation } from "react-i18next"; import { useViewStore } from "@/stores"; -import { convertVisibilityFromPb } from "@/utils/visibility"; import Icon from "./Icon"; import VisibilityIcon from "./VisibilityIcon"; @@ -33,7 +32,7 @@ const FilterView = () => { onClick={() => viewStore.setFilter({ visibility: undefined })} > - {t(`shortcut.visibility.${convertVisibilityFromPb(filter.visibility).toLowerCase()}.self`)} + {t(`shortcut.visibility.${filter.visibility.toLowerCase()}.self`)} )} diff --git a/frontend/web/src/components/ShortcutCard.tsx b/frontend/web/src/components/ShortcutCard.tsx index 2a8451f..1253e87 100644 --- a/frontend/web/src/components/ShortcutCard.tsx +++ b/frontend/web/src/components/ShortcutCard.tsx @@ -8,7 +8,6 @@ import { Link } from "react-router-dom"; import { absolutifyLink } from "@/helpers/utils"; import { useUserStore, useViewStore } from "@/stores"; import { Shortcut } from "@/types/proto/api/v1/shortcut_service"; -import { convertVisibilityFromPb } from "@/utils/visibility"; import Icon from "./Icon"; import LinkFavicon from "./LinkFavicon"; import ShortcutActionsDropdown from "./ShortcutActionsDropdown"; @@ -117,18 +116,13 @@ const ShortcutCard = (props: Props) => { alt={creator.nickname.toUpperCase()} > - +
viewStore.setFilter({ visibility: shortcut.visibility })} > - {t(`shortcut.visibility.${convertVisibilityFromPb(shortcut.visibility).toLowerCase()}.self`)} + {t(`shortcut.visibility.${shortcut.visibility.toLowerCase()}.self`)}
diff --git a/frontend/web/src/components/VisibilityIcon.tsx b/frontend/web/src/components/VisibilityIcon.tsx index e0f83ac..df25e4b 100644 --- a/frontend/web/src/components/VisibilityIcon.tsx +++ b/frontend/web/src/components/VisibilityIcon.tsx @@ -8,9 +8,7 @@ interface Props { const VisibilityIcon = (props: Props) => { const { visibility, className } = props; - if (visibility === Visibility.PRIVATE) { - return ; - } else if (visibility === Visibility.WORKSPACE) { + if (visibility === Visibility.WORKSPACE) { return ; } else if (visibility === Visibility.PUBLIC) { return ; diff --git a/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx b/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx index af67c0b..11db370 100644 --- a/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx +++ b/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx @@ -135,7 +135,6 @@ const WorkspaceGeneralSettingSection = () => { defaultValue={getDefaultVisibility(workspaceSetting.defaultVisibility)} onChange={(_, value) => handleDefaultVisibilityChange(value as Visibility)} > - diff --git a/frontend/web/src/components/setting/WorkspaceMembersSection.tsx b/frontend/web/src/components/setting/WorkspaceMembersSection.tsx index 109fcb6..87d311a 100644 --- a/frontend/web/src/components/setting/WorkspaceMembersSection.tsx +++ b/frontend/web/src/components/setting/WorkspaceMembersSection.tsx @@ -7,7 +7,6 @@ import CreateUserDialog from "@/components/CreateUserDialog"; import Icon from "@/components/Icon"; import { useUserStore } from "@/stores"; import { User } from "@/types/proto/api/v1/user_service"; -import { convertRoleFromPb } from "@/utils/user"; const WorkspaceMembersSection = () => { const { t } = useTranslation(); @@ -83,7 +82,7 @@ const WorkspaceMembersSection = () => { {user.nickname} {user.email} - {convertRoleFromPb(user.role)} + {user.role} { {creator.nickname} - +
- {t(`shortcut.visibility.${convertVisibilityFromPb(shortcut.visibility).toLowerCase()}.self`)} + {t(`shortcut.visibility.${shortcut.visibility.toLowerCase()}.self`)}
diff --git a/frontend/web/src/utils/user.ts b/frontend/web/src/utils/user.ts deleted file mode 100644 index 2e2a41d..0000000 --- a/frontend/web/src/utils/user.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { Role } from "@/types/proto/api/v1/user_service"; - -export const convertRoleFromPb = (role: Role): string => { - if (role === Role.ADMIN) { - return "Admin"; - } else if (role === Role.USER) { - return "User"; - } else { - return "Unknown"; - } -}; diff --git a/frontend/web/src/utils/visibility.ts b/frontend/web/src/utils/visibility.ts deleted file mode 100644 index 91735fc..0000000 --- a/frontend/web/src/utils/visibility.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Visibility } from "@/types/proto/api/v1/common"; - -export const convertVisibilityFromPb = (visibility: Visibility): string => { - if (visibility === Visibility.PRIVATE) { - return "PRIVATE"; - } else if (visibility === Visibility.WORKSPACE) { - return "WORKSPACE"; - } else if (visibility === Visibility.PUBLIC) { - return "PUBLIC"; - } else { - return "PRIVATE"; - } -}; diff --git a/proto/api/v1/common.proto b/proto/api/v1/common.proto index edddf61..0507346 100644 --- a/proto/api/v1/common.proto +++ b/proto/api/v1/common.proto @@ -4,6 +4,13 @@ package slash.api.v1; option go_package = "gen/api/v1"; +enum State { + STATE_UNSPECIFIED = 0; + ACTIVE = 1; + INACTIVE = 2; +} + +// deprecated enum RowStatus { ROW_STATUS_UNSPECIFIED = 0; NORMAL = 1; @@ -12,7 +19,10 @@ enum RowStatus { enum Visibility { VISIBILITY_UNSPECIFIED = 0; - PRIVATE = 1; + + PRIVATE = 1 [deprecated = true]; + WORKSPACE = 2; + PUBLIC = 3; } diff --git a/proto/api/v1/shortcut_service.proto b/proto/api/v1/shortcut_service.proto index e778655..97eed76 100644 --- a/proto/api/v1/shortcut_service.proto +++ b/proto/api/v1/shortcut_service.proto @@ -59,8 +59,6 @@ message Shortcut { google.protobuf.Timestamp updated_time = 4; - RowStatus row_status = 5; - string name = 6; string link = 7; diff --git a/proto/api/v1/user_service.proto b/proto/api/v1/user_service.proto index b725bbb..18c0b08 100644 --- a/proto/api/v1/user_service.proto +++ b/proto/api/v1/user_service.proto @@ -63,7 +63,7 @@ service UserService { message User { int32 id = 1; - RowStatus row_status = 2; + State state = 2; google.protobuf.Timestamp created_time = 3; diff --git a/proto/gen/api/v1/README.md b/proto/gen/api/v1/README.md index 7f204ac..42c5c15 100644 --- a/proto/gen/api/v1/README.md +++ b/proto/gen/api/v1/README.md @@ -5,6 +5,7 @@ - [api/v1/common.proto](#api_v1_common-proto) - [RowStatus](#slash-api-v1-RowStatus) + - [State](#slash-api-v1-State) - [Visibility](#slash-api-v1-Visibility) - [api/v1/user_service.proto](#api_v1_user_service-proto) @@ -113,7 +114,7 @@ ### RowStatus - +deprecated | Name | Number | Description | | ---- | ------ | ----------- | @@ -123,6 +124,19 @@ + + +### State + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| STATE_UNSPECIFIED | 0 | | +| ACTIVE | 1 | | +| INACTIVE | 2 | | + + + ### Visibility @@ -309,7 +323,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [int32](#int32) | | | -| row_status | [RowStatus](#slash-api-v1-RowStatus) | | | +| state | [State](#slash-api-v1-State) | | | | created_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | updated_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | role | [Role](#slash-api-v1-Role) | | | @@ -786,7 +800,6 @@ | creator_id | [int32](#int32) | | | | created_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | | updated_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | | -| row_status | [RowStatus](#slash-api-v1-RowStatus) | | | | name | [string](#string) | | | | link | [string](#string) | | | | title | [string](#string) | | | diff --git a/proto/gen/api/v1/common.pb.go b/proto/gen/api/v1/common.pb.go index a985318..946ea92 100644 --- a/proto/gen/api/v1/common.pb.go +++ b/proto/gen/api/v1/common.pb.go @@ -20,6 +20,56 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +type State int32 + +const ( + State_STATE_UNSPECIFIED State = 0 + State_ACTIVE State = 1 + State_INACTIVE State = 2 +) + +// Enum value maps for State. +var ( + State_name = map[int32]string{ + 0: "STATE_UNSPECIFIED", + 1: "ACTIVE", + 2: "INACTIVE", + } + State_value = map[string]int32{ + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2, + } +) + +func (x State) Enum() *State { + p := new(State) + *p = x + return p +} + +func (x State) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (State) Descriptor() protoreflect.EnumDescriptor { + return file_api_v1_common_proto_enumTypes[0].Descriptor() +} + +func (State) Type() protoreflect.EnumType { + return &file_api_v1_common_proto_enumTypes[0] +} + +func (x State) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use State.Descriptor instead. +func (State) EnumDescriptor() ([]byte, []int) { + return file_api_v1_common_proto_rawDescGZIP(), []int{0} +} + +// deprecated type RowStatus int32 const ( @@ -53,11 +103,11 @@ func (x RowStatus) String() string { } func (RowStatus) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_common_proto_enumTypes[0].Descriptor() + return file_api_v1_common_proto_enumTypes[1].Descriptor() } func (RowStatus) Type() protoreflect.EnumType { - return &file_api_v1_common_proto_enumTypes[0] + return &file_api_v1_common_proto_enumTypes[1] } func (x RowStatus) Number() protoreflect.EnumNumber { @@ -66,16 +116,17 @@ func (x RowStatus) Number() protoreflect.EnumNumber { // Deprecated: Use RowStatus.Descriptor instead. func (RowStatus) EnumDescriptor() ([]byte, []int) { - return file_api_v1_common_proto_rawDescGZIP(), []int{0} + return file_api_v1_common_proto_rawDescGZIP(), []int{1} } type Visibility int32 const ( Visibility_VISIBILITY_UNSPECIFIED Visibility = 0 - Visibility_PRIVATE Visibility = 1 - Visibility_WORKSPACE Visibility = 2 - Visibility_PUBLIC Visibility = 3 + // Deprecated: Marked as deprecated in api/v1/common.proto. + Visibility_PRIVATE Visibility = 1 + Visibility_WORKSPACE Visibility = 2 + Visibility_PUBLIC Visibility = 3 ) // Enum value maps for Visibility. @@ -105,11 +156,11 @@ func (x Visibility) String() string { } func (Visibility) Descriptor() protoreflect.EnumDescriptor { - return file_api_v1_common_proto_enumTypes[1].Descriptor() + return file_api_v1_common_proto_enumTypes[2].Descriptor() } func (Visibility) Type() protoreflect.EnumType { - return &file_api_v1_common_proto_enumTypes[1] + return &file_api_v1_common_proto_enumTypes[2] } func (x Visibility) Number() protoreflect.EnumNumber { @@ -118,7 +169,7 @@ func (x Visibility) Number() protoreflect.EnumNumber { // Deprecated: Use Visibility.Descriptor instead. func (Visibility) EnumDescriptor() ([]byte, []int) { - return file_api_v1_common_proto_rawDescGZIP(), []int{1} + return file_api_v1_common_proto_rawDescGZIP(), []int{2} } var File_api_v1_common_proto protoreflect.FileDescriptor @@ -126,27 +177,31 @@ var File_api_v1_common_proto protoreflect.FileDescriptor var file_api_v1_common_proto_rawDesc = []byte{ 0x0a, 0x13, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2a, 0x41, 0x0a, 0x09, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x4f, 0x57, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, - 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, - 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, - 0x49, 0x56, 0x45, 0x44, 0x10, 0x02, 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, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, - 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, - 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, - 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, - 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, - 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, - 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 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, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2e, 0x76, 0x31, 0x2a, 0x38, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, + 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, + 0x0c, 0x0a, 0x08, 0x49, 0x4e, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x02, 0x2a, 0x41, 0x0a, + 0x09, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x4f, + 0x57, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, + 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45, 0x44, 0x10, 0x02, + 0x2a, 0x54, 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, 0x0f, 0x0a, 0x07, 0x50, 0x52, + 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x01, 0x1a, 0x02, 0x08, 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, 0x42, 0xa9, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x43, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, + 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, + 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, + 0x70, 0x69, 0x5c, 0x56, 0x31, 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, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -161,10 +216,11 @@ func file_api_v1_common_proto_rawDescGZIP() []byte { return file_api_v1_common_proto_rawDescData } -var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_api_v1_common_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_api_v1_common_proto_goTypes = []any{ - (RowStatus)(0), // 0: slash.api.v1.RowStatus - (Visibility)(0), // 1: slash.api.v1.Visibility + (State)(0), // 0: slash.api.v1.State + (RowStatus)(0), // 1: slash.api.v1.RowStatus + (Visibility)(0), // 2: slash.api.v1.Visibility } var file_api_v1_common_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -184,7 +240,7 @@ func file_api_v1_common_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v1_common_proto_rawDesc, - NumEnums: 2, + NumEnums: 3, NumMessages: 0, NumExtensions: 0, NumServices: 0, diff --git a/proto/gen/api/v1/shortcut_service.pb.go b/proto/gen/api/v1/shortcut_service.pb.go index f0343ef..90dbd12 100644 --- a/proto/gen/api/v1/shortcut_service.pb.go +++ b/proto/gen/api/v1/shortcut_service.pb.go @@ -33,7 +33,6 @@ type Shortcut struct { CreatorId int32 `protobuf:"varint,2,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` CreatedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"` - RowStatus RowStatus `protobuf:"varint,5,opt,name=row_status,json=rowStatus,proto3,enum=slash.api.v1.RowStatus" json:"row_status,omitempty"` Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` Link string `protobuf:"bytes,7,opt,name=link,proto3" json:"link,omitempty"` Title string `protobuf:"bytes,8,opt,name=title,proto3" json:"title,omitempty"` @@ -104,13 +103,6 @@ func (x *Shortcut) GetUpdatedTime() *timestamppb.Timestamp { return nil } -func (x *Shortcut) GetRowStatus() RowStatus { - if x != nil { - return x.RowStatus - } - return RowStatus_ROW_STATUS_UNSPECIFIED -} - func (x *Shortcut) GetName() string { if x != nil { return x.Name @@ -739,7 +731,7 @@ var file_api_v1_shortcut_service_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x04, 0x0a, 0x08, 0x53, 0x68, + 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x04, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, @@ -751,153 +743,150 @@ var file_api_v1_shortcut_service_proto_rawDesc = []byte{ 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, - 0x69, 0x6d, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x52, 0x09, 0x72, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, - 0x69, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, - 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x20, 0x0a, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x69, 0x65, - 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x76, - 0x69, 0x65, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x49, 0x0a, 0x0b, 0x6f, 0x67, 0x5f, 0x6d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, - 0x72, 0x74, 0x63, 0x75, 0x74, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x6f, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0x1a, 0x61, 0x0a, 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 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, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, - 0x75, 0x74, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x22, 0x24, 0x0a, - 0x12, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, - 0x75, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x4b, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, - 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x31, 0x2e, 0x53, 0x68, - 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, - 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, - 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 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, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, - 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x3b, - 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x27, 0x0a, 0x15, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x02, 0x69, 0x64, 0x22, 0x2d, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, - 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x02, 0x69, 0x64, 0x22, 0xdd, 0x02, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, - 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, - 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, - 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, - 0x65, 0x6d, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x52, - 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, - 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, - 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x61, 0x6c, - 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, - 0x65, 0x73, 0x12, 0x54, 0x0a, 0x08, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x73, 0x18, 0x03, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, - 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, - 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x73, 0x1a, 0x39, 0x0a, 0x0d, 0x41, 0x6e, 0x61, 0x6c, - 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x32, 0xec, 0x06, 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, 0x31, 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, 0x31, 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, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0x6c, 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, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, - 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, - 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x23, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, - 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x55, 0x0a, 0x11, 0x47, 0x65, - 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x69, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, + 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, + 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x76, 0x69, 0x65, 0x77, 0x43, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x49, 0x0a, 0x0b, 0x6f, 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, + 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x2e, 0x4f, 0x70, + 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, + 0x0a, 0x6f, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x61, 0x0a, 0x11, 0x4f, + 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 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, + 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72, + 0x74, 0x63, 0x75, 0x74, 0x73, 0x22, 0x24, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, + 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, - 0x00, 0x12, 0x72, 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, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, - 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, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, - 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0x97, 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 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, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, - 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, - 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x48, 0xda, 0x41, 0x14, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, - 0x75, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x08, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x1a, 0x1f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, - 0x73, 0x2f, 0x7b, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x2e, 0x69, 0x64, 0x7d, 0x12, - 0x72, 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, 0x31, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, - 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, - 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x12, 0x29, 0x2e, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, - 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 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, 0x4b, 0x0a, 0x15, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 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, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, + 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x88, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 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, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x08, 0x73, 0x68, + 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, + 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, + 0x61, 0x73, 0x6b, 0x22, 0x27, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x6f, + 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2d, 0x0a, 0x1b, + 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, + 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0xdd, 0x02, 0x0a, 0x1c, + 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, + 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0a, + 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, + 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x61, + 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x0a, 0x72, 0x65, 0x66, 0x65, + 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, - 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, - 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, - 0x63, 0x73, 0x42, 0xb2, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 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, - 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, - 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 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, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, + 0x6d, 0x52, 0x07, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x54, 0x0a, 0x08, 0x62, 0x72, + 0x6f, 0x77, 0x73, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x38, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, + 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, + 0x63, 0x73, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08, 0x62, 0x72, 0x6f, 0x77, 0x73, 0x65, 0x72, 0x73, + 0x1a, 0x39, 0x0a, 0x0d, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x49, 0x74, 0x65, + 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xec, 0x06, 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, 0x31, 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, 0x31, 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, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, + 0x63, 0x75, 0x74, 0x73, 0x12, 0x6c, 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, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x23, 0xda, + 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x18, 0x12, 0x16, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, + 0x64, 0x7d, 0x12, 0x55, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, + 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, + 0x75, 0x74, 0x42, 0x79, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, + 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x00, 0x12, 0x72, 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, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 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, 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x12, 0x97, 0x01, + 0x0a, 0x0e, 0x55, 0x70, 0x64, 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, 0x31, 0x2e, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x22, 0x48, 0xda, + 0x41, 0x14, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2b, 0x3a, 0x08, 0x73, 0x68, + 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x1a, 0x1f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, + 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x73, 0x68, 0x6f, 0x72, 0x74, + 0x63, 0x75, 0x74, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x72, 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, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, + 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x18, 0x2a, 0x16, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x6f, + 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x14, + 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, + 0x74, 0x69, 0x63, 0x73, 0x12, 0x29, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, + 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, + 0x65, 0x74, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x41, 0x6e, 0x61, 0x6c, 0x79, 0x74, + 0x69, 0x63, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x02, + 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, + 0x31, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x2f, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x74, 0x69, 0x63, 0x73, 0x42, 0xb2, 0x01, 0x0a, 0x10, 0x63, + 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 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, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, + 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, + 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, + 0x69, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, + 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, + 0x56, 0x31, 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, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -927,43 +916,41 @@ var file_api_v1_shortcut_service_proto_goTypes = []any{ (*Shortcut_OpenGraphMetadata)(nil), // 10: slash.api.v1.Shortcut.OpenGraphMetadata (*GetShortcutAnalyticsResponse_AnalyticsItem)(nil), // 11: slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp - (RowStatus)(0), // 13: slash.api.v1.RowStatus - (Visibility)(0), // 14: slash.api.v1.Visibility - (*fieldmaskpb.FieldMask)(nil), // 15: google.protobuf.FieldMask - (*emptypb.Empty)(nil), // 16: google.protobuf.Empty + (Visibility)(0), // 13: slash.api.v1.Visibility + (*fieldmaskpb.FieldMask)(nil), // 14: google.protobuf.FieldMask + (*emptypb.Empty)(nil), // 15: google.protobuf.Empty } var file_api_v1_shortcut_service_proto_depIdxs = []int32{ 12, // 0: slash.api.v1.Shortcut.created_time:type_name -> google.protobuf.Timestamp 12, // 1: slash.api.v1.Shortcut.updated_time:type_name -> google.protobuf.Timestamp - 13, // 2: slash.api.v1.Shortcut.row_status:type_name -> slash.api.v1.RowStatus - 14, // 3: slash.api.v1.Shortcut.visibility:type_name -> slash.api.v1.Visibility - 10, // 4: slash.api.v1.Shortcut.og_metadata:type_name -> slash.api.v1.Shortcut.OpenGraphMetadata - 0, // 5: slash.api.v1.ListShortcutsResponse.shortcuts:type_name -> slash.api.v1.Shortcut - 0, // 6: slash.api.v1.CreateShortcutRequest.shortcut:type_name -> slash.api.v1.Shortcut - 0, // 7: slash.api.v1.UpdateShortcutRequest.shortcut:type_name -> slash.api.v1.Shortcut - 15, // 8: slash.api.v1.UpdateShortcutRequest.update_mask:type_name -> google.protobuf.FieldMask - 11, // 9: slash.api.v1.GetShortcutAnalyticsResponse.references:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem - 11, // 10: slash.api.v1.GetShortcutAnalyticsResponse.devices:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem - 11, // 11: slash.api.v1.GetShortcutAnalyticsResponse.browsers:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem - 1, // 12: slash.api.v1.ShortcutService.ListShortcuts:input_type -> slash.api.v1.ListShortcutsRequest - 3, // 13: slash.api.v1.ShortcutService.GetShortcut:input_type -> slash.api.v1.GetShortcutRequest - 4, // 14: slash.api.v1.ShortcutService.GetShortcutByName:input_type -> slash.api.v1.GetShortcutByNameRequest - 5, // 15: slash.api.v1.ShortcutService.CreateShortcut:input_type -> slash.api.v1.CreateShortcutRequest - 6, // 16: slash.api.v1.ShortcutService.UpdateShortcut:input_type -> slash.api.v1.UpdateShortcutRequest - 7, // 17: slash.api.v1.ShortcutService.DeleteShortcut:input_type -> slash.api.v1.DeleteShortcutRequest - 8, // 18: slash.api.v1.ShortcutService.GetShortcutAnalytics:input_type -> slash.api.v1.GetShortcutAnalyticsRequest - 2, // 19: slash.api.v1.ShortcutService.ListShortcuts:output_type -> slash.api.v1.ListShortcutsResponse - 0, // 20: slash.api.v1.ShortcutService.GetShortcut:output_type -> slash.api.v1.Shortcut - 0, // 21: slash.api.v1.ShortcutService.GetShortcutByName:output_type -> slash.api.v1.Shortcut - 0, // 22: slash.api.v1.ShortcutService.CreateShortcut:output_type -> slash.api.v1.Shortcut - 0, // 23: slash.api.v1.ShortcutService.UpdateShortcut:output_type -> slash.api.v1.Shortcut - 16, // 24: slash.api.v1.ShortcutService.DeleteShortcut:output_type -> google.protobuf.Empty - 9, // 25: slash.api.v1.ShortcutService.GetShortcutAnalytics:output_type -> slash.api.v1.GetShortcutAnalyticsResponse - 19, // [19:26] is the sub-list for method output_type - 12, // [12:19] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 13, // 2: slash.api.v1.Shortcut.visibility:type_name -> slash.api.v1.Visibility + 10, // 3: slash.api.v1.Shortcut.og_metadata:type_name -> slash.api.v1.Shortcut.OpenGraphMetadata + 0, // 4: slash.api.v1.ListShortcutsResponse.shortcuts:type_name -> slash.api.v1.Shortcut + 0, // 5: slash.api.v1.CreateShortcutRequest.shortcut:type_name -> slash.api.v1.Shortcut + 0, // 6: slash.api.v1.UpdateShortcutRequest.shortcut:type_name -> slash.api.v1.Shortcut + 14, // 7: slash.api.v1.UpdateShortcutRequest.update_mask:type_name -> google.protobuf.FieldMask + 11, // 8: slash.api.v1.GetShortcutAnalyticsResponse.references:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem + 11, // 9: slash.api.v1.GetShortcutAnalyticsResponse.devices:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem + 11, // 10: slash.api.v1.GetShortcutAnalyticsResponse.browsers:type_name -> slash.api.v1.GetShortcutAnalyticsResponse.AnalyticsItem + 1, // 11: slash.api.v1.ShortcutService.ListShortcuts:input_type -> slash.api.v1.ListShortcutsRequest + 3, // 12: slash.api.v1.ShortcutService.GetShortcut:input_type -> slash.api.v1.GetShortcutRequest + 4, // 13: slash.api.v1.ShortcutService.GetShortcutByName:input_type -> slash.api.v1.GetShortcutByNameRequest + 5, // 14: slash.api.v1.ShortcutService.CreateShortcut:input_type -> slash.api.v1.CreateShortcutRequest + 6, // 15: slash.api.v1.ShortcutService.UpdateShortcut:input_type -> slash.api.v1.UpdateShortcutRequest + 7, // 16: slash.api.v1.ShortcutService.DeleteShortcut:input_type -> slash.api.v1.DeleteShortcutRequest + 8, // 17: slash.api.v1.ShortcutService.GetShortcutAnalytics:input_type -> slash.api.v1.GetShortcutAnalyticsRequest + 2, // 18: slash.api.v1.ShortcutService.ListShortcuts:output_type -> slash.api.v1.ListShortcutsResponse + 0, // 19: slash.api.v1.ShortcutService.GetShortcut:output_type -> slash.api.v1.Shortcut + 0, // 20: slash.api.v1.ShortcutService.GetShortcutByName:output_type -> slash.api.v1.Shortcut + 0, // 21: slash.api.v1.ShortcutService.CreateShortcut:output_type -> slash.api.v1.Shortcut + 0, // 22: slash.api.v1.ShortcutService.UpdateShortcut:output_type -> slash.api.v1.Shortcut + 15, // 23: slash.api.v1.ShortcutService.DeleteShortcut:output_type -> google.protobuf.Empty + 9, // 24: slash.api.v1.ShortcutService.GetShortcutAnalytics:output_type -> slash.api.v1.GetShortcutAnalyticsResponse + 18, // [18:25] is the sub-list for method output_type + 11, // [11:18] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_api_v1_shortcut_service_proto_init() } diff --git a/proto/gen/api/v1/user_service.pb.go b/proto/gen/api/v1/user_service.pb.go index 3567f95..c408417 100644 --- a/proto/gen/api/v1/user_service.pb.go +++ b/proto/gen/api/v1/user_service.pb.go @@ -79,7 +79,7 @@ type User struct { unknownFields protoimpl.UnknownFields Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - RowStatus RowStatus `protobuf:"varint,2,opt,name=row_status,json=rowStatus,proto3,enum=slash.api.v1.RowStatus" json:"row_status,omitempty"` + State State `protobuf:"varint,2,opt,name=state,proto3,enum=slash.api.v1.State" json:"state,omitempty"` CreatedTime *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"` UpdatedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"` Role Role `protobuf:"varint,6,opt,name=role,proto3,enum=slash.api.v1.Role" json:"role,omitempty"` @@ -127,11 +127,11 @@ func (x *User) GetId() int32 { return 0 } -func (x *User) GetRowStatus() RowStatus { +func (x *User) GetState() State { if x != nil { - return x.RowStatus + return x.State } - return RowStatus_ROW_STATUS_UNSPECIFIED + return State_STATE_UNSPECIFIED } func (x *User) GetCreatedTime() *timestamppb.Timestamp { @@ -763,164 +763,163 @@ var file_api_v1_user_service_proto_rawDesc = []byte{ 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc2, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, - 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x36, - 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, 0x6f, 0x77, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, - 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x22, 0x20, 0x0a, - 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x3b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb5, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x29, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, + 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, + 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, + 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x12, 0x0a, + 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x3d, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, + 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x22, 0x3b, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, + 0x78, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x78, 0x0a, 0x11, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x26, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2d, 0x0a, 0x1b, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x62, 0x0a, 0x1c, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0d, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x9f, - 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x3e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, 0x88, 0x01, - 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, - 0x22, 0x51, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, - 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x09, - 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x69, 0x73, 0x73, - 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, - 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, 0x74, - 0x2a, 0x31, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f, 0x4c, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, - 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, - 0x52, 0x10, 0x02, 0x32, 0xf4, 0x07, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x5c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x14, 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, - 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x5e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, + 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2d, + 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x62, 0x0a, + 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, + 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x73, 0x22, 0x9f, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, + 0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, + 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x48, 0x00, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x41, + 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, + 0x5f, 0x61, 0x74, 0x22, 0x51, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xca, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x37, 0x0a, 0x09, 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, + 0x69, 0x73, 0x73, 0x75, 0x65, 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, + 0x72, 0x65, 0x73, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, + 0x73, 0x41, 0x74, 0x2a, 0x31, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, + 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, + 0x55, 0x53, 0x45, 0x52, 0x10, 0x02, 0x32, 0xf4, 0x07, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x63, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, + 0x65, 0x72, 0x73, 0x12, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12, 0x0d, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x5c, 0x0a, 0x07, 0x47, + 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, + 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x5e, 0x0a, 0x0a, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1b, 0x82, 0xd3, + 0xe4, 0x93, 0x02, 0x15, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x7b, 0x0a, 0x0a, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x38, 0xda, 0x41, + 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, + 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x17, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, + 0x65, 0x72, 0x2e, 0x69, 0x64, 0x7d, 0x12, 0x66, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x15, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x0d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x7b, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x38, 0xda, 0x41, 0x10, 0x75, 0x73, - 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x17, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, - 0x69, 0x64, 0x7d, 0x12, 0x66, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1f, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1f, 0xda, 0x41, 0x02, 0x69, - 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, - 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9c, 0x01, 0x0a, 0x14, - 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, - 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0xda, 0x41, 0x02, - 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, - 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x15, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, - 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, - 0x30, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, - 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, - 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, - 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, - 0x49, 0xda, 0x41, 0x0f, 0x69, 0x64, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, - 0x6b, 0x65, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x2a, 0x2f, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, 0x61, 0x63, 0x63, - 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xae, 0x01, 0x0a, 0x10, 0x63, - 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x42, - 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x53, 0x41, - 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 0xe2, - 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x31, 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, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1f, 0xda, + 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x9c, + 0x01, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, + 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x12, 0x20, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x94, 0x01, + 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x30, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, + 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, + 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x12, 0xa6, 0x01, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x2a, + 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x22, 0x49, 0xda, 0x41, 0x0f, 0x69, 0x64, 0x2c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, + 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x2a, 0x2f, 0x2f, 0x61, + 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, + 0x2f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x2f, 0x7b, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x7d, 0x42, 0xae, 0x01, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x31, 0x42, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, + 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, + 0x56, 0x31, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x31, 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, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -951,13 +950,13 @@ var file_api_v1_user_service_proto_goTypes = []any{ (*CreateUserAccessTokenRequest)(nil), // 10: slash.api.v1.CreateUserAccessTokenRequest (*DeleteUserAccessTokenRequest)(nil), // 11: slash.api.v1.DeleteUserAccessTokenRequest (*UserAccessToken)(nil), // 12: slash.api.v1.UserAccessToken - (RowStatus)(0), // 13: slash.api.v1.RowStatus + (State)(0), // 13: slash.api.v1.State (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp (*fieldmaskpb.FieldMask)(nil), // 15: google.protobuf.FieldMask (*emptypb.Empty)(nil), // 16: google.protobuf.Empty } var file_api_v1_user_service_proto_depIdxs = []int32{ - 13, // 0: slash.api.v1.User.row_status:type_name -> slash.api.v1.RowStatus + 13, // 0: slash.api.v1.User.state:type_name -> slash.api.v1.State 14, // 1: slash.api.v1.User.created_time:type_name -> google.protobuf.Timestamp 14, // 2: slash.api.v1.User.updated_time:type_name -> google.protobuf.Timestamp 0, // 3: slash.api.v1.User.role:type_name -> slash.api.v1.Role diff --git a/proto/gen/apidocs.swagger.yaml b/proto/gen/apidocs.swagger.yaml index e4af724..c332ad5 100644 --- a/proto/gen/apidocs.swagger.yaml +++ b/proto/gen/apidocs.swagger.yaml @@ -391,8 +391,6 @@ paths: updatedTime: type: string format: date-time - rowStatus: - $ref: '#/definitions/apiv1RowStatus' name: type: string link: @@ -644,8 +642,8 @@ paths: schema: type: object properties: - rowStatus: - $ref: '#/definitions/apiv1RowStatus' + state: + $ref: '#/definitions/v1State' createdTime: type: string format: date-time @@ -857,13 +855,6 @@ definitions: - TYPE_UNSPECIFIED - OAUTH2 default: TYPE_UNSPECIFIED - apiv1RowStatus: - type: string - enum: - - ROW_STATUS_UNSPECIFIED - - NORMAL - - ARCHIVED - default: ROW_STATUS_UNSPECIFIED apiv1Shortcut: type: object properties: @@ -879,8 +870,6 @@ definitions: updatedTime: type: string format: date-time - rowStatus: - $ref: '#/definitions/apiv1RowStatus' name: type: string link: @@ -1064,6 +1053,13 @@ definitions: type: string image: type: string + v1State: + type: string + enum: + - STATE_UNSPECIFIED + - ACTIVE + - INACTIVE + default: STATE_UNSPECIFIED v1Subscription: type: object properties: @@ -1108,8 +1104,8 @@ definitions: id: type: integer format: int32 - rowStatus: - $ref: '#/definitions/apiv1RowStatus' + state: + $ref: '#/definitions/v1State' createdTime: type: string format: date-time diff --git a/proto/gen/store/README.md b/proto/gen/store/README.md index 286507d..498b1f7 100644 --- a/proto/gen/store/README.md +++ b/proto/gen/store/README.md @@ -126,9 +126,8 @@ | Name | Number | Description | | ---- | ------ | ----------- | | VISIBILITY_UNSPECIFIED | 0 | | -| PRIVATE | 1 | | -| WORKSPACE | 2 | | -| PUBLIC | 3 | | +| WORKSPACE | 1 | | +| PUBLIC | 2 | | @@ -312,7 +311,6 @@ | creator_id | [int32](#int32) | | | | created_ts | [int64](#int64) | | | | updated_ts | [int64](#int64) | | | -| row_status | [RowStatus](#slash-store-RowStatus) | | | | name | [string](#string) | | | | link | [string](#string) | | | | title | [string](#string) | | | diff --git a/proto/gen/store/common.pb.go b/proto/gen/store/common.pb.go index a4ca3cc..940b5d0 100644 --- a/proto/gen/store/common.pb.go +++ b/proto/gen/store/common.pb.go @@ -73,24 +73,21 @@ type Visibility int32 const ( Visibility_VISIBILITY_UNSPECIFIED Visibility = 0 - Visibility_PRIVATE Visibility = 1 - Visibility_WORKSPACE Visibility = 2 - Visibility_PUBLIC Visibility = 3 + Visibility_WORKSPACE Visibility = 1 + Visibility_PUBLIC Visibility = 2 ) // Enum value maps for Visibility. var ( Visibility_name = map[int32]string{ 0: "VISIBILITY_UNSPECIFIED", - 1: "PRIVATE", - 2: "WORKSPACE", - 3: "PUBLIC", + 1: "WORKSPACE", + 2: "PUBLIC", } Visibility_value = map[string]int32{ "VISIBILITY_UNSPECIFIED": 0, - "PRIVATE": 1, - "WORKSPACE": 2, - "PUBLIC": 3, + "WORKSPACE": 1, + "PUBLIC": 2, } ) @@ -130,22 +127,21 @@ var file_store_common_proto_rawDesc = []byte{ 0x0a, 0x16, 0x52, 0x4f, 0x57, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, - 0x45, 0x44, 0x10, 0x02, 0x2a, 0x50, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, + 0x45, 0x44, 0x10, 0x02, 0x2a, 0x43, 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, 0x42, 0x9c, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, - 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, - 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, - 0xaa, 0x02, 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, - 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x53, - 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, - 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, + 0x0a, 0x09, 0x57, 0x4f, 0x52, 0x4b, 0x53, 0x50, 0x41, 0x43, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, + 0x06, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x02, 0x42, 0x9c, 0x01, 0x0a, 0x0f, 0x63, 0x6f, + 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x0b, 0x43, + 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, + 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, + 0x53, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0xca, 0x02, 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, + 0x02, 0x17, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, + 0x68, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/gen/store/shortcut.pb.go b/proto/gen/store/shortcut.pb.go index 8667110..4c4b7fa 100644 --- a/proto/gen/store/shortcut.pb.go +++ b/proto/gen/store/shortcut.pb.go @@ -29,7 +29,6 @@ type Shortcut struct { CreatorId int32 `protobuf:"varint,2,opt,name=creator_id,json=creatorId,proto3" json:"creator_id,omitempty"` CreatedTs int64 `protobuf:"varint,3,opt,name=created_ts,json=createdTs,proto3" json:"created_ts,omitempty"` UpdatedTs int64 `protobuf:"varint,4,opt,name=updated_ts,json=updatedTs,proto3" json:"updated_ts,omitempty"` - RowStatus RowStatus `protobuf:"varint,5,opt,name=row_status,json=rowStatus,proto3,enum=slash.store.RowStatus" json:"row_status,omitempty"` Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` Link string `protobuf:"bytes,7,opt,name=link,proto3" json:"link,omitempty"` Title string `protobuf:"bytes,8,opt,name=title,proto3" json:"title,omitempty"` @@ -99,13 +98,6 @@ func (x *Shortcut) GetUpdatedTs() int64 { return 0 } -func (x *Shortcut) GetRowStatus() RowStatus { - if x != nil { - return x.RowStatus - } - return RowStatus_ROW_STATUS_UNSPECIFIED -} - func (x *Shortcut) GetName() string { if x != nil { return x.Name @@ -224,7 +216,7 @@ var file_store_shortcut_proto_rawDesc = []byte{ 0x0a, 0x14, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x12, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, - 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x03, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x72, + 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5, 0x02, 0x0a, 0x08, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, @@ -232,42 +224,38 @@ var file_store_shortcut_proto_rawDesc = []byte{ 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, - 0x73, 0x12, 0x35, 0x0a, 0x0a, 0x72, 0x6f, 0x77, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x2e, 0x52, 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x09, 0x72, - 0x6f, 0x77, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x09, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, 0x61, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0a, - 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x17, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, - 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, - 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x3f, 0x0a, 0x0b, 0x6f, 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x61, - 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, - 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0a, 0x6f, 0x67, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x61, 0x0a, 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, - 0x61, 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, - 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x42, 0x9e, 0x01, 0x0a, 0x0f, 0x63, 0x6f, - 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x0d, 0x53, - 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, - 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, - 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, - 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0xe2, 0x02, 0x17, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x69, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, + 0x6c, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x61, 0x67, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x61, 0x67, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, + 0x69, 0x74, 0x79, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x3f, + 0x0a, 0x0b, 0x6f, 0x67, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, + 0x65, 0x2e, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0x52, 0x0a, 0x6f, 0x67, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, + 0x61, 0x0a, 0x11, 0x4f, 0x70, 0x65, 0x6e, 0x47, 0x72, 0x61, 0x70, 0x68, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, + 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, + 0x69, 0x6d, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x42, 0x9e, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x0d, 0x53, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x75, 0x74, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x75, 0x72, 0x73, 0x65, 0x6c, 0x66, 0x68, 0x6f, 0x73, 0x74, + 0x65, 0x64, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, + 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -286,18 +274,16 @@ var file_store_shortcut_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_store_shortcut_proto_goTypes = []any{ (*Shortcut)(nil), // 0: slash.store.Shortcut (*OpenGraphMetadata)(nil), // 1: slash.store.OpenGraphMetadata - (RowStatus)(0), // 2: slash.store.RowStatus - (Visibility)(0), // 3: slash.store.Visibility + (Visibility)(0), // 2: slash.store.Visibility } var file_store_shortcut_proto_depIdxs = []int32{ - 2, // 0: slash.store.Shortcut.row_status:type_name -> slash.store.RowStatus - 3, // 1: slash.store.Shortcut.visibility:type_name -> slash.store.Visibility - 1, // 2: slash.store.Shortcut.og_metadata:type_name -> slash.store.OpenGraphMetadata - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 2, // 0: slash.store.Shortcut.visibility:type_name -> slash.store.Visibility + 1, // 1: slash.store.Shortcut.og_metadata:type_name -> slash.store.OpenGraphMetadata + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_store_shortcut_proto_init() } diff --git a/proto/store/common.proto b/proto/store/common.proto index e0704fe..d017bb3 100644 --- a/proto/store/common.proto +++ b/proto/store/common.proto @@ -15,9 +15,7 @@ enum RowStatus { enum Visibility { VISIBILITY_UNSPECIFIED = 0; - PRIVATE = 1; + WORKSPACE = 1; - WORKSPACE = 2; - - PUBLIC = 3; + PUBLIC = 2; } diff --git a/proto/store/shortcut.proto b/proto/store/shortcut.proto index 95e8eb8..62b226b 100644 --- a/proto/store/shortcut.proto +++ b/proto/store/shortcut.proto @@ -15,8 +15,6 @@ message Shortcut { int64 updated_ts = 4; - RowStatus row_status = 5; - string name = 6; string link = 7; diff --git a/server/route/api/v1/acl.go b/server/route/api/v1/acl.go index 2bcb9bb..08586fd 100644 --- a/server/route/api/v1/acl.go +++ b/server/route/api/v1/acl.go @@ -116,7 +116,7 @@ func (in *GRPCAuthInterceptor) authenticate(ctx context.Context, accessToken str if user == nil { return 0, status.Errorf(codes.Unauthenticated, "user ID %q not exists in the access token", userID) } - if user.RowStatus == store.Archived { + if user.RowStatus == storepb.RowStatus_ARCHIVED { return 0, status.Errorf(codes.Unauthenticated, "user ID %q has been deactivated by administrators", userID) } diff --git a/server/route/api/v1/auth_service.go b/server/route/api/v1/auth_service.go index c4c627c..d3959ec 100644 --- a/server/route/api/v1/auth_service.go +++ b/server/route/api/v1/auth_service.go @@ -28,7 +28,7 @@ const ( func (s *APIV1Service) GetAuthStatus(ctx context.Context, _ *v1pb.GetAuthStatusRequest) (*v1pb.User, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } if user == nil { return nil, status.Errorf(codes.Unauthenticated, "user not found") @@ -58,7 +58,7 @@ func (s *APIV1Service) SignIn(ctx context.Context, request *v1pb.SignInRequest) if workspaceSecuritySetting.DisallowPasswordAuth && user.Role == store.RoleUser { return nil, status.Errorf(codes.PermissionDenied, "password authentication is not allowed") } - if user.RowStatus == store.Archived { + if user.RowStatus == storepb.RowStatus_ARCHIVED { return nil, status.Errorf(codes.PermissionDenied, fmt.Sprintf("user has been archived with email %s", request.Email)) } @@ -143,7 +143,7 @@ func (s *APIV1Service) SignInWithSSO(ctx context.Context, request *v1pb.SignInWi return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to create user, err: %s", err)) } } - if user.RowStatus == store.Archived { + if user.RowStatus == storepb.RowStatus_ARCHIVED { return nil, status.Errorf(codes.PermissionDenied, fmt.Sprintf("user has been archived with email %s", email)) } diff --git a/server/route/api/v1/collection_service.go b/server/route/api/v1/collection_service.go index 2e03005..a53fc8a 100644 --- a/server/route/api/v1/collection_service.go +++ b/server/route/api/v1/collection_service.go @@ -16,31 +16,11 @@ import ( ) func (s *APIV1Service) ListCollections(ctx context.Context, _ *v1pb.ListCollectionsRequest) (*v1pb.ListCollectionsResponse, error) { - user, err := getCurrentUser(ctx, s.Store) - if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) - } - collections, err := s.Store.ListCollections(ctx, &store.FindCollection{ - CreatorID: &user.ID, - VisibilityList: []store.Visibility{ - store.VisibilityPrivate, - }, - }) + collections, err := s.Store.ListCollections(ctx, &store.FindCollection{}) if err != nil { return nil, status.Errorf(codes.Internal, "failed to get collection list, err: %v", err) } - sharedCollections, err := s.Store.ListCollections(ctx, &store.FindCollection{ - VisibilityList: []store.Visibility{ - store.VisibilityWorkspace, - store.VisibilityPublic, - }, - }) - if err != nil { - return nil, status.Errorf(codes.Internal, "failed to get collection list, err: %v", err) - } - collections = append(collections, sharedCollections...) - convertedCollections := []*v1pb.Collection{} for _, collection := range collections { convertedCollections = append(convertedCollections, convertCollectionFromStore(collection)) @@ -65,9 +45,9 @@ func (s *APIV1Service) GetCollection(ctx context.Context, request *v1pb.GetColle user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } - if collection.Visibility == storepb.Visibility_PRIVATE && collection.CreatorId != user.ID { + if user == nil && collection.Visibility != storepb.Visibility_PUBLIC { return nil, status.Errorf(codes.PermissionDenied, "Permission denied") } return convertCollectionFromStore(collection), nil @@ -84,15 +64,12 @@ func (s *APIV1Service) GetCollectionByName(ctx context.Context, request *v1pb.Ge return nil, status.Errorf(codes.NotFound, "collection not found") } - userID, ok := ctx.Value(userIDContextKey).(int32) - if ok { - if collection.Visibility == storepb.Visibility_PRIVATE && collection.CreatorId != userID { - return nil, status.Errorf(codes.PermissionDenied, "Permission denied") - } - } else { - if collection.Visibility != storepb.Visibility_PUBLIC { - return nil, status.Errorf(codes.PermissionDenied, "Permission denied") - } + user, err := getCurrentUser(ctx, s.Store) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) + } + if user == nil && collection.Visibility != storepb.Visibility_PUBLIC { + return nil, status.Errorf(codes.PermissionDenied, "Permission denied") } return convertCollectionFromStore(collection), nil } @@ -115,7 +92,7 @@ func (s *APIV1Service) CreateCollection(ctx context.Context, request *v1pb.Creat user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } collectionCreate := &storepb.Collection{ CreatorId: user.ID, @@ -123,7 +100,7 @@ func (s *APIV1Service) CreateCollection(ctx context.Context, request *v1pb.Creat Title: request.Collection.Title, Description: request.Collection.Description, ShortcutIds: request.Collection.ShortcutIds, - Visibility: storepb.Visibility(request.Collection.Visibility), + Visibility: convertVisibilityToStorepb(request.Collection.Visibility), } collection, err := s.Store.CreateCollection(ctx, collectionCreate) if err != nil { @@ -140,7 +117,7 @@ func (s *APIV1Service) UpdateCollection(ctx context.Context, request *v1pb.Updat user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } collection, err := s.Store.GetCollection(ctx, &store.FindCollection{ ID: &request.Collection.Id, @@ -169,7 +146,7 @@ func (s *APIV1Service) UpdateCollection(ctx context.Context, request *v1pb.Updat case "shortcut_ids": update.ShortcutIDs = request.Collection.ShortcutIds case "visibility": - visibility := store.Visibility(request.Collection.Visibility.String()) + visibility := convertVisibilityToStorepb(request.Collection.Visibility) update.Visibility = &visibility } } @@ -184,7 +161,7 @@ func (s *APIV1Service) UpdateCollection(ctx context.Context, request *v1pb.Updat func (s *APIV1Service) DeleteCollection(ctx context.Context, request *v1pb.DeleteCollectionRequest) (*emptypb.Empty, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } collection, err := s.Store.GetCollection(ctx, &store.FindCollection{ ID: &request.Id, @@ -218,6 +195,6 @@ func convertCollectionFromStore(collection *storepb.Collection) *v1pb.Collection Title: collection.Title, Description: collection.Description, ShortcutIds: collection.ShortcutIds, - Visibility: v1pb.Visibility(collection.Visibility), + Visibility: convertVisibilityFromStorepb(collection.Visibility), } } diff --git a/server/route/api/v1/common.go b/server/route/api/v1/common.go index 99a05ef..d7f130e 100644 --- a/server/route/api/v1/common.go +++ b/server/route/api/v1/common.go @@ -4,20 +4,10 @@ import ( "context" v1pb "github.com/yourselfhosted/slash/proto/gen/api/v1" + storepb "github.com/yourselfhosted/slash/proto/gen/store" "github.com/yourselfhosted/slash/store" ) -func convertRowStatusFromStore(rowStatus store.RowStatus) v1pb.RowStatus { - switch rowStatus { - case store.Normal: - return v1pb.RowStatus_NORMAL - case store.Archived: - return v1pb.RowStatus_ARCHIVED - default: - return v1pb.RowStatus_ROW_STATUS_UNSPECIFIED - } -} - func getCurrentUser(ctx context.Context, s *store.Store) (*store.User, error) { userID, ok := ctx.Value(userIDContextKey).(int32) if !ok { @@ -31,3 +21,48 @@ func getCurrentUser(ctx context.Context, s *store.Store) (*store.User, error) { } return user, nil } + +func convertStateFromRowStatus(rowStatus storepb.RowStatus) v1pb.State { + switch rowStatus { + case storepb.RowStatus_NORMAL: + return v1pb.State_ACTIVE + case storepb.RowStatus_ARCHIVED: + return v1pb.State_INACTIVE + default: + return v1pb.State_STATE_UNSPECIFIED + } +} + +// ConvertStateToRowStatus converts a v1pb.State to a storepb.RowStatus. +func ConvertStateToRowStatus(state v1pb.State) storepb.RowStatus { + switch state { + case v1pb.State_ACTIVE: + return storepb.RowStatus_NORMAL + case v1pb.State_INACTIVE: + return storepb.RowStatus_ARCHIVED + default: + return storepb.RowStatus_ROW_STATUS_UNSPECIFIED + } +} + +func convertVisibilityFromStorepb(visibility storepb.Visibility) v1pb.Visibility { + switch visibility { + case storepb.Visibility_WORKSPACE: + return v1pb.Visibility_WORKSPACE + case storepb.Visibility_PUBLIC: + return v1pb.Visibility_PUBLIC + default: + return v1pb.Visibility_VISIBILITY_UNSPECIFIED + } +} + +func convertVisibilityToStorepb(visibility v1pb.Visibility) storepb.Visibility { + switch visibility { + case v1pb.Visibility_PRIVATE, v1pb.Visibility_WORKSPACE: + return storepb.Visibility_WORKSPACE + case v1pb.Visibility_PUBLIC: + return storepb.Visibility_PUBLIC + default: + return storepb.Visibility_VISIBILITY_UNSPECIFIED + } +} diff --git a/server/route/api/v1/shortcut_service.go b/server/route/api/v1/shortcut_service.go index 63c79bd..9562793 100644 --- a/server/route/api/v1/shortcut_service.go +++ b/server/route/api/v1/shortcut_service.go @@ -22,36 +22,22 @@ import ( ) func (s *APIV1Service) ListShortcuts(ctx context.Context, _ *v1pb.ListShortcutsRequest) (*v1pb.ListShortcutsResponse, error) { - user, err := getCurrentUser(ctx, s.Store) + shortcutList, err := s.Store.ListShortcuts(ctx, &store.FindShortcut{}) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) - } - 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) + return nil, status.Errorf(codes.Internal, "failed to list shortcuts, err: %v", err) } - find.VisibilityList = []store.Visibility{store.VisibilityPrivate} - find.CreatorID = &user.ID - 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 := []*v1pb.Shortcut{} + shortcutMessageList := []*v1pb.Shortcut{} for _, shortcut := range shortcutList { composedShortcut, err := s.convertShortcutFromStorepb(ctx, shortcut) if err != nil { return nil, status.Errorf(codes.Internal, "failed to convert shortcut, err: %v", err) } - shortcuts = append(shortcuts, composedShortcut) + shortcutMessageList = append(shortcutMessageList, composedShortcut) } response := &v1pb.ListShortcutsResponse{ - Shortcuts: shortcuts, + Shortcuts: shortcutMessageList, } return response, nil } @@ -67,15 +53,12 @@ func (s *APIV1Service) GetShortcut(ctx context.Context, request *v1pb.GetShortcu return nil, status.Errorf(codes.NotFound, "shortcut not found") } - userID, ok := ctx.Value(userIDContextKey).(int32) - if ok { - if shortcut.Visibility == storepb.Visibility_PRIVATE && shortcut.CreatorId != userID { - return nil, status.Errorf(codes.PermissionDenied, "Permission denied") - } - } else { - if shortcut.Visibility != storepb.Visibility_PUBLIC { - return nil, status.Errorf(codes.PermissionDenied, "Permission denied") - } + user, err := getCurrentUser(ctx, s.Store) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) + } + if user == nil && shortcut.Visibility != storepb.Visibility_PUBLIC { + return nil, status.Errorf(codes.PermissionDenied, "Permission denied") } composedShortcut, err := s.convertShortcutFromStorepb(ctx, shortcut) @@ -96,15 +79,12 @@ func (s *APIV1Service) GetShortcutByName(ctx context.Context, request *v1pb.GetS return nil, status.Errorf(codes.NotFound, "shortcut not found") } - userID, ok := ctx.Value(userIDContextKey).(int32) - if ok { - if shortcut.Visibility == storepb.Visibility_PRIVATE && shortcut.CreatorId != userID { - return nil, status.Errorf(codes.PermissionDenied, "Permission denied") - } - } else { - if shortcut.Visibility != storepb.Visibility_PUBLIC { - return nil, status.Errorf(codes.PermissionDenied, "Permission denied") - } + user, err := getCurrentUser(ctx, s.Store) + if err != nil { + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) + } + if user == nil && shortcut.Visibility != storepb.Visibility_PUBLIC { + return nil, status.Errorf(codes.PermissionDenied, "Permission denied") } composedShortcut, err := s.convertShortcutFromStorepb(ctx, shortcut) @@ -132,7 +112,7 @@ func (s *APIV1Service) CreateShortcut(ctx context.Context, request *v1pb.CreateS user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } shortcutCreate := &storepb.Shortcut{ CreatorId: user.ID, @@ -141,7 +121,7 @@ func (s *APIV1Service) CreateShortcut(ctx context.Context, request *v1pb.CreateS Title: request.Shortcut.Title, Tags: request.Shortcut.Tags, Description: request.Shortcut.Description, - Visibility: storepb.Visibility(request.Shortcut.Visibility), + Visibility: convertVisibilityToStorepb(request.Shortcut.Visibility), OgMetadata: &storepb.OpenGraphMetadata{}, } if shortcutCreate.Visibility == storepb.Visibility_VISIBILITY_UNSPECIFIED { @@ -149,11 +129,11 @@ func (s *APIV1Service) CreateShortcut(ctx context.Context, request *v1pb.CreateS if err != nil { return nil, status.Errorf(codes.Internal, "failed to get workspace setting, err: %v", err) } - visibility := v1pb.Visibility_PRIVATE + visibility := v1pb.Visibility_WORKSPACE if workspaceSetting.DefaultVisibility != v1pb.Visibility_VISIBILITY_UNSPECIFIED { visibility = workspaceSetting.DefaultVisibility } - shortcutCreate.Visibility = storepb.Visibility(visibility) + shortcutCreate.Visibility = convertVisibilityToStorepb(visibility) } if request.Shortcut.OgMetadata != nil { shortcutCreate.OgMetadata = &storepb.OpenGraphMetadata{ @@ -184,7 +164,7 @@ func (s *APIV1Service) UpdateShortcut(ctx context.Context, request *v1pb.UpdateS user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{ ID: &request.Shortcut.Id, @@ -216,7 +196,7 @@ func (s *APIV1Service) UpdateShortcut(ctx context.Context, request *v1pb.UpdateS tag := strings.Join(request.Shortcut.Tags, " ") update.Tag = &tag case "visibility": - visibility := store.Visibility(request.Shortcut.Visibility.String()) + visibility := convertVisibilityToStorepb(request.Shortcut.Visibility) update.Visibility = &visibility case "og_metadata": if request.Shortcut.OgMetadata != nil { @@ -243,7 +223,7 @@ func (s *APIV1Service) UpdateShortcut(ctx context.Context, request *v1pb.UpdateS func (s *APIV1Service) DeleteShortcut(ctx context.Context, request *v1pb.DeleteShortcutRequest) (*emptypb.Empty, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } shortcut, err := s.Store.GetShortcut(ctx, &store.FindShortcut{ ID: &request.Id, @@ -369,13 +349,12 @@ func (s *APIV1Service) convertShortcutFromStorepb(ctx context.Context, shortcut CreatorId: shortcut.CreatorId, CreatedTime: timestamppb.New(time.Unix(shortcut.CreatedTs, 0)), UpdatedTime: timestamppb.New(time.Unix(shortcut.UpdatedTs, 0)), - RowStatus: v1pb.RowStatus(shortcut.RowStatus), Name: shortcut.Name, Link: shortcut.Link, Title: shortcut.Title, Tags: shortcut.Tags, Description: shortcut.Description, - Visibility: v1pb.Visibility(shortcut.Visibility), + Visibility: convertVisibilityFromStorepb(shortcut.Visibility), OgMetadata: &v1pb.Shortcut_OpenGraphMetadata{ Title: shortcut.OgMetadata.Title, Description: shortcut.OgMetadata.Description, diff --git a/server/route/api/v1/user_service.go b/server/route/api/v1/user_service.go index d423b88..89d61ed 100644 --- a/server/route/api/v1/user_service.go +++ b/server/route/api/v1/user_service.go @@ -72,7 +72,7 @@ func (s *APIV1Service) CreateUser(ctx context.Context, request *v1pb.CreateUserR func (s *APIV1Service) UpdateUser(ctx context.Context, request *v1pb.UpdateUserRequest) (*v1pb.User, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } if user.ID != request.User.Id { return nil, status.Errorf(codes.PermissionDenied, "Permission denied") @@ -101,7 +101,7 @@ func (s *APIV1Service) UpdateUser(ctx context.Context, request *v1pb.UpdateUserR func (s *APIV1Service) DeleteUser(ctx context.Context, request *v1pb.DeleteUserRequest) (*emptypb.Empty, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } if user.ID == request.Id { return nil, status.Errorf(codes.InvalidArgument, "cannot delete yourself") @@ -116,7 +116,7 @@ func (s *APIV1Service) DeleteUser(ctx context.Context, request *v1pb.DeleteUserR func (s *APIV1Service) ListUserAccessTokens(ctx context.Context, request *v1pb.ListUserAccessTokensRequest) (*v1pb.ListUserAccessTokensResponse, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } if user.ID != request.Id { return nil, status.Errorf(codes.PermissionDenied, "Permission denied") @@ -170,7 +170,7 @@ func (s *APIV1Service) ListUserAccessTokens(ctx context.Context, request *v1pb.L func (s *APIV1Service) CreateUserAccessToken(ctx context.Context, request *v1pb.CreateUserAccessTokenRequest) (*v1pb.UserAccessToken, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } if user.ID != request.Id { return nil, status.Errorf(codes.PermissionDenied, "Permission denied") @@ -220,7 +220,7 @@ func (s *APIV1Service) CreateUserAccessToken(ctx context.Context, request *v1pb. func (s *APIV1Service) DeleteUserAccessToken(ctx context.Context, request *v1pb.DeleteUserAccessTokenRequest) (*emptypb.Empty, error) { user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } userAccessTokens, err := s.Store.GetUserAccessTokens(ctx, user.ID) if err != nil { @@ -275,7 +275,7 @@ func (s *APIV1Service) UpsertAccessTokenToStore(ctx context.Context, user *store func convertUserFromStore(user *store.User) *v1pb.User { return &v1pb.User{ Id: int32(user.ID), - RowStatus: convertRowStatusFromStore(user.RowStatus), + State: convertStateFromRowStatus(user.RowStatus), CreatedTime: timestamppb.New(time.Unix(user.CreatedTs, 0)), UpdatedTime: timestamppb.New(time.Unix(user.UpdatedTs, 0)), Role: convertUserRoleFromStore(user.Role), diff --git a/server/route/api/v1/user_setting_service.go b/server/route/api/v1/user_setting_service.go index 769ac74..f1f7cae 100644 --- a/server/route/api/v1/user_setting_service.go +++ b/server/route/api/v1/user_setting_service.go @@ -27,7 +27,7 @@ func (s *APIV1Service) UpdateUserSetting(ctx context.Context, request *v1pb.Upda user, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } for _, path := range request.UpdateMask.Paths { if path == "general" { diff --git a/server/route/api/v1/workspace_service.go b/server/route/api/v1/workspace_service.go index 5ac3222..044a1db 100644 --- a/server/route/api/v1/workspace_service.go +++ b/server/route/api/v1/workspace_service.go @@ -43,7 +43,7 @@ func (s *APIV1Service) GetWorkspaceProfile(ctx context.Context, _ *v1pb.GetWorks func (s *APIV1Service) GetWorkspaceSetting(ctx context.Context, _ *v1pb.GetWorkspaceSettingRequest) (*v1pb.WorkspaceSetting, error) { currentUser, err := getCurrentUser(ctx, s.Store) if err != nil { - return nil, status.Errorf(codes.Unauthenticated, "failed to get current user: %v", err) + return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err) } workspaceSettings, err := s.Store.ListWorkspaceSettings(ctx, &store.FindWorkspaceSetting{}) if err != nil { @@ -61,7 +61,7 @@ func (s *APIV1Service) GetWorkspaceSetting(ctx context.Context, _ *v1pb.GetWorks workspaceSetting.DisallowPasswordAuth = securitySetting.GetDisallowPasswordAuth() } else if v.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SHORTCUT_RELATED { shortcutRelatedSetting := v.GetShortcutRelated() - workspaceSetting.DefaultVisibility = v1pb.Visibility(shortcutRelatedSetting.GetDefaultVisibility()) + workspaceSetting.DefaultVisibility = convertVisibilityFromStorepb(shortcutRelatedSetting.GetDefaultVisibility()) } else if v.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_IDENTITY_PROVIDER { identityProviderSetting := v.GetIdentityProvider() workspaceSetting.IdentityProviders = []*v1pb.IdentityProvider{} @@ -129,7 +129,7 @@ func (s *APIV1Service) UpdateWorkspaceSetting(ctx context.Context, request *v1pb }, } } - shortcutRelatedSetting.GetShortcutRelated().DefaultVisibility = storepb.Visibility(request.Setting.DefaultVisibility) + shortcutRelatedSetting.GetShortcutRelated().DefaultVisibility = convertVisibilityToStorepb(request.Setting.DefaultVisibility) if _, err := s.Store.UpsertWorkspaceSetting(ctx, &storepb.WorkspaceSetting{ Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SHORTCUT_RELATED, Value: &storepb.WorkspaceSetting_ShortcutRelated{ diff --git a/store/collection.go b/store/collection.go index ae60090..37ec7fd 100644 --- a/store/collection.go +++ b/store/collection.go @@ -7,22 +7,20 @@ import ( ) type UpdateCollection struct { - ID int32 - - RowStatus *RowStatus + ID int32 Name *string Link *string Title *string Description *string ShortcutIDs []int32 - Visibility *Visibility + Visibility *storepb.Visibility } type FindCollection struct { ID *int32 CreatorID *int32 Name *string - VisibilityList []Visibility + VisibilityList []storepb.Visibility } type DeleteCollection struct { diff --git a/store/common.go b/store/common.go index bb5afce..9c451f1 100644 --- a/store/common.go +++ b/store/common.go @@ -4,26 +4,6 @@ import ( storepb "github.com/yourselfhosted/slash/proto/gen/store" ) -// RowStatus is the status for a row. -type RowStatus string - -const ( - // Normal is the status for a normal row. - Normal RowStatus = "NORMAL" - // Archived is the status for an archived row. - Archived RowStatus = "ARCHIVED" -) - -func (e RowStatus) String() string { - switch e { - case Normal: - return "NORMAL" - case Archived: - return "ARCHIVED" - } - return "" -} - func ConvertRowStatusStringToStorepb(status string) storepb.RowStatus { switch status { case "NORMAL": @@ -34,26 +14,12 @@ func ConvertRowStatusStringToStorepb(status string) storepb.RowStatus { return storepb.RowStatus_ROW_STATUS_UNSPECIFIED } -// Visibility is the type of a visibility. -type Visibility string - -const ( - // VisibilityPublic is the PUBLIC visibility. - VisibilityPublic Visibility = "PUBLIC" - // VisibilityWorkspace is the WORKSPACE visibility. - VisibilityWorkspace Visibility = "WORKSPACE" - // VisibilityPrivate is the PRIVATE visibility. - VisibilityPrivate Visibility = "PRIVATE" -) - -func (e Visibility) String() string { - switch e { - case VisibilityPublic: - return "PUBLIC" - case VisibilityWorkspace: - return "WORKSPACE" - case VisibilityPrivate: - return "PRIVATE" +func ConvertVisibilityStringToStorepb(visibility string) storepb.Visibility { + switch visibility { + case "PRIVATE", "WORKSPACE": + return storepb.Visibility_WORKSPACE + case "PUBLIC": + return storepb.Visibility_PUBLIC } - return "PRIVATE" + return storepb.Visibility_VISIBILITY_UNSPECIFIED } diff --git a/store/db/postgres/collection.go b/store/db/postgres/collection.go index 463689a..5ae069e 100644 --- a/store/db/postgres/collection.go +++ b/store/db/postgres/collection.go @@ -84,7 +84,7 @@ func (d *DB) UpdateCollection(ctx context.Context, update *store.UpdateCollectio collection.ShortcutIds = append(collection.ShortcutIds, id.Int32) } } - collection.Visibility = convertVisibilityStringToStorepb(visibility) + collection.Visibility = store.ConvertVisibilityStringToStorepb(visibility) return collection, nil } @@ -153,7 +153,7 @@ func (d *DB) ListCollections(ctx context.Context, find *store.FindCollection) ([ collection.ShortcutIds = append(collection.ShortcutIds, id.Int32) } } - collection.Visibility = storepb.Visibility(storepb.Visibility_value[visibility]) + collection.Visibility = store.ConvertVisibilityStringToStorepb(visibility) list = append(list, collection) } diff --git a/store/db/postgres/shortcut.go b/store/db/postgres/shortcut.go index f718893..8984873 100644 --- a/store/db/postgres/shortcut.go +++ b/store/db/postgres/shortcut.go @@ -27,28 +27,21 @@ func (d *DB) CreateShortcut(ctx context.Context, create *storepb.Shortcut) (*sto stmt := fmt.Sprintf(` INSERT INTO shortcut (%s) VALUES (%s) - RETURNING id, created_ts, updated_ts, row_status + RETURNING id, created_ts, updated_ts `, strings.Join(set, ","), placeholders(len(args))) - - var rowStatus string if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &create.Id, &create.CreatedTs, &create.UpdatedTs, - &rowStatus, ); err != nil { return nil, err } - create.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) shortcut := create return shortcut, nil } func (d *DB) UpdateShortcut(ctx context.Context, update *store.UpdateShortcut) (*storepb.Shortcut, error) { set, args := []string{}, []any{} - if update.RowStatus != nil { - set, args = append(set, fmt.Sprintf("row_status = $%d", len(args)+1)), append(args, update.RowStatus.String()) - } if update.Name != nil { set, args = append(set, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *update.Name) } @@ -70,7 +63,7 @@ func (d *DB) UpdateShortcut(ctx context.Context, update *store.UpdateShortcut) ( if update.OpenGraphMetadata != nil { openGraphMetadataBytes, err := protojson.Marshal(update.OpenGraphMetadata) if err != nil { - return nil, errors.Wrap(err, "Failed to marshal activity payload") + return nil, errors.Wrap(err, "failed to marshal activity payload") } set, args = append(set, fmt.Sprintf("og_metadata = $%d", len(args)+1)), append(args, string(openGraphMetadataBytes)) } @@ -83,17 +76,16 @@ func (d *DB) UpdateShortcut(ctx context.Context, update *store.UpdateShortcut) ( UPDATE shortcut SET %s WHERE id = $%d - RETURNING id, creator_id, created_ts, updated_ts, row_status, name, link, title, description, visibility, tag, og_metadata + RETURNING id, creator_id, created_ts, updated_ts, name, link, title, description, visibility, tag, og_metadata `, strings.Join(set, ","), len(args)) shortcut := &storepb.Shortcut{} - var rowStatus, visibility, tags, openGraphMetadataString string + var visibility, tags, openGraphMetadataString string if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &shortcut.Id, &shortcut.CreatorId, &shortcut.CreatedTs, &shortcut.UpdatedTs, - &rowStatus, &shortcut.Name, &shortcut.Link, &shortcut.Title, @@ -104,8 +96,7 @@ func (d *DB) UpdateShortcut(ctx context.Context, update *store.UpdateShortcut) ( ); err != nil { return nil, err } - shortcut.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) - shortcut.Visibility = convertVisibilityStringToStorepb(visibility) + shortcut.Visibility = store.ConvertVisibilityStringToStorepb(visibility) shortcut.Tags = filterTags(strings.Split(tags, " ")) var ogMetadata storepb.OpenGraphMetadata if err := protojson.Unmarshal([]byte(openGraphMetadataString), &ogMetadata); err != nil { @@ -123,9 +114,6 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st if v := find.CreatorID; v != nil { where, args = append(where, fmt.Sprintf("creator_id = %s", placeholder(len(args)+1))), append(args, *v) } - if v := find.RowStatus; v != nil { - where, args = append(where, fmt.Sprintf("row_status = %s", placeholder(len(args)+1))), append(args, *v) - } if v := find.Name; v != nil { where, args = append(where, fmt.Sprintf("name = %s", placeholder(len(args)+1))), append(args, *v) } @@ -147,7 +135,6 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st creator_id, created_ts, updated_ts, - row_status, name, link, title, @@ -167,13 +154,12 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st list := make([]*storepb.Shortcut, 0) for rows.Next() { shortcut := &storepb.Shortcut{} - var rowStatus, visibility, tags, openGraphMetadataString string + var visibility, tags, openGraphMetadataString string if err := rows.Scan( &shortcut.Id, &shortcut.CreatorId, &shortcut.CreatedTs, &shortcut.UpdatedTs, - &rowStatus, &shortcut.Name, &shortcut.Link, &shortcut.Title, @@ -184,8 +170,7 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st ); err != nil { return nil, err } - shortcut.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) - shortcut.Visibility = storepb.Visibility(storepb.Visibility_value[visibility]) + shortcut.Visibility = store.ConvertVisibilityStringToStorepb(visibility) shortcut.Tags = filterTags(strings.Split(tags, " ")) var ogMetadata storepb.OpenGraphMetadata if err := protojson.Unmarshal([]byte(openGraphMetadataString), &ogMetadata); err != nil { @@ -215,7 +200,3 @@ func filterTags(tags []string) []string { } return result } - -func convertVisibilityStringToStorepb(visibility string) storepb.Visibility { - return storepb.Visibility(storepb.Visibility_value[visibility]) -} diff --git a/store/db/postgres/user.go b/store/db/postgres/user.go index 3ab9b72..65e030f 100644 --- a/store/db/postgres/user.go +++ b/store/db/postgres/user.go @@ -19,6 +19,7 @@ func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, e VALUES ($1, $2, $3, $4) RETURNING id, created_ts, updated_ts, row_status ` + var rowStatus string if err := d.db.QueryRowContext(ctx, stmt, create.Email, create.Nickname, @@ -28,19 +29,20 @@ func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, e &create.ID, &create.CreatedTs, &create.UpdatedTs, - &create.RowStatus, + &rowStatus, ); err != nil { return nil, err } user := create + user.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) return user, nil } func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.User, error) { set, args := []string{}, []any{} if v := update.RowStatus; v != nil { - set, args = append(set, "row_status = "+placeholder(len(args)+1)), append(args, *v) + set, args = append(set, "row_status = "+placeholder(len(args)+1)), append(args, v.String()) } if v := update.Email; v != nil { set, args = append(set, "email = "+placeholder(len(args)+1)), append(args, *v) @@ -66,11 +68,12 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U ` args = append(args, update.ID) user := &store.User{} + var rowStatus string if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &user.ID, &user.CreatedTs, &user.UpdatedTs, - &user.RowStatus, + &rowStatus, &user.Email, &user.Nickname, &user.PasswordHash, @@ -79,6 +82,7 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U return nil, err } + user.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) return user, nil } @@ -124,11 +128,12 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User list := make([]*store.User, 0) for rows.Next() { user := &store.User{} + var rowStatus string if err := rows.Scan( &user.ID, &user.CreatedTs, &user.UpdatedTs, - &user.RowStatus, + &rowStatus, &user.Email, &user.Nickname, &user.PasswordHash, @@ -136,6 +141,7 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User ); err != nil { return nil, err } + user.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) list = append(list, user) } diff --git a/store/db/sqlite/collection.go b/store/db/sqlite/collection.go index 88eb3d4..bfaeca6 100644 --- a/store/db/sqlite/collection.go +++ b/store/db/sqlite/collection.go @@ -92,7 +92,7 @@ func (d *DB) UpdateCollection(ctx context.Context, update *store.UpdateCollectio collection.ShortcutIds = append(collection.ShortcutIds, shortcutID) } } - collection.Visibility = convertVisibilityStringToStorepb(visibility) + collection.Visibility = store.ConvertVisibilityStringToStorepb(visibility) return collection, nil } @@ -165,7 +165,7 @@ func (d *DB) ListCollections(ctx context.Context, find *store.FindCollection) ([ collection.ShortcutIds = append(collection.ShortcutIds, shortcutID) } } - collection.Visibility = storepb.Visibility(storepb.Visibility_value[visibility]) + collection.Visibility = store.ConvertVisibilityStringToStorepb(visibility) list = append(list, collection) } @@ -189,6 +189,5 @@ func vacuumCollection(ctx context.Context, tx *sql.Tx) error { if err != nil { return err } - return nil } diff --git a/store/db/sqlite/shortcut.go b/store/db/sqlite/shortcut.go index 9e3e004..9e6429f 100644 --- a/store/db/sqlite/shortcut.go +++ b/store/db/sqlite/shortcut.go @@ -32,27 +32,21 @@ func (d *DB) CreateShortcut(ctx context.Context, create *storepb.Shortcut) (*sto ` + strings.Join(set, ", ") + ` ) VALUES (` + strings.Join(placeholder, ",") + `) - RETURNING id, created_ts, updated_ts, row_status + RETURNING id, created_ts, updated_ts ` - var rowStatus string if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &create.Id, &create.CreatedTs, &create.UpdatedTs, - &rowStatus, ); err != nil { return nil, err } - create.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) shortcut := create return shortcut, nil } func (d *DB) UpdateShortcut(ctx context.Context, update *store.UpdateShortcut) (*storepb.Shortcut, error) { set, args := []string{}, []any{} - if update.RowStatus != nil { - set, args = append(set, "row_status = ?"), append(args, update.RowStatus.String()) - } if update.Name != nil { set, args = append(set, "name = ?"), append(args, *update.Name) } @@ -89,16 +83,15 @@ func (d *DB) UpdateShortcut(ctx context.Context, update *store.UpdateShortcut) ( ` + strings.Join(set, ", ") + ` WHERE id = ? - RETURNING id, creator_id, created_ts, updated_ts, row_status, name, link, title, description, visibility, tag, og_metadata + RETURNING id, creator_id, created_ts, updated_ts, name, link, title, description, visibility, tag, og_metadata ` shortcut := &storepb.Shortcut{} - var rowStatus, visibility, tags, openGraphMetadataString string + var visibility, tags, openGraphMetadataString string if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &shortcut.Id, &shortcut.CreatorId, &shortcut.CreatedTs, &shortcut.UpdatedTs, - &rowStatus, &shortcut.Name, &shortcut.Link, &shortcut.Title, @@ -109,8 +102,7 @@ func (d *DB) UpdateShortcut(ctx context.Context, update *store.UpdateShortcut) ( ); err != nil { return nil, err } - shortcut.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) - shortcut.Visibility = convertVisibilityStringToStorepb(visibility) + shortcut.Visibility = store.ConvertVisibilityStringToStorepb(visibility) shortcut.Tags = filterTags(strings.Split(tags, " ")) var ogMetadata storepb.OpenGraphMetadata if err := protojson.Unmarshal([]byte(openGraphMetadataString), &ogMetadata); err != nil { @@ -128,9 +120,6 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st if v := find.CreatorID; v != nil { where, args = append(where, "creator_id = ?"), append(args, *v) } - if v := find.RowStatus; v != nil { - where, args = append(where, "row_status = ?"), append(args, *v) - } if v := find.Name; v != nil { where, args = append(where, "name = ?"), append(args, *v) } @@ -138,7 +127,7 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st list := []string{} for _, visibility := range v { list = append(list, fmt.Sprintf("$%d", len(args)+1)) - args = append(args, visibility) + args = append(args, visibility.String()) } where = append(where, fmt.Sprintf("visibility in (%s)", strings.Join(list, ","))) } @@ -152,7 +141,6 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st creator_id, created_ts, updated_ts, - row_status, name, link, title, @@ -173,13 +161,12 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st list := make([]*storepb.Shortcut, 0) for rows.Next() { shortcut := &storepb.Shortcut{} - var rowStatus, visibility, tags, openGraphMetadataString string + var visibility, tags, openGraphMetadataString string if err := rows.Scan( &shortcut.Id, &shortcut.CreatorId, &shortcut.CreatedTs, &shortcut.UpdatedTs, - &rowStatus, &shortcut.Name, &shortcut.Link, &shortcut.Title, @@ -190,8 +177,7 @@ func (d *DB) ListShortcuts(ctx context.Context, find *store.FindShortcut) ([]*st ); err != nil { return nil, err } - shortcut.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) - shortcut.Visibility = storepb.Visibility(storepb.Visibility_value[visibility]) + shortcut.Visibility = store.ConvertVisibilityStringToStorepb(visibility) shortcut.Tags = filterTags(strings.Split(tags, " ")) var ogMetadata storepb.OpenGraphMetadata if err := protojson.Unmarshal([]byte(openGraphMetadataString), &ogMetadata); err != nil { @@ -234,7 +220,3 @@ func filterTags(tags []string) []string { } return result } - -func convertVisibilityStringToStorepb(visibility string) storepb.Visibility { - return storepb.Visibility(storepb.Visibility_value[visibility]) -} diff --git a/store/db/sqlite/user.go b/store/db/sqlite/user.go index d7dc385..203790f 100644 --- a/store/db/sqlite/user.go +++ b/store/db/sqlite/user.go @@ -19,6 +19,7 @@ func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, e VALUES (?, ?, ?, ?) RETURNING id, created_ts, updated_ts, row_status ` + var rowStatus string if err := d.db.QueryRowContext(ctx, stmt, create.Email, create.Nickname, @@ -28,19 +29,20 @@ func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, e &create.ID, &create.CreatedTs, &create.UpdatedTs, - &create.RowStatus, + &rowStatus, ); err != nil { return nil, err } user := create + user.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) return user, nil } func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.User, error) { set, args := []string{}, []any{} if v := update.RowStatus; v != nil { - set, args = append(set, "row_status = ?"), append(args, *v) + set, args = append(set, "row_status = ?"), append(args, v.String()) } if v := update.Email; v != nil { set, args = append(set, "email = ?"), append(args, *v) @@ -67,11 +69,12 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U ` args = append(args, update.ID) user := &store.User{} + var rowStatus string if err := d.db.QueryRowContext(ctx, stmt, args...).Scan( &user.ID, &user.CreatedTs, &user.UpdatedTs, - &user.RowStatus, + &rowStatus, &user.Email, &user.Nickname, &user.PasswordHash, @@ -79,7 +82,7 @@ func (d *DB) UpdateUser(ctx context.Context, update *store.UpdateUser) (*store.U ); err != nil { return nil, err } - + user.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) return user, nil } @@ -125,11 +128,12 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User list := make([]*store.User, 0) for rows.Next() { user := &store.User{} + var rowStatus string if err := rows.Scan( &user.ID, &user.CreatedTs, &user.UpdatedTs, - &user.RowStatus, + &rowStatus, &user.Email, &user.Nickname, &user.PasswordHash, @@ -137,6 +141,7 @@ func (d *DB) ListUsers(ctx context.Context, find *store.FindUser) ([]*store.User ); err != nil { return nil, err } + user.RowStatus = store.ConvertRowStatusStringToStorepb(rowStatus) list = append(list, user) } diff --git a/store/shortcut.go b/store/shortcut.go index 2b43fc5..61049ff 100644 --- a/store/shortcut.go +++ b/store/shortcut.go @@ -9,12 +9,11 @@ import ( type UpdateShortcut struct { ID int32 - RowStatus *RowStatus Name *string Link *string Title *string Description *string - Visibility *Visibility + Visibility *storepb.Visibility Tag *string OpenGraphMetadata *storepb.OpenGraphMetadata } @@ -22,9 +21,8 @@ type UpdateShortcut struct { type FindShortcut struct { ID *int32 CreatorID *int32 - RowStatus *RowStatus Name *string - VisibilityList []Visibility + VisibilityList []storepb.Visibility Tag *string } diff --git a/store/user.go b/store/user.go index fa2442e..adc57f7 100644 --- a/store/user.go +++ b/store/user.go @@ -2,6 +2,8 @@ package store import ( "context" + + storepb "github.com/yourselfhosted/slash/proto/gen/store" ) // Role is the type of a role. @@ -20,7 +22,7 @@ type User struct { // Standard fields CreatedTs int64 UpdatedTs int64 - RowStatus RowStatus + RowStatus storepb.RowStatus // Domain specific fields Email string @@ -32,7 +34,7 @@ type User struct { type UpdateUser struct { ID int32 - RowStatus *RowStatus + RowStatus *storepb.RowStatus Email *string Nickname *string PasswordHash *string @@ -41,7 +43,7 @@ type UpdateUser struct { type FindUser struct { ID *int32 - RowStatus *RowStatus + RowStatus *storepb.RowStatus Email *string Nickname *string Role *Role diff --git a/test/store/collection_test.go b/test/store/collection_test.go index 98e8734..7607bcf 100644 --- a/test/store/collection_test.go +++ b/test/store/collection_test.go @@ -21,7 +21,7 @@ func TestCollectionStore(t *testing.T) { Title: "My collection", Description: "A test collection", ShortcutIds: []int32{101, 102}, - Visibility: storepb.Visibility_PRIVATE, + Visibility: storepb.Visibility_WORKSPACE, }) require.NoError(t, err) collections, err := ts.ListCollections(ctx, &store.FindCollection{ diff --git a/test/store/shortcut_test.go b/test/store/shortcut_test.go index 137b579..8c47111 100644 --- a/test/store/shortcut_test.go +++ b/test/store/shortcut_test.go @@ -20,7 +20,7 @@ func TestShortcutStore(t *testing.T) { Name: "test", Link: "https://test.link", Description: "A test shortcut", - Visibility: storepb.Visibility_PRIVATE, + Visibility: storepb.Visibility_WORKSPACE, Tags: []string{"test", "shortcut"}, OgMetadata: &storepb.OpenGraphMetadata{}, })