diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index d45943c..8ae5b26 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -18,6 +18,8 @@ plugins: out: gen opt: - paths=source_relative + - plugin: buf.build/bufbuild/es:v1.3.0 + out: ../web/src/types/proto - plugin: buf.build/community/pseudomuto-doc:v1.5.1 out: gen opt: diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index 76c95aa..76f5595 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -71,8 +71,8 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | id | [int32](#int32) | | id is the user id. | -| description | [string](#string) | | | -| expiration | [google.protobuf.Duration](#google-protobuf-Duration) | | | +| description | [string](#string) | | description is the title/description of the access token. | +| expiration | [google.protobuf.Duration](#google-protobuf-Duration) | | expiration is the expires duration of the access token. | diff --git a/proto/gen/api/v2/common_pb.d.ts b/proto/gen/api/v2/common_pb.d.ts new file mode 100644 index 0000000..56292fd --- /dev/null +++ b/proto/gen/api/v2/common_pb.d.ts @@ -0,0 +1,25 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/common.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +/** + * @generated from enum slash.api.v2.RowStatus + */ +export declare enum RowStatus { + /** + * @generated from enum value: ROW_STATUS_UNSPECIFIED = 0; + */ + ROW_STATUS_UNSPECIFIED = 0, + + /** + * @generated from enum value: NORMAL = 1; + */ + NORMAL = 1, + + /** + * @generated from enum value: ARCHIVED = 2; + */ + ARCHIVED = 2, +} + diff --git a/proto/gen/api/v2/common_pb.js b/proto/gen/api/v2/common_pb.js new file mode 100644 index 0000000..d2b11ae --- /dev/null +++ b/proto/gen/api/v2/common_pb.js @@ -0,0 +1,19 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/common.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.api.v2.RowStatus + */ +export const RowStatus = proto3.makeEnum( + "slash.api.v2.RowStatus", + [ + {no: 0, name: "ROW_STATUS_UNSPECIFIED"}, + {no: 1, name: "NORMAL"}, + {no: 2, name: "ARCHIVED"}, + ], +); + diff --git a/proto/gen/api/v2/user_service.pb.go b/proto/gen/api/v2/user_service.pb.go index df5ffba..2700fc3 100644 --- a/proto/gen/api/v2/user_service.pb.go +++ b/proto/gen/api/v2/user_service.pb.go @@ -362,9 +362,11 @@ type CreateUserAccessTokenRequest struct { unknownFields protoimpl.UnknownFields // id is the user id. - Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - Expiration *durationpb.Duration `protobuf:"bytes,3,opt,name=expiration,proto3" json:"expiration,omitempty"` + Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // description is the title/description of the access token. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // expiration is the expires duration of the access token. + Expiration *durationpb.Duration `protobuf:"bytes,3,opt,name=expiration,proto3" json:"expiration,omitempty"` } func (x *CreateUserAccessTokenRequest) Reset() { diff --git a/proto/gen/api/v2/user_service_pb.d.ts b/proto/gen/api/v2/user_service_pb.d.ts new file mode 100644 index 0000000..82495ae --- /dev/null +++ b/proto/gen/api/v2/user_service_pb.d.ts @@ -0,0 +1,336 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/user_service.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, Duration, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Timestamp } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { RowStatus } from "./common_pb.js"; + +/** + * @generated from enum slash.api.v2.Role + */ +export declare enum Role { + /** + * @generated from enum value: ROLE_UNSPECIFIED = 0; + */ + ROLE_UNSPECIFIED = 0, + + /** + * @generated from enum value: ADMIN = 1; + */ + ADMIN = 1, + + /** + * @generated from enum value: USER = 2; + */ + USER = 2, +} + +/** + * @generated from message slash.api.v2.User + */ +export declare class User extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * @generated from field: slash.api.v2.RowStatus row_status = 2; + */ + rowStatus: RowStatus; + + /** + * @generated from field: int64 created_ts = 3; + */ + createdTs: bigint; + + /** + * @generated from field: int64 updated_ts = 4; + */ + updatedTs: bigint; + + /** + * @generated from field: slash.api.v2.Role role = 6; + */ + role: Role; + + /** + * @generated from field: string email = 7; + */ + email: string; + + /** + * @generated from field: string nickname = 8; + */ + nickname: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 message slash.api.v2.GetUserRequest + */ +export declare class GetUserRequest extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.GetUserResponse + */ +export declare class GetUserResponse extends Message { + /** + * @generated from field: slash.api.v2.User user = 1; + */ + user?: User; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.ListUserAccessTokensRequest + */ +export declare class ListUserAccessTokensRequest extends Message { + /** + * id is the user id. + * + * @generated from field: int32 id = 1; + */ + id: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.ListUserAccessTokensResponse + */ +export declare class ListUserAccessTokensResponse extends Message { + /** + * @generated from field: repeated slash.api.v2.UserAccessToken access_tokens = 1; + */ + accessTokens: UserAccessToken[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.CreateUserAccessTokenRequest + */ +export declare class CreateUserAccessTokenRequest extends Message { + /** + * id is the user id. + * + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * description is the title/description of the access token. + * + * @generated from field: string description = 2; + */ + description: string; + + /** + * expiration is the expires duration of the access token. + * + * @generated from field: google.protobuf.Duration expiration = 3; + */ + expiration?: Duration; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.CreateUserAccessTokenResponse + */ +export declare class CreateUserAccessTokenResponse extends Message { + /** + * @generated from field: slash.api.v2.UserAccessToken access_token = 1; + */ + accessToken?: UserAccessToken; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.DeleteUserAccessTokenRequest + */ +export declare class DeleteUserAccessTokenRequest extends Message { + /** + * id is the user id. + * + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * 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 = "slash.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 slash.api.v2.DeleteUserAccessTokenResponse + */ +export declare class DeleteUserAccessTokenResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.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 = "slash.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/proto/gen/api/v2/user_service_pb.js b/proto/gen/api/v2/user_service_pb.js new file mode 100644 index 0000000..3264cc6 --- /dev/null +++ b/proto/gen/api/v2/user_service_pb.js @@ -0,0 +1,130 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/user_service.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { Duration, proto3, Timestamp } from "@bufbuild/protobuf"; +import { RowStatus } from "./common_pb.js"; + +/** + * @generated from enum slash.api.v2.Role + */ +export const Role = proto3.makeEnum( + "slash.api.v2.Role", + [ + {no: 0, name: "ROLE_UNSPECIFIED"}, + {no: 1, name: "ADMIN"}, + {no: 2, name: "USER"}, + ], +); + +/** + * @generated from message slash.api.v2.User + */ +export const User = proto3.makeMessageType( + "slash.api.v2.User", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "row_status", kind: "enum", T: proto3.getEnumType(RowStatus) }, + { no: 3, name: "created_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "updated_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 6, name: "role", kind: "enum", T: proto3.getEnumType(Role) }, + { no: 7, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "nickname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * @generated from message slash.api.v2.GetUserRequest + */ +export const GetUserRequest = proto3.makeMessageType( + "slash.api.v2.GetUserRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ], +); + +/** + * @generated from message slash.api.v2.GetUserResponse + */ +export const GetUserResponse = proto3.makeMessageType( + "slash.api.v2.GetUserResponse", + () => [ + { no: 1, name: "user", kind: "message", T: User }, + ], +); + +/** + * @generated from message slash.api.v2.ListUserAccessTokensRequest + */ +export const ListUserAccessTokensRequest = proto3.makeMessageType( + "slash.api.v2.ListUserAccessTokensRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ], +); + +/** + * @generated from message slash.api.v2.ListUserAccessTokensResponse + */ +export const ListUserAccessTokensResponse = proto3.makeMessageType( + "slash.api.v2.ListUserAccessTokensResponse", + () => [ + { no: 1, name: "access_tokens", kind: "message", T: UserAccessToken, repeated: true }, + ], +); + +/** + * @generated from message slash.api.v2.CreateUserAccessTokenRequest + */ +export const CreateUserAccessTokenRequest = proto3.makeMessageType( + "slash.api.v2.CreateUserAccessTokenRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "expiration", kind: "message", T: Duration }, + ], +); + +/** + * @generated from message slash.api.v2.CreateUserAccessTokenResponse + */ +export const CreateUserAccessTokenResponse = proto3.makeMessageType( + "slash.api.v2.CreateUserAccessTokenResponse", + () => [ + { no: 1, name: "access_token", kind: "message", T: UserAccessToken }, + ], +); + +/** + * @generated from message slash.api.v2.DeleteUserAccessTokenRequest + */ +export const DeleteUserAccessTokenRequest = proto3.makeMessageType( + "slash.api.v2.DeleteUserAccessTokenRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * @generated from message slash.api.v2.DeleteUserAccessTokenResponse + */ +export const DeleteUserAccessTokenResponse = proto3.makeMessageType( + "slash.api.v2.DeleteUserAccessTokenResponse", + [], +); + +/** + * @generated from message slash.api.v2.UserAccessToken + */ +export const UserAccessToken = proto3.makeMessageType( + "slash.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/proto/gen/store/common_pb.d.ts b/proto/gen/store/common_pb.d.ts new file mode 100644 index 0000000..0fdf8c1 --- /dev/null +++ b/proto/gen/store/common_pb.d.ts @@ -0,0 +1,25 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/common.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +/** + * @generated from enum slash.store.RowStatus + */ +export declare enum RowStatus { + /** + * @generated from enum value: ROW_STATUS_UNSPECIFIED = 0; + */ + ROW_STATUS_UNSPECIFIED = 0, + + /** + * @generated from enum value: NORMAL = 1; + */ + NORMAL = 1, + + /** + * @generated from enum value: ARCHIVED = 2; + */ + ARCHIVED = 2, +} + diff --git a/proto/gen/store/common_pb.js b/proto/gen/store/common_pb.js new file mode 100644 index 0000000..28a6967 --- /dev/null +++ b/proto/gen/store/common_pb.js @@ -0,0 +1,19 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/common.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.store.RowStatus + */ +export const RowStatus = proto3.makeEnum( + "slash.store.RowStatus", + [ + {no: 0, name: "ROW_STATUS_UNSPECIFIED"}, + {no: 1, name: "NORMAL"}, + {no: 2, name: "ARCHIVED"}, + ], +); + diff --git a/proto/gen/store/shortcut_pb.d.ts b/proto/gen/store/shortcut_pb.d.ts new file mode 100644 index 0000000..ae696b3 --- /dev/null +++ b/proto/gen/store/shortcut_pb.d.ts @@ -0,0 +1,147 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/shortcut.proto (package slash.store, 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 slash.store.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: WORKSPACE = 2; + */ + WORKSPACE = 2, + + /** + * @generated from enum value: PUBLIC = 3; + */ + PUBLIC = 3, +} + +/** + * @generated from message slash.store.Shortcut + */ +export declare class Shortcut extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * @generated from field: int32 creator_id = 2; + */ + creatorId: number; + + /** + * @generated from field: int64 created_ts = 3; + */ + createdTs: bigint; + + /** + * @generated from field: int64 updated_ts = 4; + */ + updatedTs: bigint; + + /** + * @generated from field: slash.store.RowStatus row_status = 5; + */ + rowStatus: RowStatus; + + /** + * @generated from field: string name = 6; + */ + name: string; + + /** + * @generated from field: string link = 7; + */ + link: string; + + /** + * @generated from field: string title = 8; + */ + title: string; + + /** + * @generated from field: repeated string tags = 9; + */ + tags: string[]; + + /** + * @generated from field: string description = 10; + */ + description: string; + + /** + * @generated from field: slash.store.Visibility visibility = 11; + */ + visibility: Visibility; + + /** + * @generated from field: slash.store.OpenGraphMetadata og_metadata = 12; + */ + ogMetadata?: OpenGraphMetadata; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.store.Shortcut"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Shortcut; + + static fromJson(jsonValue: JsonValue, options?: Partial): Shortcut; + + static fromJsonString(jsonString: string, options?: Partial): Shortcut; + + static equals(a: Shortcut | PlainMessage | undefined, b: Shortcut | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.store.OpenGraphMetadata + */ +export declare class OpenGraphMetadata extends Message { + /** + * @generated from field: string title = 1; + */ + title: string; + + /** + * @generated from field: string description = 2; + */ + description: string; + + /** + * @generated from field: string image = 3; + */ + image: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.store.OpenGraphMetadata"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): OpenGraphMetadata; + + static fromJson(jsonValue: JsonValue, options?: Partial): OpenGraphMetadata; + + static fromJsonString(jsonString: string, options?: Partial): OpenGraphMetadata; + + static equals(a: OpenGraphMetadata | PlainMessage | undefined, b: OpenGraphMetadata | PlainMessage | undefined): boolean; +} + diff --git a/proto/gen/store/shortcut_pb.js b/proto/gen/store/shortcut_pb.js new file mode 100644 index 0000000..1ad4d5c --- /dev/null +++ b/proto/gen/store/shortcut_pb.js @@ -0,0 +1,54 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/shortcut.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; +import { RowStatus } from "./common_pb.js"; + +/** + * @generated from enum slash.store.Visibility + */ +export const Visibility = proto3.makeEnum( + "slash.store.Visibility", + [ + {no: 0, name: "VISIBILITY_UNSPECIFIED"}, + {no: 1, name: "PRIVATE"}, + {no: 2, name: "WORKSPACE"}, + {no: 3, name: "PUBLIC"}, + ], +); + +/** + * @generated from message slash.store.Shortcut + */ +export const Shortcut = proto3.makeMessageType( + "slash.store.Shortcut", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "creator_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "created_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "updated_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 5, name: "row_status", kind: "enum", T: proto3.getEnumType(RowStatus) }, + { no: 6, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "link", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 9, name: "tags", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 10, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "visibility", kind: "enum", T: proto3.getEnumType(Visibility) }, + { no: 12, name: "og_metadata", kind: "message", T: OpenGraphMetadata }, + ], +); + +/** + * @generated from message slash.store.OpenGraphMetadata + */ +export const OpenGraphMetadata = proto3.makeMessageType( + "slash.store.OpenGraphMetadata", + () => [ + { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + diff --git a/proto/gen/store/user_setting_pb.d.ts b/proto/gen/store/user_setting_pb.d.ts new file mode 100644 index 0000000..c125e28 --- /dev/null +++ b/proto/gen/store/user_setting_pb.d.ts @@ -0,0 +1,116 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/user_setting.proto (package slash.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 slash.store.UserSettingKey + */ +export declare enum UserSettingKey { + /** + * @generated from enum value: USER_SETTING_KEY_UNSPECIFIED = 0; + */ + USER_SETTING_KEY_UNSPECIFIED = 0, + + /** + * @generated from enum value: USER_SETTING_ACCESS_TOKENS = 1; + */ + USER_SETTING_ACCESS_TOKENS = 1, +} + +/** + * @generated from message slash.store.UserSetting + */ +export declare class UserSetting extends Message { + /** + * @generated from field: int32 user_id = 1; + */ + userId: number; + + /** + * @generated from field: slash.store.UserSettingKey key = 2; + */ + key: UserSettingKey; + + /** + * @generated from oneof slash.store.UserSetting.value + */ + value: { + /** + * @generated from field: slash.store.AccessTokensUserSetting access_tokens_user_setting = 3; + */ + value: AccessTokensUserSetting; + case: "accessTokensUserSetting"; + } | { case: undefined; value?: undefined }; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.store.AccessTokensUserSetting + */ +export declare class AccessTokensUserSetting extends Message { + /** + * @generated from field: repeated slash.store.AccessTokensUserSetting.AccessToken access_tokens = 1; + */ + accessTokens: AccessTokensUserSetting_AccessToken[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.store.AccessTokensUserSetting.AccessToken + */ +export declare class AccessTokensUserSetting_AccessToken extends Message { + /** + * @generated from field: string access_token = 1; + */ + accessToken: string; + + /** + * @generated from field: string description = 2; + */ + description: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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/proto/gen/store/user_setting_pb.js b/proto/gen/store/user_setting_pb.js new file mode 100644 index 0000000..330b9d5 --- /dev/null +++ b/proto/gen/store/user_setting_pb.js @@ -0,0 +1,52 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/user_setting.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.store.UserSettingKey + */ +export const UserSettingKey = proto3.makeEnum( + "slash.store.UserSettingKey", + [ + {no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"}, + {no: 1, name: "USER_SETTING_ACCESS_TOKENS"}, + ], +); + +/** + * @generated from message slash.store.UserSetting + */ +export const UserSetting = proto3.makeMessageType( + "slash.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_user_setting", kind: "message", T: AccessTokensUserSetting, oneof: "value" }, + ], +); + +/** + * @generated from message slash.store.AccessTokensUserSetting + */ +export const AccessTokensUserSetting = proto3.makeMessageType( + "slash.store.AccessTokensUserSetting", + () => [ + { no: 1, name: "access_tokens", kind: "message", T: AccessTokensUserSetting_AccessToken, repeated: true }, + ], +); + +/** + * @generated from message slash.store.AccessTokensUserSetting.AccessToken + */ +export const AccessTokensUserSetting_AccessToken = proto3.makeMessageType( + "slash.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/package.json b/web/package.json index 05b6760..4814007 100644 --- a/web/package.json +++ b/web/package.json @@ -8,6 +8,7 @@ "lint-fix": "eslint --ext .js,.ts,.tsx, src --fix" }, "dependencies": { + "@bufbuild/protobuf": "^1.3.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/joy": "5.0.0-beta.0", diff --git a/web/pnpm-lock.yaml b/web/pnpm-lock.yaml index e17f5a1..b6b9118 100644 --- a/web/pnpm-lock.yaml +++ b/web/pnpm-lock.yaml @@ -5,6 +5,9 @@ settings: excludeLinksFromLockfile: false dependencies: + '@bufbuild/protobuf': + specifier: ^1.3.0 + version: 1.3.0 '@emotion/react': specifier: ^11.11.1 version: 11.11.1(@types/react@18.2.18)(react@18.2.0) @@ -264,6 +267,10 @@ packages: '@babel/helper-validator-identifier': 7.22.5 to-fast-properties: 2.0.0 + /@bufbuild/protobuf@1.3.0: + resolution: {integrity: sha512-G372ods0pLt46yxVRsnP/e2btVPuuzArcMPFpIDeIwiGPuuglEs9y75iG0HMvZgncsj5TvbYRWqbVyOe3PLCWQ==} + dev: false + /@emotion/babel-plugin@11.11.0: resolution: {integrity: sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==} dependencies: diff --git a/web/src/types/proto/api/v2/common_pb.d.ts b/web/src/types/proto/api/v2/common_pb.d.ts new file mode 100644 index 0000000..56292fd --- /dev/null +++ b/web/src/types/proto/api/v2/common_pb.d.ts @@ -0,0 +1,25 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/common.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +/** + * @generated from enum slash.api.v2.RowStatus + */ +export declare enum RowStatus { + /** + * @generated from enum value: ROW_STATUS_UNSPECIFIED = 0; + */ + ROW_STATUS_UNSPECIFIED = 0, + + /** + * @generated from enum value: NORMAL = 1; + */ + NORMAL = 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 new file mode 100644 index 0000000..d2b11ae --- /dev/null +++ b/web/src/types/proto/api/v2/common_pb.js @@ -0,0 +1,19 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/common.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.api.v2.RowStatus + */ +export const RowStatus = proto3.makeEnum( + "slash.api.v2.RowStatus", + [ + {no: 0, name: "ROW_STATUS_UNSPECIFIED"}, + {no: 1, name: "NORMAL"}, + {no: 2, name: "ARCHIVED"}, + ], +); + 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 new file mode 100644 index 0000000..82495ae --- /dev/null +++ b/web/src/types/proto/api/v2/user_service_pb.d.ts @@ -0,0 +1,336 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/user_service.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, Duration, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Timestamp } from "@bufbuild/protobuf"; +import { Message, proto3 } from "@bufbuild/protobuf"; +import type { RowStatus } from "./common_pb.js"; + +/** + * @generated from enum slash.api.v2.Role + */ +export declare enum Role { + /** + * @generated from enum value: ROLE_UNSPECIFIED = 0; + */ + ROLE_UNSPECIFIED = 0, + + /** + * @generated from enum value: ADMIN = 1; + */ + ADMIN = 1, + + /** + * @generated from enum value: USER = 2; + */ + USER = 2, +} + +/** + * @generated from message slash.api.v2.User + */ +export declare class User extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * @generated from field: slash.api.v2.RowStatus row_status = 2; + */ + rowStatus: RowStatus; + + /** + * @generated from field: int64 created_ts = 3; + */ + createdTs: bigint; + + /** + * @generated from field: int64 updated_ts = 4; + */ + updatedTs: bigint; + + /** + * @generated from field: slash.api.v2.Role role = 6; + */ + role: Role; + + /** + * @generated from field: string email = 7; + */ + email: string; + + /** + * @generated from field: string nickname = 8; + */ + nickname: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 message slash.api.v2.GetUserRequest + */ +export declare class GetUserRequest extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.GetUserResponse + */ +export declare class GetUserResponse extends Message { + /** + * @generated from field: slash.api.v2.User user = 1; + */ + user?: User; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.ListUserAccessTokensRequest + */ +export declare class ListUserAccessTokensRequest extends Message { + /** + * id is the user id. + * + * @generated from field: int32 id = 1; + */ + id: number; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.ListUserAccessTokensResponse + */ +export declare class ListUserAccessTokensResponse extends Message { + /** + * @generated from field: repeated slash.api.v2.UserAccessToken access_tokens = 1; + */ + accessTokens: UserAccessToken[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.CreateUserAccessTokenRequest + */ +export declare class CreateUserAccessTokenRequest extends Message { + /** + * id is the user id. + * + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * description is the title/description of the access token. + * + * @generated from field: string description = 2; + */ + description: string; + + /** + * expiration is the expires duration of the access token. + * + * @generated from field: google.protobuf.Duration expiration = 3; + */ + expiration?: Duration; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.CreateUserAccessTokenResponse + */ +export declare class CreateUserAccessTokenResponse extends Message { + /** + * @generated from field: slash.api.v2.UserAccessToken access_token = 1; + */ + accessToken?: UserAccessToken; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.api.v2.DeleteUserAccessTokenRequest + */ +export declare class DeleteUserAccessTokenRequest extends Message { + /** + * id is the user id. + * + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * 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 = "slash.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 slash.api.v2.DeleteUserAccessTokenResponse + */ +export declare class DeleteUserAccessTokenResponse extends Message { + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.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 = "slash.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 new file mode 100644 index 0000000..3264cc6 --- /dev/null +++ b/web/src/types/proto/api/v2/user_service_pb.js @@ -0,0 +1,130 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file api/v2/user_service.proto (package slash.api.v2, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { Duration, proto3, Timestamp } from "@bufbuild/protobuf"; +import { RowStatus } from "./common_pb.js"; + +/** + * @generated from enum slash.api.v2.Role + */ +export const Role = proto3.makeEnum( + "slash.api.v2.Role", + [ + {no: 0, name: "ROLE_UNSPECIFIED"}, + {no: 1, name: "ADMIN"}, + {no: 2, name: "USER"}, + ], +); + +/** + * @generated from message slash.api.v2.User + */ +export const User = proto3.makeMessageType( + "slash.api.v2.User", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "row_status", kind: "enum", T: proto3.getEnumType(RowStatus) }, + { no: 3, name: "created_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "updated_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 6, name: "role", kind: "enum", T: proto3.getEnumType(Role) }, + { no: 7, name: "email", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "nickname", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * @generated from message slash.api.v2.GetUserRequest + */ +export const GetUserRequest = proto3.makeMessageType( + "slash.api.v2.GetUserRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ], +); + +/** + * @generated from message slash.api.v2.GetUserResponse + */ +export const GetUserResponse = proto3.makeMessageType( + "slash.api.v2.GetUserResponse", + () => [ + { no: 1, name: "user", kind: "message", T: User }, + ], +); + +/** + * @generated from message slash.api.v2.ListUserAccessTokensRequest + */ +export const ListUserAccessTokensRequest = proto3.makeMessageType( + "slash.api.v2.ListUserAccessTokensRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ], +); + +/** + * @generated from message slash.api.v2.ListUserAccessTokensResponse + */ +export const ListUserAccessTokensResponse = proto3.makeMessageType( + "slash.api.v2.ListUserAccessTokensResponse", + () => [ + { no: 1, name: "access_tokens", kind: "message", T: UserAccessToken, repeated: true }, + ], +); + +/** + * @generated from message slash.api.v2.CreateUserAccessTokenRequest + */ +export const CreateUserAccessTokenRequest = proto3.makeMessageType( + "slash.api.v2.CreateUserAccessTokenRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "expiration", kind: "message", T: Duration }, + ], +); + +/** + * @generated from message slash.api.v2.CreateUserAccessTokenResponse + */ +export const CreateUserAccessTokenResponse = proto3.makeMessageType( + "slash.api.v2.CreateUserAccessTokenResponse", + () => [ + { no: 1, name: "access_token", kind: "message", T: UserAccessToken }, + ], +); + +/** + * @generated from message slash.api.v2.DeleteUserAccessTokenRequest + */ +export const DeleteUserAccessTokenRequest = proto3.makeMessageType( + "slash.api.v2.DeleteUserAccessTokenRequest", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "access_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + +/** + * @generated from message slash.api.v2.DeleteUserAccessTokenResponse + */ +export const DeleteUserAccessTokenResponse = proto3.makeMessageType( + "slash.api.v2.DeleteUserAccessTokenResponse", + [], +); + +/** + * @generated from message slash.api.v2.UserAccessToken + */ +export const UserAccessToken = proto3.makeMessageType( + "slash.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/common_pb.d.ts b/web/src/types/proto/store/common_pb.d.ts new file mode 100644 index 0000000..0fdf8c1 --- /dev/null +++ b/web/src/types/proto/store/common_pb.d.ts @@ -0,0 +1,25 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/common.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +/** + * @generated from enum slash.store.RowStatus + */ +export declare enum RowStatus { + /** + * @generated from enum value: ROW_STATUS_UNSPECIFIED = 0; + */ + ROW_STATUS_UNSPECIFIED = 0, + + /** + * @generated from enum value: NORMAL = 1; + */ + NORMAL = 1, + + /** + * @generated from enum value: ARCHIVED = 2; + */ + ARCHIVED = 2, +} + diff --git a/web/src/types/proto/store/common_pb.js b/web/src/types/proto/store/common_pb.js new file mode 100644 index 0000000..28a6967 --- /dev/null +++ b/web/src/types/proto/store/common_pb.js @@ -0,0 +1,19 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/common.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.store.RowStatus + */ +export const RowStatus = proto3.makeEnum( + "slash.store.RowStatus", + [ + {no: 0, name: "ROW_STATUS_UNSPECIFIED"}, + {no: 1, name: "NORMAL"}, + {no: 2, name: "ARCHIVED"}, + ], +); + diff --git a/web/src/types/proto/store/shortcut_pb.d.ts b/web/src/types/proto/store/shortcut_pb.d.ts new file mode 100644 index 0000000..ae696b3 --- /dev/null +++ b/web/src/types/proto/store/shortcut_pb.d.ts @@ -0,0 +1,147 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/shortcut.proto (package slash.store, 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 slash.store.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: WORKSPACE = 2; + */ + WORKSPACE = 2, + + /** + * @generated from enum value: PUBLIC = 3; + */ + PUBLIC = 3, +} + +/** + * @generated from message slash.store.Shortcut + */ +export declare class Shortcut extends Message { + /** + * @generated from field: int32 id = 1; + */ + id: number; + + /** + * @generated from field: int32 creator_id = 2; + */ + creatorId: number; + + /** + * @generated from field: int64 created_ts = 3; + */ + createdTs: bigint; + + /** + * @generated from field: int64 updated_ts = 4; + */ + updatedTs: bigint; + + /** + * @generated from field: slash.store.RowStatus row_status = 5; + */ + rowStatus: RowStatus; + + /** + * @generated from field: string name = 6; + */ + name: string; + + /** + * @generated from field: string link = 7; + */ + link: string; + + /** + * @generated from field: string title = 8; + */ + title: string; + + /** + * @generated from field: repeated string tags = 9; + */ + tags: string[]; + + /** + * @generated from field: string description = 10; + */ + description: string; + + /** + * @generated from field: slash.store.Visibility visibility = 11; + */ + visibility: Visibility; + + /** + * @generated from field: slash.store.OpenGraphMetadata og_metadata = 12; + */ + ogMetadata?: OpenGraphMetadata; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.store.Shortcut"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): Shortcut; + + static fromJson(jsonValue: JsonValue, options?: Partial): Shortcut; + + static fromJsonString(jsonString: string, options?: Partial): Shortcut; + + static equals(a: Shortcut | PlainMessage | undefined, b: Shortcut | PlainMessage | undefined): boolean; +} + +/** + * @generated from message slash.store.OpenGraphMetadata + */ +export declare class OpenGraphMetadata extends Message { + /** + * @generated from field: string title = 1; + */ + title: string; + + /** + * @generated from field: string description = 2; + */ + description: string; + + /** + * @generated from field: string image = 3; + */ + image: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.store.OpenGraphMetadata"; + static readonly fields: FieldList; + + static fromBinary(bytes: Uint8Array, options?: Partial): OpenGraphMetadata; + + static fromJson(jsonValue: JsonValue, options?: Partial): OpenGraphMetadata; + + static fromJsonString(jsonString: string, options?: Partial): OpenGraphMetadata; + + static equals(a: OpenGraphMetadata | PlainMessage | undefined, b: OpenGraphMetadata | PlainMessage | undefined): boolean; +} + diff --git a/web/src/types/proto/store/shortcut_pb.js b/web/src/types/proto/store/shortcut_pb.js new file mode 100644 index 0000000..1ad4d5c --- /dev/null +++ b/web/src/types/proto/store/shortcut_pb.js @@ -0,0 +1,54 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/shortcut.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; +import { RowStatus } from "./common_pb.js"; + +/** + * @generated from enum slash.store.Visibility + */ +export const Visibility = proto3.makeEnum( + "slash.store.Visibility", + [ + {no: 0, name: "VISIBILITY_UNSPECIFIED"}, + {no: 1, name: "PRIVATE"}, + {no: 2, name: "WORKSPACE"}, + {no: 3, name: "PUBLIC"}, + ], +); + +/** + * @generated from message slash.store.Shortcut + */ +export const Shortcut = proto3.makeMessageType( + "slash.store.Shortcut", + () => [ + { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "creator_id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "created_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "updated_ts", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 5, name: "row_status", kind: "enum", T: proto3.getEnumType(RowStatus) }, + { no: 6, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 7, name: "link", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 9, name: "tags", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 10, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 11, name: "visibility", kind: "enum", T: proto3.getEnumType(Visibility) }, + { no: 12, name: "og_metadata", kind: "message", T: OpenGraphMetadata }, + ], +); + +/** + * @generated from message slash.store.OpenGraphMetadata + */ +export const OpenGraphMetadata = proto3.makeMessageType( + "slash.store.OpenGraphMetadata", + () => [ + { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "image", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ], +); + diff --git a/web/src/types/proto/store/user_setting_pb.d.ts b/web/src/types/proto/store/user_setting_pb.d.ts new file mode 100644 index 0000000..c125e28 --- /dev/null +++ b/web/src/types/proto/store/user_setting_pb.d.ts @@ -0,0 +1,116 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/user_setting.proto (package slash.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 slash.store.UserSettingKey + */ +export declare enum UserSettingKey { + /** + * @generated from enum value: USER_SETTING_KEY_UNSPECIFIED = 0; + */ + USER_SETTING_KEY_UNSPECIFIED = 0, + + /** + * @generated from enum value: USER_SETTING_ACCESS_TOKENS = 1; + */ + USER_SETTING_ACCESS_TOKENS = 1, +} + +/** + * @generated from message slash.store.UserSetting + */ +export declare class UserSetting extends Message { + /** + * @generated from field: int32 user_id = 1; + */ + userId: number; + + /** + * @generated from field: slash.store.UserSettingKey key = 2; + */ + key: UserSettingKey; + + /** + * @generated from oneof slash.store.UserSetting.value + */ + value: { + /** + * @generated from field: slash.store.AccessTokensUserSetting access_tokens_user_setting = 3; + */ + value: AccessTokensUserSetting; + case: "accessTokensUserSetting"; + } | { case: undefined; value?: undefined }; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.store.AccessTokensUserSetting + */ +export declare class AccessTokensUserSetting extends Message { + /** + * @generated from field: repeated slash.store.AccessTokensUserSetting.AccessToken access_tokens = 1; + */ + accessTokens: AccessTokensUserSetting_AccessToken[]; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 slash.store.AccessTokensUserSetting.AccessToken + */ +export declare class AccessTokensUserSetting_AccessToken extends Message { + /** + * @generated from field: string access_token = 1; + */ + accessToken: string; + + /** + * @generated from field: string description = 2; + */ + description: string; + + constructor(data?: PartialMessage); + + static readonly runtime: typeof proto3; + static readonly typeName = "slash.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 new file mode 100644 index 0000000..330b9d5 --- /dev/null +++ b/web/src/types/proto/store/user_setting_pb.js @@ -0,0 +1,52 @@ +// @generated by protoc-gen-es v1.3.0 +// @generated from file store/user_setting.proto (package slash.store, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { proto3 } from "@bufbuild/protobuf"; + +/** + * @generated from enum slash.store.UserSettingKey + */ +export const UserSettingKey = proto3.makeEnum( + "slash.store.UserSettingKey", + [ + {no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"}, + {no: 1, name: "USER_SETTING_ACCESS_TOKENS"}, + ], +); + +/** + * @generated from message slash.store.UserSetting + */ +export const UserSetting = proto3.makeMessageType( + "slash.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_user_setting", kind: "message", T: AccessTokensUserSetting, oneof: "value" }, + ], +); + +/** + * @generated from message slash.store.AccessTokensUserSetting + */ +export const AccessTokensUserSetting = proto3.makeMessageType( + "slash.store.AccessTokensUserSetting", + () => [ + { no: 1, name: "access_tokens", kind: "message", T: AccessTokensUserSetting_AccessToken, repeated: true }, + ], +); + +/** + * @generated from message slash.store.AccessTokensUserSetting.AccessToken + */ +export const AccessTokensUserSetting_AccessToken = proto3.makeMessageType( + "slash.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"}, +); +