mirror of
https://github.com/aykhans/slash-e.git
synced 2025-06-05 00:12:03 +00:00
chore: update ts definition generator
This commit is contained in:
parent
7cde25bdb5
commit
2fcd496fd2
@ -30,6 +30,7 @@ func NewAPIV2Service(secret string, profile *profile.Profile, store *store.Store
|
||||
),
|
||||
)
|
||||
apiv2pb.RegisterUserServiceServer(grpcServer, NewUserService(secret, store))
|
||||
apiv2pb.RegisterUserSettingServiceServer(grpcServer, NewUserSettingService(store))
|
||||
apiv2pb.RegisterShortcutServiceServer(grpcServer, NewShortcutService(secret, store))
|
||||
|
||||
return &APIV2Service{
|
||||
@ -62,6 +63,9 @@ func (s *APIV2Service) RegisterGateway(ctx context.Context, e *echo.Echo) error
|
||||
if err := apiv2pb.RegisterUserServiceHandler(context.Background(), gwMux, conn); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := apiv2pb.RegisterUserSettingServiceHandler(context.Background(), gwMux, conn); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := apiv2pb.RegisterShortcutServiceHandler(context.Background(), gwMux, conn); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -33,7 +33,6 @@
|
||||
"devDependencies": {
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.2.0",
|
||||
"@types/lodash-es": "^4.17.8",
|
||||
"@types/node": "^20.5.6",
|
||||
"@types/react": "^18.2.21",
|
||||
"@types/react-dom": "^18.2.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.4.1",
|
||||
@ -44,9 +43,11 @@
|
||||
"eslint-config-prettier": "^8.10.0",
|
||||
"eslint-plugin-prettier": "^4.2.1",
|
||||
"eslint-plugin-react": "^7.33.2",
|
||||
"long": "^5.2.3",
|
||||
"postcss": "^8.4.28",
|
||||
"prettier": "2.6.2",
|
||||
"protobufjs": "^7.2.5",
|
||||
"typescript": "^5.2.2",
|
||||
"vite": "^4.4.9"
|
||||
}
|
||||
}
|
||||
}
|
92
frontend/web/pnpm-lock.yaml
generated
92
frontend/web/pnpm-lock.yaml
generated
@ -55,7 +55,7 @@ dependencies:
|
||||
version: 2.4.1(csstype@3.1.2)(react-dom@18.2.0)(react@18.2.0)
|
||||
react-i18next:
|
||||
specifier: ^13.2.0
|
||||
version: 13.2.1(i18next@23.4.6)(react-dom@18.2.0)(react@18.2.0)
|
||||
version: 13.2.2(i18next@23.4.6)(react-dom@18.2.0)(react@18.2.0)
|
||||
react-redux:
|
||||
specifier: ^8.1.2
|
||||
version: 8.1.2(@types/react-dom@18.2.7)(@types/react@18.2.21)(react-dom@18.2.0)(react@18.2.0)(redux@4.2.1)
|
||||
@ -76,9 +76,6 @@ devDependencies:
|
||||
'@types/lodash-es':
|
||||
specifier: ^4.17.8
|
||||
version: 4.17.9
|
||||
'@types/node':
|
||||
specifier: ^20.5.6
|
||||
version: 20.5.8
|
||||
'@types/react':
|
||||
specifier: ^18.2.21
|
||||
version: 18.2.21
|
||||
@ -109,18 +106,24 @@ devDependencies:
|
||||
eslint-plugin-react:
|
||||
specifier: ^7.33.2
|
||||
version: 7.33.2(eslint@8.48.0)
|
||||
long:
|
||||
specifier: ^5.2.3
|
||||
version: 5.2.3
|
||||
postcss:
|
||||
specifier: ^8.4.28
|
||||
version: 8.4.29
|
||||
prettier:
|
||||
specifier: 2.6.2
|
||||
version: 2.6.2
|
||||
protobufjs:
|
||||
specifier: ^7.2.5
|
||||
version: 7.2.5
|
||||
typescript:
|
||||
specifier: ^5.2.2
|
||||
version: 5.2.2
|
||||
vite:
|
||||
specifier: ^4.4.9
|
||||
version: 4.4.9(@types/node@20.5.8)
|
||||
version: 4.4.9
|
||||
|
||||
packages:
|
||||
|
||||
@ -841,6 +844,49 @@ packages:
|
||||
resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/aspromise@1.1.2:
|
||||
resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/base64@1.1.2:
|
||||
resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/codegen@2.0.4:
|
||||
resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/eventemitter@1.1.0:
|
||||
resolution: {integrity: sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/fetch@1.1.0:
|
||||
resolution: {integrity: sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==}
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/inquire': 1.1.0
|
||||
dev: true
|
||||
|
||||
/@protobufjs/float@1.0.2:
|
||||
resolution: {integrity: sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/inquire@1.1.0:
|
||||
resolution: {integrity: sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/path@1.1.2:
|
||||
resolution: {integrity: sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/pool@1.1.0:
|
||||
resolution: {integrity: sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==}
|
||||
dev: true
|
||||
|
||||
/@protobufjs/utf8@1.1.0:
|
||||
resolution: {integrity: sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==}
|
||||
dev: true
|
||||
|
||||
/@reduxjs/toolkit@1.9.5(react-redux@8.1.2)(react@18.2.0):
|
||||
resolution: {integrity: sha512-Rt97jHmfTeaxL4swLRNPD/zV4OxTes4la07Xc4hetpUW/vc75t5m1ANyxG6ymnEQ2FsLQsoMlYB2vV1sO3m8tQ==}
|
||||
peerDependencies:
|
||||
@ -1024,8 +1070,8 @@ packages:
|
||||
resolution: {integrity: sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==}
|
||||
dev: true
|
||||
|
||||
/@types/node@20.5.8:
|
||||
resolution: {integrity: sha512-eajsR9aeljqNhK028VG0Wuw+OaY5LLxYmxeoXynIoE6jannr9/Ucd1LL0hSSoafk5LTYG+FfqsyGt81Q6Zkybw==}
|
||||
/@types/node@20.5.9:
|
||||
resolution: {integrity: sha512-PcGNd//40kHAS3sTlzKB9C9XL4K0sTup8nbG5lC14kzEteTNuAFh9u5nA0o5TWnSG2r/JNPRXFVcHJIIeRlmqQ==}
|
||||
dev: true
|
||||
|
||||
/@types/parse-json@4.0.0:
|
||||
@ -1201,7 +1247,7 @@ packages:
|
||||
vite: ^4
|
||||
dependencies:
|
||||
'@swc/core': 1.3.82
|
||||
vite: 4.4.9(@types/node@20.5.8)
|
||||
vite: 4.4.9
|
||||
transitivePeerDependencies:
|
||||
- '@swc/helpers'
|
||||
dev: true
|
||||
@ -2486,6 +2532,10 @@ packages:
|
||||
resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
|
||||
dev: true
|
||||
|
||||
/long@5.2.3:
|
||||
resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==}
|
||||
dev: true
|
||||
|
||||
/loose-envify@1.4.0:
|
||||
resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==}
|
||||
hasBin: true
|
||||
@ -2810,6 +2860,25 @@ packages:
|
||||
object-assign: 4.1.1
|
||||
react-is: 16.13.1
|
||||
|
||||
/protobufjs@7.2.5:
|
||||
resolution: {integrity: sha512-gGXRSXvxQ7UiPgfw8gevrfRWcTlSbOFg+p/N+JVJEK5VhueL2miT6qTymqAmjr1Q5WbOCyJbyrk6JfWKwlFn6A==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/base64': 1.1.2
|
||||
'@protobufjs/codegen': 2.0.4
|
||||
'@protobufjs/eventemitter': 1.1.0
|
||||
'@protobufjs/fetch': 1.1.0
|
||||
'@protobufjs/float': 1.0.2
|
||||
'@protobufjs/inquire': 1.1.0
|
||||
'@protobufjs/path': 1.1.2
|
||||
'@protobufjs/pool': 1.1.0
|
||||
'@protobufjs/utf8': 1.1.0
|
||||
'@types/node': 20.5.9
|
||||
long: 5.2.3
|
||||
dev: true
|
||||
|
||||
/punycode@2.3.0:
|
||||
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
||||
engines: {node: '>=6'}
|
||||
@ -2850,8 +2919,8 @@ packages:
|
||||
- csstype
|
||||
dev: false
|
||||
|
||||
/react-i18next@13.2.1(i18next@23.4.6)(react-dom@18.2.0)(react@18.2.0):
|
||||
resolution: {integrity: sha512-XhMsnGgJnytWfi2Q70HMYfm+zysPUu1Pz+It6I87WwaeclGY+W8W1c11uENEMNg+Xb+mNrGuo8GEDuQDOgO+oQ==}
|
||||
/react-i18next@13.2.2(i18next@23.4.6)(react-dom@18.2.0)(react@18.2.0):
|
||||
resolution: {integrity: sha512-+nFUkbRByFwnrfDcYqvzBuaeZb+nACHx+fAWN/pZMddWOCJH5hoc21+Sa/N/Lqi6ne6/9wC/qRGOoQhJa6IkEQ==}
|
||||
peerDependencies:
|
||||
i18next: '>= 23.2.3'
|
||||
react: '>= 16.8.0'
|
||||
@ -3367,7 +3436,7 @@ packages:
|
||||
resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==}
|
||||
dev: false
|
||||
|
||||
/vite@4.4.9(@types/node@20.5.8):
|
||||
/vite@4.4.9:
|
||||
resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==}
|
||||
engines: {node: ^14.18.0 || >=16.0.0}
|
||||
hasBin: true
|
||||
@ -3395,7 +3464,6 @@ packages:
|
||||
terser:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@types/node': 20.5.8
|
||||
esbuild: 0.18.20
|
||||
postcss: 8.4.29
|
||||
rollup: 3.28.1
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Button, IconButton } from "@mui/joy";
|
||||
import { ListUserAccessTokensResponse, UserAccessToken } from "@pbtypes/proto/api/v2/user_service_pb";
|
||||
import axios from "axios";
|
||||
import copy from "copy-to-clipboard";
|
||||
import { useEffect, useState } from "react";
|
||||
import { toast } from "react-hot-toast";
|
||||
import { ListUserAccessTokensResponse, UserAccessToken } from "@/types/proto/api/v2/user_service";
|
||||
import useUserStore from "../../stores/v1/user";
|
||||
import { showCommonDialog } from "../Alert";
|
||||
import CreateAccessTokenDialog from "../CreateAccessTokenDialog";
|
||||
|
@ -1,20 +1,41 @@
|
||||
import { useEffect } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Outlet, useNavigate } from "react-router-dom";
|
||||
import { UserSetting_Locale } from "@/types/proto/api/v2/user_setting_service";
|
||||
import Header from "../components/Header";
|
||||
import useUserStore from "../stores/v1/user";
|
||||
|
||||
const Root: React.FC = () => {
|
||||
const navigate = useNavigate();
|
||||
const currentUser = useUserStore().getCurrentUser();
|
||||
const { i18n } = useTranslation();
|
||||
const userStore = useUserStore();
|
||||
const currentUser = userStore.getCurrentUser();
|
||||
const currentUserSetting = userStore.getCurrentUserSetting();
|
||||
|
||||
useEffect(() => {
|
||||
if (!currentUser) {
|
||||
navigate("/auth", {
|
||||
replace: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// Prepare user setting.
|
||||
userStore.fetchUserSetting(currentUser.id);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (!currentUserSetting) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentUserSetting.locale === UserSetting_Locale.LOCALE_EN) {
|
||||
i18n.changeLanguage("en");
|
||||
} else if (currentUserSetting.locale === UserSetting_Locale.LOCALE_ZH) {
|
||||
i18n.changeLanguage("zh");
|
||||
}
|
||||
}, [currentUserSetting]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{currentUser && (
|
||||
|
@ -1,4 +1,6 @@
|
||||
import axios from "axios";
|
||||
import { create } from "zustand";
|
||||
import { GetUserSettingResponse, UserSetting } from "@/types/proto/api/v2/user_setting_service";
|
||||
import * as api from "../../helpers/api";
|
||||
|
||||
const convertResponseModelUser = (user: User): User => {
|
||||
@ -11,7 +13,10 @@ const convertResponseModelUser = (user: User): User => {
|
||||
|
||||
interface UserState {
|
||||
userMapById: Record<UserId, User>;
|
||||
userSettingMapById: Record<UserId, UserSetting>;
|
||||
currentUserId?: UserId;
|
||||
|
||||
// User related actions.
|
||||
fetchUserList: () => Promise<User[]>;
|
||||
fetchCurrentUser: () => Promise<User>;
|
||||
getOrFetchUserById: (id: UserId) => Promise<User>;
|
||||
@ -20,10 +25,15 @@ interface UserState {
|
||||
createUser: (userCreate: UserCreate) => Promise<User>;
|
||||
patchUser: (userPatch: UserPatch) => Promise<void>;
|
||||
deleteUser: (id: UserId) => Promise<void>;
|
||||
|
||||
// User setting related actions.
|
||||
fetchUserSetting: (userId: UserId) => Promise<UserSetting>;
|
||||
getCurrentUserSetting: () => UserSetting;
|
||||
}
|
||||
|
||||
const useUserStore = create<UserState>()((set, get) => ({
|
||||
userMapById: {},
|
||||
userSettingMapById: {},
|
||||
fetchUserList: async () => {
|
||||
const { data: userList } = await api.getUserList();
|
||||
const userMap = get().userMapById;
|
||||
@ -83,6 +93,23 @@ const useUserStore = create<UserState>()((set, get) => ({
|
||||
const currentUserId = get().currentUserId;
|
||||
return userMap[currentUserId as UserId];
|
||||
},
|
||||
fetchUserSetting: async (userId: UserId) => {
|
||||
const {
|
||||
data: { userSetting },
|
||||
} = await axios.get<GetUserSettingResponse>(`api/v2/users/${userId}/settings`);
|
||||
if (!userSetting) {
|
||||
throw new Error(`User setting not found for user ${userId}`);
|
||||
}
|
||||
const userSettingMap = get().userSettingMapById;
|
||||
userSettingMap[userId] = userSetting;
|
||||
set(userSettingMap);
|
||||
return userSetting;
|
||||
},
|
||||
getCurrentUserSetting: () => {
|
||||
const userSettingMap = get().userSettingMapById;
|
||||
const currentUserId = get().currentUserId;
|
||||
return userSettingMap[currentUserId as UserId];
|
||||
},
|
||||
}));
|
||||
|
||||
export default useUserStore;
|
||||
|
42
frontend/web/src/types/proto/api/v2/common.ts
Normal file
42
frontend/web/src/types/proto/api/v2/common.ts
Normal file
@ -0,0 +1,42 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export const protobufPackage = "slash.api.v2";
|
||||
|
||||
export enum RowStatus {
|
||||
ROW_STATUS_UNSPECIFIED = 0,
|
||||
NORMAL = 1,
|
||||
ARCHIVED = 2,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function rowStatusFromJSON(object: any): RowStatus {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "ROW_STATUS_UNSPECIFIED":
|
||||
return RowStatus.ROW_STATUS_UNSPECIFIED;
|
||||
case 1:
|
||||
case "NORMAL":
|
||||
return RowStatus.NORMAL;
|
||||
case 2:
|
||||
case "ARCHIVED":
|
||||
return RowStatus.ARCHIVED;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return RowStatus.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function rowStatusToJSON(object: RowStatus): string {
|
||||
switch (object) {
|
||||
case RowStatus.ROW_STATUS_UNSPECIFIED:
|
||||
return "ROW_STATUS_UNSPECIFIED";
|
||||
case RowStatus.NORMAL:
|
||||
return "NORMAL";
|
||||
case RowStatus.ARCHIVED:
|
||||
return "ARCHIVED";
|
||||
case RowStatus.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
885
frontend/web/src/types/proto/api/v2/shortcut_service.ts
Normal file
885
frontend/web/src/types/proto/api/v2/shortcut_service.ts
Normal file
@ -0,0 +1,885 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
import { RowStatus, rowStatusFromJSON, rowStatusToJSON } from "./common";
|
||||
|
||||
export const protobufPackage = "slash.api.v2";
|
||||
|
||||
export enum Visibility {
|
||||
VISIBILITY_UNSPECIFIED = 0,
|
||||
PRIVATE = 1,
|
||||
WORKSPACE = 2,
|
||||
PUBLIC = 3,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function visibilityFromJSON(object: any): Visibility {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "VISIBILITY_UNSPECIFIED":
|
||||
return Visibility.VISIBILITY_UNSPECIFIED;
|
||||
case 1:
|
||||
case "PRIVATE":
|
||||
return Visibility.PRIVATE;
|
||||
case 2:
|
||||
case "WORKSPACE":
|
||||
return Visibility.WORKSPACE;
|
||||
case 3:
|
||||
case "PUBLIC":
|
||||
return Visibility.PUBLIC;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return Visibility.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function visibilityToJSON(object: Visibility): string {
|
||||
switch (object) {
|
||||
case Visibility.VISIBILITY_UNSPECIFIED:
|
||||
return "VISIBILITY_UNSPECIFIED";
|
||||
case Visibility.PRIVATE:
|
||||
return "PRIVATE";
|
||||
case Visibility.WORKSPACE:
|
||||
return "WORKSPACE";
|
||||
case Visibility.PUBLIC:
|
||||
return "PUBLIC";
|
||||
case Visibility.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
export interface Shortcut {
|
||||
id: number;
|
||||
creatorId: number;
|
||||
createdTs: number;
|
||||
updatedTs: number;
|
||||
rowStatus: RowStatus;
|
||||
name: string;
|
||||
link: string;
|
||||
title: string;
|
||||
tags: string[];
|
||||
description: string;
|
||||
visibility: Visibility;
|
||||
ogMetadata?: OpenGraphMetadata | undefined;
|
||||
}
|
||||
|
||||
export interface OpenGraphMetadata {
|
||||
title: string;
|
||||
description: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
export interface ListShortcutsRequest {
|
||||
}
|
||||
|
||||
export interface ListShortcutsResponse {
|
||||
shortcuts: Shortcut[];
|
||||
}
|
||||
|
||||
export interface GetShortcutRequest {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface GetShortcutResponse {
|
||||
shortcut?: Shortcut | undefined;
|
||||
}
|
||||
|
||||
export interface CreateShortcutRequest {
|
||||
shortcut?: Shortcut | undefined;
|
||||
}
|
||||
|
||||
export interface CreateShortcutResponse {
|
||||
shortcut?: Shortcut | undefined;
|
||||
}
|
||||
|
||||
export interface DeleteShortcutRequest {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface DeleteShortcutResponse {
|
||||
}
|
||||
|
||||
function createBaseShortcut(): Shortcut {
|
||||
return {
|
||||
id: 0,
|
||||
creatorId: 0,
|
||||
createdTs: 0,
|
||||
updatedTs: 0,
|
||||
rowStatus: 0,
|
||||
name: "",
|
||||
link: "",
|
||||
title: "",
|
||||
tags: [],
|
||||
description: "",
|
||||
visibility: 0,
|
||||
ogMetadata: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export const Shortcut = {
|
||||
encode(message: Shortcut, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int32(message.id);
|
||||
}
|
||||
if (message.creatorId !== 0) {
|
||||
writer.uint32(16).int32(message.creatorId);
|
||||
}
|
||||
if (message.createdTs !== 0) {
|
||||
writer.uint32(24).int64(message.createdTs);
|
||||
}
|
||||
if (message.updatedTs !== 0) {
|
||||
writer.uint32(32).int64(message.updatedTs);
|
||||
}
|
||||
if (message.rowStatus !== 0) {
|
||||
writer.uint32(40).int32(message.rowStatus);
|
||||
}
|
||||
if (message.name !== "") {
|
||||
writer.uint32(50).string(message.name);
|
||||
}
|
||||
if (message.link !== "") {
|
||||
writer.uint32(58).string(message.link);
|
||||
}
|
||||
if (message.title !== "") {
|
||||
writer.uint32(66).string(message.title);
|
||||
}
|
||||
for (const v of message.tags) {
|
||||
writer.uint32(74).string(v!);
|
||||
}
|
||||
if (message.description !== "") {
|
||||
writer.uint32(82).string(message.description);
|
||||
}
|
||||
if (message.visibility !== 0) {
|
||||
writer.uint32(88).int32(message.visibility);
|
||||
}
|
||||
if (message.ogMetadata !== undefined) {
|
||||
OpenGraphMetadata.encode(message.ogMetadata, writer.uint32(98).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Shortcut {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseShortcut();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.int32();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.creatorId = reader.int32();
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.createdTs = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 4:
|
||||
if (tag !== 32) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.updatedTs = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 5:
|
||||
if (tag !== 40) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.rowStatus = reader.int32() as any;
|
||||
continue;
|
||||
case 6:
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = reader.string();
|
||||
continue;
|
||||
case 7:
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.link = reader.string();
|
||||
continue;
|
||||
case 8:
|
||||
if (tag !== 66) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.title = reader.string();
|
||||
continue;
|
||||
case 9:
|
||||
if (tag !== 74) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.tags.push(reader.string());
|
||||
continue;
|
||||
case 10:
|
||||
if (tag !== 82) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.description = reader.string();
|
||||
continue;
|
||||
case 11:
|
||||
if (tag !== 88) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.visibility = reader.int32() as any;
|
||||
continue;
|
||||
case 12:
|
||||
if (tag !== 98) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.ogMetadata = OpenGraphMetadata.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Shortcut {
|
||||
return {
|
||||
id: isSet(object.id) ? Number(object.id) : 0,
|
||||
creatorId: isSet(object.creatorId) ? Number(object.creatorId) : 0,
|
||||
createdTs: isSet(object.createdTs) ? Number(object.createdTs) : 0,
|
||||
updatedTs: isSet(object.updatedTs) ? Number(object.updatedTs) : 0,
|
||||
rowStatus: isSet(object.rowStatus) ? rowStatusFromJSON(object.rowStatus) : 0,
|
||||
name: isSet(object.name) ? String(object.name) : "",
|
||||
link: isSet(object.link) ? String(object.link) : "",
|
||||
title: isSet(object.title) ? String(object.title) : "",
|
||||
tags: Array.isArray(object?.tags) ? object.tags.map((e: any) => String(e)) : [],
|
||||
description: isSet(object.description) ? String(object.description) : "",
|
||||
visibility: isSet(object.visibility) ? visibilityFromJSON(object.visibility) : 0,
|
||||
ogMetadata: isSet(object.ogMetadata) ? OpenGraphMetadata.fromJSON(object.ogMetadata) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Shortcut): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = Math.round(message.id));
|
||||
message.creatorId !== undefined && (obj.creatorId = Math.round(message.creatorId));
|
||||
message.createdTs !== undefined && (obj.createdTs = Math.round(message.createdTs));
|
||||
message.updatedTs !== undefined && (obj.updatedTs = Math.round(message.updatedTs));
|
||||
message.rowStatus !== undefined && (obj.rowStatus = rowStatusToJSON(message.rowStatus));
|
||||
message.name !== undefined && (obj.name = message.name);
|
||||
message.link !== undefined && (obj.link = message.link);
|
||||
message.title !== undefined && (obj.title = message.title);
|
||||
if (message.tags) {
|
||||
obj.tags = message.tags.map((e) => e);
|
||||
} else {
|
||||
obj.tags = [];
|
||||
}
|
||||
message.description !== undefined && (obj.description = message.description);
|
||||
message.visibility !== undefined && (obj.visibility = visibilityToJSON(message.visibility));
|
||||
message.ogMetadata !== undefined &&
|
||||
(obj.ogMetadata = message.ogMetadata ? OpenGraphMetadata.toJSON(message.ogMetadata) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<Shortcut>): Shortcut {
|
||||
return Shortcut.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Shortcut>): Shortcut {
|
||||
const message = createBaseShortcut();
|
||||
message.id = object.id ?? 0;
|
||||
message.creatorId = object.creatorId ?? 0;
|
||||
message.createdTs = object.createdTs ?? 0;
|
||||
message.updatedTs = object.updatedTs ?? 0;
|
||||
message.rowStatus = object.rowStatus ?? 0;
|
||||
message.name = object.name ?? "";
|
||||
message.link = object.link ?? "";
|
||||
message.title = object.title ?? "";
|
||||
message.tags = object.tags?.map((e) => e) || [];
|
||||
message.description = object.description ?? "";
|
||||
message.visibility = object.visibility ?? 0;
|
||||
message.ogMetadata = (object.ogMetadata !== undefined && object.ogMetadata !== null)
|
||||
? OpenGraphMetadata.fromPartial(object.ogMetadata)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseOpenGraphMetadata(): OpenGraphMetadata {
|
||||
return { title: "", description: "", image: "" };
|
||||
}
|
||||
|
||||
export const OpenGraphMetadata = {
|
||||
encode(message: OpenGraphMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.title !== "") {
|
||||
writer.uint32(10).string(message.title);
|
||||
}
|
||||
if (message.description !== "") {
|
||||
writer.uint32(18).string(message.description);
|
||||
}
|
||||
if (message.image !== "") {
|
||||
writer.uint32(26).string(message.image);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): OpenGraphMetadata {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseOpenGraphMetadata();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.title = reader.string();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.description = reader.string();
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.image = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): OpenGraphMetadata {
|
||||
return {
|
||||
title: isSet(object.title) ? String(object.title) : "",
|
||||
description: isSet(object.description) ? String(object.description) : "",
|
||||
image: isSet(object.image) ? String(object.image) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: OpenGraphMetadata): unknown {
|
||||
const obj: any = {};
|
||||
message.title !== undefined && (obj.title = message.title);
|
||||
message.description !== undefined && (obj.description = message.description);
|
||||
message.image !== undefined && (obj.image = message.image);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<OpenGraphMetadata>): OpenGraphMetadata {
|
||||
return OpenGraphMetadata.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<OpenGraphMetadata>): OpenGraphMetadata {
|
||||
const message = createBaseOpenGraphMetadata();
|
||||
message.title = object.title ?? "";
|
||||
message.description = object.description ?? "";
|
||||
message.image = object.image ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseListShortcutsRequest(): ListShortcutsRequest {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const ListShortcutsRequest = {
|
||||
encode(_: ListShortcutsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ListShortcutsRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseListShortcutsRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): ListShortcutsRequest {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: ListShortcutsRequest): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<ListShortcutsRequest>): ListShortcutsRequest {
|
||||
return ListShortcutsRequest.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(_: DeepPartial<ListShortcutsRequest>): ListShortcutsRequest {
|
||||
const message = createBaseListShortcutsRequest();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseListShortcutsResponse(): ListShortcutsResponse {
|
||||
return { shortcuts: [] };
|
||||
}
|
||||
|
||||
export const ListShortcutsResponse = {
|
||||
encode(message: ListShortcutsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.shortcuts) {
|
||||
Shortcut.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ListShortcutsResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseListShortcutsResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.shortcuts.push(Shortcut.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ListShortcutsResponse {
|
||||
return {
|
||||
shortcuts: Array.isArray(object?.shortcuts) ? object.shortcuts.map((e: any) => Shortcut.fromJSON(e)) : [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: ListShortcutsResponse): unknown {
|
||||
const obj: any = {};
|
||||
if (message.shortcuts) {
|
||||
obj.shortcuts = message.shortcuts.map((e) => e ? Shortcut.toJSON(e) : undefined);
|
||||
} else {
|
||||
obj.shortcuts = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<ListShortcutsResponse>): ListShortcutsResponse {
|
||||
return ListShortcutsResponse.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<ListShortcutsResponse>): ListShortcutsResponse {
|
||||
const message = createBaseListShortcutsResponse();
|
||||
message.shortcuts = object.shortcuts?.map((e) => Shortcut.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGetShortcutRequest(): GetShortcutRequest {
|
||||
return { name: "" };
|
||||
}
|
||||
|
||||
export const GetShortcutRequest = {
|
||||
encode(message: GetShortcutRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.name !== "") {
|
||||
writer.uint32(10).string(message.name);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GetShortcutRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGetShortcutRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GetShortcutRequest {
|
||||
return { name: isSet(object.name) ? String(object.name) : "" };
|
||||
},
|
||||
|
||||
toJSON(message: GetShortcutRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.name !== undefined && (obj.name = message.name);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<GetShortcutRequest>): GetShortcutRequest {
|
||||
return GetShortcutRequest.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<GetShortcutRequest>): GetShortcutRequest {
|
||||
const message = createBaseGetShortcutRequest();
|
||||
message.name = object.name ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGetShortcutResponse(): GetShortcutResponse {
|
||||
return { shortcut: undefined };
|
||||
}
|
||||
|
||||
export const GetShortcutResponse = {
|
||||
encode(message: GetShortcutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.shortcut !== undefined) {
|
||||
Shortcut.encode(message.shortcut, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GetShortcutResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGetShortcutResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.shortcut = Shortcut.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GetShortcutResponse {
|
||||
return { shortcut: isSet(object.shortcut) ? Shortcut.fromJSON(object.shortcut) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: GetShortcutResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.shortcut !== undefined && (obj.shortcut = message.shortcut ? Shortcut.toJSON(message.shortcut) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<GetShortcutResponse>): GetShortcutResponse {
|
||||
return GetShortcutResponse.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<GetShortcutResponse>): GetShortcutResponse {
|
||||
const message = createBaseGetShortcutResponse();
|
||||
message.shortcut = (object.shortcut !== undefined && object.shortcut !== null)
|
||||
? Shortcut.fromPartial(object.shortcut)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCreateShortcutRequest(): CreateShortcutRequest {
|
||||
return { shortcut: undefined };
|
||||
}
|
||||
|
||||
export const CreateShortcutRequest = {
|
||||
encode(message: CreateShortcutRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.shortcut !== undefined) {
|
||||
Shortcut.encode(message.shortcut, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): CreateShortcutRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCreateShortcutRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.shortcut = Shortcut.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CreateShortcutRequest {
|
||||
return { shortcut: isSet(object.shortcut) ? Shortcut.fromJSON(object.shortcut) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: CreateShortcutRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.shortcut !== undefined && (obj.shortcut = message.shortcut ? Shortcut.toJSON(message.shortcut) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<CreateShortcutRequest>): CreateShortcutRequest {
|
||||
return CreateShortcutRequest.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<CreateShortcutRequest>): CreateShortcutRequest {
|
||||
const message = createBaseCreateShortcutRequest();
|
||||
message.shortcut = (object.shortcut !== undefined && object.shortcut !== null)
|
||||
? Shortcut.fromPartial(object.shortcut)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCreateShortcutResponse(): CreateShortcutResponse {
|
||||
return { shortcut: undefined };
|
||||
}
|
||||
|
||||
export const CreateShortcutResponse = {
|
||||
encode(message: CreateShortcutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.shortcut !== undefined) {
|
||||
Shortcut.encode(message.shortcut, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): CreateShortcutResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCreateShortcutResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.shortcut = Shortcut.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CreateShortcutResponse {
|
||||
return { shortcut: isSet(object.shortcut) ? Shortcut.fromJSON(object.shortcut) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: CreateShortcutResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.shortcut !== undefined && (obj.shortcut = message.shortcut ? Shortcut.toJSON(message.shortcut) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<CreateShortcutResponse>): CreateShortcutResponse {
|
||||
return CreateShortcutResponse.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<CreateShortcutResponse>): CreateShortcutResponse {
|
||||
const message = createBaseCreateShortcutResponse();
|
||||
message.shortcut = (object.shortcut !== undefined && object.shortcut !== null)
|
||||
? Shortcut.fromPartial(object.shortcut)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDeleteShortcutRequest(): DeleteShortcutRequest {
|
||||
return { name: "" };
|
||||
}
|
||||
|
||||
export const DeleteShortcutRequest = {
|
||||
encode(message: DeleteShortcutRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.name !== "") {
|
||||
writer.uint32(10).string(message.name);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DeleteShortcutRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDeleteShortcutRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DeleteShortcutRequest {
|
||||
return { name: isSet(object.name) ? String(object.name) : "" };
|
||||
},
|
||||
|
||||
toJSON(message: DeleteShortcutRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.name !== undefined && (obj.name = message.name);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<DeleteShortcutRequest>): DeleteShortcutRequest {
|
||||
return DeleteShortcutRequest.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<DeleteShortcutRequest>): DeleteShortcutRequest {
|
||||
const message = createBaseDeleteShortcutRequest();
|
||||
message.name = object.name ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDeleteShortcutResponse(): DeleteShortcutResponse {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const DeleteShortcutResponse = {
|
||||
encode(_: DeleteShortcutResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DeleteShortcutResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDeleteShortcutResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): DeleteShortcutResponse {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: DeleteShortcutResponse): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<DeleteShortcutResponse>): DeleteShortcutResponse {
|
||||
return DeleteShortcutResponse.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(_: DeepPartial<DeleteShortcutResponse>): DeleteShortcutResponse {
|
||||
const message = createBaseDeleteShortcutResponse();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare const self: any | undefined;
|
||||
declare const window: any | undefined;
|
||||
declare const global: any | undefined;
|
||||
const tsProtoGlobalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") {
|
||||
return globalThis;
|
||||
}
|
||||
if (typeof self !== "undefined") {
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== "undefined") {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== "undefined") {
|
||||
return global;
|
||||
}
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function longToNumber(long: Long): number {
|
||||
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
||||
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
return long.toNumber();
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
1229
frontend/web/src/types/proto/api/v2/user_service.ts
Normal file
1229
frontend/web/src/types/proto/api/v2/user_service.ts
Normal file
File diff suppressed because it is too large
Load Diff
418
frontend/web/src/types/proto/api/v2/user_setting_service.ts
Normal file
418
frontend/web/src/types/proto/api/v2/user_setting_service.ts
Normal file
@ -0,0 +1,418 @@
|
||||
/* eslint-disable */
|
||||
import _m0 from "protobufjs/minimal";
|
||||
import { FieldMask } from "../../google/protobuf/field_mask";
|
||||
|
||||
export const protobufPackage = "slash.api.v2";
|
||||
|
||||
export interface UserSetting {
|
||||
/** id is the user id. */
|
||||
id: number;
|
||||
/** locale is the user locale. */
|
||||
locale: UserSetting_Locale;
|
||||
}
|
||||
|
||||
export enum UserSetting_Locale {
|
||||
LOCALE_UNSPECIFIED = 0,
|
||||
LOCALE_EN = 1,
|
||||
LOCALE_ZH = 2,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function userSetting_LocaleFromJSON(object: any): UserSetting_Locale {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "LOCALE_UNSPECIFIED":
|
||||
return UserSetting_Locale.LOCALE_UNSPECIFIED;
|
||||
case 1:
|
||||
case "LOCALE_EN":
|
||||
return UserSetting_Locale.LOCALE_EN;
|
||||
case 2:
|
||||
case "LOCALE_ZH":
|
||||
return UserSetting_Locale.LOCALE_ZH;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return UserSetting_Locale.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function userSetting_LocaleToJSON(object: UserSetting_Locale): string {
|
||||
switch (object) {
|
||||
case UserSetting_Locale.LOCALE_UNSPECIFIED:
|
||||
return "LOCALE_UNSPECIFIED";
|
||||
case UserSetting_Locale.LOCALE_EN:
|
||||
return "LOCALE_EN";
|
||||
case UserSetting_Locale.LOCALE_ZH:
|
||||
return "LOCALE_ZH";
|
||||
case UserSetting_Locale.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
export interface GetUserSettingRequest {
|
||||
/** id is the user id. */
|
||||
id: number;
|
||||
}
|
||||
|
||||
export interface GetUserSettingResponse {
|
||||
userSetting?: UserSetting | undefined;
|
||||
}
|
||||
|
||||
export interface UpdateUserSettingRequest {
|
||||
/** id is the user id. */
|
||||
id: number;
|
||||
/** user_setting is the user setting to update. */
|
||||
userSetting?:
|
||||
| UserSetting
|
||||
| undefined;
|
||||
/** update_mask is the field mask to update the user setting. */
|
||||
updateMask?: string[] | undefined;
|
||||
}
|
||||
|
||||
export interface UpdateUserSettingResponse {
|
||||
userSetting?: UserSetting | undefined;
|
||||
}
|
||||
|
||||
function createBaseUserSetting(): UserSetting {
|
||||
return { id: 0, locale: 0 };
|
||||
}
|
||||
|
||||
export const UserSetting = {
|
||||
encode(message: UserSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int32(message.id);
|
||||
}
|
||||
if (message.locale !== 0) {
|
||||
writer.uint32(16).int32(message.locale);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): UserSetting {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseUserSetting();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.int32();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.locale = reader.int32() as any;
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): UserSetting {
|
||||
return {
|
||||
id: isSet(object.id) ? Number(object.id) : 0,
|
||||
locale: isSet(object.locale) ? userSetting_LocaleFromJSON(object.locale) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: UserSetting): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = Math.round(message.id));
|
||||
message.locale !== undefined && (obj.locale = userSetting_LocaleToJSON(message.locale));
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<UserSetting>): UserSetting {
|
||||
return UserSetting.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<UserSetting>): UserSetting {
|
||||
const message = createBaseUserSetting();
|
||||
message.id = object.id ?? 0;
|
||||
message.locale = object.locale ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGetUserSettingRequest(): GetUserSettingRequest {
|
||||
return { id: 0 };
|
||||
}
|
||||
|
||||
export const GetUserSettingRequest = {
|
||||
encode(message: GetUserSettingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int32(message.id);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GetUserSettingRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGetUserSettingRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.int32();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GetUserSettingRequest {
|
||||
return { id: isSet(object.id) ? Number(object.id) : 0 };
|
||||
},
|
||||
|
||||
toJSON(message: GetUserSettingRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = Math.round(message.id));
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<GetUserSettingRequest>): GetUserSettingRequest {
|
||||
return GetUserSettingRequest.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<GetUserSettingRequest>): GetUserSettingRequest {
|
||||
const message = createBaseGetUserSettingRequest();
|
||||
message.id = object.id ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseGetUserSettingResponse(): GetUserSettingResponse {
|
||||
return { userSetting: undefined };
|
||||
}
|
||||
|
||||
export const GetUserSettingResponse = {
|
||||
encode(message: GetUserSettingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.userSetting !== undefined) {
|
||||
UserSetting.encode(message.userSetting, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GetUserSettingResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGetUserSettingResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.userSetting = UserSetting.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GetUserSettingResponse {
|
||||
return { userSetting: isSet(object.userSetting) ? UserSetting.fromJSON(object.userSetting) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: GetUserSettingResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.userSetting !== undefined &&
|
||||
(obj.userSetting = message.userSetting ? UserSetting.toJSON(message.userSetting) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<GetUserSettingResponse>): GetUserSettingResponse {
|
||||
return GetUserSettingResponse.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<GetUserSettingResponse>): GetUserSettingResponse {
|
||||
const message = createBaseGetUserSettingResponse();
|
||||
message.userSetting = (object.userSetting !== undefined && object.userSetting !== null)
|
||||
? UserSetting.fromPartial(object.userSetting)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseUpdateUserSettingRequest(): UpdateUserSettingRequest {
|
||||
return { id: 0, userSetting: undefined, updateMask: undefined };
|
||||
}
|
||||
|
||||
export const UpdateUserSettingRequest = {
|
||||
encode(message: UpdateUserSettingRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int32(message.id);
|
||||
}
|
||||
if (message.userSetting !== undefined) {
|
||||
UserSetting.encode(message.userSetting, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
if (message.updateMask !== undefined) {
|
||||
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserSettingRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseUpdateUserSettingRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.int32();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.userSetting = UserSetting.decode(reader, reader.uint32());
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): UpdateUserSettingRequest {
|
||||
return {
|
||||
id: isSet(object.id) ? Number(object.id) : 0,
|
||||
userSetting: isSet(object.userSetting) ? UserSetting.fromJSON(object.userSetting) : undefined,
|
||||
updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: UpdateUserSettingRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = Math.round(message.id));
|
||||
message.userSetting !== undefined &&
|
||||
(obj.userSetting = message.userSetting ? UserSetting.toJSON(message.userSetting) : undefined);
|
||||
message.updateMask !== undefined && (obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask)));
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<UpdateUserSettingRequest>): UpdateUserSettingRequest {
|
||||
return UpdateUserSettingRequest.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<UpdateUserSettingRequest>): UpdateUserSettingRequest {
|
||||
const message = createBaseUpdateUserSettingRequest();
|
||||
message.id = object.id ?? 0;
|
||||
message.userSetting = (object.userSetting !== undefined && object.userSetting !== null)
|
||||
? UserSetting.fromPartial(object.userSetting)
|
||||
: undefined;
|
||||
message.updateMask = object.updateMask ?? undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseUpdateUserSettingResponse(): UpdateUserSettingResponse {
|
||||
return { userSetting: undefined };
|
||||
}
|
||||
|
||||
export const UpdateUserSettingResponse = {
|
||||
encode(message: UpdateUserSettingResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.userSetting !== undefined) {
|
||||
UserSetting.encode(message.userSetting, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserSettingResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseUpdateUserSettingResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.userSetting = UserSetting.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): UpdateUserSettingResponse {
|
||||
return { userSetting: isSet(object.userSetting) ? UserSetting.fromJSON(object.userSetting) : undefined };
|
||||
},
|
||||
|
||||
toJSON(message: UpdateUserSettingResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.userSetting !== undefined &&
|
||||
(obj.userSetting = message.userSetting ? UserSetting.toJSON(message.userSetting) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<UpdateUserSettingResponse>): UpdateUserSettingResponse {
|
||||
return UpdateUserSettingResponse.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<UpdateUserSettingResponse>): UpdateUserSettingResponse {
|
||||
const message = createBaseUpdateUserSettingResponse();
|
||||
message.userSetting = (object.userSetting !== undefined && object.userSetting !== null)
|
||||
? UserSetting.fromPartial(object.userSetting)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
3
frontend/web/src/types/proto/google/api/annotations.ts
Normal file
3
frontend/web/src/types/proto/google/api/annotations.ts
Normal file
@ -0,0 +1,3 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export const protobufPackage = "google.api";
|
2019
frontend/web/src/types/proto/google/api/client.ts
Normal file
2019
frontend/web/src/types/proto/google/api/client.ts
Normal file
File diff suppressed because it is too large
Load Diff
726
frontend/web/src/types/proto/google/api/http.ts
Normal file
726
frontend/web/src/types/proto/google/api/http.ts
Normal file
@ -0,0 +1,726 @@
|
||||
/* eslint-disable */
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.api";
|
||||
|
||||
/**
|
||||
* Defines the HTTP configuration for an API service. It contains a list of
|
||||
* [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
|
||||
* to one or more HTTP REST API methods.
|
||||
*/
|
||||
export interface Http {
|
||||
/**
|
||||
* A list of HTTP configuration rules that apply to individual API methods.
|
||||
*
|
||||
* **NOTE:** All service configuration rules follow "last one wins" order.
|
||||
*/
|
||||
rules: HttpRule[];
|
||||
/**
|
||||
* When set to true, URL path parameters will be fully URI-decoded except in
|
||||
* cases of single segment matches in reserved expansion, where "%2F" will be
|
||||
* left encoded.
|
||||
*
|
||||
* The default behavior is to not decode RFC 6570 reserved characters in multi
|
||||
* segment matches.
|
||||
*/
|
||||
fullyDecodeReservedExpansion: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* # gRPC Transcoding
|
||||
*
|
||||
* gRPC Transcoding is a feature for mapping between a gRPC method and one or
|
||||
* more HTTP REST endpoints. It allows developers to build a single API service
|
||||
* that supports both gRPC APIs and REST APIs. Many systems, including [Google
|
||||
* APIs](https://github.com/googleapis/googleapis),
|
||||
* [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
|
||||
* Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
|
||||
* and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
|
||||
* and use it for large scale production services.
|
||||
*
|
||||
* `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
|
||||
* how different portions of the gRPC request message are mapped to the URL
|
||||
* path, URL query parameters, and HTTP request body. It also controls how the
|
||||
* gRPC response message is mapped to the HTTP response body. `HttpRule` is
|
||||
* typically specified as an `google.api.http` annotation on the gRPC method.
|
||||
*
|
||||
* Each mapping specifies a URL path template and an HTTP method. The path
|
||||
* template may refer to one or more fields in the gRPC request message, as long
|
||||
* as each field is a non-repeated field with a primitive (non-message) type.
|
||||
* The path template controls how fields of the request message are mapped to
|
||||
* the URL path.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc GetMessage(GetMessageRequest) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* get: "/v1/{name=messages/*}"
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message GetMessageRequest {
|
||||
* string name = 1; // Mapped to URL path.
|
||||
* }
|
||||
* message Message {
|
||||
* string text = 1; // The resource content.
|
||||
* }
|
||||
*
|
||||
* This enables an HTTP REST to gRPC mapping as below:
|
||||
*
|
||||
* HTTP | gRPC
|
||||
* -----|-----
|
||||
* `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")`
|
||||
*
|
||||
* Any fields in the request message which are not bound by the path template
|
||||
* automatically become HTTP query parameters if there is no HTTP request body.
|
||||
* For example:
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc GetMessage(GetMessageRequest) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* get:"/v1/messages/{message_id}"
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message GetMessageRequest {
|
||||
* message SubMessage {
|
||||
* string subfield = 1;
|
||||
* }
|
||||
* string message_id = 1; // Mapped to URL path.
|
||||
* int64 revision = 2; // Mapped to URL query parameter `revision`.
|
||||
* SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`.
|
||||
* }
|
||||
*
|
||||
* This enables a HTTP JSON to RPC mapping as below:
|
||||
*
|
||||
* HTTP | gRPC
|
||||
* -----|-----
|
||||
* `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
|
||||
* `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
|
||||
* "foo"))`
|
||||
*
|
||||
* Note that fields which are mapped to URL query parameters must have a
|
||||
* primitive type or a repeated primitive type or a non-repeated message type.
|
||||
* In the case of a repeated type, the parameter can be repeated in the URL
|
||||
* as `...?param=A¶m=B`. In the case of a message type, each field of the
|
||||
* message is mapped to a separate parameter, such as
|
||||
* `...?foo.a=A&foo.b=B&foo.c=C`.
|
||||
*
|
||||
* For HTTP methods that allow a request body, the `body` field
|
||||
* specifies the mapping. Consider a REST update method on the
|
||||
* message resource collection:
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* patch: "/v1/messages/{message_id}"
|
||||
* body: "message"
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message UpdateMessageRequest {
|
||||
* string message_id = 1; // mapped to the URL
|
||||
* Message message = 2; // mapped to the body
|
||||
* }
|
||||
*
|
||||
* The following HTTP JSON to RPC mapping is enabled, where the
|
||||
* representation of the JSON in the request body is determined by
|
||||
* protos JSON encoding:
|
||||
*
|
||||
* HTTP | gRPC
|
||||
* -----|-----
|
||||
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
|
||||
* "123456" message { text: "Hi!" })`
|
||||
*
|
||||
* The special name `*` can be used in the body mapping to define that
|
||||
* every field not bound by the path template should be mapped to the
|
||||
* request body. This enables the following alternative definition of
|
||||
* the update method:
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc UpdateMessage(Message) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* patch: "/v1/messages/{message_id}"
|
||||
* body: "*"
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message Message {
|
||||
* string message_id = 1;
|
||||
* string text = 2;
|
||||
* }
|
||||
*
|
||||
* The following HTTP JSON to RPC mapping is enabled:
|
||||
*
|
||||
* HTTP | gRPC
|
||||
* -----|-----
|
||||
* `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
|
||||
* "123456" text: "Hi!")`
|
||||
*
|
||||
* Note that when using `*` in the body mapping, it is not possible to
|
||||
* have HTTP parameters, as all fields not bound by the path end in
|
||||
* the body. This makes this option more rarely used in practice when
|
||||
* defining REST APIs. The common usage of `*` is in custom methods
|
||||
* which don't use the URL at all for transferring data.
|
||||
*
|
||||
* It is possible to define multiple HTTP methods for one RPC by using
|
||||
* the `additional_bindings` option. Example:
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc GetMessage(GetMessageRequest) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* get: "/v1/messages/{message_id}"
|
||||
* additional_bindings {
|
||||
* get: "/v1/users/{user_id}/messages/{message_id}"
|
||||
* }
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message GetMessageRequest {
|
||||
* string message_id = 1;
|
||||
* string user_id = 2;
|
||||
* }
|
||||
*
|
||||
* This enables the following two alternative HTTP JSON to RPC mappings:
|
||||
*
|
||||
* HTTP | gRPC
|
||||
* -----|-----
|
||||
* `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
|
||||
* `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
|
||||
* "123456")`
|
||||
*
|
||||
* ## Rules for HTTP mapping
|
||||
*
|
||||
* 1. Leaf request fields (recursive expansion nested messages in the request
|
||||
* message) are classified into three categories:
|
||||
* - Fields referred by the path template. They are passed via the URL path.
|
||||
* - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
|
||||
* are passed via the HTTP
|
||||
* request body.
|
||||
* - All other fields are passed via the URL query parameters, and the
|
||||
* parameter name is the field path in the request message. A repeated
|
||||
* field can be represented as multiple query parameters under the same
|
||||
* name.
|
||||
* 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
|
||||
* query parameter, all fields
|
||||
* are passed via URL path and HTTP request body.
|
||||
* 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
|
||||
* request body, all
|
||||
* fields are passed via URL path and URL query parameters.
|
||||
*
|
||||
* ### Path template syntax
|
||||
*
|
||||
* Template = "/" Segments [ Verb ] ;
|
||||
* Segments = Segment { "/" Segment } ;
|
||||
* Segment = "*" | "**" | LITERAL | Variable ;
|
||||
* Variable = "{" FieldPath [ "=" Segments ] "}" ;
|
||||
* FieldPath = IDENT { "." IDENT } ;
|
||||
* Verb = ":" LITERAL ;
|
||||
*
|
||||
* The syntax `*` matches a single URL path segment. The syntax `**` matches
|
||||
* zero or more URL path segments, which must be the last part of the URL path
|
||||
* except the `Verb`.
|
||||
*
|
||||
* The syntax `Variable` matches part of the URL path as specified by its
|
||||
* template. A variable template must not contain other variables. If a variable
|
||||
* matches a single path segment, its template may be omitted, e.g. `{var}`
|
||||
* is equivalent to `{var=*}`.
|
||||
*
|
||||
* The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
|
||||
* contains any reserved character, such characters should be percent-encoded
|
||||
* before the matching.
|
||||
*
|
||||
* If a variable contains exactly one path segment, such as `"{var}"` or
|
||||
* `"{var=*}"`, when such a variable is expanded into a URL path on the client
|
||||
* side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
|
||||
* server side does the reverse decoding. Such variables show up in the
|
||||
* [Discovery
|
||||
* Document](https://developers.google.com/discovery/v1/reference/apis) as
|
||||
* `{var}`.
|
||||
*
|
||||
* If a variable contains multiple path segments, such as `"{var=foo/*}"`
|
||||
* or `"{var=**}"`, when such a variable is expanded into a URL path on the
|
||||
* client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
|
||||
* The server side does the reverse decoding, except "%2F" and "%2f" are left
|
||||
* unchanged. Such variables show up in the
|
||||
* [Discovery
|
||||
* Document](https://developers.google.com/discovery/v1/reference/apis) as
|
||||
* `{+var}`.
|
||||
*
|
||||
* ## Using gRPC API Service Configuration
|
||||
*
|
||||
* gRPC API Service Configuration (service config) is a configuration language
|
||||
* for configuring a gRPC service to become a user-facing product. The
|
||||
* service config is simply the YAML representation of the `google.api.Service`
|
||||
* proto message.
|
||||
*
|
||||
* As an alternative to annotating your proto file, you can configure gRPC
|
||||
* transcoding in your service config YAML files. You do this by specifying a
|
||||
* `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
|
||||
* effect as the proto annotation. This can be particularly useful if you
|
||||
* have a proto that is reused in multiple services. Note that any transcoding
|
||||
* specified in the service config will override any matching transcoding
|
||||
* configuration in the proto.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* http:
|
||||
* rules:
|
||||
* # Selects a gRPC method and applies HttpRule to it.
|
||||
* - selector: example.v1.Messaging.GetMessage
|
||||
* get: /v1/messages/{message_id}/{sub.subfield}
|
||||
*
|
||||
* ## Special notes
|
||||
*
|
||||
* When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
|
||||
* proto to JSON conversion must follow the [proto3
|
||||
* specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
|
||||
*
|
||||
* While the single segment variable follows the semantics of
|
||||
* [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
|
||||
* Expansion, the multi segment variable **does not** follow RFC 6570 Section
|
||||
* 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
|
||||
* does not expand special characters like `?` and `#`, which would lead
|
||||
* to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
|
||||
* for multi segment variables.
|
||||
*
|
||||
* The path variables **must not** refer to any repeated or mapped field,
|
||||
* because client libraries are not capable of handling such variable expansion.
|
||||
*
|
||||
* The path variables **must not** capture the leading "/" character. The reason
|
||||
* is that the most common use case "{var}" does not capture the leading "/"
|
||||
* character. For consistency, all path variables must share the same behavior.
|
||||
*
|
||||
* Repeated message fields must not be mapped to URL query parameters, because
|
||||
* no client library can support such complicated mapping.
|
||||
*
|
||||
* If an API needs to use a JSON array for request or response body, it can map
|
||||
* the request or response body to a repeated field. However, some gRPC
|
||||
* Transcoding implementations may not support this feature.
|
||||
*/
|
||||
export interface HttpRule {
|
||||
/**
|
||||
* Selects a method to which this rule applies.
|
||||
*
|
||||
* Refer to [selector][google.api.DocumentationRule.selector] for syntax
|
||||
* details.
|
||||
*/
|
||||
selector: string;
|
||||
/**
|
||||
* Maps to HTTP GET. Used for listing and getting information about
|
||||
* resources.
|
||||
*/
|
||||
get?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Maps to HTTP PUT. Used for replacing a resource. */
|
||||
put?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Maps to HTTP POST. Used for creating a resource or performing an action. */
|
||||
post?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Maps to HTTP DELETE. Used for deleting a resource. */
|
||||
delete?:
|
||||
| string
|
||||
| undefined;
|
||||
/** Maps to HTTP PATCH. Used for updating a resource. */
|
||||
patch?:
|
||||
| string
|
||||
| undefined;
|
||||
/**
|
||||
* The custom pattern is used for specifying an HTTP method that is not
|
||||
* included in the `pattern` field, such as HEAD, or "*" to leave the
|
||||
* HTTP method unspecified for this rule. The wild-card rule is useful
|
||||
* for services that provide content to Web (HTML) clients.
|
||||
*/
|
||||
custom?:
|
||||
| CustomHttpPattern
|
||||
| undefined;
|
||||
/**
|
||||
* The name of the request field whose value is mapped to the HTTP request
|
||||
* body, or `*` for mapping all request fields not captured by the path
|
||||
* pattern to the HTTP body, or omitted for not having any HTTP request body.
|
||||
*
|
||||
* NOTE: the referred field must be present at the top-level of the request
|
||||
* message type.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* Optional. The name of the response field whose value is mapped to the HTTP
|
||||
* response body. When omitted, the entire response message will be used
|
||||
* as the HTTP response body.
|
||||
*
|
||||
* NOTE: The referred field must be present at the top-level of the response
|
||||
* message type.
|
||||
*/
|
||||
responseBody: string;
|
||||
/**
|
||||
* Additional HTTP bindings for the selector. Nested bindings must
|
||||
* not contain an `additional_bindings` field themselves (that is,
|
||||
* the nesting may only be one level deep).
|
||||
*/
|
||||
additionalBindings: HttpRule[];
|
||||
}
|
||||
|
||||
/** A custom pattern is used for defining custom HTTP verb. */
|
||||
export interface CustomHttpPattern {
|
||||
/** The name of this custom HTTP verb. */
|
||||
kind: string;
|
||||
/** The path matched by this custom verb. */
|
||||
path: string;
|
||||
}
|
||||
|
||||
function createBaseHttp(): Http {
|
||||
return { rules: [], fullyDecodeReservedExpansion: false };
|
||||
}
|
||||
|
||||
export const Http = {
|
||||
encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.rules) {
|
||||
HttpRule.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.fullyDecodeReservedExpansion === true) {
|
||||
writer.uint32(16).bool(message.fullyDecodeReservedExpansion);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Http {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseHttp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.rules.push(HttpRule.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.fullyDecodeReservedExpansion = reader.bool();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Http {
|
||||
return {
|
||||
rules: Array.isArray(object?.rules) ? object.rules.map((e: any) => HttpRule.fromJSON(e)) : [],
|
||||
fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion)
|
||||
? Boolean(object.fullyDecodeReservedExpansion)
|
||||
: false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Http): unknown {
|
||||
const obj: any = {};
|
||||
if (message.rules) {
|
||||
obj.rules = message.rules.map((e) => e ? HttpRule.toJSON(e) : undefined);
|
||||
} else {
|
||||
obj.rules = [];
|
||||
}
|
||||
message.fullyDecodeReservedExpansion !== undefined &&
|
||||
(obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<Http>): Http {
|
||||
return Http.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Http>): Http {
|
||||
const message = createBaseHttp();
|
||||
message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || [];
|
||||
message.fullyDecodeReservedExpansion = object.fullyDecodeReservedExpansion ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseHttpRule(): HttpRule {
|
||||
return {
|
||||
selector: "",
|
||||
get: undefined,
|
||||
put: undefined,
|
||||
post: undefined,
|
||||
delete: undefined,
|
||||
patch: undefined,
|
||||
custom: undefined,
|
||||
body: "",
|
||||
responseBody: "",
|
||||
additionalBindings: [],
|
||||
};
|
||||
}
|
||||
|
||||
export const HttpRule = {
|
||||
encode(message: HttpRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.selector !== "") {
|
||||
writer.uint32(10).string(message.selector);
|
||||
}
|
||||
if (message.get !== undefined) {
|
||||
writer.uint32(18).string(message.get);
|
||||
}
|
||||
if (message.put !== undefined) {
|
||||
writer.uint32(26).string(message.put);
|
||||
}
|
||||
if (message.post !== undefined) {
|
||||
writer.uint32(34).string(message.post);
|
||||
}
|
||||
if (message.delete !== undefined) {
|
||||
writer.uint32(42).string(message.delete);
|
||||
}
|
||||
if (message.patch !== undefined) {
|
||||
writer.uint32(50).string(message.patch);
|
||||
}
|
||||
if (message.custom !== undefined) {
|
||||
CustomHttpPattern.encode(message.custom, writer.uint32(66).fork()).ldelim();
|
||||
}
|
||||
if (message.body !== "") {
|
||||
writer.uint32(58).string(message.body);
|
||||
}
|
||||
if (message.responseBody !== "") {
|
||||
writer.uint32(98).string(message.responseBody);
|
||||
}
|
||||
for (const v of message.additionalBindings) {
|
||||
HttpRule.encode(v!, writer.uint32(90).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseHttpRule();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.selector = reader.string();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.get = reader.string();
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.put = reader.string();
|
||||
continue;
|
||||
case 4:
|
||||
if (tag !== 34) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.post = reader.string();
|
||||
continue;
|
||||
case 5:
|
||||
if (tag !== 42) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.delete = reader.string();
|
||||
continue;
|
||||
case 6:
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.patch = reader.string();
|
||||
continue;
|
||||
case 8:
|
||||
if (tag !== 66) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.custom = CustomHttpPattern.decode(reader, reader.uint32());
|
||||
continue;
|
||||
case 7:
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.body = reader.string();
|
||||
continue;
|
||||
case 12:
|
||||
if (tag !== 98) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.responseBody = reader.string();
|
||||
continue;
|
||||
case 11:
|
||||
if (tag !== 90) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.additionalBindings.push(HttpRule.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): HttpRule {
|
||||
return {
|
||||
selector: isSet(object.selector) ? String(object.selector) : "",
|
||||
get: isSet(object.get) ? String(object.get) : undefined,
|
||||
put: isSet(object.put) ? String(object.put) : undefined,
|
||||
post: isSet(object.post) ? String(object.post) : undefined,
|
||||
delete: isSet(object.delete) ? String(object.delete) : undefined,
|
||||
patch: isSet(object.patch) ? String(object.patch) : undefined,
|
||||
custom: isSet(object.custom) ? CustomHttpPattern.fromJSON(object.custom) : undefined,
|
||||
body: isSet(object.body) ? String(object.body) : "",
|
||||
responseBody: isSet(object.responseBody) ? String(object.responseBody) : "",
|
||||
additionalBindings: Array.isArray(object?.additionalBindings)
|
||||
? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: HttpRule): unknown {
|
||||
const obj: any = {};
|
||||
message.selector !== undefined && (obj.selector = message.selector);
|
||||
message.get !== undefined && (obj.get = message.get);
|
||||
message.put !== undefined && (obj.put = message.put);
|
||||
message.post !== undefined && (obj.post = message.post);
|
||||
message.delete !== undefined && (obj.delete = message.delete);
|
||||
message.patch !== undefined && (obj.patch = message.patch);
|
||||
message.custom !== undefined &&
|
||||
(obj.custom = message.custom ? CustomHttpPattern.toJSON(message.custom) : undefined);
|
||||
message.body !== undefined && (obj.body = message.body);
|
||||
message.responseBody !== undefined && (obj.responseBody = message.responseBody);
|
||||
if (message.additionalBindings) {
|
||||
obj.additionalBindings = message.additionalBindings.map((e) => e ? HttpRule.toJSON(e) : undefined);
|
||||
} else {
|
||||
obj.additionalBindings = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<HttpRule>): HttpRule {
|
||||
return HttpRule.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<HttpRule>): HttpRule {
|
||||
const message = createBaseHttpRule();
|
||||
message.selector = object.selector ?? "";
|
||||
message.get = object.get ?? undefined;
|
||||
message.put = object.put ?? undefined;
|
||||
message.post = object.post ?? undefined;
|
||||
message.delete = object.delete ?? undefined;
|
||||
message.patch = object.patch ?? undefined;
|
||||
message.custom = (object.custom !== undefined && object.custom !== null)
|
||||
? CustomHttpPattern.fromPartial(object.custom)
|
||||
: undefined;
|
||||
message.body = object.body ?? "";
|
||||
message.responseBody = object.responseBody ?? "";
|
||||
message.additionalBindings = object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCustomHttpPattern(): CustomHttpPattern {
|
||||
return { kind: "", path: "" };
|
||||
}
|
||||
|
||||
export const CustomHttpPattern = {
|
||||
encode(message: CustomHttpPattern, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.kind !== "") {
|
||||
writer.uint32(10).string(message.kind);
|
||||
}
|
||||
if (message.path !== "") {
|
||||
writer.uint32(18).string(message.path);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCustomHttpPattern();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.kind = reader.string();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.path = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CustomHttpPattern {
|
||||
return { kind: isSet(object.kind) ? String(object.kind) : "", path: isSet(object.path) ? String(object.path) : "" };
|
||||
},
|
||||
|
||||
toJSON(message: CustomHttpPattern): unknown {
|
||||
const obj: any = {};
|
||||
message.kind !== undefined && (obj.kind = message.kind);
|
||||
message.path !== undefined && (obj.path = message.path);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<CustomHttpPattern>): CustomHttpPattern {
|
||||
return CustomHttpPattern.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<CustomHttpPattern>): CustomHttpPattern {
|
||||
const message = createBaseCustomHttpPattern();
|
||||
message.kind = object.kind ?? "";
|
||||
message.path = object.path ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
115
frontend/web/src/types/proto/google/api/launch_stage.ts
Normal file
115
frontend/web/src/types/proto/google/api/launch_stage.ts
Normal file
@ -0,0 +1,115 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export const protobufPackage = "google.api";
|
||||
|
||||
/**
|
||||
* The launch stage as defined by [Google Cloud Platform
|
||||
* Launch Stages](https://cloud.google.com/terms/launch-stages).
|
||||
*/
|
||||
export enum LaunchStage {
|
||||
/** LAUNCH_STAGE_UNSPECIFIED - Do not use this default value. */
|
||||
LAUNCH_STAGE_UNSPECIFIED = 0,
|
||||
/** UNIMPLEMENTED - The feature is not yet implemented. Users can not use it. */
|
||||
UNIMPLEMENTED = 6,
|
||||
/** PRELAUNCH - Prelaunch features are hidden from users and are only visible internally. */
|
||||
PRELAUNCH = 7,
|
||||
/**
|
||||
* EARLY_ACCESS - Early Access features are limited to a closed group of testers. To use
|
||||
* these features, you must sign up in advance and sign a Trusted Tester
|
||||
* agreement (which includes confidentiality provisions). These features may
|
||||
* be unstable, changed in backward-incompatible ways, and are not
|
||||
* guaranteed to be released.
|
||||
*/
|
||||
EARLY_ACCESS = 1,
|
||||
/**
|
||||
* ALPHA - Alpha is a limited availability test for releases before they are cleared
|
||||
* for widespread use. By Alpha, all significant design issues are resolved
|
||||
* and we are in the process of verifying functionality. Alpha customers
|
||||
* need to apply for access, agree to applicable terms, and have their
|
||||
* projects allowlisted. Alpha releases don't have to be feature complete,
|
||||
* no SLAs are provided, and there are no technical support obligations, but
|
||||
* they will be far enough along that customers can actually use them in
|
||||
* test environments or for limited-use tests -- just like they would in
|
||||
* normal production cases.
|
||||
*/
|
||||
ALPHA = 2,
|
||||
/**
|
||||
* BETA - Beta is the point at which we are ready to open a release for any
|
||||
* customer to use. There are no SLA or technical support obligations in a
|
||||
* Beta release. Products will be complete from a feature perspective, but
|
||||
* may have some open outstanding issues. Beta releases are suitable for
|
||||
* limited production use cases.
|
||||
*/
|
||||
BETA = 3,
|
||||
/**
|
||||
* GA - GA features are open to all developers and are considered stable and
|
||||
* fully qualified for production use.
|
||||
*/
|
||||
GA = 4,
|
||||
/**
|
||||
* DEPRECATED - Deprecated features are scheduled to be shut down and removed. For more
|
||||
* information, see the "Deprecation Policy" section of our [Terms of
|
||||
* Service](https://cloud.google.com/terms/)
|
||||
* and the [Google Cloud Platform Subject to the Deprecation
|
||||
* Policy](https://cloud.google.com/terms/deprecation) documentation.
|
||||
*/
|
||||
DEPRECATED = 5,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function launchStageFromJSON(object: any): LaunchStage {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "LAUNCH_STAGE_UNSPECIFIED":
|
||||
return LaunchStage.LAUNCH_STAGE_UNSPECIFIED;
|
||||
case 6:
|
||||
case "UNIMPLEMENTED":
|
||||
return LaunchStage.UNIMPLEMENTED;
|
||||
case 7:
|
||||
case "PRELAUNCH":
|
||||
return LaunchStage.PRELAUNCH;
|
||||
case 1:
|
||||
case "EARLY_ACCESS":
|
||||
return LaunchStage.EARLY_ACCESS;
|
||||
case 2:
|
||||
case "ALPHA":
|
||||
return LaunchStage.ALPHA;
|
||||
case 3:
|
||||
case "BETA":
|
||||
return LaunchStage.BETA;
|
||||
case 4:
|
||||
case "GA":
|
||||
return LaunchStage.GA;
|
||||
case 5:
|
||||
case "DEPRECATED":
|
||||
return LaunchStage.DEPRECATED;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return LaunchStage.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function launchStageToJSON(object: LaunchStage): string {
|
||||
switch (object) {
|
||||
case LaunchStage.LAUNCH_STAGE_UNSPECIFIED:
|
||||
return "LAUNCH_STAGE_UNSPECIFIED";
|
||||
case LaunchStage.UNIMPLEMENTED:
|
||||
return "UNIMPLEMENTED";
|
||||
case LaunchStage.PRELAUNCH:
|
||||
return "PRELAUNCH";
|
||||
case LaunchStage.EARLY_ACCESS:
|
||||
return "EARLY_ACCESS";
|
||||
case LaunchStage.ALPHA:
|
||||
return "ALPHA";
|
||||
case LaunchStage.BETA:
|
||||
return "BETA";
|
||||
case LaunchStage.GA:
|
||||
return "GA";
|
||||
case LaunchStage.DEPRECATED:
|
||||
return "DEPRECATED";
|
||||
case LaunchStage.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
4738
frontend/web/src/types/proto/google/protobuf/descriptor.ts
Normal file
4738
frontend/web/src/types/proto/google/protobuf/descriptor.ts
Normal file
File diff suppressed because it is too large
Load Diff
196
frontend/web/src/types/proto/google/protobuf/duration.ts
Normal file
196
frontend/web/src/types/proto/google/protobuf/duration.ts
Normal file
@ -0,0 +1,196 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* A Duration represents a signed, fixed-length span of time represented
|
||||
* as a count of seconds and fractions of seconds at nanosecond
|
||||
* resolution. It is independent of any calendar and concepts like "day"
|
||||
* or "month". It is related to Timestamp in that the difference between
|
||||
* two Timestamp values is a Duration and it can be added or subtracted
|
||||
* from a Timestamp. Range is approximately +-10,000 years.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* Example 1: Compute Duration from two Timestamps in pseudo code.
|
||||
*
|
||||
* Timestamp start = ...;
|
||||
* Timestamp end = ...;
|
||||
* Duration duration = ...;
|
||||
*
|
||||
* duration.seconds = end.seconds - start.seconds;
|
||||
* duration.nanos = end.nanos - start.nanos;
|
||||
*
|
||||
* if (duration.seconds < 0 && duration.nanos > 0) {
|
||||
* duration.seconds += 1;
|
||||
* duration.nanos -= 1000000000;
|
||||
* } else if (duration.seconds > 0 && duration.nanos < 0) {
|
||||
* duration.seconds -= 1;
|
||||
* duration.nanos += 1000000000;
|
||||
* }
|
||||
*
|
||||
* Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
||||
*
|
||||
* Timestamp start = ...;
|
||||
* Duration duration = ...;
|
||||
* Timestamp end = ...;
|
||||
*
|
||||
* end.seconds = start.seconds + duration.seconds;
|
||||
* end.nanos = start.nanos + duration.nanos;
|
||||
*
|
||||
* if (end.nanos < 0) {
|
||||
* end.seconds -= 1;
|
||||
* end.nanos += 1000000000;
|
||||
* } else if (end.nanos >= 1000000000) {
|
||||
* end.seconds += 1;
|
||||
* end.nanos -= 1000000000;
|
||||
* }
|
||||
*
|
||||
* Example 3: Compute Duration from datetime.timedelta in Python.
|
||||
*
|
||||
* td = datetime.timedelta(days=3, minutes=10)
|
||||
* duration = Duration()
|
||||
* duration.FromTimedelta(td)
|
||||
*
|
||||
* # JSON Mapping
|
||||
*
|
||||
* In JSON format, the Duration type is encoded as a string rather than an
|
||||
* object, where the string ends in the suffix "s" (indicating seconds) and
|
||||
* is preceded by the number of seconds, with nanoseconds expressed as
|
||||
* fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
||||
* encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
||||
* be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
||||
* microsecond should be expressed in JSON format as "3.000001s".
|
||||
*/
|
||||
export interface Duration {
|
||||
/**
|
||||
* Signed seconds of the span of time. Must be from -315,576,000,000
|
||||
* to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
||||
* 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
||||
*/
|
||||
seconds: number;
|
||||
/**
|
||||
* Signed fractions of a second at nanosecond resolution of the span
|
||||
* of time. Durations less than one second are represented with a 0
|
||||
* `seconds` field and a positive or negative `nanos` field. For durations
|
||||
* of one second or more, a non-zero value for the `nanos` field must be
|
||||
* of the same sign as the `seconds` field. Must be from -999,999,999
|
||||
* to +999,999,999 inclusive.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseDuration(): Duration {
|
||||
return { seconds: 0, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Duration = {
|
||||
encode(message: Duration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.seconds !== 0) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Duration {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDuration();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.seconds = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.nanos = reader.int32();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Duration {
|
||||
return {
|
||||
seconds: isSet(object.seconds) ? Number(object.seconds) : 0,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Duration): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined && (obj.seconds = Math.round(message.seconds));
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<Duration>): Duration {
|
||||
return Duration.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Duration>): Duration {
|
||||
const message = createBaseDuration();
|
||||
message.seconds = object.seconds ?? 0;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare const self: any | undefined;
|
||||
declare const window: any | undefined;
|
||||
declare const global: any | undefined;
|
||||
const tsProtoGlobalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") {
|
||||
return globalThis;
|
||||
}
|
||||
if (typeof self !== "undefined") {
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== "undefined") {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== "undefined") {
|
||||
return global;
|
||||
}
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function longToNumber(long: Long): number {
|
||||
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
||||
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
return long.toNumber();
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
286
frontend/web/src/types/proto/google/protobuf/field_mask.ts
Normal file
286
frontend/web/src/types/proto/google/protobuf/field_mask.ts
Normal file
@ -0,0 +1,286 @@
|
||||
/* eslint-disable */
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* `FieldMask` represents a set of symbolic field paths, for example:
|
||||
*
|
||||
* paths: "f.a"
|
||||
* paths: "f.b.d"
|
||||
*
|
||||
* Here `f` represents a field in some root message, `a` and `b`
|
||||
* fields in the message found in `f`, and `d` a field found in the
|
||||
* message in `f.b`.
|
||||
*
|
||||
* Field masks are used to specify a subset of fields that should be
|
||||
* returned by a get operation or modified by an update operation.
|
||||
* Field masks also have a custom JSON encoding (see below).
|
||||
*
|
||||
* # Field Masks in Projections
|
||||
*
|
||||
* When used in the context of a projection, a response message or
|
||||
* sub-message is filtered by the API to only contain those fields as
|
||||
* specified in the mask. For example, if the mask in the previous
|
||||
* example is applied to a response message as follows:
|
||||
*
|
||||
* f {
|
||||
* a : 22
|
||||
* b {
|
||||
* d : 1
|
||||
* x : 2
|
||||
* }
|
||||
* y : 13
|
||||
* }
|
||||
* z: 8
|
||||
*
|
||||
* The result will not contain specific values for fields x,y and z
|
||||
* (their value will be set to the default, and omitted in proto text
|
||||
* output):
|
||||
*
|
||||
* f {
|
||||
* a : 22
|
||||
* b {
|
||||
* d : 1
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* A repeated field is not allowed except at the last position of a
|
||||
* paths string.
|
||||
*
|
||||
* If a FieldMask object is not present in a get operation, the
|
||||
* operation applies to all fields (as if a FieldMask of all fields
|
||||
* had been specified).
|
||||
*
|
||||
* Note that a field mask does not necessarily apply to the
|
||||
* top-level response message. In case of a REST get operation, the
|
||||
* field mask applies directly to the response, but in case of a REST
|
||||
* list operation, the mask instead applies to each individual message
|
||||
* in the returned resource list. In case of a REST custom method,
|
||||
* other definitions may be used. Where the mask applies will be
|
||||
* clearly documented together with its declaration in the API. In
|
||||
* any case, the effect on the returned resource/resources is required
|
||||
* behavior for APIs.
|
||||
*
|
||||
* # Field Masks in Update Operations
|
||||
*
|
||||
* A field mask in update operations specifies which fields of the
|
||||
* targeted resource are going to be updated. The API is required
|
||||
* to only change the values of the fields as specified in the mask
|
||||
* and leave the others untouched. If a resource is passed in to
|
||||
* describe the updated values, the API ignores the values of all
|
||||
* fields not covered by the mask.
|
||||
*
|
||||
* If a repeated field is specified for an update operation, new values will
|
||||
* be appended to the existing repeated field in the target resource. Note that
|
||||
* a repeated field is only allowed in the last position of a `paths` string.
|
||||
*
|
||||
* If a sub-message is specified in the last position of the field mask for an
|
||||
* update operation, then new value will be merged into the existing sub-message
|
||||
* in the target resource.
|
||||
*
|
||||
* For example, given the target message:
|
||||
*
|
||||
* f {
|
||||
* b {
|
||||
* d: 1
|
||||
* x: 2
|
||||
* }
|
||||
* c: [1]
|
||||
* }
|
||||
*
|
||||
* And an update message:
|
||||
*
|
||||
* f {
|
||||
* b {
|
||||
* d: 10
|
||||
* }
|
||||
* c: [2]
|
||||
* }
|
||||
*
|
||||
* then if the field mask is:
|
||||
*
|
||||
* paths: ["f.b", "f.c"]
|
||||
*
|
||||
* then the result will be:
|
||||
*
|
||||
* f {
|
||||
* b {
|
||||
* d: 10
|
||||
* x: 2
|
||||
* }
|
||||
* c: [1, 2]
|
||||
* }
|
||||
*
|
||||
* An implementation may provide options to override this default behavior for
|
||||
* repeated and message fields.
|
||||
*
|
||||
* In order to reset a field's value to the default, the field must
|
||||
* be in the mask and set to the default value in the provided resource.
|
||||
* Hence, in order to reset all fields of a resource, provide a default
|
||||
* instance of the resource and set all fields in the mask, or do
|
||||
* not provide a mask as described below.
|
||||
*
|
||||
* If a field mask is not present on update, the operation applies to
|
||||
* all fields (as if a field mask of all fields has been specified).
|
||||
* Note that in the presence of schema evolution, this may mean that
|
||||
* fields the client does not know and has therefore not filled into
|
||||
* the request will be reset to their default. If this is unwanted
|
||||
* behavior, a specific service may require a client to always specify
|
||||
* a field mask, producing an error if not.
|
||||
*
|
||||
* As with get operations, the location of the resource which
|
||||
* describes the updated values in the request message depends on the
|
||||
* operation kind. In any case, the effect of the field mask is
|
||||
* required to be honored by the API.
|
||||
*
|
||||
* ## Considerations for HTTP REST
|
||||
*
|
||||
* The HTTP kind of an update operation which uses a field mask must
|
||||
* be set to PATCH instead of PUT in order to satisfy HTTP semantics
|
||||
* (PUT must only be used for full updates).
|
||||
*
|
||||
* # JSON Encoding of Field Masks
|
||||
*
|
||||
* In JSON, a field mask is encoded as a single string where paths are
|
||||
* separated by a comma. Fields name in each path are converted
|
||||
* to/from lower-camel naming conventions.
|
||||
*
|
||||
* As an example, consider the following message declarations:
|
||||
*
|
||||
* message Profile {
|
||||
* User user = 1;
|
||||
* Photo photo = 2;
|
||||
* }
|
||||
* message User {
|
||||
* string display_name = 1;
|
||||
* string address = 2;
|
||||
* }
|
||||
*
|
||||
* In proto a field mask for `Profile` may look as such:
|
||||
*
|
||||
* mask {
|
||||
* paths: "user.display_name"
|
||||
* paths: "photo"
|
||||
* }
|
||||
*
|
||||
* In JSON, the same mask is represented as below:
|
||||
*
|
||||
* {
|
||||
* mask: "user.displayName,photo"
|
||||
* }
|
||||
*
|
||||
* # Field Masks and Oneof Fields
|
||||
*
|
||||
* Field masks treat fields in oneofs just as regular fields. Consider the
|
||||
* following message:
|
||||
*
|
||||
* message SampleMessage {
|
||||
* oneof test_oneof {
|
||||
* string name = 4;
|
||||
* SubMessage sub_message = 9;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* The field mask can be:
|
||||
*
|
||||
* mask {
|
||||
* paths: "name"
|
||||
* }
|
||||
*
|
||||
* Or:
|
||||
*
|
||||
* mask {
|
||||
* paths: "sub_message"
|
||||
* }
|
||||
*
|
||||
* Note that oneof type names ("test_oneof" in this case) cannot be used in
|
||||
* paths.
|
||||
*
|
||||
* ## Field Mask Verification
|
||||
*
|
||||
* The implementation of any API method which has a FieldMask type field in the
|
||||
* request should verify the included field paths, and return an
|
||||
* `INVALID_ARGUMENT` error if any path is unmappable.
|
||||
*/
|
||||
export interface FieldMask {
|
||||
/** The set of field mask paths. */
|
||||
paths: string[];
|
||||
}
|
||||
|
||||
function createBaseFieldMask(): FieldMask {
|
||||
return { paths: [] };
|
||||
}
|
||||
|
||||
export const FieldMask = {
|
||||
encode(message: FieldMask, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.paths) {
|
||||
writer.uint32(10).string(v!);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): FieldMask {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseFieldMask();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.paths.push(reader.string());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): FieldMask {
|
||||
return {
|
||||
paths: typeof (object) === "string"
|
||||
? object.split(",").filter(Boolean)
|
||||
: Array.isArray(object?.paths)
|
||||
? object.paths.map(String)
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: FieldMask): string {
|
||||
return message.paths.join(",");
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<FieldMask>): FieldMask {
|
||||
return FieldMask.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<FieldMask>): FieldMask {
|
||||
const message = createBaseFieldMask();
|
||||
message.paths = object.paths?.map((e) => e) || [];
|
||||
return message;
|
||||
},
|
||||
|
||||
wrap(paths: string[]): FieldMask {
|
||||
const result = createBaseFieldMask();
|
||||
result.paths = paths;
|
||||
return result;
|
||||
},
|
||||
|
||||
unwrap(message: FieldMask): string[] {
|
||||
return message.paths;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
225
frontend/web/src/types/proto/google/protobuf/timestamp.ts
Normal file
225
frontend/web/src/types/proto/google/protobuf/timestamp.ts
Normal file
@ -0,0 +1,225 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* A Timestamp represents a point in time independent of any time zone or local
|
||||
* calendar, encoded as a count of seconds and fractions of seconds at
|
||||
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
||||
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
||||
* Gregorian calendar backwards to year one.
|
||||
*
|
||||
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
||||
* second table is needed for interpretation, using a [24-hour linear
|
||||
* smear](https://developers.google.com/time/smear).
|
||||
*
|
||||
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
||||
* restricting to that range, we ensure that we can convert to and from [RFC
|
||||
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
||||
*
|
||||
* # Examples
|
||||
*
|
||||
* Example 1: Compute Timestamp from POSIX `time()`.
|
||||
*
|
||||
* Timestamp timestamp;
|
||||
* timestamp.set_seconds(time(NULL));
|
||||
* timestamp.set_nanos(0);
|
||||
*
|
||||
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
||||
*
|
||||
* struct timeval tv;
|
||||
* gettimeofday(&tv, NULL);
|
||||
*
|
||||
* Timestamp timestamp;
|
||||
* timestamp.set_seconds(tv.tv_sec);
|
||||
* timestamp.set_nanos(tv.tv_usec * 1000);
|
||||
*
|
||||
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
||||
*
|
||||
* FILETIME ft;
|
||||
* GetSystemTimeAsFileTime(&ft);
|
||||
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
||||
*
|
||||
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
||||
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
||||
* Timestamp timestamp;
|
||||
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
||||
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
||||
*
|
||||
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
||||
*
|
||||
* long millis = System.currentTimeMillis();
|
||||
*
|
||||
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
||||
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
||||
*
|
||||
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
||||
*
|
||||
* Instant now = Instant.now();
|
||||
*
|
||||
* Timestamp timestamp =
|
||||
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
||||
* .setNanos(now.getNano()).build();
|
||||
*
|
||||
* Example 6: Compute Timestamp from current time in Python.
|
||||
*
|
||||
* timestamp = Timestamp()
|
||||
* timestamp.GetCurrentTime()
|
||||
*
|
||||
* # JSON Mapping
|
||||
*
|
||||
* In JSON format, the Timestamp type is encoded as a string in the
|
||||
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
||||
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
||||
* where {year} is always expressed using four digits while {month}, {day},
|
||||
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
||||
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
||||
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
||||
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
||||
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
||||
* able to accept both UTC and other timezones (as indicated by an offset).
|
||||
*
|
||||
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
||||
* 01:30 UTC on January 15, 2017.
|
||||
*
|
||||
* In JavaScript, one can convert a Date object to this format using the
|
||||
* standard
|
||||
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
||||
* method. In Python, a standard `datetime.datetime` object can be converted
|
||||
* to this format using
|
||||
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
||||
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
||||
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
||||
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
* ) to obtain a formatter capable of generating timestamps in this format.
|
||||
*/
|
||||
export interface Timestamp {
|
||||
/**
|
||||
* Represents seconds of UTC time since Unix epoch
|
||||
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
||||
* 9999-12-31T23:59:59Z inclusive.
|
||||
*/
|
||||
seconds: number;
|
||||
/**
|
||||
* Non-negative fractions of a second at nanosecond resolution. Negative
|
||||
* second values with fractions must still have non-negative nanos values
|
||||
* that count forward in time. Must be from 0 to 999,999,999
|
||||
* inclusive.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseTimestamp(): Timestamp {
|
||||
return { seconds: 0, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Timestamp = {
|
||||
encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.seconds !== 0) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTimestamp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.seconds = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.nanos = reader.int32();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Timestamp {
|
||||
return {
|
||||
seconds: isSet(object.seconds) ? Number(object.seconds) : 0,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Timestamp): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined && (obj.seconds = Math.round(message.seconds));
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<Timestamp>): Timestamp {
|
||||
return Timestamp.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Timestamp>): Timestamp {
|
||||
const message = createBaseTimestamp();
|
||||
message.seconds = object.seconds ?? 0;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare const self: any | undefined;
|
||||
declare const window: any | undefined;
|
||||
declare const global: any | undefined;
|
||||
const tsProtoGlobalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") {
|
||||
return globalThis;
|
||||
}
|
||||
if (typeof self !== "undefined") {
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== "undefined") {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== "undefined") {
|
||||
return global;
|
||||
}
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function longToNumber(long: Long): number {
|
||||
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
||||
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
return long.toNumber();
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
75
frontend/web/src/types/proto/store/activity.ts
Normal file
75
frontend/web/src/types/proto/store/activity.ts
Normal file
@ -0,0 +1,75 @@
|
||||
/* eslint-disable */
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "slash.store";
|
||||
|
||||
export interface ActivityShorcutCreatePayload {
|
||||
shortcutId: number;
|
||||
}
|
||||
|
||||
function createBaseActivityShorcutCreatePayload(): ActivityShorcutCreatePayload {
|
||||
return { shortcutId: 0 };
|
||||
}
|
||||
|
||||
export const ActivityShorcutCreatePayload = {
|
||||
encode(message: ActivityShorcutCreatePayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.shortcutId !== 0) {
|
||||
writer.uint32(8).int32(message.shortcutId);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): ActivityShorcutCreatePayload {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseActivityShorcutCreatePayload();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.shortcutId = reader.int32();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): ActivityShorcutCreatePayload {
|
||||
return { shortcutId: isSet(object.shortcutId) ? Number(object.shortcutId) : 0 };
|
||||
},
|
||||
|
||||
toJSON(message: ActivityShorcutCreatePayload): unknown {
|
||||
const obj: any = {};
|
||||
message.shortcutId !== undefined && (obj.shortcutId = Math.round(message.shortcutId));
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<ActivityShorcutCreatePayload>): ActivityShorcutCreatePayload {
|
||||
return ActivityShorcutCreatePayload.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<ActivityShorcutCreatePayload>): ActivityShorcutCreatePayload {
|
||||
const message = createBaseActivityShorcutCreatePayload();
|
||||
message.shortcutId = object.shortcutId ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
42
frontend/web/src/types/proto/store/common.ts
Normal file
42
frontend/web/src/types/proto/store/common.ts
Normal file
@ -0,0 +1,42 @@
|
||||
/* eslint-disable */
|
||||
|
||||
export const protobufPackage = "slash.store";
|
||||
|
||||
export enum RowStatus {
|
||||
ROW_STATUS_UNSPECIFIED = 0,
|
||||
NORMAL = 1,
|
||||
ARCHIVED = 2,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function rowStatusFromJSON(object: any): RowStatus {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "ROW_STATUS_UNSPECIFIED":
|
||||
return RowStatus.ROW_STATUS_UNSPECIFIED;
|
||||
case 1:
|
||||
case "NORMAL":
|
||||
return RowStatus.NORMAL;
|
||||
case 2:
|
||||
case "ARCHIVED":
|
||||
return RowStatus.ARCHIVED;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return RowStatus.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function rowStatusToJSON(object: RowStatus): string {
|
||||
switch (object) {
|
||||
case RowStatus.ROW_STATUS_UNSPECIFIED:
|
||||
return "ROW_STATUS_UNSPECIFIED";
|
||||
case RowStatus.NORMAL:
|
||||
return "NORMAL";
|
||||
case RowStatus.ARCHIVED:
|
||||
return "ARCHIVED";
|
||||
case RowStatus.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
419
frontend/web/src/types/proto/store/shortcut.ts
Normal file
419
frontend/web/src/types/proto/store/shortcut.ts
Normal file
@ -0,0 +1,419 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
import { RowStatus, rowStatusFromJSON, rowStatusToJSON } from "./common";
|
||||
|
||||
export const protobufPackage = "slash.store";
|
||||
|
||||
export enum Visibility {
|
||||
VISIBILITY_UNSPECIFIED = 0,
|
||||
PRIVATE = 1,
|
||||
WORKSPACE = 2,
|
||||
PUBLIC = 3,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function visibilityFromJSON(object: any): Visibility {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "VISIBILITY_UNSPECIFIED":
|
||||
return Visibility.VISIBILITY_UNSPECIFIED;
|
||||
case 1:
|
||||
case "PRIVATE":
|
||||
return Visibility.PRIVATE;
|
||||
case 2:
|
||||
case "WORKSPACE":
|
||||
return Visibility.WORKSPACE;
|
||||
case 3:
|
||||
case "PUBLIC":
|
||||
return Visibility.PUBLIC;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return Visibility.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function visibilityToJSON(object: Visibility): string {
|
||||
switch (object) {
|
||||
case Visibility.VISIBILITY_UNSPECIFIED:
|
||||
return "VISIBILITY_UNSPECIFIED";
|
||||
case Visibility.PRIVATE:
|
||||
return "PRIVATE";
|
||||
case Visibility.WORKSPACE:
|
||||
return "WORKSPACE";
|
||||
case Visibility.PUBLIC:
|
||||
return "PUBLIC";
|
||||
case Visibility.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
export interface Shortcut {
|
||||
id: number;
|
||||
creatorId: number;
|
||||
createdTs: number;
|
||||
updatedTs: number;
|
||||
rowStatus: RowStatus;
|
||||
name: string;
|
||||
link: string;
|
||||
title: string;
|
||||
tags: string[];
|
||||
description: string;
|
||||
visibility: Visibility;
|
||||
ogMetadata?: OpenGraphMetadata | undefined;
|
||||
}
|
||||
|
||||
export interface OpenGraphMetadata {
|
||||
title: string;
|
||||
description: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
function createBaseShortcut(): Shortcut {
|
||||
return {
|
||||
id: 0,
|
||||
creatorId: 0,
|
||||
createdTs: 0,
|
||||
updatedTs: 0,
|
||||
rowStatus: 0,
|
||||
name: "",
|
||||
link: "",
|
||||
title: "",
|
||||
tags: [],
|
||||
description: "",
|
||||
visibility: 0,
|
||||
ogMetadata: undefined,
|
||||
};
|
||||
}
|
||||
|
||||
export const Shortcut = {
|
||||
encode(message: Shortcut, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.id !== 0) {
|
||||
writer.uint32(8).int32(message.id);
|
||||
}
|
||||
if (message.creatorId !== 0) {
|
||||
writer.uint32(16).int32(message.creatorId);
|
||||
}
|
||||
if (message.createdTs !== 0) {
|
||||
writer.uint32(24).int64(message.createdTs);
|
||||
}
|
||||
if (message.updatedTs !== 0) {
|
||||
writer.uint32(32).int64(message.updatedTs);
|
||||
}
|
||||
if (message.rowStatus !== 0) {
|
||||
writer.uint32(40).int32(message.rowStatus);
|
||||
}
|
||||
if (message.name !== "") {
|
||||
writer.uint32(50).string(message.name);
|
||||
}
|
||||
if (message.link !== "") {
|
||||
writer.uint32(58).string(message.link);
|
||||
}
|
||||
if (message.title !== "") {
|
||||
writer.uint32(66).string(message.title);
|
||||
}
|
||||
for (const v of message.tags) {
|
||||
writer.uint32(74).string(v!);
|
||||
}
|
||||
if (message.description !== "") {
|
||||
writer.uint32(82).string(message.description);
|
||||
}
|
||||
if (message.visibility !== 0) {
|
||||
writer.uint32(88).int32(message.visibility);
|
||||
}
|
||||
if (message.ogMetadata !== undefined) {
|
||||
OpenGraphMetadata.encode(message.ogMetadata, writer.uint32(98).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Shortcut {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseShortcut();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.id = reader.int32();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.creatorId = reader.int32();
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.createdTs = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 4:
|
||||
if (tag !== 32) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.updatedTs = longToNumber(reader.int64() as Long);
|
||||
continue;
|
||||
case 5:
|
||||
if (tag !== 40) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.rowStatus = reader.int32() as any;
|
||||
continue;
|
||||
case 6:
|
||||
if (tag !== 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.name = reader.string();
|
||||
continue;
|
||||
case 7:
|
||||
if (tag !== 58) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.link = reader.string();
|
||||
continue;
|
||||
case 8:
|
||||
if (tag !== 66) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.title = reader.string();
|
||||
continue;
|
||||
case 9:
|
||||
if (tag !== 74) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.tags.push(reader.string());
|
||||
continue;
|
||||
case 10:
|
||||
if (tag !== 82) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.description = reader.string();
|
||||
continue;
|
||||
case 11:
|
||||
if (tag !== 88) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.visibility = reader.int32() as any;
|
||||
continue;
|
||||
case 12:
|
||||
if (tag !== 98) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.ogMetadata = OpenGraphMetadata.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Shortcut {
|
||||
return {
|
||||
id: isSet(object.id) ? Number(object.id) : 0,
|
||||
creatorId: isSet(object.creatorId) ? Number(object.creatorId) : 0,
|
||||
createdTs: isSet(object.createdTs) ? Number(object.createdTs) : 0,
|
||||
updatedTs: isSet(object.updatedTs) ? Number(object.updatedTs) : 0,
|
||||
rowStatus: isSet(object.rowStatus) ? rowStatusFromJSON(object.rowStatus) : 0,
|
||||
name: isSet(object.name) ? String(object.name) : "",
|
||||
link: isSet(object.link) ? String(object.link) : "",
|
||||
title: isSet(object.title) ? String(object.title) : "",
|
||||
tags: Array.isArray(object?.tags) ? object.tags.map((e: any) => String(e)) : [],
|
||||
description: isSet(object.description) ? String(object.description) : "",
|
||||
visibility: isSet(object.visibility) ? visibilityFromJSON(object.visibility) : 0,
|
||||
ogMetadata: isSet(object.ogMetadata) ? OpenGraphMetadata.fromJSON(object.ogMetadata) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Shortcut): unknown {
|
||||
const obj: any = {};
|
||||
message.id !== undefined && (obj.id = Math.round(message.id));
|
||||
message.creatorId !== undefined && (obj.creatorId = Math.round(message.creatorId));
|
||||
message.createdTs !== undefined && (obj.createdTs = Math.round(message.createdTs));
|
||||
message.updatedTs !== undefined && (obj.updatedTs = Math.round(message.updatedTs));
|
||||
message.rowStatus !== undefined && (obj.rowStatus = rowStatusToJSON(message.rowStatus));
|
||||
message.name !== undefined && (obj.name = message.name);
|
||||
message.link !== undefined && (obj.link = message.link);
|
||||
message.title !== undefined && (obj.title = message.title);
|
||||
if (message.tags) {
|
||||
obj.tags = message.tags.map((e) => e);
|
||||
} else {
|
||||
obj.tags = [];
|
||||
}
|
||||
message.description !== undefined && (obj.description = message.description);
|
||||
message.visibility !== undefined && (obj.visibility = visibilityToJSON(message.visibility));
|
||||
message.ogMetadata !== undefined &&
|
||||
(obj.ogMetadata = message.ogMetadata ? OpenGraphMetadata.toJSON(message.ogMetadata) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<Shortcut>): Shortcut {
|
||||
return Shortcut.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<Shortcut>): Shortcut {
|
||||
const message = createBaseShortcut();
|
||||
message.id = object.id ?? 0;
|
||||
message.creatorId = object.creatorId ?? 0;
|
||||
message.createdTs = object.createdTs ?? 0;
|
||||
message.updatedTs = object.updatedTs ?? 0;
|
||||
message.rowStatus = object.rowStatus ?? 0;
|
||||
message.name = object.name ?? "";
|
||||
message.link = object.link ?? "";
|
||||
message.title = object.title ?? "";
|
||||
message.tags = object.tags?.map((e) => e) || [];
|
||||
message.description = object.description ?? "";
|
||||
message.visibility = object.visibility ?? 0;
|
||||
message.ogMetadata = (object.ogMetadata !== undefined && object.ogMetadata !== null)
|
||||
? OpenGraphMetadata.fromPartial(object.ogMetadata)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseOpenGraphMetadata(): OpenGraphMetadata {
|
||||
return { title: "", description: "", image: "" };
|
||||
}
|
||||
|
||||
export const OpenGraphMetadata = {
|
||||
encode(message: OpenGraphMetadata, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.title !== "") {
|
||||
writer.uint32(10).string(message.title);
|
||||
}
|
||||
if (message.description !== "") {
|
||||
writer.uint32(18).string(message.description);
|
||||
}
|
||||
if (message.image !== "") {
|
||||
writer.uint32(26).string(message.image);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): OpenGraphMetadata {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseOpenGraphMetadata();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.title = reader.string();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.description = reader.string();
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.image = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): OpenGraphMetadata {
|
||||
return {
|
||||
title: isSet(object.title) ? String(object.title) : "",
|
||||
description: isSet(object.description) ? String(object.description) : "",
|
||||
image: isSet(object.image) ? String(object.image) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: OpenGraphMetadata): unknown {
|
||||
const obj: any = {};
|
||||
message.title !== undefined && (obj.title = message.title);
|
||||
message.description !== undefined && (obj.description = message.description);
|
||||
message.image !== undefined && (obj.image = message.image);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<OpenGraphMetadata>): OpenGraphMetadata {
|
||||
return OpenGraphMetadata.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<OpenGraphMetadata>): OpenGraphMetadata {
|
||||
const message = createBaseOpenGraphMetadata();
|
||||
message.title = object.title ?? "";
|
||||
message.description = object.description ?? "";
|
||||
message.image = object.image ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare const self: any | undefined;
|
||||
declare const window: any | undefined;
|
||||
declare const global: any | undefined;
|
||||
const tsProtoGlobalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") {
|
||||
return globalThis;
|
||||
}
|
||||
if (typeof self !== "undefined") {
|
||||
return self;
|
||||
}
|
||||
if (typeof window !== "undefined") {
|
||||
return window;
|
||||
}
|
||||
if (typeof global !== "undefined") {
|
||||
return global;
|
||||
}
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function longToNumber(long: Long): number {
|
||||
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
||||
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
||||
}
|
||||
return long.toNumber();
|
||||
}
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
352
frontend/web/src/types/proto/store/user_setting.ts
Normal file
352
frontend/web/src/types/proto/store/user_setting.ts
Normal file
@ -0,0 +1,352 @@
|
||||
/* eslint-disable */
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "slash.store";
|
||||
|
||||
export enum UserSettingKey {
|
||||
USER_SETTING_KEY_UNSPECIFIED = 0,
|
||||
/** USER_SETTING_ACCESS_TOKENS - Access tokens for the user. */
|
||||
USER_SETTING_ACCESS_TOKENS = 1,
|
||||
/** USER_SETTING_LOCALE - Locale for the user. */
|
||||
USER_SETTING_LOCALE = 2,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function userSettingKeyFromJSON(object: any): UserSettingKey {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "USER_SETTING_KEY_UNSPECIFIED":
|
||||
return UserSettingKey.USER_SETTING_KEY_UNSPECIFIED;
|
||||
case 1:
|
||||
case "USER_SETTING_ACCESS_TOKENS":
|
||||
return UserSettingKey.USER_SETTING_ACCESS_TOKENS;
|
||||
case 2:
|
||||
case "USER_SETTING_LOCALE":
|
||||
return UserSettingKey.USER_SETTING_LOCALE;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return UserSettingKey.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function userSettingKeyToJSON(object: UserSettingKey): string {
|
||||
switch (object) {
|
||||
case UserSettingKey.USER_SETTING_KEY_UNSPECIFIED:
|
||||
return "USER_SETTING_KEY_UNSPECIFIED";
|
||||
case UserSettingKey.USER_SETTING_ACCESS_TOKENS:
|
||||
return "USER_SETTING_ACCESS_TOKENS";
|
||||
case UserSettingKey.USER_SETTING_LOCALE:
|
||||
return "USER_SETTING_LOCALE";
|
||||
case UserSettingKey.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
export enum LocaleUserSetting {
|
||||
LOCALE_USER_SETTING_UNSPECIFIED = 0,
|
||||
LOCALE_USER_SETTING_EN = 1,
|
||||
LOCALE_USER_SETTING_ZH = 2,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function localeUserSettingFromJSON(object: any): LocaleUserSetting {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "LOCALE_USER_SETTING_UNSPECIFIED":
|
||||
return LocaleUserSetting.LOCALE_USER_SETTING_UNSPECIFIED;
|
||||
case 1:
|
||||
case "LOCALE_USER_SETTING_EN":
|
||||
return LocaleUserSetting.LOCALE_USER_SETTING_EN;
|
||||
case 2:
|
||||
case "LOCALE_USER_SETTING_ZH":
|
||||
return LocaleUserSetting.LOCALE_USER_SETTING_ZH;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return LocaleUserSetting.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function localeUserSettingToJSON(object: LocaleUserSetting): string {
|
||||
switch (object) {
|
||||
case LocaleUserSetting.LOCALE_USER_SETTING_UNSPECIFIED:
|
||||
return "LOCALE_USER_SETTING_UNSPECIFIED";
|
||||
case LocaleUserSetting.LOCALE_USER_SETTING_EN:
|
||||
return "LOCALE_USER_SETTING_EN";
|
||||
case LocaleUserSetting.LOCALE_USER_SETTING_ZH:
|
||||
return "LOCALE_USER_SETTING_ZH";
|
||||
case LocaleUserSetting.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
export interface UserSetting {
|
||||
userId: number;
|
||||
key: UserSettingKey;
|
||||
accessTokens?: AccessTokensUserSetting | undefined;
|
||||
locale?: LocaleUserSetting | undefined;
|
||||
}
|
||||
|
||||
export interface AccessTokensUserSetting {
|
||||
accessTokens: AccessTokensUserSetting_AccessToken[];
|
||||
}
|
||||
|
||||
export interface AccessTokensUserSetting_AccessToken {
|
||||
/**
|
||||
* The access token is a JWT token.
|
||||
* Including expiration time, issuer, etc.
|
||||
*/
|
||||
accessToken: string;
|
||||
/** A description for the access token. */
|
||||
description: string;
|
||||
}
|
||||
|
||||
function createBaseUserSetting(): UserSetting {
|
||||
return { userId: 0, key: 0, accessTokens: undefined, locale: undefined };
|
||||
}
|
||||
|
||||
export const UserSetting = {
|
||||
encode(message: UserSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.userId !== 0) {
|
||||
writer.uint32(8).int32(message.userId);
|
||||
}
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(16).int32(message.key);
|
||||
}
|
||||
if (message.accessTokens !== undefined) {
|
||||
AccessTokensUserSetting.encode(message.accessTokens, writer.uint32(26).fork()).ldelim();
|
||||
}
|
||||
if (message.locale !== undefined) {
|
||||
writer.uint32(32).int32(message.locale);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): UserSetting {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseUserSetting();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.userId = reader.int32();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 16) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.int32() as any;
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 26) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.accessTokens = AccessTokensUserSetting.decode(reader, reader.uint32());
|
||||
continue;
|
||||
case 4:
|
||||
if (tag !== 32) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.locale = reader.int32() as any;
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): UserSetting {
|
||||
return {
|
||||
userId: isSet(object.userId) ? Number(object.userId) : 0,
|
||||
key: isSet(object.key) ? userSettingKeyFromJSON(object.key) : 0,
|
||||
accessTokens: isSet(object.accessTokens) ? AccessTokensUserSetting.fromJSON(object.accessTokens) : undefined,
|
||||
locale: isSet(object.locale) ? localeUserSettingFromJSON(object.locale) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: UserSetting): unknown {
|
||||
const obj: any = {};
|
||||
message.userId !== undefined && (obj.userId = Math.round(message.userId));
|
||||
message.key !== undefined && (obj.key = userSettingKeyToJSON(message.key));
|
||||
message.accessTokens !== undefined &&
|
||||
(obj.accessTokens = message.accessTokens ? AccessTokensUserSetting.toJSON(message.accessTokens) : undefined);
|
||||
message.locale !== undefined &&
|
||||
(obj.locale = message.locale !== undefined ? localeUserSettingToJSON(message.locale) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<UserSetting>): UserSetting {
|
||||
return UserSetting.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<UserSetting>): UserSetting {
|
||||
const message = createBaseUserSetting();
|
||||
message.userId = object.userId ?? 0;
|
||||
message.key = object.key ?? 0;
|
||||
message.accessTokens = (object.accessTokens !== undefined && object.accessTokens !== null)
|
||||
? AccessTokensUserSetting.fromPartial(object.accessTokens)
|
||||
: undefined;
|
||||
message.locale = object.locale ?? undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAccessTokensUserSetting(): AccessTokensUserSetting {
|
||||
return { accessTokens: [] };
|
||||
}
|
||||
|
||||
export const AccessTokensUserSetting = {
|
||||
encode(message: AccessTokensUserSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.accessTokens) {
|
||||
AccessTokensUserSetting_AccessToken.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): AccessTokensUserSetting {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAccessTokensUserSetting();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.accessTokens.push(AccessTokensUserSetting_AccessToken.decode(reader, reader.uint32()));
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AccessTokensUserSetting {
|
||||
return {
|
||||
accessTokens: Array.isArray(object?.accessTokens)
|
||||
? object.accessTokens.map((e: any) => AccessTokensUserSetting_AccessToken.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: AccessTokensUserSetting): unknown {
|
||||
const obj: any = {};
|
||||
if (message.accessTokens) {
|
||||
obj.accessTokens = message.accessTokens.map((e) => e ? AccessTokensUserSetting_AccessToken.toJSON(e) : undefined);
|
||||
} else {
|
||||
obj.accessTokens = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<AccessTokensUserSetting>): AccessTokensUserSetting {
|
||||
return AccessTokensUserSetting.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<AccessTokensUserSetting>): AccessTokensUserSetting {
|
||||
const message = createBaseAccessTokensUserSetting();
|
||||
message.accessTokens = object.accessTokens?.map((e) => AccessTokensUserSetting_AccessToken.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAccessTokensUserSetting_AccessToken(): AccessTokensUserSetting_AccessToken {
|
||||
return { accessToken: "", description: "" };
|
||||
}
|
||||
|
||||
export const AccessTokensUserSetting_AccessToken = {
|
||||
encode(message: AccessTokensUserSetting_AccessToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.accessToken !== "") {
|
||||
writer.uint32(10).string(message.accessToken);
|
||||
}
|
||||
if (message.description !== "") {
|
||||
writer.uint32(18).string(message.description);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): AccessTokensUserSetting_AccessToken {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAccessTokensUserSetting_AccessToken();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 10) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.accessToken = reader.string();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.description = reader.string();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AccessTokensUserSetting_AccessToken {
|
||||
return {
|
||||
accessToken: isSet(object.accessToken) ? String(object.accessToken) : "",
|
||||
description: isSet(object.description) ? String(object.description) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: AccessTokensUserSetting_AccessToken): unknown {
|
||||
const obj: any = {};
|
||||
message.accessToken !== undefined && (obj.accessToken = message.accessToken);
|
||||
message.description !== undefined && (obj.description = message.description);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<AccessTokensUserSetting_AccessToken>): AccessTokensUserSetting_AccessToken {
|
||||
return AccessTokensUserSetting_AccessToken.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<AccessTokensUserSetting_AccessToken>): AccessTokensUserSetting_AccessToken {
|
||||
const message = createBaseAccessTokensUserSetting_AccessToken();
|
||||
message.accessToken = object.accessToken ?? "";
|
||||
message.description = object.description ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
224
frontend/web/src/types/proto/store/workspace_setting.ts
Normal file
224
frontend/web/src/types/proto/store/workspace_setting.ts
Normal file
@ -0,0 +1,224 @@
|
||||
/* eslint-disable */
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "slash.store";
|
||||
|
||||
export enum WorkspaceSettingKey {
|
||||
WORKSPACE_SETTING_KEY_UNSPECIFIED = 0,
|
||||
WORKSPACE_SETTING_AUTO_BACKUP = 1,
|
||||
UNRECOGNIZED = -1,
|
||||
}
|
||||
|
||||
export function workspaceSettingKeyFromJSON(object: any): WorkspaceSettingKey {
|
||||
switch (object) {
|
||||
case 0:
|
||||
case "WORKSPACE_SETTING_KEY_UNSPECIFIED":
|
||||
return WorkspaceSettingKey.WORKSPACE_SETTING_KEY_UNSPECIFIED;
|
||||
case 1:
|
||||
case "WORKSPACE_SETTING_AUTO_BACKUP":
|
||||
return WorkspaceSettingKey.WORKSPACE_SETTING_AUTO_BACKUP;
|
||||
case -1:
|
||||
case "UNRECOGNIZED":
|
||||
default:
|
||||
return WorkspaceSettingKey.UNRECOGNIZED;
|
||||
}
|
||||
}
|
||||
|
||||
export function workspaceSettingKeyToJSON(object: WorkspaceSettingKey): string {
|
||||
switch (object) {
|
||||
case WorkspaceSettingKey.WORKSPACE_SETTING_KEY_UNSPECIFIED:
|
||||
return "WORKSPACE_SETTING_KEY_UNSPECIFIED";
|
||||
case WorkspaceSettingKey.WORKSPACE_SETTING_AUTO_BACKUP:
|
||||
return "WORKSPACE_SETTING_AUTO_BACKUP";
|
||||
case WorkspaceSettingKey.UNRECOGNIZED:
|
||||
default:
|
||||
return "UNRECOGNIZED";
|
||||
}
|
||||
}
|
||||
|
||||
export interface WorkspaceSetting {
|
||||
key: WorkspaceSettingKey;
|
||||
autoBackup?: AutoBackupWorkspaceSetting | undefined;
|
||||
}
|
||||
|
||||
export interface AutoBackupWorkspaceSetting {
|
||||
/** Whether auto backup is enabled. */
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The cron expression for auto backup.
|
||||
* For example, "0 0 0 * * *" means backup at 00:00:00 every day.
|
||||
* See https://en.wikipedia.org/wiki/Cron for more details.
|
||||
*/
|
||||
cronExpression: string;
|
||||
/** The maximum number of backups to keep. */
|
||||
maxKeep: number;
|
||||
}
|
||||
|
||||
function createBaseWorkspaceSetting(): WorkspaceSetting {
|
||||
return { key: 0, autoBackup: undefined };
|
||||
}
|
||||
|
||||
export const WorkspaceSetting = {
|
||||
encode(message: WorkspaceSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.key !== 0) {
|
||||
writer.uint32(8).int32(message.key);
|
||||
}
|
||||
if (message.autoBackup !== undefined) {
|
||||
AutoBackupWorkspaceSetting.encode(message.autoBackup, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): WorkspaceSetting {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseWorkspaceSetting();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.key = reader.int32() as any;
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.autoBackup = AutoBackupWorkspaceSetting.decode(reader, reader.uint32());
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): WorkspaceSetting {
|
||||
return {
|
||||
key: isSet(object.key) ? workspaceSettingKeyFromJSON(object.key) : 0,
|
||||
autoBackup: isSet(object.autoBackup) ? AutoBackupWorkspaceSetting.fromJSON(object.autoBackup) : undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: WorkspaceSetting): unknown {
|
||||
const obj: any = {};
|
||||
message.key !== undefined && (obj.key = workspaceSettingKeyToJSON(message.key));
|
||||
message.autoBackup !== undefined &&
|
||||
(obj.autoBackup = message.autoBackup ? AutoBackupWorkspaceSetting.toJSON(message.autoBackup) : undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<WorkspaceSetting>): WorkspaceSetting {
|
||||
return WorkspaceSetting.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<WorkspaceSetting>): WorkspaceSetting {
|
||||
const message = createBaseWorkspaceSetting();
|
||||
message.key = object.key ?? 0;
|
||||
message.autoBackup = (object.autoBackup !== undefined && object.autoBackup !== null)
|
||||
? AutoBackupWorkspaceSetting.fromPartial(object.autoBackup)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseAutoBackupWorkspaceSetting(): AutoBackupWorkspaceSetting {
|
||||
return { enabled: false, cronExpression: "", maxKeep: 0 };
|
||||
}
|
||||
|
||||
export const AutoBackupWorkspaceSetting = {
|
||||
encode(message: AutoBackupWorkspaceSetting, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.enabled === true) {
|
||||
writer.uint32(8).bool(message.enabled);
|
||||
}
|
||||
if (message.cronExpression !== "") {
|
||||
writer.uint32(18).string(message.cronExpression);
|
||||
}
|
||||
if (message.maxKeep !== 0) {
|
||||
writer.uint32(24).int32(message.maxKeep);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): AutoBackupWorkspaceSetting {
|
||||
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseAutoBackupWorkspaceSetting();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
if (tag !== 8) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.enabled = reader.bool();
|
||||
continue;
|
||||
case 2:
|
||||
if (tag !== 18) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.cronExpression = reader.string();
|
||||
continue;
|
||||
case 3:
|
||||
if (tag !== 24) {
|
||||
break;
|
||||
}
|
||||
|
||||
message.maxKeep = reader.int32();
|
||||
continue;
|
||||
}
|
||||
if ((tag & 7) === 4 || tag === 0) {
|
||||
break;
|
||||
}
|
||||
reader.skipType(tag & 7);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): AutoBackupWorkspaceSetting {
|
||||
return {
|
||||
enabled: isSet(object.enabled) ? Boolean(object.enabled) : false,
|
||||
cronExpression: isSet(object.cronExpression) ? String(object.cronExpression) : "",
|
||||
maxKeep: isSet(object.maxKeep) ? Number(object.maxKeep) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: AutoBackupWorkspaceSetting): unknown {
|
||||
const obj: any = {};
|
||||
message.enabled !== undefined && (obj.enabled = message.enabled);
|
||||
message.cronExpression !== undefined && (obj.cronExpression = message.cronExpression);
|
||||
message.maxKeep !== undefined && (obj.maxKeep = Math.round(message.maxKeep));
|
||||
return obj;
|
||||
},
|
||||
|
||||
create(base?: DeepPartial<AutoBackupWorkspaceSetting>): AutoBackupWorkspaceSetting {
|
||||
return AutoBackupWorkspaceSetting.fromPartial(base ?? {});
|
||||
},
|
||||
|
||||
fromPartial(object: DeepPartial<AutoBackupWorkspaceSetting>): AutoBackupWorkspaceSetting {
|
||||
const message = createBaseAutoBackupWorkspaceSetting();
|
||||
message.enabled = object.enabled ?? false;
|
||||
message.cronExpression = object.cronExpression ?? "";
|
||||
message.maxKeep = object.maxKeep ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin ? T
|
||||
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
"types": ["vite/client"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": false,
|
||||
"esModuleInterop": false,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
@ -19,11 +19,8 @@
|
||||
"@/*": [
|
||||
"./src/*"
|
||||
],
|
||||
"@pbtypes/*": [
|
||||
"../types/*"
|
||||
]
|
||||
},
|
||||
"baseUrl": "."
|
||||
},
|
||||
"include": ["./src", "../types"]
|
||||
"include": ["./src"]
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import react from "@vitejs/plugin-react-swc";
|
||||
import { resolve } from "path";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
@ -18,4 +19,9 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
"@/": `${resolve(__dirname, "src")}/`,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -11,13 +11,13 @@ option go_package = "gen/api/v2";
|
||||
service UserSettingService {
|
||||
// GetUserSetting returns the user setting.
|
||||
rpc GetUserSetting(GetUserSettingRequest) returns (GetUserSettingResponse) {
|
||||
option (google.api.http) = {get: "/api/v2/user/{id}/setting"};
|
||||
option (google.api.http) = {get: "/api/v2/users/{id}/settings"};
|
||||
option (google.api.method_signature) = "id";
|
||||
}
|
||||
// UpdateUserSetting updates the user setting.
|
||||
rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) {
|
||||
option (google.api.http) = {
|
||||
put: "/api/v2/user/{id}/settins"
|
||||
put: "/api/v2/users/{id}/settings"
|
||||
body: "*"
|
||||
};
|
||||
option (google.api.method_signature) = "id";
|
||||
|
@ -20,6 +20,10 @@ plugins:
|
||||
- paths=source_relative
|
||||
- plugin: buf.build/bufbuild/es:v1.3.0
|
||||
out: ../frontend/types/proto
|
||||
- plugin: buf.build/community/stephenh-ts-proto:v1.152.1
|
||||
out: ../frontend/web/src/types/proto
|
||||
# reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md#using-ts-proto
|
||||
opt: env=browser,useOptionals=messages,outputServices=false,useExactTypes=false,esModuleInterop=true
|
||||
- plugin: buf.build/community/pseudomuto-doc:v1.5.1
|
||||
out: gen
|
||||
opt:
|
||||
|
@ -381,37 +381,38 @@ var file_api_v2_user_setting_service_proto_rawDesc = []byte{
|
||||
0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e,
|
||||
0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65,
|
||||
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xac, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65,
|
||||
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xb0, 0x02, 0x0a, 0x12, 0x55, 0x73, 0x65,
|
||||
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,
|
||||
0x83, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||
0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
|
||||
0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
|
||||
0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
|
||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
|
||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda,
|
||||
0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x12, 0x19, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65,
|
||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x8f, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
|
||||
0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e, 0x73, 0x6c,
|
||||
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
|
||||
0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74,
|
||||
0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0xda, 0x41,
|
||||
0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x1a, 0x19, 0x2f, 0x61,
|
||||
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f,
|
||||
0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x73, 0x42, 0xae, 0x01, 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e,
|
||||
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x42, 0x17, 0x55, 0x73,
|
||||
0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
|
||||
0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73,
|
||||
0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||
0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02,
|
||||
0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c,
|
||||
0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53,
|
||||
0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d,
|
||||
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a,
|
||||
0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, 0xda,
|
||||
0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73,
|
||||
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61,
|
||||
0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x2e,
|
||||
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64,
|
||||
0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70,
|
||||
0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53,
|
||||
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b,
|
||||
0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x1a, 0x1b,
|
||||
0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69,
|
||||
0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xae, 0x01, 0x0a, 0x10,
|
||||
0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32,
|
||||
0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72,
|
||||
0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, 0x74,
|
||||
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b, 0x2f,
|
||||
0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
|
||||
0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x53,
|
||||
0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, 0x56,
|
||||
0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32,
|
||||
0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, 0x5c,
|
||||
0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, 0x6c,
|
||||
0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
@ -165,7 +165,7 @@ func RegisterUserSettingServiceHandlerServer(ctx context.Context, mux *runtime.S
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v2/user/{id}/setting"))
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
@ -190,7 +190,7 @@ func RegisterUserSettingServiceHandlerServer(ctx context.Context, mux *runtime.S
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v2/user/{id}/settins"))
|
||||
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/slash.api.v2.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
@ -254,7 +254,7 @@ func RegisterUserSettingServiceHandlerClient(ctx context.Context, mux *runtime.S
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v2/user/{id}/setting"))
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.UserSettingService/GetUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
@ -276,7 +276,7 @@ func RegisterUserSettingServiceHandlerClient(ctx context.Context, mux *runtime.S
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
var err error
|
||||
var annotatedContext context.Context
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v2/user/{id}/settins"))
|
||||
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/slash.api.v2.UserSettingService/UpdateUserSetting", runtime.WithHTTPPathPattern("/api/v2/users/{id}/settings"))
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
@ -296,9 +296,9 @@ func RegisterUserSettingServiceHandlerClient(ctx context.Context, mux *runtime.S
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_UserSettingService_GetUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "user", "id", "setting"}, ""))
|
||||
pattern_UserSettingService_GetUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "id", "settings"}, ""))
|
||||
|
||||
pattern_UserSettingService_UpdateUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "user", "id", "settins"}, ""))
|
||||
pattern_UserSettingService_UpdateUserSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"api", "v2", "users", "id", "settings"}, ""))
|
||||
)
|
||||
|
||||
var (
|
||||
|
Loading…
x
Reference in New Issue
Block a user