diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 8140441e..da358b8c 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -19,8 +19,6 @@ plugins: opt: - paths=source_relative # Build the TypeScript definitions for the web. - - plugin: buf.build/bufbuild/es:v1.3.0 - out: ../web/src/types/proto - plugin: buf.build/community/stephenh-ts-proto:v1.152.1 out: ../web/src/types/proto-grpcweb # reference: https://github.com/deeplay-io/nice-grpc/blob/master/packages/nice-grpc-web/README.md#using-ts-proto diff --git a/web/src/components/CreateResourceDialog.tsx b/web/src/components/CreateResourceDialog.tsx index e524b6de..b7230a21 100644 --- a/web/src/components/CreateResourceDialog.tsx +++ b/web/src/components/CreateResourceDialog.tsx @@ -1,7 +1,7 @@ import { Autocomplete, Button, Input, List, ListItem, Option, Select, Typography } from "@mui/joy"; import React, { useRef, useState } from "react"; import { toast } from "react-hot-toast"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import { useTranslate } from "@/utils/i18n"; import { useResourceStore } from "../store/module"; import { generateDialog } from "./Dialog"; diff --git a/web/src/components/MemoEditor/ResourceListView.tsx b/web/src/components/MemoEditor/ResourceListView.tsx index 5ec9f28f..2d93bf0a 100644 --- a/web/src/components/MemoEditor/ResourceListView.tsx +++ b/web/src/components/MemoEditor/ResourceListView.tsx @@ -1,4 +1,4 @@ -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import Icon from "../Icon"; import ResourceIcon from "../ResourceIcon"; diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index 2f4fcb74..f93b74d2 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -8,7 +8,7 @@ import { TAB_SPACE_WIDTH, UNKNOWN_ID } from "@/helpers/consts"; import { clearContentQueryParam } from "@/helpers/utils"; import { getMatchedNodes } from "@/labs/marked"; import { useFilterStore, useGlobalStore, useMemoStore, useResourceStore, useTagStore, useUserStore } from "@/store/module"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import { useTranslate } from "@/utils/i18n"; import showCreateResourceDialog from "../CreateResourceDialog"; import Icon from "../Icon"; diff --git a/web/src/components/MemoResource.tsx b/web/src/components/MemoResource.tsx index d4060a5b..ad7fa079 100644 --- a/web/src/components/MemoResource.tsx +++ b/web/src/components/MemoResource.tsx @@ -1,4 +1,4 @@ -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import { getResourceUrl } from "@/utils/resource"; import ResourceIcon from "./ResourceIcon"; diff --git a/web/src/components/MemoResourceListView.tsx b/web/src/components/MemoResourceListView.tsx index 6208f58d..ce006ef3 100644 --- a/web/src/components/MemoResourceListView.tsx +++ b/web/src/components/MemoResourceListView.tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; import { absolutifyLink } from "@/helpers/utils"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import { getResourceType, getResourceUrl } from "@/utils/resource"; import MemoResource from "./MemoResource"; import showPreviewImageDialog from "./PreviewImageDialog"; diff --git a/web/src/components/ResourceCard.tsx b/web/src/components/ResourceCard.tsx deleted file mode 100644 index 0c093dd0..00000000 --- a/web/src/components/ResourceCard.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { getDateTimeString } from "@/helpers/datetime"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; -import ResourceIcon from "./ResourceIcon"; - -interface Props { - resource: Resource; -} - -const ResourceCard = ({ resource }: Props) => { - return ( -
-
- -
-
-
{resource.filename}
-
{getDateTimeString(resource.createdTs)}
-
-
- ); -}; - -export default ResourceCard; diff --git a/web/src/components/ResourceIcon.tsx b/web/src/components/ResourceIcon.tsx index d674c41a..907b3e80 100644 --- a/web/src/components/ResourceIcon.tsx +++ b/web/src/components/ResourceIcon.tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; import React from "react"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import { getResourceType, getResourceUrl } from "@/utils/resource"; import Icon from "./Icon"; import showPreviewImageDialog from "./PreviewImageDialog"; diff --git a/web/src/components/Settings/AccessTokenSection.tsx b/web/src/components/Settings/AccessTokenSection.tsx index b68c0c97..db7ad70b 100644 --- a/web/src/components/Settings/AccessTokenSection.tsx +++ b/web/src/components/Settings/AccessTokenSection.tsx @@ -4,7 +4,7 @@ import copy from "copy-to-clipboard"; import { useEffect, useState } from "react"; import { toast } from "react-hot-toast"; import useCurrentUser from "@/hooks/useCurrentUser"; -import { ListUserAccessTokensResponse, UserAccessToken } from "@/types/proto/api/v2/user_service_pb"; +import { ListUserAccessTokensResponse, UserAccessToken } from "@/types/proto-grpcweb/api/v2/user_service"; import { useTranslate } from "@/utils/i18n"; import showCreateAccessTokenDialog from "../CreateAccessTokenDialog"; import { showCommonDialog } from "../Dialog/CommonDialog"; diff --git a/web/src/helpers/api.ts b/web/src/helpers/api.ts index 5a005759..3464b09b 100644 --- a/web/src/helpers/api.ts +++ b/web/src/helpers/api.ts @@ -1,6 +1,6 @@ import axios from "axios"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; -import { GetUserResponse } from "@/types/proto/api/v2/user_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; +import { GetUserResponse } from "@/types/proto-grpcweb/api/v2/user_service"; export function getSystemStatus() { return axios.get("/api/v1/status"); diff --git a/web/src/pages/Resources.tsx b/web/src/pages/Resources.tsx index 9384aa4d..2245e9d2 100644 --- a/web/src/pages/Resources.tsx +++ b/web/src/pages/Resources.tsx @@ -6,7 +6,7 @@ import Icon from "@/components/Icon"; import MobileHeader from "@/components/MobileHeader"; import ResourceIcon from "@/components/ResourceIcon"; import useLoading from "@/hooks/useLoading"; -import { ListResourcesResponse, Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { ListResourcesResponse, Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import { useTranslate } from "@/utils/i18n"; const fetchAllResources = async () => { diff --git a/web/src/store/module/resource.ts b/web/src/store/module/resource.ts index 755bb638..5f5d8f35 100644 --- a/web/src/store/module/resource.ts +++ b/web/src/store/module/resource.ts @@ -1,5 +1,5 @@ import * as api from "@/helpers/api"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; import { useTranslate } from "@/utils/i18n"; import store, { useAppSelector } from "../"; import { deleteResource, patchResource, setResources } from "../reducer/resource"; diff --git a/web/src/store/reducer/resource.ts b/web/src/store/reducer/resource.ts index de11ed05..e0d07b43 100644 --- a/web/src/store/reducer/resource.ts +++ b/web/src/store/reducer/resource.ts @@ -1,6 +1,6 @@ import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { uniqBy } from "lodash-es"; -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; interface State { resources: Resource[]; diff --git a/web/src/types/proto/api/v2/common_pb.d.ts b/web/src/types/proto/api/v2/common_pb.d.ts deleted file mode 100644 index 4d8214e5..00000000 --- a/web/src/types/proto/api/v2/common_pb.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/common.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -/** - * @generated from enum memos.api.v2.RowStatus - */ -export declare enum RowStatus { - /** - * @generated from enum value: ROW_STATUS_UNSPECIFIED = 0; - */ - ROW_STATUS_UNSPECIFIED = 0, - - /** - * @generated from enum value: ACTIVE = 1; - */ - ACTIVE = 1, - - /** - * @generated from enum value: ARCHIVED = 2; - */ - ARCHIVED = 2, -} - diff --git a/web/src/types/proto/api/v2/common_pb.js b/web/src/types/proto/api/v2/common_pb.js deleted file mode 100644 index b4cb85a8..00000000 --- a/web/src/types/proto/api/v2/common_pb.js +++ /dev/null @@ -1,19 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/common.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from enum memos.api.v2.RowStatus - */ -export const RowStatus = proto3.makeEnum( - "memos.api.v2.RowStatus", - [ - {no: 0, name: "ROW_STATUS_UNSPECIFIED"}, - {no: 1, name: "ACTIVE"}, - {no: 2, name: "ARCHIVED"}, - ], -); - diff --git a/web/src/types/proto/api/v2/memo_service_pb.d.ts b/web/src/types/proto/api/v2/memo_service_pb.d.ts deleted file mode 100644 index 30839902..00000000 --- a/web/src/types/proto/api/v2/memo_service_pb.d.ts +++ /dev/null @@ -1,201 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/memo_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import type { RowStatus } from "./common_pb.js"; - -/** - * @generated from enum memos.api.v2.Visibility - */ -export declare enum Visibility { - /** - * @generated from enum value: VISIBILITY_UNSPECIFIED = 0; - */ - VISIBILITY_UNSPECIFIED = 0, - - /** - * @generated from enum value: PRIVATE = 1; - */ - PRIVATE = 1, - - /** - * @generated from enum value: PROTECTED = 2; - */ - PROTECTED = 2, - - /** - * @generated from enum value: PUBLIC = 3; - */ - PUBLIC = 3, -} - -/** - * @generated from message memos.api.v2.Memo - */ -export declare class Memo extends Message { - /** - * @generated from field: int32 id = 1; - */ - id: number; - - /** - * @generated from field: memos.api.v2.RowStatus row_status = 2; - */ - rowStatus: RowStatus; - - /** - * @generated from field: int32 creator_id = 3; - */ - creatorId: number; - - /** - * @generated from field: int64 created_ts = 4; - */ - createdTs: bigint; - - /** - * @generated from field: int64 updated_ts = 5; - */ - updatedTs: bigint; - - /** - * @generated from field: string content = 6; - */ - content: string; - - /** - * @generated from field: memos.api.v2.Visibility visibility = 7; - */ - visibility: Visibility; - - /** - * @generated from field: bool pinned = 8; - */ - pinned: boolean; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.Memo"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Memo; - - static fromJson(jsonValue: JsonValue, options?: Partial): Memo; - - static fromJsonString(jsonString: string, options?: Partial): Memo; - - static equals(a: Memo | PlainMessage | undefined, b: Memo | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListMemosRequest - */ -export declare class ListMemosRequest extends Message { - /** - * @generated from field: int32 page = 1; - */ - page: number; - - /** - * @generated from field: int32 page_size = 2; - */ - pageSize: number; - - /** - * Filter is used to filter memos returned in the list. - * - * @generated from field: string filter = 3; - */ - filter: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListMemosRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListMemosRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListMemosRequest; - - static fromJsonString(jsonString: string, options?: Partial): ListMemosRequest; - - static equals(a: ListMemosRequest | PlainMessage | undefined, b: ListMemosRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListMemosResponse - */ -export declare class ListMemosResponse extends Message { - /** - * @generated from field: repeated memos.api.v2.Memo memos = 1; - */ - memos: Memo[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListMemosResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListMemosResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListMemosResponse; - - static fromJsonString(jsonString: string, options?: Partial): ListMemosResponse; - - static equals(a: ListMemosResponse | PlainMessage | undefined, b: ListMemosResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.GetMemoRequest - */ -export declare class GetMemoRequest extends Message { - /** - * @generated from field: int32 id = 1; - */ - id: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.GetMemoRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetMemoRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetMemoRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetMemoRequest; - - static equals(a: GetMemoRequest | PlainMessage | undefined, b: GetMemoRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.GetMemoResponse - */ -export declare class GetMemoResponse extends Message { - /** - * @generated from field: memos.api.v2.Memo memo = 1; - */ - memo?: Memo; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.GetMemoResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetMemoResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetMemoResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetMemoResponse; - - static equals(a: GetMemoResponse | PlainMessage | undefined, b: GetMemoResponse | PlainMessage | undefined): boolean; -} - diff --git a/web/src/types/proto/api/v2/memo_service_pb.js b/web/src/types/proto/api/v2/memo_service_pb.js deleted file mode 100644 index 10f20597..00000000 --- a/web/src/types/proto/api/v2/memo_service_pb.js +++ /dev/null @@ -1,80 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/memo_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; -import { RowStatus } from "./common_pb.js"; - -/** - * @generated from enum memos.api.v2.Visibility - */ -export const Visibility = proto3.makeEnum( - "memos.api.v2.Visibility", - [ - {no: 0, name: "VISIBILITY_UNSPECIFIED"}, - {no: 1, name: "PRIVATE"}, - {no: 2, name: "PROTECTED"}, - {no: 3, name: "PUBLIC"}, - ], -); - -/** - * @generated from message memos.api.v2.Memo - */ -export const Memo = proto3.makeMessageType( - "memos.api.v2.Memo", - () => [ - { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "row_status", kind: "enum", T: proto3.getEnumType(RowStatus) }, - { no: 3, name: "creator_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "created_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 5, name: "updated_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 6, name: "content", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "visibility", kind: "enum", T: proto3.getEnumType(Visibility) }, - { no: 8, name: "pinned", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ], -); - -/** - * @generated from message memos.api.v2.ListMemosRequest - */ -export const ListMemosRequest = proto3.makeMessageType( - "memos.api.v2.ListMemosRequest", - () => [ - { no: 1, name: "page", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 3, name: "filter", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message memos.api.v2.ListMemosResponse - */ -export const ListMemosResponse = proto3.makeMessageType( - "memos.api.v2.ListMemosResponse", - () => [ - { no: 1, name: "memos", kind: "message", T: Memo, repeated: true }, - ], -); - -/** - * @generated from message memos.api.v2.GetMemoRequest - */ -export const GetMemoRequest = proto3.makeMessageType( - "memos.api.v2.GetMemoRequest", - () => [ - { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - -/** - * @generated from message memos.api.v2.GetMemoResponse - */ -export const GetMemoResponse = proto3.makeMessageType( - "memos.api.v2.GetMemoResponse", - () => [ - { no: 1, name: "memo", kind: "message", T: Memo }, - ], -); - diff --git a/web/src/types/proto/api/v2/resource_service_pb.d.ts b/web/src/types/proto/api/v2/resource_service_pb.d.ts deleted file mode 100644 index ed39c197..00000000 --- a/web/src/types/proto/api/v2/resource_service_pb.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/resource_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Timestamp } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from message memos.api.v2.Resource - */ -export declare class Resource extends Message { - /** - * @generated from field: int32 id = 1; - */ - id: number; - - /** - * @generated from field: google.protobuf.Timestamp created_ts = 2; - */ - createdTs?: Timestamp; - - /** - * @generated from field: string filename = 3; - */ - filename: string; - - /** - * @generated from field: string external_link = 4; - */ - externalLink: string; - - /** - * @generated from field: string type = 5; - */ - type: string; - - /** - * @generated from field: int64 size = 6; - */ - size: bigint; - - /** - * @generated from field: optional int32 related_memo_id = 7; - */ - relatedMemoId?: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.Resource"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Resource; - - static fromJson(jsonValue: JsonValue, options?: Partial): Resource; - - static fromJsonString(jsonString: string, options?: Partial): Resource; - - static equals(a: Resource | PlainMessage | undefined, b: Resource | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListResourcesRequest - */ -export declare class ListResourcesRequest extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListResourcesRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListResourcesRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListResourcesRequest; - - static fromJsonString(jsonString: string, options?: Partial): ListResourcesRequest; - - static equals(a: ListResourcesRequest | PlainMessage | undefined, b: ListResourcesRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListResourcesResponse - */ -export declare class ListResourcesResponse extends Message { - /** - * @generated from field: repeated memos.api.v2.Resource resources = 1; - */ - resources: Resource[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListResourcesResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListResourcesResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListResourcesResponse; - - static fromJsonString(jsonString: string, options?: Partial): ListResourcesResponse; - - static equals(a: ListResourcesResponse | PlainMessage | undefined, b: ListResourcesResponse | PlainMessage | undefined): boolean; -} - diff --git a/web/src/types/proto/api/v2/resource_service_pb.js b/web/src/types/proto/api/v2/resource_service_pb.js deleted file mode 100644 index 8143e36a..00000000 --- a/web/src/types/proto/api/v2/resource_service_pb.js +++ /dev/null @@ -1,41 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/resource_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3, Timestamp } from "@bufbuild/protobuf"; - -/** - * @generated from message memos.api.v2.Resource - */ -export const Resource = proto3.makeMessageType( - "memos.api.v2.Resource", - () => [ - { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "created_ts", kind: "message", T: Timestamp }, - { no: 3, name: "filename", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "external_link", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "size", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - { no: 7, name: "related_memo_id", kind: "scalar", T: 5 /* ScalarType.INT32 */, opt: true }, - ], -); - -/** - * @generated from message memos.api.v2.ListResourcesRequest - */ -export const ListResourcesRequest = proto3.makeMessageType( - "memos.api.v2.ListResourcesRequest", - [], -); - -/** - * @generated from message memos.api.v2.ListResourcesResponse - */ -export const ListResourcesResponse = proto3.makeMessageType( - "memos.api.v2.ListResourcesResponse", - () => [ - { no: 1, name: "resources", kind: "message", T: Resource, repeated: true }, - ], -); - diff --git a/web/src/types/proto/api/v2/system_service_pb.d.ts b/web/src/types/proto/api/v2/system_service_pb.d.ts deleted file mode 100644 index ce511f02..00000000 --- a/web/src/types/proto/api/v2/system_service_pb.d.ts +++ /dev/null @@ -1,162 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/system_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from message memos.api.v2.SystemInfo - */ -export declare class SystemInfo extends Message { - /** - * @generated from field: string version = 1; - */ - version: string; - - /** - * @generated from field: string mode = 2; - */ - mode: string; - - /** - * @generated from field: bool allow_registration = 3; - */ - allowRegistration: boolean; - - /** - * @generated from field: bool disable_password_login = 4; - */ - disablePasswordLogin: boolean; - - /** - * @generated from field: string additional_script = 5; - */ - additionalScript: string; - - /** - * @generated from field: string additional_style = 6; - */ - additionalStyle: string; - - /** - * @generated from field: int64 db_size = 7; - */ - dbSize: bigint; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.SystemInfo"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): SystemInfo; - - static fromJson(jsonValue: JsonValue, options?: Partial): SystemInfo; - - static fromJsonString(jsonString: string, options?: Partial): SystemInfo; - - static equals(a: SystemInfo | PlainMessage | undefined, b: SystemInfo | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.GetSystemInfoRequest - */ -export declare class GetSystemInfoRequest extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.GetSystemInfoRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSystemInfoRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSystemInfoRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetSystemInfoRequest; - - static equals(a: GetSystemInfoRequest | PlainMessage | undefined, b: GetSystemInfoRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.GetSystemInfoResponse - */ -export declare class GetSystemInfoResponse extends Message { - /** - * @generated from field: memos.api.v2.SystemInfo system_info = 1; - */ - systemInfo?: SystemInfo; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.GetSystemInfoResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSystemInfoResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSystemInfoResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetSystemInfoResponse; - - static equals(a: GetSystemInfoResponse | PlainMessage | undefined, b: GetSystemInfoResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.UpdateSystemInfoRequest - */ -export declare class UpdateSystemInfoRequest extends Message { - /** - * System info is the updated data. - * - * @generated from field: memos.api.v2.SystemInfo system_info = 1; - */ - systemInfo?: SystemInfo; - - /** - * Update mask is the array of paths. - * - * @generated from field: repeated string update_mask = 2; - */ - updateMask: string[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.UpdateSystemInfoRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateSystemInfoRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateSystemInfoRequest; - - static fromJsonString(jsonString: string, options?: Partial): UpdateSystemInfoRequest; - - static equals(a: UpdateSystemInfoRequest | PlainMessage | undefined, b: UpdateSystemInfoRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.UpdateSystemInfoResponse - */ -export declare class UpdateSystemInfoResponse extends Message { - /** - * @generated from field: memos.api.v2.SystemInfo system_info = 1; - */ - systemInfo?: SystemInfo; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.UpdateSystemInfoResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateSystemInfoResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateSystemInfoResponse; - - static fromJsonString(jsonString: string, options?: Partial): UpdateSystemInfoResponse; - - static equals(a: UpdateSystemInfoResponse | PlainMessage | undefined, b: UpdateSystemInfoResponse | PlainMessage | undefined): boolean; -} - diff --git a/web/src/types/proto/api/v2/system_service_pb.js b/web/src/types/proto/api/v2/system_service_pb.js deleted file mode 100644 index 78b44da4..00000000 --- a/web/src/types/proto/api/v2/system_service_pb.js +++ /dev/null @@ -1,62 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/system_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from message memos.api.v2.SystemInfo - */ -export const SystemInfo = proto3.makeMessageType( - "memos.api.v2.SystemInfo", - () => [ - { no: 1, name: "version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "mode", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "allow_registration", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 4, name: "disable_password_login", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 5, name: "additional_script", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "additional_style", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "db_size", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, - ], -); - -/** - * @generated from message memos.api.v2.GetSystemInfoRequest - */ -export const GetSystemInfoRequest = proto3.makeMessageType( - "memos.api.v2.GetSystemInfoRequest", - [], -); - -/** - * @generated from message memos.api.v2.GetSystemInfoResponse - */ -export const GetSystemInfoResponse = proto3.makeMessageType( - "memos.api.v2.GetSystemInfoResponse", - () => [ - { no: 1, name: "system_info", kind: "message", T: SystemInfo }, - ], -); - -/** - * @generated from message memos.api.v2.UpdateSystemInfoRequest - */ -export const UpdateSystemInfoRequest = proto3.makeMessageType( - "memos.api.v2.UpdateSystemInfoRequest", - () => [ - { no: 1, name: "system_info", kind: "message", T: SystemInfo }, - { no: 2, name: "update_mask", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - ], -); - -/** - * @generated from message memos.api.v2.UpdateSystemInfoResponse - */ -export const UpdateSystemInfoResponse = proto3.makeMessageType( - "memos.api.v2.UpdateSystemInfoResponse", - () => [ - { no: 1, name: "system_info", kind: "message", T: SystemInfo }, - ], -); - diff --git a/web/src/types/proto/api/v2/tag_service_pb.d.ts b/web/src/types/proto/api/v2/tag_service_pb.d.ts deleted file mode 100644 index fb8aa26a..00000000 --- a/web/src/types/proto/api/v2/tag_service_pb.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/tag_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from message memos.api.v2.Tag - */ -export declare class Tag extends Message { - /** - * @generated from field: string name = 1; - */ - name: string; - - /** - * @generated from field: int32 creator_id = 2; - */ - creatorId: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.Tag"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Tag; - - static fromJson(jsonValue: JsonValue, options?: Partial): Tag; - - static fromJsonString(jsonString: string, options?: Partial): Tag; - - static equals(a: Tag | PlainMessage | undefined, b: Tag | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListTagsRequest - */ -export declare class ListTagsRequest extends Message { - /** - * @generated from field: int32 creator_id = 1; - */ - creatorId: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListTagsRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListTagsRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListTagsRequest; - - static fromJsonString(jsonString: string, options?: Partial): ListTagsRequest; - - static equals(a: ListTagsRequest | PlainMessage | undefined, b: ListTagsRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListTagsResponse - */ -export declare class ListTagsResponse extends Message { - /** - * @generated from field: repeated memos.api.v2.Tag tags = 1; - */ - tags: Tag[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListTagsResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListTagsResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListTagsResponse; - - static fromJsonString(jsonString: string, options?: Partial): ListTagsResponse; - - static equals(a: ListTagsResponse | PlainMessage | undefined, b: ListTagsResponse | PlainMessage | undefined): boolean; -} - diff --git a/web/src/types/proto/api/v2/tag_service_pb.js b/web/src/types/proto/api/v2/tag_service_pb.js deleted file mode 100644 index 475546b4..00000000 --- a/web/src/types/proto/api/v2/tag_service_pb.js +++ /dev/null @@ -1,38 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/tag_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from message memos.api.v2.Tag - */ -export const Tag = proto3.makeMessageType( - "memos.api.v2.Tag", - () => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "creator_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - -/** - * @generated from message memos.api.v2.ListTagsRequest - */ -export const ListTagsRequest = proto3.makeMessageType( - "memos.api.v2.ListTagsRequest", - () => [ - { no: 1, name: "creator_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - -/** - * @generated from message memos.api.v2.ListTagsResponse - */ -export const ListTagsResponse = proto3.makeMessageType( - "memos.api.v2.ListTagsResponse", - () => [ - { no: 1, name: "tags", kind: "message", T: Tag, repeated: true }, - ], -); - diff --git a/web/src/types/proto/api/v2/user_service_pb.d.ts b/web/src/types/proto/api/v2/user_service_pb.d.ts deleted file mode 100644 index 15734350..00000000 --- a/web/src/types/proto/api/v2/user_service_pb.d.ts +++ /dev/null @@ -1,401 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/user_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Timestamp } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import type { RowStatus } from "./common_pb.js"; - -/** - * @generated from message memos.api.v2.User - */ -export declare class User extends Message { - /** - * @generated from field: int32 id = 1; - */ - id: number; - - /** - * @generated from field: string username = 2; - */ - username: string; - - /** - * @generated from field: memos.api.v2.User.Role role = 3; - */ - role: User_Role; - - /** - * @generated from field: string email = 4; - */ - email: string; - - /** - * @generated from field: string nickname = 5; - */ - nickname: string; - - /** - * @generated from field: string avatar_url = 6; - */ - avatarUrl: string; - - /** - * @generated from field: string password = 7; - */ - password: string; - - /** - * @generated from field: memos.api.v2.RowStatus row_status = 8; - */ - rowStatus: RowStatus; - - /** - * @generated from field: google.protobuf.Timestamp create_time = 9; - */ - createTime?: Timestamp; - - /** - * @generated from field: google.protobuf.Timestamp update_time = 10; - */ - updateTime?: Timestamp; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.User"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): User; - - static fromJson(jsonValue: JsonValue, options?: Partial): User; - - static fromJsonString(jsonString: string, options?: Partial): User; - - static equals(a: User | PlainMessage | undefined, b: User | PlainMessage | undefined): boolean; -} - -/** - * @generated from enum memos.api.v2.User.Role - */ -export declare enum User_Role { - /** - * @generated from enum value: ROLE_UNSPECIFIED = 0; - */ - ROLE_UNSPECIFIED = 0, - - /** - * @generated from enum value: HOST = 1; - */ - HOST = 1, - - /** - * @generated from enum value: ADMIN = 2; - */ - ADMIN = 2, - - /** - * @generated from enum value: USER = 3; - */ - USER = 3, -} - -/** - * @generated from message memos.api.v2.GetUserRequest - */ -export declare class GetUserRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.GetUserRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetUserRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetUserRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetUserRequest; - - static equals(a: GetUserRequest | PlainMessage | undefined, b: GetUserRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.GetUserResponse - */ -export declare class GetUserResponse extends Message { - /** - * @generated from field: memos.api.v2.User user = 1; - */ - user?: User; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.GetUserResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetUserResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetUserResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetUserResponse; - - static equals(a: GetUserResponse | PlainMessage | undefined, b: GetUserResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.UpdateUserRequest - */ -export declare class UpdateUserRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - /** - * @generated from field: memos.api.v2.User user = 2; - */ - user?: User; - - /** - * The update mask applies to the user resource. - * - * @generated from field: repeated string update_mask = 3; - */ - updateMask: string[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.UpdateUserRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateUserRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateUserRequest; - - static fromJsonString(jsonString: string, options?: Partial): UpdateUserRequest; - - static equals(a: UpdateUserRequest | PlainMessage | undefined, b: UpdateUserRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.UpdateUserResponse - */ -export declare class UpdateUserResponse extends Message { - /** - * @generated from field: memos.api.v2.User user = 1; - */ - user?: User; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.UpdateUserResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateUserResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateUserResponse; - - static fromJsonString(jsonString: string, options?: Partial): UpdateUserResponse; - - static equals(a: UpdateUserResponse | PlainMessage | undefined, b: UpdateUserResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListUserAccessTokensRequest - */ -export declare class ListUserAccessTokensRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListUserAccessTokensRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListUserAccessTokensRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListUserAccessTokensRequest; - - static fromJsonString(jsonString: string, options?: Partial): ListUserAccessTokensRequest; - - static equals(a: ListUserAccessTokensRequest | PlainMessage | undefined, b: ListUserAccessTokensRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.ListUserAccessTokensResponse - */ -export declare class ListUserAccessTokensResponse extends Message { - /** - * @generated from field: repeated memos.api.v2.UserAccessToken access_tokens = 1; - */ - accessTokens: UserAccessToken[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.ListUserAccessTokensResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListUserAccessTokensResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListUserAccessTokensResponse; - - static fromJsonString(jsonString: string, options?: Partial): ListUserAccessTokensResponse; - - static equals(a: ListUserAccessTokensResponse | PlainMessage | undefined, b: ListUserAccessTokensResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.CreateUserAccessTokenRequest - */ -export declare class CreateUserAccessTokenRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - /** - * @generated from field: memos.api.v2.UserAccessToken user_access_token = 2; - */ - userAccessToken?: UserAccessToken; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.CreateUserAccessTokenRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateUserAccessTokenRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateUserAccessTokenRequest; - - static fromJsonString(jsonString: string, options?: Partial): CreateUserAccessTokenRequest; - - static equals(a: CreateUserAccessTokenRequest | PlainMessage | undefined, b: CreateUserAccessTokenRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.CreateUserAccessTokenResponse - */ -export declare class CreateUserAccessTokenResponse extends Message { - /** - * @generated from field: memos.api.v2.UserAccessToken access_token = 1; - */ - accessToken?: UserAccessToken; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.CreateUserAccessTokenResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateUserAccessTokenResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateUserAccessTokenResponse; - - static fromJsonString(jsonString: string, options?: Partial): CreateUserAccessTokenResponse; - - static equals(a: CreateUserAccessTokenResponse | PlainMessage | undefined, b: CreateUserAccessTokenResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.DeleteUserAccessTokenRequest - */ -export declare class DeleteUserAccessTokenRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - /** - * access_token is the access token to delete. - * - * @generated from field: string access_token = 2; - */ - accessToken: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.DeleteUserAccessTokenRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DeleteUserAccessTokenRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): DeleteUserAccessTokenRequest; - - static fromJsonString(jsonString: string, options?: Partial): DeleteUserAccessTokenRequest; - - static equals(a: DeleteUserAccessTokenRequest | PlainMessage | undefined, b: DeleteUserAccessTokenRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.DeleteUserAccessTokenResponse - */ -export declare class DeleteUserAccessTokenResponse extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.DeleteUserAccessTokenResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DeleteUserAccessTokenResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): DeleteUserAccessTokenResponse; - - static fromJsonString(jsonString: string, options?: Partial): DeleteUserAccessTokenResponse; - - static equals(a: DeleteUserAccessTokenResponse | PlainMessage | undefined, b: DeleteUserAccessTokenResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.api.v2.UserAccessToken - */ -export declare class UserAccessToken extends Message { - /** - * @generated from field: string access_token = 1; - */ - accessToken: string; - - /** - * @generated from field: string description = 2; - */ - description: string; - - /** - * @generated from field: google.protobuf.Timestamp issued_at = 3; - */ - issuedAt?: Timestamp; - - /** - * @generated from field: google.protobuf.Timestamp expires_at = 4; - */ - expiresAt?: Timestamp; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.api.v2.UserAccessToken"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UserAccessToken; - - static fromJson(jsonValue: JsonValue, options?: Partial): UserAccessToken; - - static fromJsonString(jsonString: string, options?: Partial): UserAccessToken; - - static equals(a: UserAccessToken | PlainMessage | undefined, b: UserAccessToken | PlainMessage | undefined): boolean; -} - diff --git a/web/src/types/proto/api/v2/user_service_pb.js b/web/src/types/proto/api/v2/user_service_pb.js deleted file mode 100644 index d22e0726..00000000 --- a/web/src/types/proto/api/v2/user_service_pb.js +++ /dev/null @@ -1,155 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file api/v2/user_service.proto (package memos.api.v2, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3, Timestamp } from "@bufbuild/protobuf"; -import { RowStatus } from "./common_pb.js"; - -/** - * @generated from message memos.api.v2.User - */ -export const User = proto3.makeMessageType( - "memos.api.v2.User", - () => [ - { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "role", kind: "enum", T: proto3.getEnumType(User_Role) }, - { no: 4, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "nickname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "avatar_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 7, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 8, name: "row_status", kind: "enum", T: proto3.getEnumType(RowStatus) }, - { no: 9, name: "create_time", kind: "message", T: Timestamp }, - { no: 10, name: "update_time", kind: "message", T: Timestamp }, - ], -); - -/** - * @generated from enum memos.api.v2.User.Role - */ -export const User_Role = proto3.makeEnum( - "memos.api.v2.User.Role", - [ - {no: 0, name: "ROLE_UNSPECIFIED"}, - {no: 1, name: "HOST"}, - {no: 2, name: "ADMIN"}, - {no: 3, name: "USER"}, - ], -); - -/** - * @generated from message memos.api.v2.GetUserRequest - */ -export const GetUserRequest = proto3.makeMessageType( - "memos.api.v2.GetUserRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message memos.api.v2.GetUserResponse - */ -export const GetUserResponse = proto3.makeMessageType( - "memos.api.v2.GetUserResponse", - () => [ - { no: 1, name: "user", kind: "message", T: User }, - ], -); - -/** - * @generated from message memos.api.v2.UpdateUserRequest - */ -export const UpdateUserRequest = proto3.makeMessageType( - "memos.api.v2.UpdateUserRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "user", kind: "message", T: User }, - { no: 3, name: "update_mask", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - ], -); - -/** - * @generated from message memos.api.v2.UpdateUserResponse - */ -export const UpdateUserResponse = proto3.makeMessageType( - "memos.api.v2.UpdateUserResponse", - () => [ - { no: 1, name: "user", kind: "message", T: User }, - ], -); - -/** - * @generated from message memos.api.v2.ListUserAccessTokensRequest - */ -export const ListUserAccessTokensRequest = proto3.makeMessageType( - "memos.api.v2.ListUserAccessTokensRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message memos.api.v2.ListUserAccessTokensResponse - */ -export const ListUserAccessTokensResponse = proto3.makeMessageType( - "memos.api.v2.ListUserAccessTokensResponse", - () => [ - { no: 1, name: "access_tokens", kind: "message", T: UserAccessToken, repeated: true }, - ], -); - -/** - * @generated from message memos.api.v2.CreateUserAccessTokenRequest - */ -export const CreateUserAccessTokenRequest = proto3.makeMessageType( - "memos.api.v2.CreateUserAccessTokenRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "user_access_token", kind: "message", T: UserAccessToken }, - ], -); - -/** - * @generated from message memos.api.v2.CreateUserAccessTokenResponse - */ -export const CreateUserAccessTokenResponse = proto3.makeMessageType( - "memos.api.v2.CreateUserAccessTokenResponse", - () => [ - { no: 1, name: "access_token", kind: "message", T: UserAccessToken }, - ], -); - -/** - * @generated from message memos.api.v2.DeleteUserAccessTokenRequest - */ -export const DeleteUserAccessTokenRequest = proto3.makeMessageType( - "memos.api.v2.DeleteUserAccessTokenRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message memos.api.v2.DeleteUserAccessTokenResponse - */ -export const DeleteUserAccessTokenResponse = proto3.makeMessageType( - "memos.api.v2.DeleteUserAccessTokenResponse", - [], -); - -/** - * @generated from message memos.api.v2.UserAccessToken - */ -export const UserAccessToken = proto3.makeMessageType( - "memos.api.v2.UserAccessToken", - () => [ - { no: 1, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "issued_at", kind: "message", T: Timestamp }, - { no: 4, name: "expires_at", kind: "message", T: Timestamp }, - ], -); - diff --git a/web/src/types/proto/store/system_setting_pb.d.ts b/web/src/types/proto/store/system_setting_pb.d.ts deleted file mode 100644 index b9acd650..00000000 --- a/web/src/types/proto/store/system_setting_pb.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file store/system_setting.proto (package memos.store, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from enum memos.store.SystemSettingKey - */ -export declare enum SystemSettingKey { - /** - * @generated from enum value: SYSTEM_SETTING_KEY_UNSPECIFIED = 0; - */ - SYSTEM_SETTING_KEY_UNSPECIFIED = 0, - - /** - * BackupConfig is the key for auto-backup configuration. - * - * @generated from enum value: BACKUP_CONFIG = 1; - */ - BACKUP_CONFIG = 1, -} - -/** - * @generated from message memos.store.BackupConfig - */ -export declare class BackupConfig extends Message { - /** - * enabled indicates whether backup is enabled. - * - * @generated from field: bool enabled = 1; - */ - enabled: boolean; - - /** - * cron is the cron expression for backup. See https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format - * - * @generated from field: string cron = 2; - */ - cron: string; - - /** - * max_keep is the maximum number of backups to keep. - * - * @generated from field: int32 max_keep = 3; - */ - maxKeep: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.store.BackupConfig"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): BackupConfig; - - static fromJson(jsonValue: JsonValue, options?: Partial): BackupConfig; - - static fromJsonString(jsonString: string, options?: Partial): BackupConfig; - - static equals(a: BackupConfig | PlainMessage | undefined, b: BackupConfig | PlainMessage | undefined): boolean; -} - diff --git a/web/src/types/proto/store/system_setting_pb.js b/web/src/types/proto/store/system_setting_pb.js deleted file mode 100644 index b57c3ff6..00000000 --- a/web/src/types/proto/store/system_setting_pb.js +++ /dev/null @@ -1,30 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file store/system_setting.proto (package memos.store, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from enum memos.store.SystemSettingKey - */ -export const SystemSettingKey = proto3.makeEnum( - "memos.store.SystemSettingKey", - [ - {no: 0, name: "SYSTEM_SETTING_KEY_UNSPECIFIED"}, - {no: 1, name: "BACKUP_CONFIG"}, - ], -); - -/** - * @generated from message memos.store.BackupConfig - */ -export const BackupConfig = proto3.makeMessageType( - "memos.store.BackupConfig", - () => [ - { no: 1, name: "enabled", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 2, name: "cron", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "max_keep", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - diff --git a/web/src/types/proto/store/user_setting_pb.d.ts b/web/src/types/proto/store/user_setting_pb.d.ts deleted file mode 100644 index bb2af523..00000000 --- a/web/src/types/proto/store/user_setting_pb.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file store/user_setting.proto (package memos.store, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from enum memos.store.UserSettingKey - */ -export declare enum UserSettingKey { - /** - * @generated from enum value: USER_SETTING_KEY_UNSPECIFIED = 0; - */ - USER_SETTING_KEY_UNSPECIFIED = 0, - - /** - * Access tokens for the user. - * - * @generated from enum value: USER_SETTING_ACCESS_TOKENS = 1; - */ - USER_SETTING_ACCESS_TOKENS = 1, -} - -/** - * @generated from message memos.store.UserSetting - */ -export declare class UserSetting extends Message { - /** - * @generated from field: int32 user_id = 1; - */ - userId: number; - - /** - * @generated from field: memos.store.UserSettingKey key = 2; - */ - key: UserSettingKey; - - /** - * @generated from oneof memos.store.UserSetting.value - */ - value: { - /** - * @generated from field: memos.store.AccessTokensUserSetting access_tokens = 3; - */ - value: AccessTokensUserSetting; - case: "accessTokens"; - } | { case: undefined; value?: undefined }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.store.UserSetting"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UserSetting; - - static fromJson(jsonValue: JsonValue, options?: Partial): UserSetting; - - static fromJsonString(jsonString: string, options?: Partial): UserSetting; - - static equals(a: UserSetting | PlainMessage | undefined, b: UserSetting | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.store.AccessTokensUserSetting - */ -export declare class AccessTokensUserSetting extends Message { - /** - * @generated from field: repeated memos.store.AccessTokensUserSetting.AccessToken access_tokens = 1; - */ - accessTokens: AccessTokensUserSetting_AccessToken[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.store.AccessTokensUserSetting"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): AccessTokensUserSetting; - - static fromJson(jsonValue: JsonValue, options?: Partial): AccessTokensUserSetting; - - static fromJsonString(jsonString: string, options?: Partial): AccessTokensUserSetting; - - static equals(a: AccessTokensUserSetting | PlainMessage | undefined, b: AccessTokensUserSetting | PlainMessage | undefined): boolean; -} - -/** - * @generated from message memos.store.AccessTokensUserSetting.AccessToken - */ -export declare class AccessTokensUserSetting_AccessToken extends Message { - /** - * The access token is a JWT token. - * Including expiration time, issuer, etc. - * - * @generated from field: string access_token = 1; - */ - accessToken: string; - - /** - * A description for the access token. - * - * @generated from field: string description = 2; - */ - description: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "memos.store.AccessTokensUserSetting.AccessToken"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): AccessTokensUserSetting_AccessToken; - - static fromJson(jsonValue: JsonValue, options?: Partial): AccessTokensUserSetting_AccessToken; - - static fromJsonString(jsonString: string, options?: Partial): AccessTokensUserSetting_AccessToken; - - static equals(a: AccessTokensUserSetting_AccessToken | PlainMessage | undefined, b: AccessTokensUserSetting_AccessToken | PlainMessage | undefined): boolean; -} - diff --git a/web/src/types/proto/store/user_setting_pb.js b/web/src/types/proto/store/user_setting_pb.js deleted file mode 100644 index eea4ee5d..00000000 --- a/web/src/types/proto/store/user_setting_pb.js +++ /dev/null @@ -1,52 +0,0 @@ -// @generated by protoc-gen-es v1.3.0 -// @generated from file store/user_setting.proto (package memos.store, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from enum memos.store.UserSettingKey - */ -export const UserSettingKey = proto3.makeEnum( - "memos.store.UserSettingKey", - [ - {no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"}, - {no: 1, name: "USER_SETTING_ACCESS_TOKENS"}, - ], -); - -/** - * @generated from message memos.store.UserSetting - */ -export const UserSetting = proto3.makeMessageType( - "memos.store.UserSetting", - () => [ - { no: 1, name: "user_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "key", kind: "enum", T: proto3.getEnumType(UserSettingKey) }, - { no: 3, name: "access_tokens", kind: "message", T: AccessTokensUserSetting, oneof: "value" }, - ], -); - -/** - * @generated from message memos.store.AccessTokensUserSetting - */ -export const AccessTokensUserSetting = proto3.makeMessageType( - "memos.store.AccessTokensUserSetting", - () => [ - { no: 1, name: "access_tokens", kind: "message", T: AccessTokensUserSetting_AccessToken, repeated: true }, - ], -); - -/** - * @generated from message memos.store.AccessTokensUserSetting.AccessToken - */ -export const AccessTokensUserSetting_AccessToken = proto3.makeMessageType( - "memos.store.AccessTokensUserSetting.AccessToken", - () => [ - { no: 1, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], - {localName: "AccessTokensUserSetting_AccessToken"}, -); - diff --git a/web/src/utils/resource.ts b/web/src/utils/resource.ts index 863dc9db..f4174d0a 100644 --- a/web/src/utils/resource.ts +++ b/web/src/utils/resource.ts @@ -1,4 +1,4 @@ -import { Resource } from "@/types/proto/api/v2/resource_service_pb"; +import { Resource } from "@/types/proto-grpcweb/api/v2/resource_service"; export const getResourceUrl = (resource: Resource, withOrigin = true) => { if (resource.externalLink) {