Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: sheet payload proto (#5786)

p0ny1221458857e4
diff --git a/frontend/src/types/proto/store/sheet.ts b/frontend/src/types/proto/store/sheet.ts
new file mode 100644
index 0000000000..d9bf470844
--- /dev/null
+++ b/frontend/src/types/proto/store/sheet.ts
@@ -0,0 +1,343 @@
+/* eslint-disable */
+import * as Long from "long";
+import * as _m0 from "protobufjs/minimal";
+
+export const protobufPackage = "bytebase.store";
+
+export interface SheetPayload {
+ vcsPayload?: SheetPayload_VCSPayload;
+ /** used_by_issues link to the issues where the sheet is used. */
+ usedByIssues: SheetPayload_UsedByIssue[];
+}
+
+export interface SheetPayload_VCSPayload {
+ fileName: string;
+ filePath: string;
+ size: number;
+ author: string;
+ lastCommitId: string;
+ lastSyncTs: number;
+}
+
+export interface SheetPayload_UsedByIssue {
+ issueId: number;
+ issueTitle: string;
+}
+
+function createBaseSheetPayload(): SheetPayload {
+ return { vcsPayload: undefined, usedByIssues: [] };
+}
+
+export const SheetPayload = {
+ encode(message: SheetPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.vcsPayload !== undefined) {
+ SheetPayload_VCSPayload.encode(message.vcsPayload, writer.uint32(10).fork()).ldelim();
+ }
+ for (const v of message.usedByIssues) {
+ SheetPayload_UsedByIssue.encode(v!, writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SheetPayload {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSheetPayload();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag != 10) {
+ break;
+ }
+
+ message.vcsPayload = SheetPayload_VCSPayload.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag != 18) {
+ break;
+ }
+
+ message.usedByIssues.push(SheetPayload_UsedByIssue.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) == 4 || tag == 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SheetPayload {
+ return {
+ vcsPayload: isSet(object.vcsPayload) ? SheetPayload_VCSPayload.fromJSON(object.vcsPayload) : undefined,
+ usedByIssues: Array.isArray(object?.usedByIssues)
+ ? object.usedByIssues.map((e: any) => SheetPayload_UsedByIssue.fromJSON(e))
+ : [],
+ };
+ },
+
+ toJSON(message: SheetPayload): unknown {
+ const obj: any = {};
+ message.vcsPayload !== undefined &&
+ (obj.vcsPayload = message.vcsPayload ? SheetPayload_VCSPayload.toJSON(message.vcsPayload) : undefined);
+ if (message.usedByIssues) {
+ obj.usedByIssues = message.usedByIssues.map((e) => e ? SheetPayload_UsedByIssue.toJSON(e) : undefined);
+ } else {
+ obj.usedByIssues = [];
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<SheetPayload>): SheetPayload {
+ return SheetPayload.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<SheetPayload>): SheetPayload {
+ const message = createBaseSheetPayload();
+ message.vcsPayload = (object.vcsPayload !== undefined && object.vcsPayload !== null)
+ ? SheetPayload_VCSPayload.fromPartial(object.vcsPayload)
+ : undefined;
+ message.usedByIssues = object.usedByIssues?.map((e) => SheetPayload_UsedByIssue.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseSheetPayload_VCSPayload(): SheetPayload_VCSPayload {
+ return { fileName: "", filePath: "", size: 0, author: "", lastCommitId: "", lastSyncTs: 0 };
+}
+
+export const SheetPayload_VCSPayload = {
+ encode(message: SheetPayload_VCSPayload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.fileName !== "") {
+ writer.uint32(10).string(message.fileName);
+ }
+ if (message.filePath !== "") {
+ writer.uint32(18).string(message.filePath);
+ }
+ if (message.size !== 0) {
+ writer.uint32(24).int64(message.size);
+ }
+ if (message.author !== "") {
+ writer.uint32(34).string(message.author);
+ }
+ if (message.lastCommitId !== "") {
+ writer.uint32(42).string(message.lastCommitId);
+ }
+ if (message.lastSyncTs !== 0) {
+ writer.uint32(48).int64(message.lastSyncTs);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SheetPayload_VCSPayload {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSheetPayload_VCSPayload();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag != 10) {
+ break;
+ }
+
+ message.fileName = reader.string();
+ continue;
+ case 2:
+ if (tag != 18) {
+ break;
+ }
+
+ message.filePath = reader.string();
+ continue;
+ case 3:
+ if (tag != 24) {
+ break;
+ }
+
+ message.size = longToNumber(reader.int64() as Long);
+ continue;
+ case 4:
+ if (tag != 34) {
+ break;
+ }
+
+ message.author = reader.string();
+ continue;
+ case 5:
+ if (tag != 42) {
+ break;
+ }
+
+ message.lastCommitId = reader.string();
+ continue;
+ case 6:
+ if (tag != 48) {
+ break;
+ }
+
+ message.lastSyncTs = longToNumber(reader.int64() as Long);
+ continue;
+ }
+ if ((tag & 7) == 4 || tag == 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SheetPayload_VCSPayload {
+ return {
+ fileName: isSet(object.fileName) ? String(object.fileName) : "",
+ filePath: isSet(object.filePath) ? String(object.filePath) : "",
+ size: isSet(object.size) ? Number(object.size) : 0,
+ author: isSet(object.author) ? String(object.author) : "",
+ lastCommitId: isSet(object.lastCommitId) ? String(object.lastCommitId) : "",
+ lastSyncTs: isSet(object.lastSyncTs) ? Number(object.lastSyncTs) : 0,
+ };
+ },
+
+ toJSON(message: SheetPayload_VCSPayload): unknown {
+ const obj: any = {};
+ message.fileName !== undefined && (obj.fileName = message.fileName);
+ message.filePath !== undefined && (obj.filePath = message.filePath);
+ message.size !== undefined && (obj.size = Math.round(message.size));
+ message.author !== undefined && (obj.author = message.author);
+ message.lastCommitId !== undefined && (obj.lastCommitId = message.lastCommitId);
+ message.lastSyncTs !== undefined && (obj.lastSyncTs = Math.round(message.lastSyncTs));
+ return obj;
+ },
+
+ create(base?: DeepPartial<SheetPayload_VCSPayload>): SheetPayload_VCSPayload {
+ return SheetPayload_VCSPayload.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<SheetPayload_VCSPayload>): SheetPayload_VCSPayload {
+ const message = createBaseSheetPayload_VCSPayload();
+ message.fileName = object.fileName ?? "";
+ message.filePath = object.filePath ?? "";
+ message.size = object.size ?? 0;
+ message.author = object.author ?? "";
+ message.lastCommitId = object.lastCommitId ?? "";
+ message.lastSyncTs = object.lastSyncTs ?? 0;
+ return message;
+ },
+};
+
+function createBaseSheetPayload_UsedByIssue(): SheetPayload_UsedByIssue {
+ return { issueId: 0, issueTitle: "" };
+}
+
+export const SheetPayload_UsedByIssue = {
+ encode(message: SheetPayload_UsedByIssue, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.issueId !== 0) {
+ writer.uint32(8).int64(message.issueId);
+ }
+ if (message.issueTitle !== "") {
+ writer.uint32(18).string(message.issueTitle);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SheetPayload_UsedByIssue {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSheetPayload_UsedByIssue();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag != 8) {
+ break;
+ }
+
+ message.issueId = longToNumber(reader.int64() as Long);
+ continue;
+ case 2:
+ if (tag != 18) {
+ break;
+ }
+
+ message.issueTitle = reader.string();
+ continue;
+ }
+ if ((tag & 7) == 4 || tag == 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SheetPayload_UsedByIssue {
+ return {
+ issueId: isSet(object.issueId) ? Number(object.issueId) : 0,
+ issueTitle: isSet(object.issueTitle) ? String(object.issueTitle) : "",
+ };
+ },
+
+ toJSON(message: SheetPayload_UsedByIssue): unknown {
+ const obj: any = {};
+ message.issueId !== undefined && (obj.issueId = Math.round(message.issueId));
+ message.issueTitle !== undefined && (obj.issueTitle = message.issueTitle);
+ return obj;
+ },
+
+ create(base?: DeepPartial<SheetPayload_UsedByIssue>): SheetPayload_UsedByIssue {
+ return SheetPayload_UsedByIssue.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<SheetPayload_UsedByIssue>): SheetPayload_UsedByIssue {
+ const message = createBaseSheetPayload_UsedByIssue();
+ message.issueId = object.issueId ?? 0;
+ message.issueTitle = object.issueTitle ?? "";
+ return message;
+ },
+};
+
+declare var self: any | undefined;
+declare var window: any | undefined;
+declare var global: any | undefined;
+var tsProtoGlobalThis: any = (() => {
+ if (typeof globalThis !== "undefined") {
+ return globalThis;
+ }
+ if (typeof self !== "undefined") {
+ return self;
+ }
+ if (typeof window !== "undefined") {
+ return window;
+ }
+ if (typeof global !== "undefined") {
+ return global;
+ }
+ throw "Unable to locate global object";
+})();
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function longToNumber(long: Long): number {
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
+ throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
+ }
+ return long.toNumber();
+}
+
+// If you get a compile-error about 'Constructor<Long> and ... have no overlap',
+// add '--ts_proto_opt=esModuleInterop=true' as a flag when calling 'protoc'.
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index a7c0328154..2a28ec4eb2 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -67,6 +67,11 @@
- [SMTPMailDeliverySetting.Authentication](#bytebase-store-SMTPMailDeliverySetting-Authentication)
- [SMTPMailDeliverySetting.Encryption](#bytebase-store-SMTPMailDeliverySetting-Encryption)
+- [store/sheet.proto](#store_sheet-proto)
+ - [SheetPayload](#bytebase-store-SheetPayload)
+ - [SheetPayload.UsedByIssue](#bytebase-store-SheetPayload-UsedByIssue)
+ - [SheetPayload.VCSPayload](#bytebase-store-SheetPayload-VCSPayload)
+
- [store/slow_query.proto](#store_slow_query-proto)
- [SlowQueryDetails](#bytebase-store-SlowQueryDetails)
- [SlowQueryStatistics](#bytebase-store-SlowQueryStatistics)
@@ -988,6 +993,74 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
+<a name="store_sheet-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/sheet.proto
+
+
+
+<a name="bytebase-store-SheetPayload"></a>
+
+### SheetPayload
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| vcs_payload | [SheetPayload.VCSPayload](#bytebase-store-SheetPayload-VCSPayload) | | |
+| used_by_issues | [SheetPayload.UsedByIssue](#bytebase-store-SheetPayload-UsedByIssue) | repeated | used_by_issues link to the issues where the sheet is used. |
+
+
+
+
+
+
+<a name="bytebase-store-SheetPayload-UsedByIssue"></a>
+
+### SheetPayload.UsedByIssue
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| issue_id | [int64](#int64) | | |
+| issue_title | [string](#string) | | |
+
+
+
+
+
+
+<a name="bytebase-store-SheetPayload-VCSPayload"></a>
+
+### SheetPayload.VCSPayload
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| file_name | [string](#string) | | |
+| file_path | [string](#string) | | |
+| size | [int64](#int64) | | |
+| author | [string](#string) | | |
+| last_commit_id | [string](#string) | | |
+| last_sync_ts | [int64](#int64) | | |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<a name="store_slow_query-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/generated-go/store/sheet.pb.go b/proto/generated-go/store/sheet.pb.go
new file mode 100644
index 0000000000..e1f52254f1
--- /dev/null
+++ b/proto/generated-go/store/sheet.pb.go
@@ -0,0 +1,347 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.30.0
+// protoc (unknown)
+// source: store/sheet.proto
+
+package store
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type SheetPayload struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ VcsPayload *SheetPayload_VCSPayload `protobuf:"bytes,1,opt,name=vcs_payload,json=vcsPayload,proto3" json:"vcs_payload,omitempty"`
+ // used_by_issues link to the issues where the sheet is used.
+ UsedByIssues []*SheetPayload_UsedByIssue `protobuf:"bytes,2,rep,name=used_by_issues,json=usedByIssues,proto3" json:"used_by_issues,omitempty"`
+}
+
+func (x *SheetPayload) Reset() {
+ *x = SheetPayload{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_sheet_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SheetPayload) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SheetPayload) ProtoMessage() {}
+
+func (x *SheetPayload) ProtoReflect() protoreflect.Message {
+ mi := &file_store_sheet_proto_msgTypes[0]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SheetPayload.ProtoReflect.Descriptor instead.
+func (*SheetPayload) Descriptor() ([]byte, []int) {
+ return file_store_sheet_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *SheetPayload) GetVcsPayload() *SheetPayload_VCSPayload {
+ if x != nil {
+ return x.VcsPayload
+ }
+ return nil
+}
+
+func (x *SheetPayload) GetUsedByIssues() []*SheetPayload_UsedByIssue {
+ if x != nil {
+ return x.UsedByIssues
+ }
+ return nil
+}
+
+type SheetPayload_VCSPayload struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ FileName string `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
+ FilePath string `protobuf:"bytes,2,opt,name=file_path,json=filePath,proto3" json:"file_path,omitempty"`
+ Size int64 `protobuf:"varint,3,opt,name=size,proto3" json:"size,omitempty"`
+ Author string `protobuf:"bytes,4,opt,name=author,proto3" json:"author,omitempty"`
+ LastCommitId string `protobuf:"bytes,5,opt,name=last_commit_id,json=lastCommitId,proto3" json:"last_commit_id,omitempty"`
+ LastSyncTs int64 `protobuf:"varint,6,opt,name=last_sync_ts,json=lastSyncTs,proto3" json:"last_sync_ts,omitempty"`
+}
+
+func (x *SheetPayload_VCSPayload) Reset() {
+ *x = SheetPayload_VCSPayload{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_sheet_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SheetPayload_VCSPayload) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SheetPayload_VCSPayload) ProtoMessage() {}
+
+func (x *SheetPayload_VCSPayload) ProtoReflect() protoreflect.Message {
+ mi := &file_store_sheet_proto_msgTypes[1]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SheetPayload_VCSPayload.ProtoReflect.Descriptor instead.
+func (*SheetPayload_VCSPayload) Descriptor() ([]byte, []int) {
+ return file_store_sheet_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *SheetPayload_VCSPayload) GetFileName() string {
+ if x != nil {
+ return x.FileName
+ }
+ return ""
+}
+
+func (x *SheetPayload_VCSPayload) GetFilePath() string {
+ if x != nil {
+ return x.FilePath
+ }
+ return ""
+}
+
+func (x *SheetPayload_VCSPayload) GetSize() int64 {
+ if x != nil {
+ return x.Size
+ }
+ return 0
+}
+
+func (x *SheetPayload_VCSPayload) GetAuthor() string {
+ if x != nil {
+ return x.Author
+ }
+ return ""
+}
+
+func (x *SheetPayload_VCSPayload) GetLastCommitId() string {
+ if x != nil {
+ return x.LastCommitId
+ }
+ return ""
+}
+
+func (x *SheetPayload_VCSPayload) GetLastSyncTs() int64 {
+ if x != nil {
+ return x.LastSyncTs
+ }
+ return 0
+}
+
+type SheetPayload_UsedByIssue struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ IssueId int64 `protobuf:"varint,1,opt,name=issue_id,json=issueId,proto3" json:"issue_id,omitempty"`
+ IssueTitle string `protobuf:"bytes,2,opt,name=issue_title,json=issueTitle,proto3" json:"issue_title,omitempty"`
+}
+
+func (x *SheetPayload_UsedByIssue) Reset() {
+ *x = SheetPayload_UsedByIssue{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_sheet_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SheetPayload_UsedByIssue) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SheetPayload_UsedByIssue) ProtoMessage() {}
+
+func (x *SheetPayload_UsedByIssue) ProtoReflect() protoreflect.Message {
+ mi := &file_store_sheet_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use SheetPayload_UsedByIssue.ProtoReflect.Descriptor instead.
+func (*SheetPayload_UsedByIssue) Descriptor() ([]byte, []int) {
+ return file_store_sheet_proto_rawDescGZIP(), []int{0, 1}
+}
+
+func (x *SheetPayload_UsedByIssue) GetIssueId() int64 {
+ if x != nil {
+ return x.IssueId
+ }
+ return 0
+}
+
+func (x *SheetPayload_UsedByIssue) GetIssueTitle() string {
+ if x != nil {
+ return x.IssueTitle
+ }
+ return ""
+}
+
+var File_store_sheet_proto protoreflect.FileDescriptor
+
+var file_store_sheet_proto_rawDesc = []byte{
+ 0x0a, 0x11, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74,
+ 0x6f, 0x72, 0x65, 0x22, 0xb0, 0x03, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79,
+ 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x48, 0x0a, 0x0b, 0x76, 0x63, 0x73, 0x5f, 0x70, 0x61, 0x79, 0x6c,
+ 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74,
+ 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x56, 0x43, 0x53, 0x50, 0x61, 0x79, 0x6c, 0x6f,
+ 0x61, 0x64, 0x52, 0x0a, 0x76, 0x63, 0x73, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x4e,
+ 0x0a, 0x0e, 0x75, 0x73, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x5f, 0x69, 0x73, 0x73, 0x75, 0x65, 0x73,
+ 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x50, 0x61, 0x79,
+ 0x6c, 0x6f, 0x61, 0x64, 0x2e, 0x55, 0x73, 0x65, 0x64, 0x42, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65,
+ 0x52, 0x0c, 0x75, 0x73, 0x65, 0x64, 0x42, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x73, 0x1a, 0xba,
+ 0x01, 0x0a, 0x0a, 0x56, 0x43, 0x53, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1b, 0x0a,
+ 0x09, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+ 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x69,
+ 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66,
+ 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61,
+ 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74,
+ 0x68, 0x6f, 0x72, 0x12, 0x24, 0x0a, 0x0e, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x69, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6c, 0x61, 0x73,
+ 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6c, 0x61, 0x73,
+ 0x74, 0x5f, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
+ 0x0a, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x79, 0x6e, 0x63, 0x54, 0x73, 0x1a, 0x49, 0x0a, 0x0b, 0x55,
+ 0x73, 0x65, 0x64, 0x42, 0x79, 0x49, 0x73, 0x73, 0x75, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x73,
+ 0x73, 0x75, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x69, 0x73,
+ 0x73, 0x75, 0x65, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x73, 0x73, 0x75, 0x65, 0x5f, 0x74,
+ 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x73, 0x73, 0x75,
+ 0x65, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_store_sheet_proto_rawDescOnce sync.Once
+ file_store_sheet_proto_rawDescData = file_store_sheet_proto_rawDesc
+)
+
+func file_store_sheet_proto_rawDescGZIP() []byte {
+ file_store_sheet_proto_rawDescOnce.Do(func() {
+ file_store_sheet_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_sheet_proto_rawDescData)
+ })
+ return file_store_sheet_proto_rawDescData
+}
+
+var file_store_sheet_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
+var file_store_sheet_proto_goTypes = []interface{}{
+ (*SheetPayload)(nil), // 0: bytebase.store.SheetPayload
+ (*SheetPayload_VCSPayload)(nil), // 1: bytebase.store.SheetPayload.VCSPayload
+ (*SheetPayload_UsedByIssue)(nil), // 2: bytebase.store.SheetPayload.UsedByIssue
+}
+var file_store_sheet_proto_depIdxs = []int32{
+ 1, // 0: bytebase.store.SheetPayload.vcs_payload:type_name -> bytebase.store.SheetPayload.VCSPayload
+ 2, // 1: bytebase.store.SheetPayload.used_by_issues:type_name -> bytebase.store.SheetPayload.UsedByIssue
+ 2, // [2:2] is the sub-list for method output_type
+ 2, // [2:2] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_store_sheet_proto_init() }
+func file_store_sheet_proto_init() {
+ if File_store_sheet_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_store_sheet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SheetPayload); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_sheet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SheetPayload_VCSPayload); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_sheet_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SheetPayload_UsedByIssue); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_store_sheet_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 3,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_store_sheet_proto_goTypes,
+ DependencyIndexes: file_store_sheet_proto_depIdxs,
+ MessageInfos: file_store_sheet_proto_msgTypes,
+ }.Build()
+ File_store_sheet_proto = out.File
+ file_store_sheet_proto_rawDesc = nil
+ file_store_sheet_proto_goTypes = nil
+ file_store_sheet_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/v1/database_service.pb.go b/proto/generated-go/v1/database_service.pb.go
index 5ab8933eb6..2d4c6a7c0c 100644
--- a/proto/generated-go/v1/database_service.pb.go
+++ b/proto/generated-go/v1/database_service.pb.go
@@ -2929,15 +2929,15 @@ var file_v1_database_service_proto_rawDesc = []byte{
0x64, 0x5f, 0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
- 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
- 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70,
- 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67,
+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66,
+ 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
+ 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
+ 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
+ 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x2d, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
diff --git a/proto/store/database.proto b/proto/store/database.proto
index 5d0fbceb94..1d450c5556 100644
--- a/proto/store/database.proto
+++ b/proto/store/database.proto
@@ -237,4 +237,4 @@ message SecretItem {
// The description is the description of the secret.
string description = 3;
-}
\ No newline at end of file
+}
diff --git a/proto/store/sheet.proto b/proto/store/sheet.proto
new file mode 100644
index 0000000000..995b8a08f1
--- /dev/null
+++ b/proto/store/sheet.proto
@@ -0,0 +1,24 @@
+syntax = "proto3";
+
+package bytebase.store;
+
+option go_package = "generated-go/store";
+
+message SheetPayload {
+ message VCSPayload {
+ string file_name = 1;
+ string file_path = 2;
+ int64 size = 3;
+ string author = 4;
+ string last_commit_id = 5;
+ int64 last_sync_ts = 6;
+ }
+ VCSPayload vcs_payload = 1;
+
+ message UsedByIssue {
+ int64 issue_id = 1;
+ string issue_title = 2;
+ }
+ // used_by_issues link to the issues where the sheet is used.
+ repeated UsedByIssue used_by_issues = 2;
+}
diff --git a/proto/v1/database_service.proto b/proto/v1/database_service.proto
index d9e4332026..3d1c036e6b 100644
--- a/proto/v1/database_service.proto
+++ b/proto/v1/database_service.proto
@@ -6,11 +6,11 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/duration.proto";
+import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/wrappers.proto";
import "v1/common.proto";
-import "google/protobuf/empty.proto";
option go_package = "generated-go/v1";
@@ -77,9 +77,7 @@ service DatabaseService {
}
rpc ListSecrets(ListSecretsRequest) returns (ListSecretsResponse) {
- option (google.api.http) = {
- get: "/v1/{parent=environments/*/instances/*/databases/*}/secrets"
- };
+ option (google.api.http) = {get: "/v1/{parent=environments/*/instances/*/databases/*}/secrets"};
option (google.api.method_signature) = "parent";
}
@@ -91,9 +89,7 @@ service DatabaseService {
}
rpc DeleteSecret(DeleteSecretRequest) returns (google.protobuf.Empty) {
- option (google.api.http) = {
- delete: "/v1/{name=environments/*/instances/*/databases/*/secrets/*}"
- };
+ option (google.api.http) = {delete: "/v1/{name=environments/*/instances/*/databases/*/secrets/*}"};
}
}
@@ -612,10 +608,10 @@ message SlowQueryStatistics {
// The maximum rows examined of the slow query log.
int64 maximum_rows_examined = 9;
-
+
// The percentage of the query time.
double query_time_percent = 10;
-
+
// The percentage of the count.
double count_percent = 11;
@@ -708,4 +704,4 @@ message Secret {
// The decsription of the secret.
string description = 5;
-}
\ No newline at end of file
+}