Skip to content

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

feat(api): the proto definition of sheet service (#6068)

h3n4l4b0e95691c1c
diff --git a/frontend/src/types/proto/v1/sheet_service.ts b/frontend/src/types/proto/v1/sheet_service.ts
new file mode 100644
index 0000000000..c52974fc08
--- /dev/null
+++ b/frontend/src/types/proto/v1/sheet_service.ts
@@ -0,0 +1,1432 @@
+/* eslint-disable */
+import type { CallContext, CallOptions } from "nice-grpc-common";
+import * as _m0 from "protobufjs/minimal";
+import { Empty } from "../google/protobuf/empty";
+import { FieldMask } from "../google/protobuf/field_mask";
+import { Timestamp } from "../google/protobuf/timestamp";
+
+export const protobufPackage = "bytebase.v1";
+
+export interface CreateSheetRequest {
+ /**
+ * The parent resource where this sheet will be created.
+ * Foramt: projects/{project}
+ */
+ parent: string;
+ /** The sheet to create. */
+ sheet?: Sheet;
+}
+
+export interface GetSheetRequest {
+ /**
+ * The name of the sheet to retrieve.
+ * Format: projects/{project}/sheets/{sheet}
+ */
+ name: string;
+ /** By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content. */
+ raw: boolean;
+}
+
+export interface UpdateSheetRequest {
+ /**
+ * The sheet to update.
+ *
+ * The sheet's `name` field is used to identify the sheet to update.
+ * Format: projects/{project}/sheets/{sheet}
+ */
+ sheet?: Sheet;
+ /**
+ * The list of fields to be updated.
+ * Fields are specified relative to the sheet.
+ * (e.g. `title`, `statement`; *not* `sheet.title` or `sheet.statement`)
+ */
+ updateMask?: string[];
+}
+
+export interface DeleteSheetRequest {
+ /**
+ * The name of the sheet to delete.
+ * Format: projects/{project}/sheets/{sheet}
+ */
+ name: string;
+}
+
+export interface SearchSheetsRequest {
+ /**
+ * The parent resource of the sheet.
+ * Foramt: projects/{project}
+ */
+ parent: string;
+ /**
+ * Not used. The maximum number of sheets to return. The service may return fewer than
+ * this value.
+ * If unspecified, at most 50 sheets will be returned.
+ * The maximum value is 1000; values above 1000 will be coerced to 1000.
+ */
+ pageSize: number;
+ /**
+ * Not used. A page token, received from a previous `SearchSheets` call.
+ * Provide this to retrieve the subsequent page.
+ *
+ * When paginating, all other parameters provided to `SearchSheets` must match
+ * the call that provided the page token.
+ */
+ pageToken: string;
+}
+
+export interface SearchSheetsResponse {
+ /** The sheets that matched the search criteria. */
+ sheets: Sheet[];
+ /**
+ * To filter the search result.
+ * Format: only support the following spec for now:
+ * - `creator = user:{email}`, `creator != user:{email}`
+ * - `starred = true`, `starred = false`.
+ */
+ filter: string;
+ /**
+ * Not used. A token, which can be sent as `page_token` to retrieve the next page.
+ * If this field is omitted, there are no subsequent pages.
+ */
+ nextPageToken: string;
+}
+
+export interface SyncSheetsRequest {
+ /**
+ * The name of the project to sync sheets.
+ *
+ * Format: projects/{project}
+ */
+ parent: string;
+}
+
+export interface Sheet {
+ /**
+ * The name of the sheet resource, generated by the server.
+ * Canonical parent is project.
+ * Format: projects/{project}/sheets/{sheet}
+ */
+ name: string;
+ /**
+ * The database resource name.
+ * Format: instances/{instance}/databases/{database}
+ * If the database parent doesn't exist, the database field is empty.
+ */
+ database: string;
+ /** The title of the sheet. */
+ title: string;
+ /**
+ * The creator of the Sheet.
+ * Format: user:{email}
+ */
+ creator: string;
+ /** The create time of the sheet. */
+ createTime?: Date;
+ /** The last update time of the sheet. */
+ updateTime?: Date;
+ /**
+ * The content of the sheet.
+ * By default, it will be cut off, if it doesn't match the `content_size`, you can
+ * set the `raw` to true in GetSheet request to retrieve the full content.
+ */
+ content: Uint8Array;
+ /** content_size is the full size of the content, may not match the size of the `content` field. */
+ contentSize: Uint8Array;
+ visibility: Sheet_Visibility;
+ /** The source of the sheet. */
+ source: Sheet_Source;
+ /** The type of the sheet. */
+ type: Sheet_Type;
+ /** starred indicates whether the sheet is starred by the current authenticated user. */
+ starred: boolean;
+}
+
+export enum Sheet_Visibility {
+ VISIBILITY_UNSPECIFIED = 0,
+ /** VISIBILITY_PUBLIC - Public, sheet OWNER can read/write, and all others can read. */
+ VISIBILITY_PUBLIC = 1,
+ /** VISIBILITY_PROJECT - Project, sheet OWNER and project OWNER can read/write, and project DEVELOPER can read. */
+ VISIBILITY_PROJECT = 2,
+ /** VISIBILITY_PRIVATE - Private, only sheet OWNER can read/write. */
+ VISIBILITY_PRIVATE = 3,
+ UNRECOGNIZED = -1,
+}
+
+export function sheet_VisibilityFromJSON(object: any): Sheet_Visibility {
+ switch (object) {
+ case 0:
+ case "VISIBILITY_UNSPECIFIED":
+ return Sheet_Visibility.VISIBILITY_UNSPECIFIED;
+ case 1:
+ case "VISIBILITY_PUBLIC":
+ return Sheet_Visibility.VISIBILITY_PUBLIC;
+ case 2:
+ case "VISIBILITY_PROJECT":
+ return Sheet_Visibility.VISIBILITY_PROJECT;
+ case 3:
+ case "VISIBILITY_PRIVATE":
+ return Sheet_Visibility.VISIBILITY_PRIVATE;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return Sheet_Visibility.UNRECOGNIZED;
+ }
+}
+
+export function sheet_VisibilityToJSON(object: Sheet_Visibility): string {
+ switch (object) {
+ case Sheet_Visibility.VISIBILITY_UNSPECIFIED:
+ return "VISIBILITY_UNSPECIFIED";
+ case Sheet_Visibility.VISIBILITY_PUBLIC:
+ return "VISIBILITY_PUBLIC";
+ case Sheet_Visibility.VISIBILITY_PROJECT:
+ return "VISIBILITY_PROJECT";
+ case Sheet_Visibility.VISIBILITY_PRIVATE:
+ return "VISIBILITY_PRIVATE";
+ case Sheet_Visibility.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export enum Sheet_Source {
+ SOURCE_UNSPECIFIED = 0,
+ /** SOURCE_BYTEBASE - BYTEBASE is the sheet created by Bytebase. e.g. SQL Editor. */
+ SOURCE_BYTEBASE = 1,
+ /** SOURCE_BYTEBASE_ARTIFACT - BYTEBASE_ARTIFACT is the artifact sheet. */
+ SOURCE_BYTEBASE_ARTIFACT = 2,
+ /** SOURCE_GITLAB - GITLAB is the sheet synced from GitLab (for both GitLab.com and self-hosted GitLab). */
+ SOURCE_GITLAB = 3,
+ /** SOURCE_GITHUB - GITHUB is the sheet synced from GitHub (for both GitHub.com and GitHub Enterprise). */
+ SOURCE_GITHUB = 4,
+ /** SOURCE_BITBUCKET - BITBUCKET is the sheet synced from Bitbucket (for both Bitbucket.org and Bitbucket Server). */
+ SOURCE_BITBUCKET = 5,
+ UNRECOGNIZED = -1,
+}
+
+export function sheet_SourceFromJSON(object: any): Sheet_Source {
+ switch (object) {
+ case 0:
+ case "SOURCE_UNSPECIFIED":
+ return Sheet_Source.SOURCE_UNSPECIFIED;
+ case 1:
+ case "SOURCE_BYTEBASE":
+ return Sheet_Source.SOURCE_BYTEBASE;
+ case 2:
+ case "SOURCE_BYTEBASE_ARTIFACT":
+ return Sheet_Source.SOURCE_BYTEBASE_ARTIFACT;
+ case 3:
+ case "SOURCE_GITLAB":
+ return Sheet_Source.SOURCE_GITLAB;
+ case 4:
+ case "SOURCE_GITHUB":
+ return Sheet_Source.SOURCE_GITHUB;
+ case 5:
+ case "SOURCE_BITBUCKET":
+ return Sheet_Source.SOURCE_BITBUCKET;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return Sheet_Source.UNRECOGNIZED;
+ }
+}
+
+export function sheet_SourceToJSON(object: Sheet_Source): string {
+ switch (object) {
+ case Sheet_Source.SOURCE_UNSPECIFIED:
+ return "SOURCE_UNSPECIFIED";
+ case Sheet_Source.SOURCE_BYTEBASE:
+ return "SOURCE_BYTEBASE";
+ case Sheet_Source.SOURCE_BYTEBASE_ARTIFACT:
+ return "SOURCE_BYTEBASE_ARTIFACT";
+ case Sheet_Source.SOURCE_GITLAB:
+ return "SOURCE_GITLAB";
+ case Sheet_Source.SOURCE_GITHUB:
+ return "SOURCE_GITHUB";
+ case Sheet_Source.SOURCE_BITBUCKET:
+ return "SOURCE_BITBUCKET";
+ case Sheet_Source.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export enum Sheet_Type {
+ TYPE_UNSPECIFIED = 0,
+ TYPE_SQL = 1,
+ UNRECOGNIZED = -1,
+}
+
+export function sheet_TypeFromJSON(object: any): Sheet_Type {
+ switch (object) {
+ case 0:
+ case "TYPE_UNSPECIFIED":
+ return Sheet_Type.TYPE_UNSPECIFIED;
+ case 1:
+ case "TYPE_SQL":
+ return Sheet_Type.TYPE_SQL;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return Sheet_Type.UNRECOGNIZED;
+ }
+}
+
+export function sheet_TypeToJSON(object: Sheet_Type): string {
+ switch (object) {
+ case Sheet_Type.TYPE_UNSPECIFIED:
+ return "TYPE_UNSPECIFIED";
+ case Sheet_Type.TYPE_SQL:
+ return "TYPE_SQL";
+ case Sheet_Type.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+function createBaseCreateSheetRequest(): CreateSheetRequest {
+ return { parent: "", sheet: undefined };
+}
+
+export const CreateSheetRequest = {
+ encode(message: CreateSheetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.parent !== "") {
+ writer.uint32(10).string(message.parent);
+ }
+ if (message.sheet !== undefined) {
+ Sheet.encode(message.sheet, writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): CreateSheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseCreateSheetRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.parent = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.sheet = Sheet.decode(reader, reader.uint32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): CreateSheetRequest {
+ return {
+ parent: isSet(object.parent) ? String(object.parent) : "",
+ sheet: isSet(object.sheet) ? Sheet.fromJSON(object.sheet) : undefined,
+ };
+ },
+
+ toJSON(message: CreateSheetRequest): unknown {
+ const obj: any = {};
+ message.parent !== undefined && (obj.parent = message.parent);
+ message.sheet !== undefined && (obj.sheet = message.sheet ? Sheet.toJSON(message.sheet) : undefined);
+ return obj;
+ },
+
+ create(base?: DeepPartial<CreateSheetRequest>): CreateSheetRequest {
+ return CreateSheetRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<CreateSheetRequest>): CreateSheetRequest {
+ const message = createBaseCreateSheetRequest();
+ message.parent = object.parent ?? "";
+ message.sheet = (object.sheet !== undefined && object.sheet !== null) ? Sheet.fromPartial(object.sheet) : undefined;
+ return message;
+ },
+};
+
+function createBaseGetSheetRequest(): GetSheetRequest {
+ return { name: "", raw: false };
+}
+
+export const GetSheetRequest = {
+ encode(message: GetSheetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ if (message.raw === true) {
+ writer.uint32(16).bool(message.raw);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): GetSheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseGetSheetRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.raw = reader.bool();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): GetSheetRequest {
+ return {
+ name: isSet(object.name) ? String(object.name) : "",
+ raw: isSet(object.raw) ? Boolean(object.raw) : false,
+ };
+ },
+
+ toJSON(message: GetSheetRequest): unknown {
+ const obj: any = {};
+ message.name !== undefined && (obj.name = message.name);
+ message.raw !== undefined && (obj.raw = message.raw);
+ return obj;
+ },
+
+ create(base?: DeepPartial<GetSheetRequest>): GetSheetRequest {
+ return GetSheetRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<GetSheetRequest>): GetSheetRequest {
+ const message = createBaseGetSheetRequest();
+ message.name = object.name ?? "";
+ message.raw = object.raw ?? false;
+ return message;
+ },
+};
+
+function createBaseUpdateSheetRequest(): UpdateSheetRequest {
+ return { sheet: undefined, updateMask: undefined };
+}
+
+export const UpdateSheetRequest = {
+ encode(message: UpdateSheetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.sheet !== undefined) {
+ Sheet.encode(message.sheet, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.updateMask !== undefined) {
+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseUpdateSheetRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.sheet = Sheet.decode(reader, reader.uint32());
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): UpdateSheetRequest {
+ return {
+ sheet: isSet(object.sheet) ? Sheet.fromJSON(object.sheet) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
+ toJSON(message: UpdateSheetRequest): unknown {
+ const obj: any = {};
+ message.sheet !== undefined && (obj.sheet = message.sheet ? Sheet.toJSON(message.sheet) : undefined);
+ message.updateMask !== undefined && (obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask)));
+ return obj;
+ },
+
+ create(base?: DeepPartial<UpdateSheetRequest>): UpdateSheetRequest {
+ return UpdateSheetRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<UpdateSheetRequest>): UpdateSheetRequest {
+ const message = createBaseUpdateSheetRequest();
+ message.sheet = (object.sheet !== undefined && object.sheet !== null) ? Sheet.fromPartial(object.sheet) : undefined;
+ message.updateMask = object.updateMask ?? undefined;
+ return message;
+ },
+};
+
+function createBaseDeleteSheetRequest(): DeleteSheetRequest {
+ return { name: "" };
+}
+
+export const DeleteSheetRequest = {
+ encode(message: DeleteSheetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteSheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDeleteSheetRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): DeleteSheetRequest {
+ return { name: isSet(object.name) ? String(object.name) : "" };
+ },
+
+ toJSON(message: DeleteSheetRequest): unknown {
+ const obj: any = {};
+ message.name !== undefined && (obj.name = message.name);
+ return obj;
+ },
+
+ create(base?: DeepPartial<DeleteSheetRequest>): DeleteSheetRequest {
+ return DeleteSheetRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<DeleteSheetRequest>): DeleteSheetRequest {
+ const message = createBaseDeleteSheetRequest();
+ message.name = object.name ?? "";
+ return message;
+ },
+};
+
+function createBaseSearchSheetsRequest(): SearchSheetsRequest {
+ return { parent: "", pageSize: 0, pageToken: "" };
+}
+
+export const SearchSheetsRequest = {
+ encode(message: SearchSheetsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.parent !== "") {
+ writer.uint32(10).string(message.parent);
+ }
+ if (message.pageSize !== 0) {
+ writer.uint32(16).int32(message.pageSize);
+ }
+ if (message.pageToken !== "") {
+ writer.uint32(26).string(message.pageToken);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SearchSheetsRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSearchSheetsRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.parent = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.pageSize = reader.int32();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.pageToken = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SearchSheetsRequest {
+ return {
+ parent: isSet(object.parent) ? String(object.parent) : "",
+ pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? String(object.pageToken) : "",
+ };
+ },
+
+ toJSON(message: SearchSheetsRequest): unknown {
+ const obj: any = {};
+ message.parent !== undefined && (obj.parent = message.parent);
+ message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize));
+ message.pageToken !== undefined && (obj.pageToken = message.pageToken);
+ return obj;
+ },
+
+ create(base?: DeepPartial<SearchSheetsRequest>): SearchSheetsRequest {
+ return SearchSheetsRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<SearchSheetsRequest>): SearchSheetsRequest {
+ const message = createBaseSearchSheetsRequest();
+ message.parent = object.parent ?? "";
+ message.pageSize = object.pageSize ?? 0;
+ message.pageToken = object.pageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseSearchSheetsResponse(): SearchSheetsResponse {
+ return { sheets: [], filter: "", nextPageToken: "" };
+}
+
+export const SearchSheetsResponse = {
+ encode(message: SearchSheetsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.sheets) {
+ Sheet.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.filter !== "") {
+ writer.uint32(18).string(message.filter);
+ }
+ if (message.nextPageToken !== "") {
+ writer.uint32(26).string(message.nextPageToken);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SearchSheetsResponse {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSearchSheetsResponse();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.sheets.push(Sheet.decode(reader, reader.uint32()));
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.filter = reader.string();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.nextPageToken = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SearchSheetsResponse {
+ return {
+ sheets: Array.isArray(object?.sheets) ? object.sheets.map((e: any) => Sheet.fromJSON(e)) : [],
+ filter: isSet(object.filter) ? String(object.filter) : "",
+ nextPageToken: isSet(object.nextPageToken) ? String(object.nextPageToken) : "",
+ };
+ },
+
+ toJSON(message: SearchSheetsResponse): unknown {
+ const obj: any = {};
+ if (message.sheets) {
+ obj.sheets = message.sheets.map((e) => e ? Sheet.toJSON(e) : undefined);
+ } else {
+ obj.sheets = [];
+ }
+ message.filter !== undefined && (obj.filter = message.filter);
+ message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);
+ return obj;
+ },
+
+ create(base?: DeepPartial<SearchSheetsResponse>): SearchSheetsResponse {
+ return SearchSheetsResponse.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<SearchSheetsResponse>): SearchSheetsResponse {
+ const message = createBaseSearchSheetsResponse();
+ message.sheets = object.sheets?.map((e) => Sheet.fromPartial(e)) || [];
+ message.filter = object.filter ?? "";
+ message.nextPageToken = object.nextPageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseSyncSheetsRequest(): SyncSheetsRequest {
+ return { parent: "" };
+}
+
+export const SyncSheetsRequest = {
+ encode(message: SyncSheetsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.parent !== "") {
+ writer.uint32(10).string(message.parent);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SyncSheetsRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSyncSheetsRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.parent = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SyncSheetsRequest {
+ return { parent: isSet(object.parent) ? String(object.parent) : "" };
+ },
+
+ toJSON(message: SyncSheetsRequest): unknown {
+ const obj: any = {};
+ message.parent !== undefined && (obj.parent = message.parent);
+ return obj;
+ },
+
+ create(base?: DeepPartial<SyncSheetsRequest>): SyncSheetsRequest {
+ return SyncSheetsRequest.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<SyncSheetsRequest>): SyncSheetsRequest {
+ const message = createBaseSyncSheetsRequest();
+ message.parent = object.parent ?? "";
+ return message;
+ },
+};
+
+function createBaseSheet(): Sheet {
+ return {
+ name: "",
+ database: "",
+ title: "",
+ creator: "",
+ createTime: undefined,
+ updateTime: undefined,
+ content: new Uint8Array(),
+ contentSize: new Uint8Array(),
+ visibility: 0,
+ source: 0,
+ type: 0,
+ starred: false,
+ };
+}
+
+export const Sheet = {
+ encode(message: Sheet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ if (message.database !== "") {
+ writer.uint32(18).string(message.database);
+ }
+ if (message.title !== "") {
+ writer.uint32(26).string(message.title);
+ }
+ if (message.creator !== "") {
+ writer.uint32(34).string(message.creator);
+ }
+ if (message.createTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.createTime), writer.uint32(42).fork()).ldelim();
+ }
+ if (message.updateTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(50).fork()).ldelim();
+ }
+ if (message.content.length !== 0) {
+ writer.uint32(58).bytes(message.content);
+ }
+ if (message.contentSize.length !== 0) {
+ writer.uint32(66).bytes(message.contentSize);
+ }
+ if (message.visibility !== 0) {
+ writer.uint32(72).int32(message.visibility);
+ }
+ if (message.source !== 0) {
+ writer.uint32(80).int32(message.source);
+ }
+ if (message.type !== 0) {
+ writer.uint32(88).int32(message.type);
+ }
+ if (message.starred === true) {
+ writer.uint32(96).bool(message.starred);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Sheet {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSheet();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.database = reader.string();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.title = reader.string();
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.creator = reader.string();
+ continue;
+ case 5:
+ if (tag !== 42) {
+ break;
+ }
+
+ message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ continue;
+ case 6:
+ if (tag !== 50) {
+ break;
+ }
+
+ message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ continue;
+ case 7:
+ if (tag !== 58) {
+ break;
+ }
+
+ message.content = reader.bytes();
+ continue;
+ case 8:
+ if (tag !== 66) {
+ break;
+ }
+
+ message.contentSize = reader.bytes();
+ continue;
+ case 9:
+ if (tag !== 72) {
+ break;
+ }
+
+ message.visibility = reader.int32() as any;
+ continue;
+ case 10:
+ if (tag !== 80) {
+ break;
+ }
+
+ message.source = reader.int32() as any;
+ continue;
+ case 11:
+ if (tag !== 88) {
+ break;
+ }
+
+ message.type = reader.int32() as any;
+ continue;
+ case 12:
+ if (tag !== 96) {
+ break;
+ }
+
+ message.starred = reader.bool();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): Sheet {
+ return {
+ name: isSet(object.name) ? String(object.name) : "",
+ database: isSet(object.database) ? String(object.database) : "",
+ title: isSet(object.title) ? String(object.title) : "",
+ creator: isSet(object.creator) ? String(object.creator) : "",
+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,
+ updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,
+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(),
+ contentSize: isSet(object.contentSize) ? bytesFromBase64(object.contentSize) : new Uint8Array(),
+ visibility: isSet(object.visibility) ? sheet_VisibilityFromJSON(object.visibility) : 0,
+ source: isSet(object.source) ? sheet_SourceFromJSON(object.source) : 0,
+ type: isSet(object.type) ? sheet_TypeFromJSON(object.type) : 0,
+ starred: isSet(object.starred) ? Boolean(object.starred) : false,
+ };
+ },
+
+ toJSON(message: Sheet): unknown {
+ const obj: any = {};
+ message.name !== undefined && (obj.name = message.name);
+ message.database !== undefined && (obj.database = message.database);
+ message.title !== undefined && (obj.title = message.title);
+ message.creator !== undefined && (obj.creator = message.creator);
+ message.createTime !== undefined && (obj.createTime = message.createTime.toISOString());
+ message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString());
+ message.content !== undefined &&
+ (obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array()));
+ message.contentSize !== undefined &&
+ (obj.contentSize = base64FromBytes(message.contentSize !== undefined ? message.contentSize : new Uint8Array()));
+ message.visibility !== undefined && (obj.visibility = sheet_VisibilityToJSON(message.visibility));
+ message.source !== undefined && (obj.source = sheet_SourceToJSON(message.source));
+ message.type !== undefined && (obj.type = sheet_TypeToJSON(message.type));
+ message.starred !== undefined && (obj.starred = message.starred);
+ return obj;
+ },
+
+ create(base?: DeepPartial<Sheet>): Sheet {
+ return Sheet.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<Sheet>): Sheet {
+ const message = createBaseSheet();
+ message.name = object.name ?? "";
+ message.database = object.database ?? "";
+ message.title = object.title ?? "";
+ message.creator = object.creator ?? "";
+ message.createTime = object.createTime ?? undefined;
+ message.updateTime = object.updateTime ?? undefined;
+ message.content = object.content ?? new Uint8Array();
+ message.contentSize = object.contentSize ?? new Uint8Array();
+ message.visibility = object.visibility ?? 0;
+ message.source = object.source ?? 0;
+ message.type = object.type ?? 0;
+ message.starred = object.starred ?? false;
+ return message;
+ },
+};
+
+export type SheetServiceDefinition = typeof SheetServiceDefinition;
+export const SheetServiceDefinition = {
+ name: "SheetService",
+ fullName: "bytebase.v1.SheetService",
+ methods: {
+ createSheet: {
+ name: "CreateSheet",
+ requestType: CreateSheetRequest,
+ requestStream: false,
+ responseType: Sheet,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([12, 112, 97, 114, 101, 110, 116, 44, 115, 104, 101, 101, 116])],
+ 578365826: [
+ new Uint8Array([
+ 39,
+ 58,
+ 5,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 34,
+ 30,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 112,
+ 97,
+ 114,
+ 101,
+ 110,
+ 116,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ 47,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ ]),
+ ],
+ },
+ },
+ },
+ getSheet: {
+ name: "GetSheet",
+ requestType: GetSheetRequest,
+ requestStream: false,
+ responseType: Sheet,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],
+ 578365826: [
+ new Uint8Array([
+ 32,
+ 18,
+ 30,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 47,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ searchSheets: {
+ name: "SearchSheets",
+ requestType: SearchSheetsRequest,
+ requestStream: false,
+ responseType: SearchSheetsResponse,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 578365826: [
+ new Uint8Array([
+ 39,
+ 18,
+ 37,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 112,
+ 97,
+ 114,
+ 101,
+ 110,
+ 116,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ 47,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 58,
+ 115,
+ 101,
+ 97,
+ 114,
+ 99,
+ 104,
+ ]),
+ ],
+ },
+ },
+ },
+ updateSheet: {
+ name: "UpdateSheet",
+ requestType: UpdateSheetRequest,
+ requestStream: false,
+ responseType: Sheet,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([17, 115, 104, 101, 101, 116, 44, 117, 112, 100, 97, 116, 101, 95, 109, 97, 115, 107])],
+ 578365826: [
+ new Uint8Array([
+ 45,
+ 58,
+ 5,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 50,
+ 36,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 46,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 47,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ deleteSheet: {
+ name: "DeleteSheet",
+ requestType: DeleteSheetRequest,
+ requestStream: false,
+ responseType: Empty,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],
+ 578365826: [
+ new Uint8Array([
+ 32,
+ 42,
+ 30,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 47,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ syncSheets: {
+ name: "SyncSheets",
+ requestType: SyncSheetsRequest,
+ requestStream: false,
+ responseType: Empty,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([6, 112, 97, 114, 101, 110, 116])],
+ 578365826: [
+ new Uint8Array([
+ 37,
+ 34,
+ 35,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 112,
+ 97,
+ 114,
+ 101,
+ 110,
+ 116,
+ 61,
+ 112,
+ 114,
+ 111,
+ 106,
+ 101,
+ 99,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ 47,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 58,
+ 115,
+ 121,
+ 110,
+ 99,
+ ]),
+ ],
+ },
+ },
+ },
+ },
+} as const;
+
+export interface SheetServiceImplementation<CallContextExt = {}> {
+ createSheet(request: CreateSheetRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Sheet>>;
+ getSheet(request: GetSheetRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Sheet>>;
+ searchSheets(
+ request: SearchSheetsRequest,
+ context: CallContext & CallContextExt,
+ ): Promise<DeepPartial<SearchSheetsResponse>>;
+ updateSheet(request: UpdateSheetRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Sheet>>;
+ deleteSheet(request: DeleteSheetRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Empty>>;
+ syncSheets(request: SyncSheetsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<Empty>>;
+}
+
+export interface SheetServiceClient<CallOptionsExt = {}> {
+ createSheet(request: DeepPartial<CreateSheetRequest>, options?: CallOptions & CallOptionsExt): Promise<Sheet>;
+ getSheet(request: DeepPartial<GetSheetRequest>, options?: CallOptions & CallOptionsExt): Promise<Sheet>;
+ searchSheets(
+ request: DeepPartial<SearchSheetsRequest>,
+ options?: CallOptions & CallOptionsExt,
+ ): Promise<SearchSheetsResponse>;
+ updateSheet(request: DeepPartial<UpdateSheetRequest>, options?: CallOptions & CallOptionsExt): Promise<Sheet>;
+ deleteSheet(request: DeepPartial<DeleteSheetRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
+ syncSheets(request: DeepPartial<SyncSheetsRequest>, options?: CallOptions & CallOptionsExt): Promise<Empty>;
+}
+
+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";
+})();
+
+function bytesFromBase64(b64: string): Uint8Array {
+ if (tsProtoGlobalThis.Buffer) {
+ return Uint8Array.from(tsProtoGlobalThis.Buffer.from(b64, "base64"));
+ } else {
+ const bin = tsProtoGlobalThis.atob(b64);
+ const arr = new Uint8Array(bin.length);
+ for (let i = 0; i < bin.length; ++i) {
+ arr[i] = bin.charCodeAt(i);
+ }
+ return arr;
+ }
+}
+
+function base64FromBytes(arr: Uint8Array): string {
+ if (tsProtoGlobalThis.Buffer) {
+ return tsProtoGlobalThis.Buffer.from(arr).toString("base64");
+ } else {
+ const bin: string[] = [];
+ arr.forEach((byte) => {
+ bin.push(String.fromCharCode(byte));
+ });
+ return tsProtoGlobalThis.btoa(bin.join(""));
+ }
+}
+
+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 toTimestamp(date: Date): Timestamp {
+ const seconds = date.getTime() / 1_000;
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
+ return { seconds, nanos };
+}
+
+function fromTimestamp(t: Timestamp): Date {
+ let millis = t.seconds * 1_000;
+ millis += t.nanos / 1_000_000;
+ return new Date(millis);
+}
+
+function fromJsonTimestamp(o: any): Date {
+ if (o instanceof Date) {
+ return o;
+ } else if (typeof o === "string") {
+ return new Date(o);
+ } else {
+ return fromTimestamp(Timestamp.fromJSON(o));
+ }
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index a4c73b5b51..6fdc23b9b7 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -348,6 +348,22 @@
- [SettingService](#bytebase-v1-SettingService)
+- [v1/sheet_service.proto](#v1_sheet_service-proto)
+ - [CreateSheetRequest](#bytebase-v1-CreateSheetRequest)
+ - [DeleteSheetRequest](#bytebase-v1-DeleteSheetRequest)
+ - [GetSheetRequest](#bytebase-v1-GetSheetRequest)
+ - [SearchSheetsRequest](#bytebase-v1-SearchSheetsRequest)
+ - [SearchSheetsResponse](#bytebase-v1-SearchSheetsResponse)
+ - [Sheet](#bytebase-v1-Sheet)
+ - [SyncSheetsRequest](#bytebase-v1-SyncSheetsRequest)
+ - [UpdateSheetRequest](#bytebase-v1-UpdateSheetRequest)
+
+ - [Sheet.Source](#bytebase-v1-Sheet-Source)
+ - [Sheet.Type](#bytebase-v1-Sheet-Type)
+ - [Sheet.Visibility](#bytebase-v1-Sheet-Visibility)
+
+ - [SheetService](#bytebase-v1-SheetService)
+
- [v1/sql_service.proto](#v1_sql_service-proto)
- [PrettyRequest](#bytebase-v1-PrettyRequest)
- [PrettyResponse](#bytebase-v1-PrettyResponse)
@@ -5300,6 +5316,223 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
+<a name="v1_sheet_service-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## v1/sheet_service.proto
+
+
+
+<a name="bytebase-v1-CreateSheetRequest"></a>
+
+### CreateSheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent resource where this sheet will be created. Foramt: projects/{project} |
+| sheet | [Sheet](#bytebase-v1-Sheet) | | The sheet to create. |
+
+
+
+
+
+
+<a name="bytebase-v1-DeleteSheetRequest"></a>
+
+### DeleteSheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the sheet to delete. Format: projects/{project}/sheets/{sheet} |
+
+
+
+
+
+
+<a name="bytebase-v1-GetSheetRequest"></a>
+
+### GetSheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the sheet to retrieve. Format: projects/{project}/sheets/{sheet} |
+| raw | [bool](#bool) | | By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content. |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchSheetsRequest"></a>
+
+### SearchSheetsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The parent resource of the sheet. Foramt: projects/{project} |
+| page_size | [int32](#int32) | | Not used. The maximum number of sheets to return. The service may return fewer than this value. If unspecified, at most 50 sheets will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
+| page_token | [string](#string) | | Not used. A page token, received from a previous `SearchSheets` call. Provide this to retrieve the subsequent page.
+
+When paginating, all other parameters provided to `SearchSheets` must match the call that provided the page token. |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchSheetsResponse"></a>
+
+### SearchSheetsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| sheets | [Sheet](#bytebase-v1-Sheet) | repeated | The sheets that matched the search criteria. |
+| filter | [string](#string) | | To filter the search result. Format: only support the following spec for now: - `creator = user:{email}`, `creator != user:{email}` - `starred = true`, `starred = false`. |
+| next_page_token | [string](#string) | | Not used. A token, which can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. |
+
+
+
+
+
+
+<a name="bytebase-v1-Sheet"></a>
+
+### Sheet
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the sheet resource, generated by the server. Canonical parent is project. Format: projects/{project}/sheets/{sheet} |
+| database | [string](#string) | | The database resource name. Format: instances/{instance}/databases/{database} If the database parent doesn&#39;t exist, the database field is empty. |
+| title | [string](#string) | | The title of the sheet. |
+| creator | [string](#string) | | The creator of the Sheet. Format: user:{email} |
+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The create time of the sheet. |
+| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The last update time of the sheet. |
+| content | [bytes](#bytes) | | The content of the sheet. By default, it will be cut off, if it doesn&#39;t match the `content_size`, you can set the `raw` to true in GetSheet request to retrieve the full content. |
+| content_size | [bytes](#bytes) | | content_size is the full size of the content, may not match the size of the `content` field. |
+| visibility | [Sheet.Visibility](#bytebase-v1-Sheet-Visibility) | | |
+| source | [Sheet.Source](#bytebase-v1-Sheet-Source) | | The source of the sheet. |
+| type | [Sheet.Type](#bytebase-v1-Sheet-Type) | | The type of the sheet. |
+| starred | [bool](#bool) | | starred indicates whether the sheet is starred by the current authenticated user. |
+
+
+
+
+
+
+<a name="bytebase-v1-SyncSheetsRequest"></a>
+
+### SyncSheetsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| parent | [string](#string) | | The name of the project to sync sheets.
+
+Format: projects/{project} |
+
+
+
+
+
+
+<a name="bytebase-v1-UpdateSheetRequest"></a>
+
+### UpdateSheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| sheet | [Sheet](#bytebase-v1-Sheet) | | The sheet to update.
+
+The sheet&#39;s `name` field is used to identify the sheet to update. Format: projects/{project}/sheets/{sheet} |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. Fields are specified relative to the sheet. (e.g. `title`, `statement`; *not* `sheet.title` or `sheet.statement`) |
+
+
+
+
+
+
+
+
+<a name="bytebase-v1-Sheet-Source"></a>
+
+### Sheet.Source
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| SOURCE_UNSPECIFIED | 0 | |
+| SOURCE_BYTEBASE | 1 | BYTEBASE is the sheet created by Bytebase. e.g. SQL Editor. |
+| SOURCE_BYTEBASE_ARTIFACT | 2 | BYTEBASE_ARTIFACT is the artifact sheet. |
+| SOURCE_GITLAB | 3 | GITLAB is the sheet synced from GitLab (for both GitLab.com and self-hosted GitLab). |
+| SOURCE_GITHUB | 4 | GITHUB is the sheet synced from GitHub (for both GitHub.com and GitHub Enterprise). |
+| SOURCE_BITBUCKET | 5 | BITBUCKET is the sheet synced from Bitbucket (for both Bitbucket.org and Bitbucket Server). |
+
+
+
+<a name="bytebase-v1-Sheet-Type"></a>
+
+### Sheet.Type
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| TYPE_UNSPECIFIED | 0 | |
+| TYPE_SQL | 1 | |
+
+
+
+<a name="bytebase-v1-Sheet-Visibility"></a>
+
+### Sheet.Visibility
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| VISIBILITY_UNSPECIFIED | 0 | |
+| VISIBILITY_PUBLIC | 1 | Public, sheet OWNER can read/write, and all others can read. |
+| VISIBILITY_PROJECT | 2 | Project, sheet OWNER and project OWNER can read/write, and project DEVELOPER can read. |
+| VISIBILITY_PRIVATE | 3 | Private, only sheet OWNER can read/write. |
+
+
+
+
+
+
+
+<a name="bytebase-v1-SheetService"></a>
+
+### SheetService
+
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| CreateSheet | [CreateSheetRequest](#bytebase-v1-CreateSheetRequest) | [Sheet](#bytebase-v1-Sheet) | |
+| GetSheet | [GetSheetRequest](#bytebase-v1-GetSheetRequest) | [Sheet](#bytebase-v1-Sheet) | |
+| SearchSheets | [SearchSheetsRequest](#bytebase-v1-SearchSheetsRequest) | [SearchSheetsResponse](#bytebase-v1-SearchSheetsResponse) | |
+| UpdateSheet | [UpdateSheetRequest](#bytebase-v1-UpdateSheetRequest) | [Sheet](#bytebase-v1-Sheet) | |
+| DeleteSheet | [DeleteSheetRequest](#bytebase-v1-DeleteSheetRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
+| SyncSheets | [SyncSheetsRequest](#bytebase-v1-SyncSheetsRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
+
+
+
+
+
<a name="v1_sql_service-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/generated-go/v1/sheet_service.pb.go b/proto/generated-go/v1/sheet_service.pb.go
new file mode 100644
index 0000000000..41aa02e699
--- /dev/null
+++ b/proto/generated-go/v1/sheet_service.pb.go
@@ -0,0 +1,1107 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.30.0
+// protoc (unknown)
+// source: v1/sheet_service.proto
+
+package v1
+
+import (
+ _ "google.golang.org/genproto/googleapis/api/annotations"
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"
+ 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 Sheet_Visibility int32
+
+const (
+ Sheet_VISIBILITY_UNSPECIFIED Sheet_Visibility = 0
+ // Public, sheet OWNER can read/write, and all others can read.
+ Sheet_VISIBILITY_PUBLIC Sheet_Visibility = 1
+ // Project, sheet OWNER and project OWNER can read/write, and project DEVELOPER can read.
+ Sheet_VISIBILITY_PROJECT Sheet_Visibility = 2
+ // Private, only sheet OWNER can read/write.
+ Sheet_VISIBILITY_PRIVATE Sheet_Visibility = 3
+)
+
+// Enum value maps for Sheet_Visibility.
+var (
+ Sheet_Visibility_name = map[int32]string{
+ 0: "VISIBILITY_UNSPECIFIED",
+ 1: "VISIBILITY_PUBLIC",
+ 2: "VISIBILITY_PROJECT",
+ 3: "VISIBILITY_PRIVATE",
+ }
+ Sheet_Visibility_value = map[string]int32{
+ "VISIBILITY_UNSPECIFIED": 0,
+ "VISIBILITY_PUBLIC": 1,
+ "VISIBILITY_PROJECT": 2,
+ "VISIBILITY_PRIVATE": 3,
+ }
+)
+
+func (x Sheet_Visibility) Enum() *Sheet_Visibility {
+ p := new(Sheet_Visibility)
+ *p = x
+ return p
+}
+
+func (x Sheet_Visibility) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Sheet_Visibility) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_sheet_service_proto_enumTypes[0].Descriptor()
+}
+
+func (Sheet_Visibility) Type() protoreflect.EnumType {
+ return &file_v1_sheet_service_proto_enumTypes[0]
+}
+
+func (x Sheet_Visibility) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Sheet_Visibility.Descriptor instead.
+func (Sheet_Visibility) EnumDescriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{7, 0}
+}
+
+type Sheet_Source int32
+
+const (
+ Sheet_SOURCE_UNSPECIFIED Sheet_Source = 0
+ // BYTEBASE is the sheet created by Bytebase. e.g. SQL Editor.
+ Sheet_SOURCE_BYTEBASE Sheet_Source = 1
+ // BYTEBASE_ARTIFACT is the artifact sheet.
+ Sheet_SOURCE_BYTEBASE_ARTIFACT Sheet_Source = 2
+ // GITLAB is the sheet synced from GitLab (for both GitLab.com and self-hosted GitLab).
+ Sheet_SOURCE_GITLAB Sheet_Source = 3
+ // GITHUB is the sheet synced from GitHub (for both GitHub.com and GitHub Enterprise).
+ Sheet_SOURCE_GITHUB Sheet_Source = 4
+ // BITBUCKET is the sheet synced from Bitbucket (for both Bitbucket.org and Bitbucket Server).
+ Sheet_SOURCE_BITBUCKET Sheet_Source = 5
+)
+
+// Enum value maps for Sheet_Source.
+var (
+ Sheet_Source_name = map[int32]string{
+ 0: "SOURCE_UNSPECIFIED",
+ 1: "SOURCE_BYTEBASE",
+ 2: "SOURCE_BYTEBASE_ARTIFACT",
+ 3: "SOURCE_GITLAB",
+ 4: "SOURCE_GITHUB",
+ 5: "SOURCE_BITBUCKET",
+ }
+ Sheet_Source_value = map[string]int32{
+ "SOURCE_UNSPECIFIED": 0,
+ "SOURCE_BYTEBASE": 1,
+ "SOURCE_BYTEBASE_ARTIFACT": 2,
+ "SOURCE_GITLAB": 3,
+ "SOURCE_GITHUB": 4,
+ "SOURCE_BITBUCKET": 5,
+ }
+)
+
+func (x Sheet_Source) Enum() *Sheet_Source {
+ p := new(Sheet_Source)
+ *p = x
+ return p
+}
+
+func (x Sheet_Source) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Sheet_Source) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_sheet_service_proto_enumTypes[1].Descriptor()
+}
+
+func (Sheet_Source) Type() protoreflect.EnumType {
+ return &file_v1_sheet_service_proto_enumTypes[1]
+}
+
+func (x Sheet_Source) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Sheet_Source.Descriptor instead.
+func (Sheet_Source) EnumDescriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{7, 1}
+}
+
+type Sheet_Type int32
+
+const (
+ Sheet_TYPE_UNSPECIFIED Sheet_Type = 0
+ Sheet_TYPE_SQL Sheet_Type = 1
+)
+
+// Enum value maps for Sheet_Type.
+var (
+ Sheet_Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "TYPE_SQL",
+ }
+ Sheet_Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "TYPE_SQL": 1,
+ }
+)
+
+func (x Sheet_Type) Enum() *Sheet_Type {
+ p := new(Sheet_Type)
+ *p = x
+ return p
+}
+
+func (x Sheet_Type) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Sheet_Type) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_sheet_service_proto_enumTypes[2].Descriptor()
+}
+
+func (Sheet_Type) Type() protoreflect.EnumType {
+ return &file_v1_sheet_service_proto_enumTypes[2]
+}
+
+func (x Sheet_Type) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Sheet_Type.Descriptor instead.
+func (Sheet_Type) EnumDescriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{7, 2}
+}
+
+type CreateSheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The parent resource where this sheet will be created.
+ // Foramt: projects/{project}
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // The sheet to create.
+ Sheet *Sheet `protobuf:"bytes,2,opt,name=sheet,proto3" json:"sheet,omitempty"`
+}
+
+func (x *CreateSheetRequest) Reset() {
+ *x = CreateSheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateSheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateSheetRequest) ProtoMessage() {}
+
+func (x *CreateSheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_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 CreateSheetRequest.ProtoReflect.Descriptor instead.
+func (*CreateSheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CreateSheetRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *CreateSheetRequest) GetSheet() *Sheet {
+ if x != nil {
+ return x.Sheet
+ }
+ return nil
+}
+
+type GetSheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the sheet to retrieve.
+ // Format: projects/{project}/sheets/{sheet}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
+ Raw bool `protobuf:"varint,2,opt,name=raw,proto3" json:"raw,omitempty"`
+}
+
+func (x *GetSheetRequest) Reset() {
+ *x = GetSheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetSheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetSheetRequest) ProtoMessage() {}
+
+func (x *GetSheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_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 GetSheetRequest.ProtoReflect.Descriptor instead.
+func (*GetSheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GetSheetRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *GetSheetRequest) GetRaw() bool {
+ if x != nil {
+ return x.Raw
+ }
+ return false
+}
+
+type UpdateSheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The sheet to update.
+ //
+ // The sheet's `name` field is used to identify the sheet to update.
+ // Format: projects/{project}/sheets/{sheet}
+ Sheet *Sheet `protobuf:"bytes,1,opt,name=sheet,proto3" json:"sheet,omitempty"`
+ // The list of fields to be updated.
+ // Fields are specified relative to the sheet.
+ // (e.g. `title`, `statement`; *not* `sheet.title` or `sheet.statement`)
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateSheetRequest) Reset() {
+ *x = UpdateSheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateSheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateSheetRequest) ProtoMessage() {}
+
+func (x *UpdateSheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_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 UpdateSheetRequest.ProtoReflect.Descriptor instead.
+func (*UpdateSheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *UpdateSheetRequest) GetSheet() *Sheet {
+ if x != nil {
+ return x.Sheet
+ }
+ return nil
+}
+
+func (x *UpdateSheetRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+type DeleteSheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the sheet to delete.
+ // Format: projects/{project}/sheets/{sheet}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *DeleteSheetRequest) Reset() {
+ *x = DeleteSheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteSheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteSheetRequest) ProtoMessage() {}
+
+func (x *DeleteSheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_proto_msgTypes[3]
+ 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 DeleteSheetRequest.ProtoReflect.Descriptor instead.
+func (*DeleteSheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *DeleteSheetRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+type SearchSheetsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The parent resource of the sheet.
+ // Foramt: projects/{project}
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+ // Not used. The maximum number of sheets to return. The service may return fewer than
+ // this value.
+ // If unspecified, at most 50 sheets will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
+ PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
+ // Not used. A page token, received from a previous `SearchSheets` call.
+ // Provide this to retrieve the subsequent page.
+ //
+ // When paginating, all other parameters provided to `SearchSheets` must match
+ // the call that provided the page token.
+ PageToken string `protobuf:"bytes,3,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
+}
+
+func (x *SearchSheetsRequest) Reset() {
+ *x = SearchSheetsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SearchSheetsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SearchSheetsRequest) ProtoMessage() {}
+
+func (x *SearchSheetsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_proto_msgTypes[4]
+ 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 SearchSheetsRequest.ProtoReflect.Descriptor instead.
+func (*SearchSheetsRequest) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *SearchSheetsRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+func (x *SearchSheetsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *SearchSheetsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+type SearchSheetsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The sheets that matched the search criteria.
+ Sheets []*Sheet `protobuf:"bytes,1,rep,name=sheets,proto3" json:"sheets,omitempty"`
+ // To filter the search result.
+ // Format: only support the following spec for now:
+ // - `creator = user:{email}`, `creator != user:{email}`
+ // - `starred = true`, `starred = false`.
+ Filter string `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
+ // Not used. A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no subsequent pages.
+ NextPageToken string `protobuf:"bytes,3,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *SearchSheetsResponse) Reset() {
+ *x = SearchSheetsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SearchSheetsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SearchSheetsResponse) ProtoMessage() {}
+
+func (x *SearchSheetsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_proto_msgTypes[5]
+ 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 SearchSheetsResponse.ProtoReflect.Descriptor instead.
+func (*SearchSheetsResponse) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *SearchSheetsResponse) GetSheets() []*Sheet {
+ if x != nil {
+ return x.Sheets
+ }
+ return nil
+}
+
+func (x *SearchSheetsResponse) GetFilter() string {
+ if x != nil {
+ return x.Filter
+ }
+ return ""
+}
+
+func (x *SearchSheetsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+type SyncSheetsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the project to sync sheets.
+ //
+ // Format: projects/{project}
+ Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"`
+}
+
+func (x *SyncSheetsRequest) Reset() {
+ *x = SyncSheetsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SyncSheetsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SyncSheetsRequest) ProtoMessage() {}
+
+func (x *SyncSheetsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_proto_msgTypes[6]
+ 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 SyncSheetsRequest.ProtoReflect.Descriptor instead.
+func (*SyncSheetsRequest) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *SyncSheetsRequest) GetParent() string {
+ if x != nil {
+ return x.Parent
+ }
+ return ""
+}
+
+type Sheet struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the sheet resource, generated by the server.
+ // Canonical parent is project.
+ // Format: projects/{project}/sheets/{sheet}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // The database resource name.
+ // Format: instances/{instance}/databases/{database}
+ // If the database parent doesn't exist, the database field is empty.
+ Database string `protobuf:"bytes,2,opt,name=database,proto3" json:"database,omitempty"`
+ // The title of the sheet.
+ Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
+ // The creator of the Sheet.
+ // Format: user:{email}
+ Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"`
+ // The create time of the sheet.
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ // The last update time of the sheet.
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ // The content of the sheet.
+ // By default, it will be cut off, if it doesn't match the `content_size`, you can
+ // set the `raw` to true in GetSheet request to retrieve the full content.
+ Content []byte `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"`
+ // content_size is the full size of the content, may not match the size of the `content` field.
+ ContentSize []byte `protobuf:"bytes,8,opt,name=content_size,json=contentSize,proto3" json:"content_size,omitempty"`
+ Visibility Sheet_Visibility `protobuf:"varint,9,opt,name=visibility,proto3,enum=bytebase.v1.Sheet_Visibility" json:"visibility,omitempty"`
+ // The source of the sheet.
+ Source Sheet_Source `protobuf:"varint,10,opt,name=source,proto3,enum=bytebase.v1.Sheet_Source" json:"source,omitempty"`
+ // The type of the sheet.
+ Type Sheet_Type `protobuf:"varint,11,opt,name=type,proto3,enum=bytebase.v1.Sheet_Type" json:"type,omitempty"`
+ // starred indicates whether the sheet is starred by the current authenticated user.
+ Starred bool `protobuf:"varint,12,opt,name=starred,proto3" json:"starred,omitempty"`
+}
+
+func (x *Sheet) Reset() {
+ *x = Sheet{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_sheet_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Sheet) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Sheet) ProtoMessage() {}
+
+func (x *Sheet) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_sheet_service_proto_msgTypes[7]
+ 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 Sheet.ProtoReflect.Descriptor instead.
+func (*Sheet) Descriptor() ([]byte, []int) {
+ return file_v1_sheet_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *Sheet) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Sheet) GetDatabase() string {
+ if x != nil {
+ return x.Database
+ }
+ return ""
+}
+
+func (x *Sheet) GetTitle() string {
+ if x != nil {
+ return x.Title
+ }
+ return ""
+}
+
+func (x *Sheet) GetCreator() string {
+ if x != nil {
+ return x.Creator
+ }
+ return ""
+}
+
+func (x *Sheet) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *Sheet) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+func (x *Sheet) GetContent() []byte {
+ if x != nil {
+ return x.Content
+ }
+ return nil
+}
+
+func (x *Sheet) GetContentSize() []byte {
+ if x != nil {
+ return x.ContentSize
+ }
+ return nil
+}
+
+func (x *Sheet) GetVisibility() Sheet_Visibility {
+ if x != nil {
+ return x.Visibility
+ }
+ return Sheet_VISIBILITY_UNSPECIFIED
+}
+
+func (x *Sheet) GetSource() Sheet_Source {
+ if x != nil {
+ return x.Source
+ }
+ return Sheet_SOURCE_UNSPECIFIED
+}
+
+func (x *Sheet) GetType() Sheet_Type {
+ if x != nil {
+ return x.Type
+ }
+ return Sheet_TYPE_UNSPECIFIED
+}
+
+func (x *Sheet) GetStarred() bool {
+ if x != nil {
+ return x.Starred
+ }
+ return false
+}
+
+var File_v1_sheet_service_proto protoreflect.FileDescriptor
+
+var file_v1_sheet_service_proto_rawDesc = []byte{
+ 0x0a, 0x16, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69,
+ 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
+ 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
+ 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62,
+ 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 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, 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, 0x22, 0x60, 0x0a,
+ 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68,
+ 0x65, 0x65, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22,
+ 0x3c, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x53, 0x68, 0x65, 0x65, 0x74, 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, 0x12, 0x10, 0x0a, 0x03, 0x72,
+ 0x61, 0x77, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x72, 0x61, 0x77, 0x22, 0x80, 0x01,
+ 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,
+ 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64,
+ 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b,
+ 0x22, 0x2d, 0x0a, 0x12, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 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, 0x22,
+ 0x6e, 0x0a, 0x13, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x68, 0x65, 0x65, 0x74, 0x73, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x06, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,
+ 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22,
+ 0x82, 0x01, 0x0a, 0x14, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x68, 0x65, 0x65, 0x74, 0x73,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x06, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0f,
+ 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x2b, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x68, 0x65, 0x65,
+ 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x72,
+ 0x65, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e,
+ 0x74, 0x22, 0xbb, 0x06, 0x0a, 0x05, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x04, 0x6e,
+ 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe0, 0x41, 0x02, 0xe0, 0x41,
+ 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62,
+ 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x1d,
+ 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42,
+ 0x03, 0xe0, 0x41, 0x03, 0x52, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x40, 0x0a,
+ 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03,
+ 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
+ 0x40, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x06,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
+ 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
+ 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20, 0x01,
+ 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
+ 0x12, 0x26, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65,
+ 0x18, 0x08, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x6e,
+ 0x74, 0x65, 0x6e, 0x74, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x42, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69,
+ 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1d, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74,
+ 0x2e, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x42, 0x03, 0xe0, 0x41, 0x02,
+ 0x52, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x36, 0x0a, 0x06,
+ 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74,
+ 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x06, 0x73, 0x6f,
+ 0x75, 0x72, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01,
+ 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x42, 0x03, 0xe0, 0x41, 0x02,
+ 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x72, 0x65,
+ 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x72, 0x65, 0x64,
+ 0x22, 0x6f, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a,
+ 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53,
+ 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x49,
+ 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10,
+ 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f,
+ 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x49, 0x53,
+ 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10,
+ 0x03, 0x22, 0x8f, 0x01, 0x0a, 0x06, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x12,
+ 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
+ 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x42,
+ 0x59, 0x54, 0x45, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x4f, 0x55,
+ 0x52, 0x43, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x41, 0x52, 0x54,
+ 0x49, 0x46, 0x41, 0x43, 0x54, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x4f, 0x55, 0x52, 0x43,
+ 0x45, 0x5f, 0x47, 0x49, 0x54, 0x4c, 0x41, 0x42, 0x10, 0x03, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x4f,
+ 0x55, 0x52, 0x43, 0x45, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x10, 0x04, 0x12, 0x14, 0x0a,
+ 0x10, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x42, 0x49, 0x54, 0x42, 0x55, 0x43, 0x4b, 0x45,
+ 0x54, 0x10, 0x05, 0x22, 0x2a, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54,
+ 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
+ 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x51, 0x4c, 0x10, 0x01, 0x32,
+ 0x84, 0x06, 0x0a, 0x0c, 0x53, 0x68, 0x65, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+ 0x12, 0x80, 0x01, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74,
+ 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x53, 0x68, 0x65, 0x65, 0x74, 0x22, 0x3c, 0xda, 0x41, 0x0c, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x2c, 0x73, 0x68, 0x65, 0x65, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x3a, 0x05, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
+ 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x73, 0x12, 0x6b, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x53, 0x68, 0x65, 0x65, 0x74, 0x12,
+ 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65,
+ 0x74, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65,
+ 0x74, 0x22, 0x2d, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20,
+ 0x12, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d,
+ 0x12, 0x82, 0x01, 0x0a, 0x0c, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x68, 0x65, 0x65, 0x74,
+ 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x68, 0x65, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x53, 0x68, 0x65, 0x65, 0x74, 0x73, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25,
+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x3a, 0x73,
+ 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x8b, 0x01, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x53, 0x68, 0x65, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x65, 0x65, 0x74, 0x22, 0x47, 0xda, 0x41, 0x11, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2d, 0x3a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x32, 0x24, 0x2f,
+ 0x76, 0x31, 0x2f, 0x7b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73,
+ 0x2f, 0x2a, 0x7d, 0x12, 0x75, 0x0a, 0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x65,
+ 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2d, 0xda, 0x41, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x2a, 0x1e, 0x2f, 0x76, 0x31, 0x2f,
+ 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,
+ 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x7a, 0x0a, 0x0a, 0x53, 0x79,
+ 0x6e, 0x63, 0x53, 0x68, 0x65, 0x65, 0x74, 0x73, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x68, 0x65, 0x65, 0x74,
+ 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
+ 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
+ 0x22, 0x34, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x25, 0x22, 0x23, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x70,
+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x73, 0x3a, 0x73, 0x79, 0x6e, 0x63, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x33,
+}
+
+var (
+ file_v1_sheet_service_proto_rawDescOnce sync.Once
+ file_v1_sheet_service_proto_rawDescData = file_v1_sheet_service_proto_rawDesc
+)
+
+func file_v1_sheet_service_proto_rawDescGZIP() []byte {
+ file_v1_sheet_service_proto_rawDescOnce.Do(func() {
+ file_v1_sheet_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_sheet_service_proto_rawDescData)
+ })
+ return file_v1_sheet_service_proto_rawDescData
+}
+
+var file_v1_sheet_service_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
+var file_v1_sheet_service_proto_msgTypes = make([]protoimpl.MessageInfo, 8)
+var file_v1_sheet_service_proto_goTypes = []interface{}{
+ (Sheet_Visibility)(0), // 0: bytebase.v1.Sheet.Visibility
+ (Sheet_Source)(0), // 1: bytebase.v1.Sheet.Source
+ (Sheet_Type)(0), // 2: bytebase.v1.Sheet.Type
+ (*CreateSheetRequest)(nil), // 3: bytebase.v1.CreateSheetRequest
+ (*GetSheetRequest)(nil), // 4: bytebase.v1.GetSheetRequest
+ (*UpdateSheetRequest)(nil), // 5: bytebase.v1.UpdateSheetRequest
+ (*DeleteSheetRequest)(nil), // 6: bytebase.v1.DeleteSheetRequest
+ (*SearchSheetsRequest)(nil), // 7: bytebase.v1.SearchSheetsRequest
+ (*SearchSheetsResponse)(nil), // 8: bytebase.v1.SearchSheetsResponse
+ (*SyncSheetsRequest)(nil), // 9: bytebase.v1.SyncSheetsRequest
+ (*Sheet)(nil), // 10: bytebase.v1.Sheet
+ (*fieldmaskpb.FieldMask)(nil), // 11: google.protobuf.FieldMask
+ (*timestamppb.Timestamp)(nil), // 12: google.protobuf.Timestamp
+ (*emptypb.Empty)(nil), // 13: google.protobuf.Empty
+}
+var file_v1_sheet_service_proto_depIdxs = []int32{
+ 10, // 0: bytebase.v1.CreateSheetRequest.sheet:type_name -> bytebase.v1.Sheet
+ 10, // 1: bytebase.v1.UpdateSheetRequest.sheet:type_name -> bytebase.v1.Sheet
+ 11, // 2: bytebase.v1.UpdateSheetRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 10, // 3: bytebase.v1.SearchSheetsResponse.sheets:type_name -> bytebase.v1.Sheet
+ 12, // 4: bytebase.v1.Sheet.create_time:type_name -> google.protobuf.Timestamp
+ 12, // 5: bytebase.v1.Sheet.update_time:type_name -> google.protobuf.Timestamp
+ 0, // 6: bytebase.v1.Sheet.visibility:type_name -> bytebase.v1.Sheet.Visibility
+ 1, // 7: bytebase.v1.Sheet.source:type_name -> bytebase.v1.Sheet.Source
+ 2, // 8: bytebase.v1.Sheet.type:type_name -> bytebase.v1.Sheet.Type
+ 3, // 9: bytebase.v1.SheetService.CreateSheet:input_type -> bytebase.v1.CreateSheetRequest
+ 4, // 10: bytebase.v1.SheetService.GetSheet:input_type -> bytebase.v1.GetSheetRequest
+ 7, // 11: bytebase.v1.SheetService.SearchSheets:input_type -> bytebase.v1.SearchSheetsRequest
+ 5, // 12: bytebase.v1.SheetService.UpdateSheet:input_type -> bytebase.v1.UpdateSheetRequest
+ 6, // 13: bytebase.v1.SheetService.DeleteSheet:input_type -> bytebase.v1.DeleteSheetRequest
+ 9, // 14: bytebase.v1.SheetService.SyncSheets:input_type -> bytebase.v1.SyncSheetsRequest
+ 10, // 15: bytebase.v1.SheetService.CreateSheet:output_type -> bytebase.v1.Sheet
+ 10, // 16: bytebase.v1.SheetService.GetSheet:output_type -> bytebase.v1.Sheet
+ 8, // 17: bytebase.v1.SheetService.SearchSheets:output_type -> bytebase.v1.SearchSheetsResponse
+ 10, // 18: bytebase.v1.SheetService.UpdateSheet:output_type -> bytebase.v1.Sheet
+ 13, // 19: bytebase.v1.SheetService.DeleteSheet:output_type -> google.protobuf.Empty
+ 13, // 20: bytebase.v1.SheetService.SyncSheets:output_type -> google.protobuf.Empty
+ 15, // [15:21] is the sub-list for method output_type
+ 9, // [9:15] is the sub-list for method input_type
+ 9, // [9:9] is the sub-list for extension type_name
+ 9, // [9:9] is the sub-list for extension extendee
+ 0, // [0:9] is the sub-list for field type_name
+}
+
+func init() { file_v1_sheet_service_proto_init() }
+func file_v1_sheet_service_proto_init() {
+ if File_v1_sheet_service_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_v1_sheet_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateSheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_sheet_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetSheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_sheet_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateSheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_sheet_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteSheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_sheet_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SearchSheetsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_sheet_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SearchSheetsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_sheet_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SyncSheetsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_sheet_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Sheet); 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_v1_sheet_service_proto_rawDesc,
+ NumEnums: 3,
+ NumMessages: 8,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_v1_sheet_service_proto_goTypes,
+ DependencyIndexes: file_v1_sheet_service_proto_depIdxs,
+ EnumInfos: file_v1_sheet_service_proto_enumTypes,
+ MessageInfos: file_v1_sheet_service_proto_msgTypes,
+ }.Build()
+ File_v1_sheet_service_proto = out.File
+ file_v1_sheet_service_proto_rawDesc = nil
+ file_v1_sheet_service_proto_goTypes = nil
+ file_v1_sheet_service_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/v1/sheet_service.pb.gw.go b/proto/generated-go/v1/sheet_service.pb.gw.go
new file mode 100644
index 0000000000..125769a721
--- /dev/null
+++ b/proto/generated-go/v1/sheet_service.pb.gw.go
@@ -0,0 +1,804 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: v1/sheet_service.proto
+
+/*
+Package v1 is a reverse proxy.
+
+It translates gRPC into RESTful JSON APIs.
+*/
+package v1
+
+import (
+ "context"
+ "io"
+ "net/http"
+
+ "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
+ "github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
+ "google.golang.org/grpc"
+ "google.golang.org/grpc/codes"
+ "google.golang.org/grpc/grpclog"
+ "google.golang.org/grpc/metadata"
+ "google.golang.org/grpc/status"
+ "google.golang.org/protobuf/proto"
+)
+
+// Suppress "imported and not used" errors
+var _ codes.Code
+var _ io.Reader
+var _ status.Status
+var _ = runtime.String
+var _ = utilities.NewDoubleArray
+var _ = metadata.Join
+
+func request_SheetService_CreateSheet_0(ctx context.Context, marshaler runtime.Marshaler, client SheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq CreateSheetRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Sheet); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
+ msg, err := client.CreateSheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SheetService_CreateSheet_0(ctx context.Context, marshaler runtime.Marshaler, server SheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq CreateSheetRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Sheet); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
+ msg, err := server.CreateSheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_SheetService_GetSheet_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}}
+)
+
+func request_SheetService_GetSheet_0(ctx context.Context, marshaler runtime.Marshaler, client SheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq GetSheetRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SheetService_GetSheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.GetSheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SheetService_GetSheet_0(ctx context.Context, marshaler runtime.Marshaler, server SheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq GetSheetRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SheetService_GetSheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.GetSheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_SheetService_SearchSheets_0 = &utilities.DoubleArray{Encoding: map[string]int{"parent": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}}
+)
+
+func request_SheetService_SearchSheets_0(ctx context.Context, marshaler runtime.Marshaler, client SheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SearchSheetsRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SheetService_SearchSheets_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.SearchSheets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SheetService_SearchSheets_0(ctx context.Context, marshaler runtime.Marshaler, server SheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SearchSheetsRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SheetService_SearchSheets_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.SearchSheets(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_SheetService_UpdateSheet_0 = &utilities.DoubleArray{Encoding: map[string]int{"sheet": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}}
+)
+
+func request_SheetService_UpdateSheet_0(ctx context.Context, marshaler runtime.Marshaler, client SheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateSheetRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Sheet); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Sheet); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["sheet.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sheet.name")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "sheet.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sheet.name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SheetService_UpdateSheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.UpdateSheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SheetService_UpdateSheet_0(ctx context.Context, marshaler runtime.Marshaler, server SheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateSheetRequest
+ var metadata runtime.ServerMetadata
+
+ newReader, berr := utilities.IOReaderFactory(req.Body)
+ if berr != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
+ }
+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Sheet); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.Sheet); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ } else {
+ protoReq.UpdateMask = fieldMask
+ }
+ }
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["sheet.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sheet.name")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "sheet.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sheet.name", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_SheetService_UpdateSheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.UpdateSheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_SheetService_DeleteSheet_0(ctx context.Context, marshaler runtime.Marshaler, client SheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeleteSheetRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ msg, err := client.DeleteSheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SheetService_DeleteSheet_0(ctx context.Context, marshaler runtime.Marshaler, server SheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeleteSheetRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+
+ msg, err := server.DeleteSheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_SheetService_SyncSheets_0(ctx context.Context, marshaler runtime.Marshaler, client SheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SyncSheetsRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
+ msg, err := client.SyncSheets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_SheetService_SyncSheets_0(ctx context.Context, marshaler runtime.Marshaler, server SheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SyncSheetsRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["parent"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "parent")
+ }
+
+ protoReq.Parent, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err)
+ }
+
+ msg, err := server.SyncSheets(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+// RegisterSheetServiceHandlerServer registers the http handlers for service SheetService to "mux".
+// UnaryRPC :call SheetServiceServer directly.
+// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
+// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterSheetServiceHandlerFromEndpoint instead.
+func RegisterSheetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SheetServiceServer) error {
+
+ mux.Handle("POST", pattern_SheetService_CreateSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SheetService/CreateSheet", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/sheets"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SheetService_CreateSheet_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_CreateSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_SheetService_GetSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SheetService/GetSheet", runtime.WithHTTPPathPattern("/v1/{name=projects/*/sheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SheetService_GetSheet_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_GetSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_SheetService_SearchSheets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SheetService/SearchSheets", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/sheets:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SheetService_SearchSheets_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_SearchSheets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PATCH", pattern_SheetService_UpdateSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SheetService/UpdateSheet", runtime.WithHTTPPathPattern("/v1/{sheet.name=projects/*/sheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SheetService_UpdateSheet_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_UpdateSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_SheetService_DeleteSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SheetService/DeleteSheet", runtime.WithHTTPPathPattern("/v1/{name=projects/*/sheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SheetService_DeleteSheet_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_DeleteSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_SheetService_SyncSheets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.SheetService/SyncSheets", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/sheets:sync"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_SheetService_SyncSheets_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_SyncSheets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+// RegisterSheetServiceHandlerFromEndpoint is same as RegisterSheetServiceHandler but
+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
+func RegisterSheetServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
+ conn, err := grpc.DialContext(ctx, endpoint, opts...)
+ if err != nil {
+ return err
+ }
+ defer func() {
+ if err != nil {
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ return
+ }
+ go func() {
+ <-ctx.Done()
+ if cerr := conn.Close(); cerr != nil {
+ grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
+ }
+ }()
+ }()
+
+ return RegisterSheetServiceHandler(ctx, mux, conn)
+}
+
+// RegisterSheetServiceHandler registers the http handlers for service SheetService to "mux".
+// The handlers forward requests to the grpc endpoint over "conn".
+func RegisterSheetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
+ return RegisterSheetServiceHandlerClient(ctx, mux, NewSheetServiceClient(conn))
+}
+
+// RegisterSheetServiceHandlerClient registers the http handlers for service SheetService
+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SheetServiceClient".
+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SheetServiceClient"
+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
+// "SheetServiceClient" to call the correct interceptors.
+func RegisterSheetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SheetServiceClient) error {
+
+ mux.Handle("POST", pattern_SheetService_CreateSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SheetService/CreateSheet", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/sheets"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SheetService_CreateSheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_CreateSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_SheetService_GetSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SheetService/GetSheet", runtime.WithHTTPPathPattern("/v1/{name=projects/*/sheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SheetService_GetSheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_GetSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_SheetService_SearchSheets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SheetService/SearchSheets", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/sheets:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SheetService_SearchSheets_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_SearchSheets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PATCH", pattern_SheetService_UpdateSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SheetService/UpdateSheet", runtime.WithHTTPPathPattern("/v1/{sheet.name=projects/*/sheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SheetService_UpdateSheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_UpdateSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_SheetService_DeleteSheet_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SheetService/DeleteSheet", runtime.WithHTTPPathPattern("/v1/{name=projects/*/sheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SheetService_DeleteSheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_DeleteSheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("POST", pattern_SheetService_SyncSheets_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.SheetService/SyncSheets", runtime.WithHTTPPathPattern("/v1/{parent=projects/*}/sheets:sync"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_SheetService_SyncSheets_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_SheetService_SyncSheets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+var (
+ pattern_SheetService_CreateSheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "sheets"}, ""))
+
+ pattern_SheetService_GetSheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "sheets", "name"}, ""))
+
+ pattern_SheetService_SearchSheets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "sheets"}, "search"))
+
+ pattern_SheetService_UpdateSheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "sheets", "sheet.name"}, ""))
+
+ pattern_SheetService_DeleteSheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 2, 2, 1, 0, 4, 4, 5, 3}, []string{"v1", "projects", "sheets", "name"}, ""))
+
+ pattern_SheetService_SyncSheets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "projects", "parent", "sheets"}, "sync"))
+)
+
+var (
+ forward_SheetService_CreateSheet_0 = runtime.ForwardResponseMessage
+
+ forward_SheetService_GetSheet_0 = runtime.ForwardResponseMessage
+
+ forward_SheetService_SearchSheets_0 = runtime.ForwardResponseMessage
+
+ forward_SheetService_UpdateSheet_0 = runtime.ForwardResponseMessage
+
+ forward_SheetService_DeleteSheet_0 = runtime.ForwardResponseMessage
+
+ forward_SheetService_SyncSheets_0 = runtime.ForwardResponseMessage
+)
diff --git a/proto/generated-go/v1/sheet_service_grpc.pb.go b/proto/generated-go/v1/sheet_service_grpc.pb.go
new file mode 100644
index 0000000000..c2f31d1c8f
--- /dev/null
+++ b/proto/generated-go/v1/sheet_service_grpc.pb.go
@@ -0,0 +1,295 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.3.0
+// - protoc (unknown)
+// source: v1/sheet_service.proto
+
+package v1
+
+import (
+ context "context"
+ grpc "google.golang.org/grpc"
+ codes "google.golang.org/grpc/codes"
+ status "google.golang.org/grpc/status"
+ emptypb "google.golang.org/protobuf/types/known/emptypb"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+const (
+ SheetService_CreateSheet_FullMethodName = "/bytebase.v1.SheetService/CreateSheet"
+ SheetService_GetSheet_FullMethodName = "/bytebase.v1.SheetService/GetSheet"
+ SheetService_SearchSheets_FullMethodName = "/bytebase.v1.SheetService/SearchSheets"
+ SheetService_UpdateSheet_FullMethodName = "/bytebase.v1.SheetService/UpdateSheet"
+ SheetService_DeleteSheet_FullMethodName = "/bytebase.v1.SheetService/DeleteSheet"
+ SheetService_SyncSheets_FullMethodName = "/bytebase.v1.SheetService/SyncSheets"
+)
+
+// SheetServiceClient is the client API for SheetService service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type SheetServiceClient interface {
+ CreateSheet(ctx context.Context, in *CreateSheetRequest, opts ...grpc.CallOption) (*Sheet, error)
+ GetSheet(ctx context.Context, in *GetSheetRequest, opts ...grpc.CallOption) (*Sheet, error)
+ SearchSheets(ctx context.Context, in *SearchSheetsRequest, opts ...grpc.CallOption) (*SearchSheetsResponse, error)
+ UpdateSheet(ctx context.Context, in *UpdateSheetRequest, opts ...grpc.CallOption) (*Sheet, error)
+ DeleteSheet(ctx context.Context, in *DeleteSheetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+ SyncSheets(ctx context.Context, in *SyncSheetsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+}
+
+type sheetServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewSheetServiceClient(cc grpc.ClientConnInterface) SheetServiceClient {
+ return &sheetServiceClient{cc}
+}
+
+func (c *sheetServiceClient) CreateSheet(ctx context.Context, in *CreateSheetRequest, opts ...grpc.CallOption) (*Sheet, error) {
+ out := new(Sheet)
+ err := c.cc.Invoke(ctx, SheetService_CreateSheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *sheetServiceClient) GetSheet(ctx context.Context, in *GetSheetRequest, opts ...grpc.CallOption) (*Sheet, error) {
+ out := new(Sheet)
+ err := c.cc.Invoke(ctx, SheetService_GetSheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *sheetServiceClient) SearchSheets(ctx context.Context, in *SearchSheetsRequest, opts ...grpc.CallOption) (*SearchSheetsResponse, error) {
+ out := new(SearchSheetsResponse)
+ err := c.cc.Invoke(ctx, SheetService_SearchSheets_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *sheetServiceClient) UpdateSheet(ctx context.Context, in *UpdateSheetRequest, opts ...grpc.CallOption) (*Sheet, error) {
+ out := new(Sheet)
+ err := c.cc.Invoke(ctx, SheetService_UpdateSheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *sheetServiceClient) DeleteSheet(ctx context.Context, in *DeleteSheetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, SheetService_DeleteSheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *sheetServiceClient) SyncSheets(ctx context.Context, in *SyncSheetsRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, SheetService_SyncSheets_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// SheetServiceServer is the server API for SheetService service.
+// All implementations must embed UnimplementedSheetServiceServer
+// for forward compatibility
+type SheetServiceServer interface {
+ CreateSheet(context.Context, *CreateSheetRequest) (*Sheet, error)
+ GetSheet(context.Context, *GetSheetRequest) (*Sheet, error)
+ SearchSheets(context.Context, *SearchSheetsRequest) (*SearchSheetsResponse, error)
+ UpdateSheet(context.Context, *UpdateSheetRequest) (*Sheet, error)
+ DeleteSheet(context.Context, *DeleteSheetRequest) (*emptypb.Empty, error)
+ SyncSheets(context.Context, *SyncSheetsRequest) (*emptypb.Empty, error)
+ mustEmbedUnimplementedSheetServiceServer()
+}
+
+// UnimplementedSheetServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedSheetServiceServer struct {
+}
+
+func (UnimplementedSheetServiceServer) CreateSheet(context.Context, *CreateSheetRequest) (*Sheet, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateSheet not implemented")
+}
+func (UnimplementedSheetServiceServer) GetSheet(context.Context, *GetSheetRequest) (*Sheet, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetSheet not implemented")
+}
+func (UnimplementedSheetServiceServer) SearchSheets(context.Context, *SearchSheetsRequest) (*SearchSheetsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SearchSheets not implemented")
+}
+func (UnimplementedSheetServiceServer) UpdateSheet(context.Context, *UpdateSheetRequest) (*Sheet, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateSheet not implemented")
+}
+func (UnimplementedSheetServiceServer) DeleteSheet(context.Context, *DeleteSheetRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteSheet not implemented")
+}
+func (UnimplementedSheetServiceServer) SyncSheets(context.Context, *SyncSheetsRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SyncSheets not implemented")
+}
+func (UnimplementedSheetServiceServer) mustEmbedUnimplementedSheetServiceServer() {}
+
+// UnsafeSheetServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to SheetServiceServer will
+// result in compilation errors.
+type UnsafeSheetServiceServer interface {
+ mustEmbedUnimplementedSheetServiceServer()
+}
+
+func RegisterSheetServiceServer(s grpc.ServiceRegistrar, srv SheetServiceServer) {
+ s.RegisterService(&SheetService_ServiceDesc, srv)
+}
+
+func _SheetService_CreateSheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateSheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SheetServiceServer).CreateSheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SheetService_CreateSheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SheetServiceServer).CreateSheet(ctx, req.(*CreateSheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SheetService_GetSheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetSheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SheetServiceServer).GetSheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SheetService_GetSheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SheetServiceServer).GetSheet(ctx, req.(*GetSheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SheetService_SearchSheets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(SearchSheetsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SheetServiceServer).SearchSheets(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SheetService_SearchSheets_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SheetServiceServer).SearchSheets(ctx, req.(*SearchSheetsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SheetService_UpdateSheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateSheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SheetServiceServer).UpdateSheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SheetService_UpdateSheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SheetServiceServer).UpdateSheet(ctx, req.(*UpdateSheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SheetService_DeleteSheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteSheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SheetServiceServer).DeleteSheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SheetService_DeleteSheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SheetServiceServer).DeleteSheet(ctx, req.(*DeleteSheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _SheetService_SyncSheets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(SyncSheetsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(SheetServiceServer).SyncSheets(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: SheetService_SyncSheets_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(SheetServiceServer).SyncSheets(ctx, req.(*SyncSheetsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// SheetService_ServiceDesc is the grpc.ServiceDesc for SheetService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var SheetService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "bytebase.v1.SheetService",
+ HandlerType: (*SheetServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "CreateSheet",
+ Handler: _SheetService_CreateSheet_Handler,
+ },
+ {
+ MethodName: "GetSheet",
+ Handler: _SheetService_GetSheet_Handler,
+ },
+ {
+ MethodName: "SearchSheets",
+ Handler: _SheetService_SearchSheets_Handler,
+ },
+ {
+ MethodName: "UpdateSheet",
+ Handler: _SheetService_UpdateSheet_Handler,
+ },
+ {
+ MethodName: "DeleteSheet",
+ Handler: _SheetService_DeleteSheet_Handler,
+ },
+ {
+ MethodName: "SyncSheets",
+ Handler: _SheetService_SyncSheets_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "v1/sheet_service.proto",
+}
diff --git a/proto/v1/sheet_service.proto b/proto/v1/sheet_service.proto
new file mode 100644
index 0000000000..2350f2a5ac
--- /dev/null
+++ b/proto/v1/sheet_service.proto
@@ -0,0 +1,200 @@
+syntax = "proto3";
+
+package bytebase.v1;
+
+import "google/api/annotations.proto";
+import "google/api/client.proto";
+import "google/api/field_behavior.proto";
+import "google/protobuf/empty.proto";
+import "google/protobuf/field_mask.proto";
+import "google/protobuf/timestamp.proto";
+
+option go_package = "generated-go/v1";
+
+service SheetService {
+ rpc CreateSheet(CreateSheetRequest) returns (Sheet) {
+ option (google.api.http) = {
+ post: "/v1/{parent=projects/*}/sheets"
+ body: "sheet"
+ };
+ option (google.api.method_signature) = "parent,sheet";
+ }
+
+ rpc GetSheet(GetSheetRequest) returns (Sheet) {
+ option (google.api.http) = {get: "/v1/{name=projects/*/sheets/*}"};
+ option (google.api.method_signature) = "name";
+ }
+
+ rpc SearchSheets(SearchSheetsRequest) returns (SearchSheetsResponse) {
+ option (google.api.http) = {get: "/v1/{parent=projects/*}/sheets:search"};
+ }
+
+ rpc UpdateSheet(UpdateSheetRequest) returns (Sheet) {
+ option (google.api.http) = {
+ patch: "/v1/{sheet.name=projects/*/sheets/*}"
+ body: "sheet"
+ };
+ option (google.api.method_signature) = "sheet,update_mask";
+ }
+
+ rpc DeleteSheet(DeleteSheetRequest) returns (google.protobuf.Empty) {
+ option (google.api.http) = {delete: "/v1/{name=projects/*/sheets/*}"};
+ option (google.api.method_signature) = "name";
+ }
+
+ rpc SyncSheets(SyncSheetsRequest) returns (google.protobuf.Empty) {
+ option (google.api.http) = {post: "/v1/{parent=projects/*}/sheets:sync"};
+ option (google.api.method_signature) = "parent";
+ }
+}
+
+message CreateSheetRequest {
+ // The parent resource where this sheet will be created.
+ // Foramt: projects/{project}
+ string parent = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The sheet to create.
+ Sheet sheet = 2 [(google.api.field_behavior) = REQUIRED];
+}
+
+message GetSheetRequest {
+ // The name of the sheet to retrieve.
+ // Format: projects/{project}/sheets/{sheet}
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // By default, the content of the sheet is cut off, set the `raw` to true to retrieve the full content.
+ bool raw = 2;
+}
+
+message UpdateSheetRequest {
+ // The sheet to update.
+ //
+ // The sheet's `name` field is used to identify the sheet to update.
+ // Format: projects/{project}/sheets/{sheet}
+ Sheet sheet = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The list of fields to be updated.
+ // Fields are specified relative to the sheet.
+ // (e.g. `title`, `statement`; *not* `sheet.title` or `sheet.statement`)
+ google.protobuf.FieldMask update_mask = 2;
+}
+
+message DeleteSheetRequest {
+ // The name of the sheet to delete.
+ // Format: projects/{project}/sheets/{sheet}
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
+}
+
+message SearchSheetsRequest {
+ // The parent resource of the sheet.
+ // Foramt: projects/{project}
+ string parent = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // Not used. The maximum number of sheets to return. The service may return fewer than
+ // this value.
+ // If unspecified, at most 50 sheets will be returned.
+ // The maximum value is 1000; values above 1000 will be coerced to 1000.
+ int32 page_size = 2;
+
+ // Not used. A page token, received from a previous `SearchSheets` call.
+ // Provide this to retrieve the subsequent page.
+ //
+ // When paginating, all other parameters provided to `SearchSheets` must match
+ // the call that provided the page token.
+ string page_token = 3;
+}
+
+message SearchSheetsResponse {
+ // The sheets that matched the search criteria.
+ repeated Sheet sheets = 1;
+
+ // To filter the search result.
+ // Format: only support the following spec for now:
+ // - `creator = user:{email}`, `creator != user:{email}`
+ // - `starred = true`, `starred = false`.
+ string filter = 2;
+
+ // Not used. A token, which can be sent as `page_token` to retrieve the next page.
+ // If this field is omitted, there are no subsequent pages.
+ string next_page_token = 3;
+}
+
+message SyncSheetsRequest {
+ // The name of the project to sync sheets.
+ //
+ // Format: projects/{project}
+ string parent = 1;
+}
+
+message Sheet {
+ // The name of the sheet resource, generated by the server.
+ // Canonical parent is project.
+ // Format: projects/{project}/sheets/{sheet}
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.field_behavior) = IMMUTABLE
+ ];
+
+ // The database resource name.
+ // Format: instances/{instance}/databases/{database}
+ // If the database parent doesn't exist, the database field is empty.
+ string database = 2;
+
+ // The title of the sheet.
+ string title = 3 [(google.api.field_behavior) = REQUIRED];
+
+ // The creator of the Sheet.
+ // Format: user:{email}
+ string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The create time of the sheet.
+ google.protobuf.Timestamp create_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The last update time of the sheet.
+ google.protobuf.Timestamp update_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The content of the sheet.
+ // By default, it will be cut off, if it doesn't match the `content_size`, you can
+ // set the `raw` to true in GetSheet request to retrieve the full content.
+ bytes content = 7 [(google.api.field_behavior) = REQUIRED];
+
+ // content_size is the full size of the content, may not match the size of the `content` field.
+ bytes content_size = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ enum Visibility {
+ VISIBILITY_UNSPECIFIED = 0;
+ // Public, sheet OWNER can read/write, and all others can read.
+ VISIBILITY_PUBLIC = 1;
+ // Project, sheet OWNER and project OWNER can read/write, and project DEVELOPER can read.
+ VISIBILITY_PROJECT = 2;
+ // Private, only sheet OWNER can read/write.
+ VISIBILITY_PRIVATE = 3;
+ }
+ Visibility visibility = 9 [(google.api.field_behavior) = REQUIRED];
+
+ enum Source {
+ SOURCE_UNSPECIFIED = 0;
+ // BYTEBASE is the sheet created by Bytebase. e.g. SQL Editor.
+ SOURCE_BYTEBASE = 1;
+ // BYTEBASE_ARTIFACT is the artifact sheet.
+ SOURCE_BYTEBASE_ARTIFACT = 2;
+ // GITLAB is the sheet synced from GitLab (for both GitLab.com and self-hosted GitLab).
+ SOURCE_GITLAB = 3;
+ // GITHUB is the sheet synced from GitHub (for both GitHub.com and GitHub Enterprise).
+ SOURCE_GITHUB = 4;
+ // BITBUCKET is the sheet synced from Bitbucket (for both Bitbucket.org and Bitbucket Server).
+ SOURCE_BITBUCKET = 5;
+ }
+ // The source of the sheet.
+ Source source = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ enum Type {
+ TYPE_UNSPECIFIED = 0;
+ TYPE_SQL = 1;
+ }
+ // The type of the sheet.
+ Type type = 11 [(google.api.field_behavior) = REQUIRED];
+
+ // starred indicates whether the sheet is starred by the current authenticated user.
+ bool starred = 12;
+}