Skip to content

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

chore: worksheet service proto (#10570)

Danny Xu773a3b5799ba
diff --git a/frontend/src/types/proto/v1/worksheet_service.ts b/frontend/src/types/proto/v1/worksheet_service.ts
new file mode 100644
index 0000000000..ba5daf8531
--- /dev/null
+++ b/frontend/src/types/proto/v1/worksheet_service.ts
@@ -0,0 +1,1469 @@
+/* eslint-disable */
+import Long from "long";
+import _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 CreateWorksheetRequest {
+ /** The worksheet to create. */
+ worksheet: Worksheet | undefined;
+}
+
+export interface GetWorksheetRequest {
+ /**
+ * The name of the worksheet to retrieve.
+ * Format: worksheets/{worksheet}
+ */
+ name: string;
+ /** By default, the content of the worksheet is cut off, set the `raw` to true to retrieve the full content. */
+ raw: boolean;
+}
+
+export interface UpdateWorksheetRequest {
+ /**
+ * The worksheet to update.
+ *
+ * The worksheet's `name` field is used to identify the worksheet to update.
+ * Format: worksheets/{worksheet}
+ */
+ worksheet:
+ | Worksheet
+ | undefined;
+ /**
+ * The list of fields to be updated.
+ * Fields are specified relative to the worksheet.
+ * (e.g. `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
+ * Only support update the following fields for now:
+ * - `title`
+ * - `statement`
+ * - `starred`
+ * - `visibility`
+ */
+ updateMask: string[] | undefined;
+}
+
+export interface UpdateWorksheetOrganizerRequest {
+ /**
+ * The organizer to update.
+ *
+ * The organizer's `worksheet` field is used to identify the worksheet.
+ * Format: worksheets/{worksheet}
+ */
+ organizer:
+ | WorksheetOrganizer
+ | undefined;
+ /**
+ * The list of fields to be updated.
+ * Fields are specified relative to the worksheet organizer.
+ * Only support update the following fields for now:
+ * - `starred`
+ * - `pinned`
+ */
+ updateMask: string[] | undefined;
+}
+
+export interface WorksheetOrganizer {
+ /**
+ * The name of the worksheet.
+ * Format: worksheets/{worksheet}
+ */
+ worksheet: string;
+ /** starred means if the worksheet is starred. */
+ starred: boolean;
+ /** pinned means if the worksheet is pinned. */
+ pinned: boolean;
+}
+
+export interface DeleteWorksheetRequest {
+ /**
+ * The name of the worksheet to delete.
+ * Format: worksheets/{worksheet}
+ */
+ name: string;
+}
+
+export interface SearchWorksheetsRequest {
+ /**
+ * To filter the search result.
+ * Format: only support the following spec for now:
+ * - `creator = users/{email}`, `creator != users/{email}`
+ * - `starred = true`, `starred = false`.
+ * Not support empty filter for now.
+ */
+ filter: string;
+ /**
+ * Not used. The maximum number of worksheets to return. The service may return fewer than
+ * this value.
+ * If unspecified, at most 50 worksheets 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 `SearchWorksheets` call.
+ * Provide this to retrieve the subsequent page.
+ *
+ * When paginating, all other parameters provided to `SearchWorksheets` must match
+ * the call that provided the page token.
+ */
+ pageToken: string;
+}
+
+export interface SearchWorksheetsResponse {
+ /** The worksheets that matched the search criteria. */
+ worksheets: Worksheet[];
+ /**
+ * 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 Worksheet {
+ /**
+ * The name of the worksheet resource, generated by the server.
+ * Canonical parent is project.
+ * Format: worksheets/{worksheet}
+ */
+ name: string;
+ /**
+ * The project resource name.
+ * Format: projects/{project}
+ */
+ project: 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 worksheet. */
+ title: string;
+ /**
+ * The creator of the Worksheet.
+ * Format: users/{email}
+ */
+ creator: string;
+ /** The create time of the worksheet. */
+ createTime:
+ | Date
+ | undefined;
+ /** The last update time of the worksheet. */
+ updateTime:
+ | Date
+ | undefined;
+ /**
+ * The content of the worksheet.
+ * By default, it will be cut off, if it doesn't match the `content_size`, you can
+ * set the `raw` to true in GetWorksheet 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: Long;
+ visibility: Worksheet_Visibility;
+ /** starred indicates whether the worksheet is starred by the current authenticated user. */
+ starred: boolean;
+}
+
+export enum Worksheet_Visibility {
+ VISIBILITY_UNSPECIFIED = 0,
+ /** VISIBILITY_PUBLIC - Public, worksheet OWNER can read/write, and all others can read. */
+ VISIBILITY_PUBLIC = 1,
+ /** VISIBILITY_PROJECT - Project, worksheet OWNER and project OWNER can read/write, and project DEVELOPER can read. */
+ VISIBILITY_PROJECT = 2,
+ /** VISIBILITY_PRIVATE - Private, only worksheet OWNER can read/write. */
+ VISIBILITY_PRIVATE = 3,
+ UNRECOGNIZED = -1,
+}
+
+export function worksheet_VisibilityFromJSON(object: any): Worksheet_Visibility {
+ switch (object) {
+ case 0:
+ case "VISIBILITY_UNSPECIFIED":
+ return Worksheet_Visibility.VISIBILITY_UNSPECIFIED;
+ case 1:
+ case "VISIBILITY_PUBLIC":
+ return Worksheet_Visibility.VISIBILITY_PUBLIC;
+ case 2:
+ case "VISIBILITY_PROJECT":
+ return Worksheet_Visibility.VISIBILITY_PROJECT;
+ case 3:
+ case "VISIBILITY_PRIVATE":
+ return Worksheet_Visibility.VISIBILITY_PRIVATE;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return Worksheet_Visibility.UNRECOGNIZED;
+ }
+}
+
+export function worksheet_VisibilityToJSON(object: Worksheet_Visibility): string {
+ switch (object) {
+ case Worksheet_Visibility.VISIBILITY_UNSPECIFIED:
+ return "VISIBILITY_UNSPECIFIED";
+ case Worksheet_Visibility.VISIBILITY_PUBLIC:
+ return "VISIBILITY_PUBLIC";
+ case Worksheet_Visibility.VISIBILITY_PROJECT:
+ return "VISIBILITY_PROJECT";
+ case Worksheet_Visibility.VISIBILITY_PRIVATE:
+ return "VISIBILITY_PRIVATE";
+ case Worksheet_Visibility.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+function createBaseCreateWorksheetRequest(): CreateWorksheetRequest {
+ return { worksheet: undefined };
+}
+
+export const CreateWorksheetRequest = {
+ encode(message: CreateWorksheetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.worksheet !== undefined) {
+ Worksheet.encode(message.worksheet, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): CreateWorksheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseCreateWorksheetRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.worksheet = Worksheet.decode(reader, reader.uint32());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): CreateWorksheetRequest {
+ return { worksheet: isSet(object.worksheet) ? Worksheet.fromJSON(object.worksheet) : undefined };
+ },
+
+ toJSON(message: CreateWorksheetRequest): unknown {
+ const obj: any = {};
+ if (message.worksheet !== undefined) {
+ obj.worksheet = Worksheet.toJSON(message.worksheet);
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<CreateWorksheetRequest>): CreateWorksheetRequest {
+ return CreateWorksheetRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<CreateWorksheetRequest>): CreateWorksheetRequest {
+ const message = createBaseCreateWorksheetRequest();
+ message.worksheet = (object.worksheet !== undefined && object.worksheet !== null)
+ ? Worksheet.fromPartial(object.worksheet)
+ : undefined;
+ return message;
+ },
+};
+
+function createBaseGetWorksheetRequest(): GetWorksheetRequest {
+ return { name: "", raw: false };
+}
+
+export const GetWorksheetRequest = {
+ encode(message: GetWorksheetRequest, 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): GetWorksheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseGetWorksheetRequest();
+ 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): GetWorksheetRequest {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ raw: isSet(object.raw) ? globalThis.Boolean(object.raw) : false,
+ };
+ },
+
+ toJSON(message: GetWorksheetRequest): unknown {
+ const obj: any = {};
+ if (message.name !== "") {
+ obj.name = message.name;
+ }
+ if (message.raw === true) {
+ obj.raw = message.raw;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<GetWorksheetRequest>): GetWorksheetRequest {
+ return GetWorksheetRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<GetWorksheetRequest>): GetWorksheetRequest {
+ const message = createBaseGetWorksheetRequest();
+ message.name = object.name ?? "";
+ message.raw = object.raw ?? false;
+ return message;
+ },
+};
+
+function createBaseUpdateWorksheetRequest(): UpdateWorksheetRequest {
+ return { worksheet: undefined, updateMask: undefined };
+}
+
+export const UpdateWorksheetRequest = {
+ encode(message: UpdateWorksheetRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.worksheet !== undefined) {
+ Worksheet.encode(message.worksheet, 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): UpdateWorksheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseUpdateWorksheetRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.worksheet = Worksheet.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): UpdateWorksheetRequest {
+ return {
+ worksheet: isSet(object.worksheet) ? Worksheet.fromJSON(object.worksheet) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
+ toJSON(message: UpdateWorksheetRequest): unknown {
+ const obj: any = {};
+ if (message.worksheet !== undefined) {
+ obj.worksheet = Worksheet.toJSON(message.worksheet);
+ }
+ if (message.updateMask !== undefined) {
+ obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<UpdateWorksheetRequest>): UpdateWorksheetRequest {
+ return UpdateWorksheetRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<UpdateWorksheetRequest>): UpdateWorksheetRequest {
+ const message = createBaseUpdateWorksheetRequest();
+ message.worksheet = (object.worksheet !== undefined && object.worksheet !== null)
+ ? Worksheet.fromPartial(object.worksheet)
+ : undefined;
+ message.updateMask = object.updateMask ?? undefined;
+ return message;
+ },
+};
+
+function createBaseUpdateWorksheetOrganizerRequest(): UpdateWorksheetOrganizerRequest {
+ return { organizer: undefined, updateMask: undefined };
+}
+
+export const UpdateWorksheetOrganizerRequest = {
+ encode(message: UpdateWorksheetOrganizerRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.organizer !== undefined) {
+ WorksheetOrganizer.encode(message.organizer, 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): UpdateWorksheetOrganizerRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseUpdateWorksheetOrganizerRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.organizer = WorksheetOrganizer.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): UpdateWorksheetOrganizerRequest {
+ return {
+ organizer: isSet(object.organizer) ? WorksheetOrganizer.fromJSON(object.organizer) : undefined,
+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ };
+ },
+
+ toJSON(message: UpdateWorksheetOrganizerRequest): unknown {
+ const obj: any = {};
+ if (message.organizer !== undefined) {
+ obj.organizer = WorksheetOrganizer.toJSON(message.organizer);
+ }
+ if (message.updateMask !== undefined) {
+ obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask));
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<UpdateWorksheetOrganizerRequest>): UpdateWorksheetOrganizerRequest {
+ return UpdateWorksheetOrganizerRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<UpdateWorksheetOrganizerRequest>): UpdateWorksheetOrganizerRequest {
+ const message = createBaseUpdateWorksheetOrganizerRequest();
+ message.organizer = (object.organizer !== undefined && object.organizer !== null)
+ ? WorksheetOrganizer.fromPartial(object.organizer)
+ : undefined;
+ message.updateMask = object.updateMask ?? undefined;
+ return message;
+ },
+};
+
+function createBaseWorksheetOrganizer(): WorksheetOrganizer {
+ return { worksheet: "", starred: false, pinned: false };
+}
+
+export const WorksheetOrganizer = {
+ encode(message: WorksheetOrganizer, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.worksheet !== "") {
+ writer.uint32(10).string(message.worksheet);
+ }
+ if (message.starred === true) {
+ writer.uint32(16).bool(message.starred);
+ }
+ if (message.pinned === true) {
+ writer.uint32(24).bool(message.pinned);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): WorksheetOrganizer {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseWorksheetOrganizer();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.worksheet = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.starred = reader.bool();
+ continue;
+ case 3:
+ if (tag !== 24) {
+ break;
+ }
+
+ message.pinned = reader.bool();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): WorksheetOrganizer {
+ return {
+ worksheet: isSet(object.worksheet) ? globalThis.String(object.worksheet) : "",
+ starred: isSet(object.starred) ? globalThis.Boolean(object.starred) : false,
+ pinned: isSet(object.pinned) ? globalThis.Boolean(object.pinned) : false,
+ };
+ },
+
+ toJSON(message: WorksheetOrganizer): unknown {
+ const obj: any = {};
+ if (message.worksheet !== "") {
+ obj.worksheet = message.worksheet;
+ }
+ if (message.starred === true) {
+ obj.starred = message.starred;
+ }
+ if (message.pinned === true) {
+ obj.pinned = message.pinned;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<WorksheetOrganizer>): WorksheetOrganizer {
+ return WorksheetOrganizer.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<WorksheetOrganizer>): WorksheetOrganizer {
+ const message = createBaseWorksheetOrganizer();
+ message.worksheet = object.worksheet ?? "";
+ message.starred = object.starred ?? false;
+ message.pinned = object.pinned ?? false;
+ return message;
+ },
+};
+
+function createBaseDeleteWorksheetRequest(): DeleteWorksheetRequest {
+ return { name: "" };
+}
+
+export const DeleteWorksheetRequest = {
+ encode(message: DeleteWorksheetRequest, 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): DeleteWorksheetRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseDeleteWorksheetRequest();
+ 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): DeleteWorksheetRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
+ toJSON(message: DeleteWorksheetRequest): unknown {
+ const obj: any = {};
+ if (message.name !== "") {
+ obj.name = message.name;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<DeleteWorksheetRequest>): DeleteWorksheetRequest {
+ return DeleteWorksheetRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<DeleteWorksheetRequest>): DeleteWorksheetRequest {
+ const message = createBaseDeleteWorksheetRequest();
+ message.name = object.name ?? "";
+ return message;
+ },
+};
+
+function createBaseSearchWorksheetsRequest(): SearchWorksheetsRequest {
+ return { filter: "", pageSize: 0, pageToken: "" };
+}
+
+export const SearchWorksheetsRequest = {
+ encode(message: SearchWorksheetsRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.filter !== "") {
+ writer.uint32(10).string(message.filter);
+ }
+ 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): SearchWorksheetsRequest {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSearchWorksheetsRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.filter = 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): SearchWorksheetsRequest {
+ return {
+ filter: isSet(object.filter) ? globalThis.String(object.filter) : "",
+ pageSize: isSet(object.pageSize) ? globalThis.Number(object.pageSize) : 0,
+ pageToken: isSet(object.pageToken) ? globalThis.String(object.pageToken) : "",
+ };
+ },
+
+ toJSON(message: SearchWorksheetsRequest): unknown {
+ const obj: any = {};
+ if (message.filter !== "") {
+ obj.filter = message.filter;
+ }
+ if (message.pageSize !== 0) {
+ obj.pageSize = Math.round(message.pageSize);
+ }
+ if (message.pageToken !== "") {
+ obj.pageToken = message.pageToken;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<SearchWorksheetsRequest>): SearchWorksheetsRequest {
+ return SearchWorksheetsRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<SearchWorksheetsRequest>): SearchWorksheetsRequest {
+ const message = createBaseSearchWorksheetsRequest();
+ message.filter = object.filter ?? "";
+ message.pageSize = object.pageSize ?? 0;
+ message.pageToken = object.pageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseSearchWorksheetsResponse(): SearchWorksheetsResponse {
+ return { worksheets: [], nextPageToken: "" };
+}
+
+export const SearchWorksheetsResponse = {
+ encode(message: SearchWorksheetsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.worksheets) {
+ Worksheet.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ if (message.nextPageToken !== "") {
+ writer.uint32(18).string(message.nextPageToken);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): SearchWorksheetsResponse {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseSearchWorksheetsResponse();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.worksheets.push(Worksheet.decode(reader, reader.uint32()));
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.nextPageToken = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): SearchWorksheetsResponse {
+ return {
+ worksheets: globalThis.Array.isArray(object?.worksheets)
+ ? object.worksheets.map((e: any) => Worksheet.fromJSON(e))
+ : [],
+ nextPageToken: isSet(object.nextPageToken) ? globalThis.String(object.nextPageToken) : "",
+ };
+ },
+
+ toJSON(message: SearchWorksheetsResponse): unknown {
+ const obj: any = {};
+ if (message.worksheets?.length) {
+ obj.worksheets = message.worksheets.map((e) => Worksheet.toJSON(e));
+ }
+ if (message.nextPageToken !== "") {
+ obj.nextPageToken = message.nextPageToken;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<SearchWorksheetsResponse>): SearchWorksheetsResponse {
+ return SearchWorksheetsResponse.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<SearchWorksheetsResponse>): SearchWorksheetsResponse {
+ const message = createBaseSearchWorksheetsResponse();
+ message.worksheets = object.worksheets?.map((e) => Worksheet.fromPartial(e)) || [];
+ message.nextPageToken = object.nextPageToken ?? "";
+ return message;
+ },
+};
+
+function createBaseWorksheet(): Worksheet {
+ return {
+ name: "",
+ project: "",
+ database: "",
+ title: "",
+ creator: "",
+ createTime: undefined,
+ updateTime: undefined,
+ content: new Uint8Array(0),
+ contentSize: Long.ZERO,
+ visibility: 0,
+ starred: false,
+ };
+}
+
+export const Worksheet = {
+ encode(message: Worksheet, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ if (message.project !== "") {
+ writer.uint32(18).string(message.project);
+ }
+ if (message.database !== "") {
+ writer.uint32(26).string(message.database);
+ }
+ if (message.title !== "") {
+ writer.uint32(34).string(message.title);
+ }
+ if (message.creator !== "") {
+ writer.uint32(42).string(message.creator);
+ }
+ if (message.createTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.createTime), writer.uint32(50).fork()).ldelim();
+ }
+ if (message.updateTime !== undefined) {
+ Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(58).fork()).ldelim();
+ }
+ if (message.content.length !== 0) {
+ writer.uint32(66).bytes(message.content);
+ }
+ if (!message.contentSize.isZero()) {
+ writer.uint32(72).int64(message.contentSize);
+ }
+ if (message.visibility !== 0) {
+ writer.uint32(80).int32(message.visibility);
+ }
+ if (message.starred === true) {
+ writer.uint32(88).bool(message.starred);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Worksheet {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseWorksheet();
+ 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.project = reader.string();
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.database = reader.string();
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.title = reader.string();
+ continue;
+ case 5:
+ if (tag !== 42) {
+ break;
+ }
+
+ message.creator = reader.string();
+ continue;
+ case 6:
+ if (tag !== 50) {
+ break;
+ }
+
+ message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ continue;
+ case 7:
+ if (tag !== 58) {
+ break;
+ }
+
+ message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
+ continue;
+ case 8:
+ if (tag !== 66) {
+ break;
+ }
+
+ message.content = reader.bytes();
+ continue;
+ case 9:
+ if (tag !== 72) {
+ break;
+ }
+
+ message.contentSize = reader.int64() as Long;
+ continue;
+ case 10:
+ if (tag !== 80) {
+ break;
+ }
+
+ message.visibility = reader.int32() as any;
+ continue;
+ case 11:
+ if (tag !== 88) {
+ break;
+ }
+
+ message.starred = reader.bool();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): Worksheet {
+ return {
+ name: isSet(object.name) ? globalThis.String(object.name) : "",
+ project: isSet(object.project) ? globalThis.String(object.project) : "",
+ database: isSet(object.database) ? globalThis.String(object.database) : "",
+ title: isSet(object.title) ? globalThis.String(object.title) : "",
+ creator: isSet(object.creator) ? globalThis.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(0),
+ contentSize: isSet(object.contentSize) ? Long.fromValue(object.contentSize) : Long.ZERO,
+ visibility: isSet(object.visibility) ? worksheet_VisibilityFromJSON(object.visibility) : 0,
+ starred: isSet(object.starred) ? globalThis.Boolean(object.starred) : false,
+ };
+ },
+
+ toJSON(message: Worksheet): unknown {
+ const obj: any = {};
+ if (message.name !== "") {
+ obj.name = message.name;
+ }
+ if (message.project !== "") {
+ obj.project = message.project;
+ }
+ if (message.database !== "") {
+ obj.database = message.database;
+ }
+ if (message.title !== "") {
+ obj.title = message.title;
+ }
+ if (message.creator !== "") {
+ obj.creator = message.creator;
+ }
+ if (message.createTime !== undefined) {
+ obj.createTime = message.createTime.toISOString();
+ }
+ if (message.updateTime !== undefined) {
+ obj.updateTime = message.updateTime.toISOString();
+ }
+ if (message.content.length !== 0) {
+ obj.content = base64FromBytes(message.content);
+ }
+ if (!message.contentSize.isZero()) {
+ obj.contentSize = (message.contentSize || Long.ZERO).toString();
+ }
+ if (message.visibility !== 0) {
+ obj.visibility = worksheet_VisibilityToJSON(message.visibility);
+ }
+ if (message.starred === true) {
+ obj.starred = message.starred;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<Worksheet>): Worksheet {
+ return Worksheet.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<Worksheet>): Worksheet {
+ const message = createBaseWorksheet();
+ message.name = object.name ?? "";
+ message.project = object.project ?? "";
+ 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(0);
+ message.contentSize = (object.contentSize !== undefined && object.contentSize !== null)
+ ? Long.fromValue(object.contentSize)
+ : Long.ZERO;
+ message.visibility = object.visibility ?? 0;
+ message.starred = object.starred ?? false;
+ return message;
+ },
+};
+
+export type WorksheetServiceDefinition = typeof WorksheetServiceDefinition;
+export const WorksheetServiceDefinition = {
+ name: "WorksheetService",
+ fullName: "bytebase.v1.WorksheetService",
+ methods: {
+ createWorksheet: {
+ name: "CreateWorksheet",
+ requestType: CreateWorksheetRequest,
+ requestStream: false,
+ responseType: Worksheet,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([16, 112, 97, 114, 101, 110, 116, 44, 119, 111, 114, 107, 115, 104, 101, 101, 116])],
+ 578365826: [
+ new Uint8Array([
+ 27,
+ 58,
+ 9,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 34,
+ 14,
+ 47,
+ 118,
+ 49,
+ 47,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ ]),
+ ],
+ },
+ },
+ },
+ getWorksheet: {
+ name: "GetWorksheet",
+ requestType: GetWorksheetRequest,
+ requestStream: false,
+ responseType: Worksheet,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],
+ 578365826: [
+ new Uint8Array([
+ 25,
+ 18,
+ 23,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ searchWorksheets: {
+ name: "SearchWorksheets",
+ requestType: SearchWorksheetsRequest,
+ requestStream: false,
+ responseType: SearchWorksheetsResponse,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 578365826: [
+ new Uint8Array([
+ 23,
+ 18,
+ 21,
+ 47,
+ 118,
+ 49,
+ 47,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 58,
+ 115,
+ 101,
+ 97,
+ 114,
+ 99,
+ 104,
+ ]),
+ ],
+ },
+ },
+ },
+ updateWorksheet: {
+ name: "UpdateWorksheet",
+ requestType: UpdateWorksheetRequest,
+ requestStream: false,
+ responseType: Worksheet,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [
+ new Uint8Array([
+ 21,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 44,
+ 117,
+ 112,
+ 100,
+ 97,
+ 116,
+ 101,
+ 95,
+ 109,
+ 97,
+ 115,
+ 107,
+ ]),
+ ],
+ 578365826: [
+ new Uint8Array([
+ 46,
+ 58,
+ 9,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 50,
+ 33,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 46,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ updateWorksheetOrganizer: {
+ name: "UpdateWorksheetOrganizer",
+ requestType: UpdateWorksheetOrganizerRequest,
+ requestStream: false,
+ responseType: WorksheetOrganizer,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [
+ new Uint8Array([
+ 21,
+ 111,
+ 114,
+ 103,
+ 97,
+ 110,
+ 105,
+ 122,
+ 101,
+ 114,
+ 44,
+ 117,
+ 112,
+ 100,
+ 97,
+ 116,
+ 101,
+ 95,
+ 109,
+ 97,
+ 115,
+ 107,
+ ]),
+ ],
+ 578365826: [
+ new Uint8Array([
+ 61,
+ 58,
+ 9,
+ 111,
+ 114,
+ 103,
+ 97,
+ 110,
+ 105,
+ 122,
+ 101,
+ 114,
+ 26,
+ 48,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 111,
+ 114,
+ 103,
+ 97,
+ 110,
+ 105,
+ 122,
+ 101,
+ 114,
+ 46,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 61,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ 47,
+ 111,
+ 114,
+ 103,
+ 97,
+ 110,
+ 105,
+ 122,
+ 101,
+ 114,
+ ]),
+ ],
+ },
+ },
+ },
+ deleteWorksheet: {
+ name: "DeleteWorksheet",
+ requestType: DeleteWorksheetRequest,
+ requestStream: false,
+ responseType: Empty,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],
+ 578365826: [
+ new Uint8Array([
+ 25,
+ 42,
+ 23,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 119,
+ 111,
+ 114,
+ 107,
+ 115,
+ 104,
+ 101,
+ 101,
+ 116,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
+ },
+} as const;
+
+function bytesFromBase64(b64: string): Uint8Array {
+ if (globalThis.Buffer) {
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
+ } else {
+ const bin = globalThis.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 (globalThis.Buffer) {
+ return globalThis.Buffer.from(arr).toString("base64");
+ } else {
+ const bin: string[] = [];
+ arr.forEach((byte) => {
+ bin.push(globalThis.String.fromCharCode(byte));
+ });
+ return globalThis.btoa(bin.join(""));
+ }
+}
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Long ? string | number | Long : T extends globalThis.Array<infer U> ? globalThis.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 = numberToLong(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.toNumber() || 0) * 1_000;
+ millis += (t.nanos || 0) / 1_000_000;
+ return new globalThis.Date(millis);
+}
+
+function fromJsonTimestamp(o: any): Date {
+ if (o instanceof globalThis.Date) {
+ return o;
+ } else if (typeof o === "string") {
+ return new globalThis.Date(o);
+ } else {
+ return fromTimestamp(Timestamp.fromJSON(o));
+ }
+}
+
+function numberToLong(number: number) {
+ return Long.fromNumber(number);
+}
+
+if (_m0.util.Long !== Long) {
+ _m0.util.Long = Long as any;
+ _m0.configure();
+}
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 074e3ac2fe..f8b50b4577 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -618,6 +618,21 @@
- [SQLService](#bytebase-v1-SQLService)
+- [v1/worksheet_service.proto](#v1_worksheet_service-proto)
+ - [CreateWorksheetRequest](#bytebase-v1-CreateWorksheetRequest)
+ - [DeleteWorksheetRequest](#bytebase-v1-DeleteWorksheetRequest)
+ - [GetWorksheetRequest](#bytebase-v1-GetWorksheetRequest)
+ - [SearchWorksheetsRequest](#bytebase-v1-SearchWorksheetsRequest)
+ - [SearchWorksheetsResponse](#bytebase-v1-SearchWorksheetsResponse)
+ - [UpdateWorksheetOrganizerRequest](#bytebase-v1-UpdateWorksheetOrganizerRequest)
+ - [UpdateWorksheetRequest](#bytebase-v1-UpdateWorksheetRequest)
+ - [Worksheet](#bytebase-v1-Worksheet)
+ - [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer)
+
+ - [Worksheet.Visibility](#bytebase-v1-Worksheet-Visibility)
+
+ - [WorksheetService](#bytebase-v1-WorksheetService)
+
- [Scalar Value Types](#scalar-value-types)
@@ -9957,6 +9972,210 @@ Type of the SheetPayload.
+<a name="v1_worksheet_service-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## v1/worksheet_service.proto
+
+
+
+<a name="bytebase-v1-CreateWorksheetRequest"></a>
+
+### CreateWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheet | [Worksheet](#bytebase-v1-Worksheet) | | The worksheet to create. |
+
+
+
+
+
+
+<a name="bytebase-v1-DeleteWorksheetRequest"></a>
+
+### DeleteWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the worksheet to delete. Format: worksheets/{worksheet} |
+
+
+
+
+
+
+<a name="bytebase-v1-GetWorksheetRequest"></a>
+
+### GetWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the worksheet to retrieve. Format: worksheets/{worksheet} |
+| raw | [bool](#bool) | | By default, the content of the worksheet is cut off, set the `raw` to true to retrieve the full content. |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchWorksheetsRequest"></a>
+
+### SearchWorksheetsRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| filter | [string](#string) | | To filter the search result. Format: only support the following spec for now: - `creator = users/{email}`, `creator != users/{email}` - `starred = true`, `starred = false`. Not support empty filter for now. |
+| page_size | [int32](#int32) | | Not used. The maximum number of worksheets to return. The service may return fewer than this value. If unspecified, at most 50 worksheets 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 `SearchWorksheets` call. Provide this to retrieve the subsequent page.
+
+When paginating, all other parameters provided to `SearchWorksheets` must match the call that provided the page token. |
+
+
+
+
+
+
+<a name="bytebase-v1-SearchWorksheetsResponse"></a>
+
+### SearchWorksheetsResponse
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheets | [Worksheet](#bytebase-v1-Worksheet) | repeated | The worksheets that matched the search criteria. |
+| 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-UpdateWorksheetOrganizerRequest"></a>
+
+### UpdateWorksheetOrganizerRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| organizer | [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer) | | The organizer to update.
+
+The organizer&#39;s `worksheet` field is used to identify the worksheet. Format: worksheets/{worksheet} |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. Fields are specified relative to the worksheet organizer. Only support update the following fields for now: - `starred` - `pinned` |
+
+
+
+
+
+
+<a name="bytebase-v1-UpdateWorksheetRequest"></a>
+
+### UpdateWorksheetRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheet | [Worksheet](#bytebase-v1-Worksheet) | | The worksheet to update.
+
+The worksheet&#39;s `name` field is used to identify the worksheet to update. Format: worksheets/{worksheet} |
+| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to be updated. Fields are specified relative to the worksheet. (e.g. `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`) Only support update the following fields for now: - `title` - `statement` - `starred` - `visibility` |
+
+
+
+
+
+
+<a name="bytebase-v1-Worksheet"></a>
+
+### Worksheet
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the worksheet resource, generated by the server. Canonical parent is project. Format: worksheets/{worksheet} |
+| project | [string](#string) | | The project resource name. Format: projects/{project} |
+| 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 worksheet. |
+| creator | [string](#string) | | The creator of the Worksheet. Format: users/{email} |
+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The create time of the worksheet. |
+| update_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The last update time of the worksheet. |
+| content | [bytes](#bytes) | | The content of the worksheet. By default, it will be cut off, if it doesn&#39;t match the `content_size`, you can set the `raw` to true in GetWorksheet request to retrieve the full content. |
+| content_size | [int64](#int64) | | content_size is the full size of the content, may not match the size of the `content` field. |
+| visibility | [Worksheet.Visibility](#bytebase-v1-Worksheet-Visibility) | | |
+| starred | [bool](#bool) | | starred indicates whether the worksheet is starred by the current authenticated user. |
+
+
+
+
+
+
+<a name="bytebase-v1-WorksheetOrganizer"></a>
+
+### WorksheetOrganizer
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| worksheet | [string](#string) | | The name of the worksheet. Format: worksheets/{worksheet} |
+| starred | [bool](#bool) | | starred means if the worksheet is starred. |
+| pinned | [bool](#bool) | | pinned means if the worksheet is pinned. |
+
+
+
+
+
+
+
+
+<a name="bytebase-v1-Worksheet-Visibility"></a>
+
+### Worksheet.Visibility
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| VISIBILITY_UNSPECIFIED | 0 | |
+| VISIBILITY_PUBLIC | 1 | Public, worksheet OWNER can read/write, and all others can read. |
+| VISIBILITY_PROJECT | 2 | Project, worksheet OWNER and project OWNER can read/write, and project DEVELOPER can read. |
+| VISIBILITY_PRIVATE | 3 | Private, only worksheet OWNER can read/write. |
+
+
+
+
+
+
+
+<a name="bytebase-v1-WorksheetService"></a>
+
+### WorksheetService
+
+
+| Method Name | Request Type | Response Type | Description |
+| ----------- | ------------ | ------------- | ------------|
+| CreateWorksheet | [CreateWorksheetRequest](#bytebase-v1-CreateWorksheetRequest) | [Worksheet](#bytebase-v1-Worksheet) | |
+| GetWorksheet | [GetWorksheetRequest](#bytebase-v1-GetWorksheetRequest) | [Worksheet](#bytebase-v1-Worksheet) | |
+| SearchWorksheets | [SearchWorksheetsRequest](#bytebase-v1-SearchWorksheetsRequest) | [SearchWorksheetsResponse](#bytebase-v1-SearchWorksheetsResponse) | |
+| UpdateWorksheet | [UpdateWorksheetRequest](#bytebase-v1-UpdateWorksheetRequest) | [Worksheet](#bytebase-v1-Worksheet) | |
+| UpdateWorksheetOrganizer | [UpdateWorksheetOrganizerRequest](#bytebase-v1-UpdateWorksheetOrganizerRequest) | [WorksheetOrganizer](#bytebase-v1-WorksheetOrganizer) | |
+| DeleteWorksheet | [DeleteWorksheetRequest](#bytebase-v1-DeleteWorksheetRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
+
+
+
+
+
## Scalar Value Types
| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby |
diff --git a/proto/generated-go/v1/worksheet_service.pb.go b/proto/generated-go/v1/worksheet_service.pb.go
new file mode 100644
index 0000000000..c30c02de19
--- /dev/null
+++ b/proto/generated-go/v1/worksheet_service.pb.go
@@ -0,0 +1,1073 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.32.0
+// protoc (unknown)
+// source: v1/worksheet_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 Worksheet_Visibility int32
+
+const (
+ Worksheet_VISIBILITY_UNSPECIFIED Worksheet_Visibility = 0
+ // Public, worksheet OWNER can read/write, and all others can read.
+ Worksheet_VISIBILITY_PUBLIC Worksheet_Visibility = 1
+ // Project, worksheet OWNER and project OWNER can read/write, and project DEVELOPER can read.
+ Worksheet_VISIBILITY_PROJECT Worksheet_Visibility = 2
+ // Private, only worksheet OWNER can read/write.
+ Worksheet_VISIBILITY_PRIVATE Worksheet_Visibility = 3
+)
+
+// Enum value maps for Worksheet_Visibility.
+var (
+ Worksheet_Visibility_name = map[int32]string{
+ 0: "VISIBILITY_UNSPECIFIED",
+ 1: "VISIBILITY_PUBLIC",
+ 2: "VISIBILITY_PROJECT",
+ 3: "VISIBILITY_PRIVATE",
+ }
+ Worksheet_Visibility_value = map[string]int32{
+ "VISIBILITY_UNSPECIFIED": 0,
+ "VISIBILITY_PUBLIC": 1,
+ "VISIBILITY_PROJECT": 2,
+ "VISIBILITY_PRIVATE": 3,
+ }
+)
+
+func (x Worksheet_Visibility) Enum() *Worksheet_Visibility {
+ p := new(Worksheet_Visibility)
+ *p = x
+ return p
+}
+
+func (x Worksheet_Visibility) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Worksheet_Visibility) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_worksheet_service_proto_enumTypes[0].Descriptor()
+}
+
+func (Worksheet_Visibility) Type() protoreflect.EnumType {
+ return &file_v1_worksheet_service_proto_enumTypes[0]
+}
+
+func (x Worksheet_Visibility) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Worksheet_Visibility.Descriptor instead.
+func (Worksheet_Visibility) EnumDescriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{8, 0}
+}
+
+type CreateWorksheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The worksheet to create.
+ Worksheet *Worksheet `protobuf:"bytes,1,opt,name=worksheet,proto3" json:"worksheet,omitempty"`
+}
+
+func (x *CreateWorksheetRequest) Reset() {
+ *x = CreateWorksheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CreateWorksheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CreateWorksheetRequest) ProtoMessage() {}
+
+func (x *CreateWorksheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 CreateWorksheetRequest.ProtoReflect.Descriptor instead.
+func (*CreateWorksheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *CreateWorksheetRequest) GetWorksheet() *Worksheet {
+ if x != nil {
+ return x.Worksheet
+ }
+ return nil
+}
+
+type GetWorksheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the worksheet to retrieve.
+ // Format: worksheets/{worksheet}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // By default, the content of the worksheet 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 *GetWorksheetRequest) Reset() {
+ *x = GetWorksheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *GetWorksheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetWorksheetRequest) ProtoMessage() {}
+
+func (x *GetWorksheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 GetWorksheetRequest.ProtoReflect.Descriptor instead.
+func (*GetWorksheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GetWorksheetRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *GetWorksheetRequest) GetRaw() bool {
+ if x != nil {
+ return x.Raw
+ }
+ return false
+}
+
+type UpdateWorksheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The worksheet to update.
+ //
+ // The worksheet's `name` field is used to identify the worksheet to update.
+ // Format: worksheets/{worksheet}
+ Worksheet *Worksheet `protobuf:"bytes,1,opt,name=worksheet,proto3" json:"worksheet,omitempty"`
+ // The list of fields to be updated.
+ // Fields are specified relative to the worksheet.
+ // (e.g. `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
+ // Only support update the following fields for now:
+ // - `title`
+ // - `statement`
+ // - `starred`
+ // - `visibility`
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateWorksheetRequest) Reset() {
+ *x = UpdateWorksheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateWorksheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateWorksheetRequest) ProtoMessage() {}
+
+func (x *UpdateWorksheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 UpdateWorksheetRequest.ProtoReflect.Descriptor instead.
+func (*UpdateWorksheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *UpdateWorksheetRequest) GetWorksheet() *Worksheet {
+ if x != nil {
+ return x.Worksheet
+ }
+ return nil
+}
+
+func (x *UpdateWorksheetRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+type UpdateWorksheetOrganizerRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The organizer to update.
+ //
+ // The organizer's `worksheet` field is used to identify the worksheet.
+ // Format: worksheets/{worksheet}
+ Organizer *WorksheetOrganizer `protobuf:"bytes,1,opt,name=organizer,proto3" json:"organizer,omitempty"`
+ // The list of fields to be updated.
+ // Fields are specified relative to the worksheet organizer.
+ // Only support update the following fields for now:
+ // - `starred`
+ // - `pinned`
+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+}
+
+func (x *UpdateWorksheetOrganizerRequest) Reset() {
+ *x = UpdateWorksheetOrganizerRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *UpdateWorksheetOrganizerRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*UpdateWorksheetOrganizerRequest) ProtoMessage() {}
+
+func (x *UpdateWorksheetOrganizerRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 UpdateWorksheetOrganizerRequest.ProtoReflect.Descriptor instead.
+func (*UpdateWorksheetOrganizerRequest) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *UpdateWorksheetOrganizerRequest) GetOrganizer() *WorksheetOrganizer {
+ if x != nil {
+ return x.Organizer
+ }
+ return nil
+}
+
+func (x *UpdateWorksheetOrganizerRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
+ if x != nil {
+ return x.UpdateMask
+ }
+ return nil
+}
+
+type WorksheetOrganizer struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the worksheet.
+ // Format: worksheets/{worksheet}
+ Worksheet string `protobuf:"bytes,1,opt,name=worksheet,proto3" json:"worksheet,omitempty"`
+ // starred means if the worksheet is starred.
+ Starred bool `protobuf:"varint,2,opt,name=starred,proto3" json:"starred,omitempty"`
+ // pinned means if the worksheet is pinned.
+ Pinned bool `protobuf:"varint,3,opt,name=pinned,proto3" json:"pinned,omitempty"`
+}
+
+func (x *WorksheetOrganizer) Reset() {
+ *x = WorksheetOrganizer{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[4]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *WorksheetOrganizer) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*WorksheetOrganizer) ProtoMessage() {}
+
+func (x *WorksheetOrganizer) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 WorksheetOrganizer.ProtoReflect.Descriptor instead.
+func (*WorksheetOrganizer) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{4}
+}
+
+func (x *WorksheetOrganizer) GetWorksheet() string {
+ if x != nil {
+ return x.Worksheet
+ }
+ return ""
+}
+
+func (x *WorksheetOrganizer) GetStarred() bool {
+ if x != nil {
+ return x.Starred
+ }
+ return false
+}
+
+func (x *WorksheetOrganizer) GetPinned() bool {
+ if x != nil {
+ return x.Pinned
+ }
+ return false
+}
+
+type DeleteWorksheetRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the worksheet to delete.
+ // Format: worksheets/{worksheet}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *DeleteWorksheetRequest) Reset() {
+ *x = DeleteWorksheetRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[5]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *DeleteWorksheetRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*DeleteWorksheetRequest) ProtoMessage() {}
+
+func (x *DeleteWorksheetRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 DeleteWorksheetRequest.ProtoReflect.Descriptor instead.
+func (*DeleteWorksheetRequest) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *DeleteWorksheetRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+type SearchWorksheetsRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // To filter the search result.
+ // Format: only support the following spec for now:
+ // - `creator = users/{email}`, `creator != users/{email}`
+ // - `starred = true`, `starred = false`.
+ // Not support empty filter for now.
+ Filter string `protobuf:"bytes,1,opt,name=filter,proto3" json:"filter,omitempty"`
+ // Not used. The maximum number of worksheets to return. The service may return fewer than
+ // this value.
+ // If unspecified, at most 50 worksheets 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 `SearchWorksheets` call.
+ // Provide this to retrieve the subsequent page.
+ //
+ // When paginating, all other parameters provided to `SearchWorksheets` 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 *SearchWorksheetsRequest) Reset() {
+ *x = SearchWorksheetsRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[6]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SearchWorksheetsRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SearchWorksheetsRequest) ProtoMessage() {}
+
+func (x *SearchWorksheetsRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 SearchWorksheetsRequest.ProtoReflect.Descriptor instead.
+func (*SearchWorksheetsRequest) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *SearchWorksheetsRequest) GetFilter() string {
+ if x != nil {
+ return x.Filter
+ }
+ return ""
+}
+
+func (x *SearchWorksheetsRequest) GetPageSize() int32 {
+ if x != nil {
+ return x.PageSize
+ }
+ return 0
+}
+
+func (x *SearchWorksheetsRequest) GetPageToken() string {
+ if x != nil {
+ return x.PageToken
+ }
+ return ""
+}
+
+type SearchWorksheetsResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The worksheets that matched the search criteria.
+ Worksheets []*Worksheet `protobuf:"bytes,1,rep,name=worksheets,proto3" json:"worksheets,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,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
+}
+
+func (x *SearchWorksheetsResponse) Reset() {
+ *x = SearchWorksheetsResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[7]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *SearchWorksheetsResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*SearchWorksheetsResponse) ProtoMessage() {}
+
+func (x *SearchWorksheetsResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_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 SearchWorksheetsResponse.ProtoReflect.Descriptor instead.
+func (*SearchWorksheetsResponse) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{7}
+}
+
+func (x *SearchWorksheetsResponse) GetWorksheets() []*Worksheet {
+ if x != nil {
+ return x.Worksheets
+ }
+ return nil
+}
+
+func (x *SearchWorksheetsResponse) GetNextPageToken() string {
+ if x != nil {
+ return x.NextPageToken
+ }
+ return ""
+}
+
+type Worksheet struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the worksheet resource, generated by the server.
+ // Canonical parent is project.
+ // Format: worksheets/{worksheet}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ // The project resource name.
+ // Format: projects/{project}
+ Project string `protobuf:"bytes,2,opt,name=project,proto3" json:"project,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,3,opt,name=database,proto3" json:"database,omitempty"`
+ // The title of the worksheet.
+ Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`
+ // The creator of the Worksheet.
+ // Format: users/{email}
+ Creator string `protobuf:"bytes,5,opt,name=creator,proto3" json:"creator,omitempty"`
+ // The create time of the worksheet.
+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
+ // The last update time of the worksheet.
+ UpdateTime *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"`
+ // The content of the worksheet.
+ // By default, it will be cut off, if it doesn't match the `content_size`, you can
+ // set the `raw` to true in GetWorksheet request to retrieve the full content.
+ Content []byte `protobuf:"bytes,8,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 int64 `protobuf:"varint,9,opt,name=content_size,json=contentSize,proto3" json:"content_size,omitempty"`
+ Visibility Worksheet_Visibility `protobuf:"varint,10,opt,name=visibility,proto3,enum=bytebase.v1.Worksheet_Visibility" json:"visibility,omitempty"`
+ // starred indicates whether the worksheet is starred by the current authenticated user.
+ Starred bool `protobuf:"varint,11,opt,name=starred,proto3" json:"starred,omitempty"`
+}
+
+func (x *Worksheet) Reset() {
+ *x = Worksheet{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_v1_worksheet_service_proto_msgTypes[8]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Worksheet) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Worksheet) ProtoMessage() {}
+
+func (x *Worksheet) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_worksheet_service_proto_msgTypes[8]
+ 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 Worksheet.ProtoReflect.Descriptor instead.
+func (*Worksheet) Descriptor() ([]byte, []int) {
+ return file_v1_worksheet_service_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *Worksheet) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
+func (x *Worksheet) GetProject() string {
+ if x != nil {
+ return x.Project
+ }
+ return ""
+}
+
+func (x *Worksheet) GetDatabase() string {
+ if x != nil {
+ return x.Database
+ }
+ return ""
+}
+
+func (x *Worksheet) GetTitle() string {
+ if x != nil {
+ return x.Title
+ }
+ return ""
+}
+
+func (x *Worksheet) GetCreator() string {
+ if x != nil {
+ return x.Creator
+ }
+ return ""
+}
+
+func (x *Worksheet) GetCreateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.CreateTime
+ }
+ return nil
+}
+
+func (x *Worksheet) GetUpdateTime() *timestamppb.Timestamp {
+ if x != nil {
+ return x.UpdateTime
+ }
+ return nil
+}
+
+func (x *Worksheet) GetContent() []byte {
+ if x != nil {
+ return x.Content
+ }
+ return nil
+}
+
+func (x *Worksheet) GetContentSize() int64 {
+ if x != nil {
+ return x.ContentSize
+ }
+ return 0
+}
+
+func (x *Worksheet) GetVisibility() Worksheet_Visibility {
+ if x != nil {
+ return x.Visibility
+ }
+ return Worksheet_VISIBILITY_UNSPECIFIED
+}
+
+func (x *Worksheet) GetStarred() bool {
+ if x != nil {
+ return x.Starred
+ }
+ return false
+}
+
+var File_v1_worksheet_service_proto protoreflect.FileDescriptor
+
+var file_v1_worksheet_service_proto_rawDesc = []byte{
+ 0x0a, 0x1a, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 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, 0x53, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x09, 0x77,
+ 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72,
+ 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x77, 0x6f, 0x72,
+ 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22, 0x40, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72,
+ 0x6b, 0x73, 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, 0x90, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x42, 0x03,
+ 0xe0, 0x41, 0x02, 0x52, 0x09, 0x77, 0x6f, 0x72, 0x6b, 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, 0xa2, 0x01, 0x0a, 0x1f,
+ 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x4f,
+ 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x42, 0x0a, 0x09, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69,
+ 0x7a, 0x65, 0x72, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69,
+ 0x7a, 0x65, 0x72, 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, 0x69, 0x0a, 0x12, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x4f, 0x72, 0x67,
+ 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x09, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x09,
+ 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61,
+ 0x72, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72,
+ 0x72, 0x65, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x18, 0x03, 0x20,
+ 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x69, 0x6e, 0x6e, 0x65, 0x64, 0x22, 0x31, 0x0a, 0x16, 0x44,
+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 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, 0x6d,
+ 0x0a, 0x17, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x66, 0x69, 0x6c,
+ 0x74, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x66, 0x69, 0x6c, 0x74, 0x65,
+ 0x72, 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, 0x7a, 0x0a,
+ 0x18, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x0a, 0x77, 0x6f, 0x72,
+ 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x52, 0x0a, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74,
+ 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74,
+ 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74,
+ 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xbf, 0x04, 0x0a, 0x09, 0x57, 0x6f,
+ 0x72, 0x6b, 0x73, 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, 0x1d, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x02, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65,
+ 0x63, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x19,
+ 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 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, 0x05, 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, 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,
+ 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, 0x07, 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, 0x08, 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, 0x09, 0x20, 0x01, 0x28,
+ 0x03, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x53,
+ 0x69, 0x7a, 0x65, 0x12, 0x46, 0x0a, 0x0a, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74,
+ 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 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, 0x1d, 0x0a, 0x07, 0x73,
+ 0x74, 0x61, 0x72, 0x72, 0x65, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x03, 0xe0, 0x41,
+ 0x03, 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, 0x32, 0xeb, 0x06, 0x0a, 0x10,
+ 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
+ 0x12, 0x84, 0x01, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x22, 0x34, 0xda, 0x41, 0x10, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x77, 0x6f, 0x72,
+ 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, 0x3a, 0x09, 0x77, 0x6f,
+ 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72,
+ 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x12, 0x70, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x57, 0x6f,
+ 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65,
+ 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x22, 0x26, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19,
+ 0x12, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x77, 0x6f, 0x72, 0x6b,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x7e, 0x0a, 0x10, 0x53, 0x65, 0x61,
+ 0x72, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x12, 0x24, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72,
+ 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65,
+ 0x74, 0x73, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x12, 0x9c, 0x01, 0x0a, 0x0f, 0x55, 0x70,
+ 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x23, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61,
+ 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
+ 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x22, 0x4c, 0xda, 0x41, 0x15, 0x77,
+ 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
+ 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x3a, 0x09, 0x77, 0x6f, 0x72, 0x6b,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x32, 0x21, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x77, 0x6f, 0x72, 0x6b,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x77, 0x6f, 0x72, 0x6b, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xc6, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61,
+ 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x2c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x57, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x4f, 0x72, 0x67, 0x61, 0x6e,
+ 0x69, 0x7a, 0x65, 0x72, 0x22, 0x5b, 0xda, 0x41, 0x15, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a,
+ 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x3d, 0x3a, 0x09, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x1a,
+ 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x65, 0x72, 0x2e,
+ 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x68, 0x65, 0x65, 0x74, 0x3d, 0x77, 0x6f, 0x72, 0x6b, 0x73, 0x68,
+ 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x6f, 0x72, 0x67, 0x61, 0x6e, 0x69, 0x7a, 0x65,
+ 0x72, 0x12, 0x76, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73,
+ 0x68, 0x65, 0x65, 0x74, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x57, 0x6f, 0x72, 0x6b, 0x73, 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, 0x26, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x19,
+ 0x2a, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x77, 0x6f, 0x72, 0x6b,
+ 0x73, 0x68, 0x65, 0x65, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 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_worksheet_service_proto_rawDescOnce sync.Once
+ file_v1_worksheet_service_proto_rawDescData = file_v1_worksheet_service_proto_rawDesc
+)
+
+func file_v1_worksheet_service_proto_rawDescGZIP() []byte {
+ file_v1_worksheet_service_proto_rawDescOnce.Do(func() {
+ file_v1_worksheet_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_worksheet_service_proto_rawDescData)
+ })
+ return file_v1_worksheet_service_proto_rawDescData
+}
+
+var file_v1_worksheet_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_v1_worksheet_service_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
+var file_v1_worksheet_service_proto_goTypes = []interface{}{
+ (Worksheet_Visibility)(0), // 0: bytebase.v1.Worksheet.Visibility
+ (*CreateWorksheetRequest)(nil), // 1: bytebase.v1.CreateWorksheetRequest
+ (*GetWorksheetRequest)(nil), // 2: bytebase.v1.GetWorksheetRequest
+ (*UpdateWorksheetRequest)(nil), // 3: bytebase.v1.UpdateWorksheetRequest
+ (*UpdateWorksheetOrganizerRequest)(nil), // 4: bytebase.v1.UpdateWorksheetOrganizerRequest
+ (*WorksheetOrganizer)(nil), // 5: bytebase.v1.WorksheetOrganizer
+ (*DeleteWorksheetRequest)(nil), // 6: bytebase.v1.DeleteWorksheetRequest
+ (*SearchWorksheetsRequest)(nil), // 7: bytebase.v1.SearchWorksheetsRequest
+ (*SearchWorksheetsResponse)(nil), // 8: bytebase.v1.SearchWorksheetsResponse
+ (*Worksheet)(nil), // 9: bytebase.v1.Worksheet
+ (*fieldmaskpb.FieldMask)(nil), // 10: google.protobuf.FieldMask
+ (*timestamppb.Timestamp)(nil), // 11: google.protobuf.Timestamp
+ (*emptypb.Empty)(nil), // 12: google.protobuf.Empty
+}
+var file_v1_worksheet_service_proto_depIdxs = []int32{
+ 9, // 0: bytebase.v1.CreateWorksheetRequest.worksheet:type_name -> bytebase.v1.Worksheet
+ 9, // 1: bytebase.v1.UpdateWorksheetRequest.worksheet:type_name -> bytebase.v1.Worksheet
+ 10, // 2: bytebase.v1.UpdateWorksheetRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 5, // 3: bytebase.v1.UpdateWorksheetOrganizerRequest.organizer:type_name -> bytebase.v1.WorksheetOrganizer
+ 10, // 4: bytebase.v1.UpdateWorksheetOrganizerRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 9, // 5: bytebase.v1.SearchWorksheetsResponse.worksheets:type_name -> bytebase.v1.Worksheet
+ 11, // 6: bytebase.v1.Worksheet.create_time:type_name -> google.protobuf.Timestamp
+ 11, // 7: bytebase.v1.Worksheet.update_time:type_name -> google.protobuf.Timestamp
+ 0, // 8: bytebase.v1.Worksheet.visibility:type_name -> bytebase.v1.Worksheet.Visibility
+ 1, // 9: bytebase.v1.WorksheetService.CreateWorksheet:input_type -> bytebase.v1.CreateWorksheetRequest
+ 2, // 10: bytebase.v1.WorksheetService.GetWorksheet:input_type -> bytebase.v1.GetWorksheetRequest
+ 7, // 11: bytebase.v1.WorksheetService.SearchWorksheets:input_type -> bytebase.v1.SearchWorksheetsRequest
+ 3, // 12: bytebase.v1.WorksheetService.UpdateWorksheet:input_type -> bytebase.v1.UpdateWorksheetRequest
+ 4, // 13: bytebase.v1.WorksheetService.UpdateWorksheetOrganizer:input_type -> bytebase.v1.UpdateWorksheetOrganizerRequest
+ 6, // 14: bytebase.v1.WorksheetService.DeleteWorksheet:input_type -> bytebase.v1.DeleteWorksheetRequest
+ 9, // 15: bytebase.v1.WorksheetService.CreateWorksheet:output_type -> bytebase.v1.Worksheet
+ 9, // 16: bytebase.v1.WorksheetService.GetWorksheet:output_type -> bytebase.v1.Worksheet
+ 8, // 17: bytebase.v1.WorksheetService.SearchWorksheets:output_type -> bytebase.v1.SearchWorksheetsResponse
+ 9, // 18: bytebase.v1.WorksheetService.UpdateWorksheet:output_type -> bytebase.v1.Worksheet
+ 5, // 19: bytebase.v1.WorksheetService.UpdateWorksheetOrganizer:output_type -> bytebase.v1.WorksheetOrganizer
+ 12, // 20: bytebase.v1.WorksheetService.DeleteWorksheet: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_worksheet_service_proto_init() }
+func file_v1_worksheet_service_proto_init() {
+ if File_v1_worksheet_service_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_v1_worksheet_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*CreateWorksheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*GetWorksheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateWorksheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*UpdateWorksheetOrganizerRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*WorksheetOrganizer); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*DeleteWorksheetRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SearchWorksheetsRequest); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*SearchWorksheetsResponse); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_v1_worksheet_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Worksheet); 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_worksheet_service_proto_rawDesc,
+ NumEnums: 1,
+ NumMessages: 9,
+ NumExtensions: 0,
+ NumServices: 1,
+ },
+ GoTypes: file_v1_worksheet_service_proto_goTypes,
+ DependencyIndexes: file_v1_worksheet_service_proto_depIdxs,
+ EnumInfos: file_v1_worksheet_service_proto_enumTypes,
+ MessageInfos: file_v1_worksheet_service_proto_msgTypes,
+ }.Build()
+ File_v1_worksheet_service_proto = out.File
+ file_v1_worksheet_service_proto_rawDesc = nil
+ file_v1_worksheet_service_proto_goTypes = nil
+ file_v1_worksheet_service_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/v1/worksheet_service.pb.gw.go b/proto/generated-go/v1/worksheet_service.pb.gw.go
new file mode 100644
index 0000000000..f25df99838
--- /dev/null
+++ b/proto/generated-go/v1/worksheet_service.pb.gw.go
@@ -0,0 +1,754 @@
+// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
+// source: v1/worksheet_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_WorksheetService_CreateWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, client WorksheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq CreateWorksheetRequest
+ var metadata runtime.ServerMetadata
+
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Worksheet); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.CreateWorksheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_WorksheetService_CreateWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, server WorksheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq CreateWorksheetRequest
+ var metadata runtime.ServerMetadata
+
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Worksheet); err != nil && err != io.EOF {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.CreateWorksheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_WorksheetService_GetWorksheet_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
+)
+
+func request_WorksheetService_GetWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, client WorksheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq GetWorksheetRequest
+ 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_WorksheetService_GetWorksheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.GetWorksheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_WorksheetService_GetWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, server WorksheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq GetWorksheetRequest
+ 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_WorksheetService_GetWorksheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.GetWorksheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_WorksheetService_SearchWorksheets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
+)
+
+func request_WorksheetService_SearchWorksheets_0(ctx context.Context, marshaler runtime.Marshaler, client WorksheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SearchWorksheetsRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorksheetService_SearchWorksheets_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.SearchWorksheets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_WorksheetService_SearchWorksheets_0(ctx context.Context, marshaler runtime.Marshaler, server WorksheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq SearchWorksheetsRequest
+ var metadata runtime.ServerMetadata
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorksheetService_SearchWorksheets_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.SearchWorksheets(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_WorksheetService_UpdateWorksheet_0 = &utilities.DoubleArray{Encoding: map[string]int{"worksheet": 0, "name": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
+)
+
+func request_WorksheetService_UpdateWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, client WorksheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateWorksheetRequest
+ 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.Worksheet); 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.Worksheet); 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["worksheet.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "worksheet.name")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "worksheet.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "worksheet.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_WorksheetService_UpdateWorksheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.UpdateWorksheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_WorksheetService_UpdateWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, server WorksheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateWorksheetRequest
+ 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.Worksheet); 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.Worksheet); 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["worksheet.name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "worksheet.name")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "worksheet.name", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "worksheet.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_WorksheetService_UpdateWorksheet_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.UpdateWorksheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+var (
+ filter_WorksheetService_UpdateWorksheetOrganizer_0 = &utilities.DoubleArray{Encoding: map[string]int{"organizer": 0, "worksheet": 1}, Base: []int{1, 2, 1, 0, 0}, Check: []int{0, 1, 2, 3, 2}}
+)
+
+func request_WorksheetService_UpdateWorksheetOrganizer_0(ctx context.Context, marshaler runtime.Marshaler, client WorksheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateWorksheetOrganizerRequest
+ var metadata runtime.ServerMetadata
+
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Organizer); 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["organizer.worksheet"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "organizer.worksheet")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "organizer.worksheet", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "organizer.worksheet", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorksheetService_UpdateWorksheetOrganizer_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := client.UpdateWorksheetOrganizer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_WorksheetService_UpdateWorksheetOrganizer_0(ctx context.Context, marshaler runtime.Marshaler, server WorksheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq UpdateWorksheetOrganizerRequest
+ var metadata runtime.ServerMetadata
+
+ if err := marshaler.NewDecoder(req.Body).Decode(&protoReq.Organizer); 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["organizer.worksheet"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "organizer.worksheet")
+ }
+
+ err = runtime.PopulateFieldFromPath(&protoReq, "organizer.worksheet", val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "organizer.worksheet", err)
+ }
+
+ if err := req.ParseForm(); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_WorksheetService_UpdateWorksheetOrganizer_0); err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
+ }
+
+ msg, err := server.UpdateWorksheetOrganizer(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+func request_WorksheetService_DeleteWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, client WorksheetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeleteWorksheetRequest
+ 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.DeleteWorksheet(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_WorksheetService_DeleteWorksheet_0(ctx context.Context, marshaler runtime.Marshaler, server WorksheetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq DeleteWorksheetRequest
+ 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.DeleteWorksheet(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
+// RegisterWorksheetServiceHandlerServer registers the http handlers for service WorksheetService to "mux".
+// UnaryRPC :call WorksheetServiceServer 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 RegisterWorksheetServiceHandlerFromEndpoint instead.
+func RegisterWorksheetServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WorksheetServiceServer) error {
+
+ mux.Handle("POST", pattern_WorksheetService_CreateWorksheet_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.WorksheetService/CreateWorksheet", runtime.WithHTTPPathPattern("/v1/worksheets"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_WorksheetService_CreateWorksheet_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_WorksheetService_CreateWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_WorksheetService_GetWorksheet_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.WorksheetService/GetWorksheet", runtime.WithHTTPPathPattern("/v1/{name=worksheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_WorksheetService_GetWorksheet_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_WorksheetService_GetWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_WorksheetService_SearchWorksheets_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.WorksheetService/SearchWorksheets", runtime.WithHTTPPathPattern("/v1/worksheets:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_WorksheetService_SearchWorksheets_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_WorksheetService_SearchWorksheets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PATCH", pattern_WorksheetService_UpdateWorksheet_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.WorksheetService/UpdateWorksheet", runtime.WithHTTPPathPattern("/v1/{worksheet.name=worksheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_WorksheetService_UpdateWorksheet_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_WorksheetService_UpdateWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PUT", pattern_WorksheetService_UpdateWorksheetOrganizer_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.WorksheetService/UpdateWorksheetOrganizer", runtime.WithHTTPPathPattern("/v1/{organizer.worksheet=worksheets/*}/organizer"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_WorksheetService_UpdateWorksheetOrganizer_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_WorksheetService_UpdateWorksheetOrganizer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_WorksheetService_DeleteWorksheet_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.WorksheetService/DeleteWorksheet", runtime.WithHTTPPathPattern("/v1/{name=worksheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_WorksheetService_DeleteWorksheet_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_WorksheetService_DeleteWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+// RegisterWorksheetServiceHandlerFromEndpoint is same as RegisterWorksheetServiceHandler but
+// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
+func RegisterWorksheetServiceHandlerFromEndpoint(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 RegisterWorksheetServiceHandler(ctx, mux, conn)
+}
+
+// RegisterWorksheetServiceHandler registers the http handlers for service WorksheetService to "mux".
+// The handlers forward requests to the grpc endpoint over "conn".
+func RegisterWorksheetServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
+ return RegisterWorksheetServiceHandlerClient(ctx, mux, NewWorksheetServiceClient(conn))
+}
+
+// RegisterWorksheetServiceHandlerClient registers the http handlers for service WorksheetService
+// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WorksheetServiceClient".
+// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WorksheetServiceClient"
+// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
+// "WorksheetServiceClient" to call the correct interceptors.
+func RegisterWorksheetServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WorksheetServiceClient) error {
+
+ mux.Handle("POST", pattern_WorksheetService_CreateWorksheet_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.WorksheetService/CreateWorksheet", runtime.WithHTTPPathPattern("/v1/worksheets"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_WorksheetService_CreateWorksheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_WorksheetService_CreateWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_WorksheetService_GetWorksheet_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.WorksheetService/GetWorksheet", runtime.WithHTTPPathPattern("/v1/{name=worksheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_WorksheetService_GetWorksheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_WorksheetService_GetWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("GET", pattern_WorksheetService_SearchWorksheets_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.WorksheetService/SearchWorksheets", runtime.WithHTTPPathPattern("/v1/worksheets:search"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_WorksheetService_SearchWorksheets_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_WorksheetService_SearchWorksheets_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PATCH", pattern_WorksheetService_UpdateWorksheet_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.WorksheetService/UpdateWorksheet", runtime.WithHTTPPathPattern("/v1/{worksheet.name=worksheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_WorksheetService_UpdateWorksheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_WorksheetService_UpdateWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("PUT", pattern_WorksheetService_UpdateWorksheetOrganizer_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.WorksheetService/UpdateWorksheetOrganizer", runtime.WithHTTPPathPattern("/v1/{organizer.worksheet=worksheets/*}/organizer"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_WorksheetService_UpdateWorksheetOrganizer_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_WorksheetService_UpdateWorksheetOrganizer_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ mux.Handle("DELETE", pattern_WorksheetService_DeleteWorksheet_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.WorksheetService/DeleteWorksheet", runtime.WithHTTPPathPattern("/v1/{name=worksheets/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_WorksheetService_DeleteWorksheet_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_WorksheetService_DeleteWorksheet_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
+ return nil
+}
+
+var (
+ pattern_WorksheetService_CreateWorksheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "worksheets"}, ""))
+
+ pattern_WorksheetService_GetWorksheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "worksheets", "name"}, ""))
+
+ pattern_WorksheetService_SearchWorksheets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "worksheets"}, "search"))
+
+ pattern_WorksheetService_UpdateWorksheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "worksheets", "worksheet.name"}, ""))
+
+ pattern_WorksheetService_UpdateWorksheetOrganizer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2, 2, 3}, []string{"v1", "worksheets", "organizer.worksheet", "organizer"}, ""))
+
+ pattern_WorksheetService_DeleteWorksheet_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "worksheets", "name"}, ""))
+)
+
+var (
+ forward_WorksheetService_CreateWorksheet_0 = runtime.ForwardResponseMessage
+
+ forward_WorksheetService_GetWorksheet_0 = runtime.ForwardResponseMessage
+
+ forward_WorksheetService_SearchWorksheets_0 = runtime.ForwardResponseMessage
+
+ forward_WorksheetService_UpdateWorksheet_0 = runtime.ForwardResponseMessage
+
+ forward_WorksheetService_UpdateWorksheetOrganizer_0 = runtime.ForwardResponseMessage
+
+ forward_WorksheetService_DeleteWorksheet_0 = runtime.ForwardResponseMessage
+)
diff --git a/proto/generated-go/v1/worksheet_service_grpc.pb.go b/proto/generated-go/v1/worksheet_service_grpc.pb.go
new file mode 100644
index 0000000000..ab725f3f69
--- /dev/null
+++ b/proto/generated-go/v1/worksheet_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/worksheet_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 (
+ WorksheetService_CreateWorksheet_FullMethodName = "/bytebase.v1.WorksheetService/CreateWorksheet"
+ WorksheetService_GetWorksheet_FullMethodName = "/bytebase.v1.WorksheetService/GetWorksheet"
+ WorksheetService_SearchWorksheets_FullMethodName = "/bytebase.v1.WorksheetService/SearchWorksheets"
+ WorksheetService_UpdateWorksheet_FullMethodName = "/bytebase.v1.WorksheetService/UpdateWorksheet"
+ WorksheetService_UpdateWorksheetOrganizer_FullMethodName = "/bytebase.v1.WorksheetService/UpdateWorksheetOrganizer"
+ WorksheetService_DeleteWorksheet_FullMethodName = "/bytebase.v1.WorksheetService/DeleteWorksheet"
+)
+
+// WorksheetServiceClient is the client API for WorksheetService 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 WorksheetServiceClient interface {
+ CreateWorksheet(ctx context.Context, in *CreateWorksheetRequest, opts ...grpc.CallOption) (*Worksheet, error)
+ GetWorksheet(ctx context.Context, in *GetWorksheetRequest, opts ...grpc.CallOption) (*Worksheet, error)
+ SearchWorksheets(ctx context.Context, in *SearchWorksheetsRequest, opts ...grpc.CallOption) (*SearchWorksheetsResponse, error)
+ UpdateWorksheet(ctx context.Context, in *UpdateWorksheetRequest, opts ...grpc.CallOption) (*Worksheet, error)
+ UpdateWorksheetOrganizer(ctx context.Context, in *UpdateWorksheetOrganizerRequest, opts ...grpc.CallOption) (*WorksheetOrganizer, error)
+ DeleteWorksheet(ctx context.Context, in *DeleteWorksheetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
+}
+
+type worksheetServiceClient struct {
+ cc grpc.ClientConnInterface
+}
+
+func NewWorksheetServiceClient(cc grpc.ClientConnInterface) WorksheetServiceClient {
+ return &worksheetServiceClient{cc}
+}
+
+func (c *worksheetServiceClient) CreateWorksheet(ctx context.Context, in *CreateWorksheetRequest, opts ...grpc.CallOption) (*Worksheet, error) {
+ out := new(Worksheet)
+ err := c.cc.Invoke(ctx, WorksheetService_CreateWorksheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *worksheetServiceClient) GetWorksheet(ctx context.Context, in *GetWorksheetRequest, opts ...grpc.CallOption) (*Worksheet, error) {
+ out := new(Worksheet)
+ err := c.cc.Invoke(ctx, WorksheetService_GetWorksheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *worksheetServiceClient) SearchWorksheets(ctx context.Context, in *SearchWorksheetsRequest, opts ...grpc.CallOption) (*SearchWorksheetsResponse, error) {
+ out := new(SearchWorksheetsResponse)
+ err := c.cc.Invoke(ctx, WorksheetService_SearchWorksheets_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *worksheetServiceClient) UpdateWorksheet(ctx context.Context, in *UpdateWorksheetRequest, opts ...grpc.CallOption) (*Worksheet, error) {
+ out := new(Worksheet)
+ err := c.cc.Invoke(ctx, WorksheetService_UpdateWorksheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *worksheetServiceClient) UpdateWorksheetOrganizer(ctx context.Context, in *UpdateWorksheetOrganizerRequest, opts ...grpc.CallOption) (*WorksheetOrganizer, error) {
+ out := new(WorksheetOrganizer)
+ err := c.cc.Invoke(ctx, WorksheetService_UpdateWorksheetOrganizer_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+func (c *worksheetServiceClient) DeleteWorksheet(ctx context.Context, in *DeleteWorksheetRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
+ out := new(emptypb.Empty)
+ err := c.cc.Invoke(ctx, WorksheetService_DeleteWorksheet_FullMethodName, in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
+// WorksheetServiceServer is the server API for WorksheetService service.
+// All implementations must embed UnimplementedWorksheetServiceServer
+// for forward compatibility
+type WorksheetServiceServer interface {
+ CreateWorksheet(context.Context, *CreateWorksheetRequest) (*Worksheet, error)
+ GetWorksheet(context.Context, *GetWorksheetRequest) (*Worksheet, error)
+ SearchWorksheets(context.Context, *SearchWorksheetsRequest) (*SearchWorksheetsResponse, error)
+ UpdateWorksheet(context.Context, *UpdateWorksheetRequest) (*Worksheet, error)
+ UpdateWorksheetOrganizer(context.Context, *UpdateWorksheetOrganizerRequest) (*WorksheetOrganizer, error)
+ DeleteWorksheet(context.Context, *DeleteWorksheetRequest) (*emptypb.Empty, error)
+ mustEmbedUnimplementedWorksheetServiceServer()
+}
+
+// UnimplementedWorksheetServiceServer must be embedded to have forward compatible implementations.
+type UnimplementedWorksheetServiceServer struct {
+}
+
+func (UnimplementedWorksheetServiceServer) CreateWorksheet(context.Context, *CreateWorksheetRequest) (*Worksheet, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CreateWorksheet not implemented")
+}
+func (UnimplementedWorksheetServiceServer) GetWorksheet(context.Context, *GetWorksheetRequest) (*Worksheet, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetWorksheet not implemented")
+}
+func (UnimplementedWorksheetServiceServer) SearchWorksheets(context.Context, *SearchWorksheetsRequest) (*SearchWorksheetsResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method SearchWorksheets not implemented")
+}
+func (UnimplementedWorksheetServiceServer) UpdateWorksheet(context.Context, *UpdateWorksheetRequest) (*Worksheet, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateWorksheet not implemented")
+}
+func (UnimplementedWorksheetServiceServer) UpdateWorksheetOrganizer(context.Context, *UpdateWorksheetOrganizerRequest) (*WorksheetOrganizer, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method UpdateWorksheetOrganizer not implemented")
+}
+func (UnimplementedWorksheetServiceServer) DeleteWorksheet(context.Context, *DeleteWorksheetRequest) (*emptypb.Empty, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method DeleteWorksheet not implemented")
+}
+func (UnimplementedWorksheetServiceServer) mustEmbedUnimplementedWorksheetServiceServer() {}
+
+// UnsafeWorksheetServiceServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to WorksheetServiceServer will
+// result in compilation errors.
+type UnsafeWorksheetServiceServer interface {
+ mustEmbedUnimplementedWorksheetServiceServer()
+}
+
+func RegisterWorksheetServiceServer(s grpc.ServiceRegistrar, srv WorksheetServiceServer) {
+ s.RegisterService(&WorksheetService_ServiceDesc, srv)
+}
+
+func _WorksheetService_CreateWorksheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CreateWorksheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(WorksheetServiceServer).CreateWorksheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: WorksheetService_CreateWorksheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(WorksheetServiceServer).CreateWorksheet(ctx, req.(*CreateWorksheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _WorksheetService_GetWorksheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetWorksheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(WorksheetServiceServer).GetWorksheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: WorksheetService_GetWorksheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(WorksheetServiceServer).GetWorksheet(ctx, req.(*GetWorksheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _WorksheetService_SearchWorksheets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(SearchWorksheetsRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(WorksheetServiceServer).SearchWorksheets(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: WorksheetService_SearchWorksheets_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(WorksheetServiceServer).SearchWorksheets(ctx, req.(*SearchWorksheetsRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _WorksheetService_UpdateWorksheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateWorksheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(WorksheetServiceServer).UpdateWorksheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: WorksheetService_UpdateWorksheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(WorksheetServiceServer).UpdateWorksheet(ctx, req.(*UpdateWorksheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _WorksheetService_UpdateWorksheetOrganizer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(UpdateWorksheetOrganizerRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(WorksheetServiceServer).UpdateWorksheetOrganizer(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: WorksheetService_UpdateWorksheetOrganizer_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(WorksheetServiceServer).UpdateWorksheetOrganizer(ctx, req.(*UpdateWorksheetOrganizerRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+func _WorksheetService_DeleteWorksheet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(DeleteWorksheetRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(WorksheetServiceServer).DeleteWorksheet(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: WorksheetService_DeleteWorksheet_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(WorksheetServiceServer).DeleteWorksheet(ctx, req.(*DeleteWorksheetRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
+// WorksheetService_ServiceDesc is the grpc.ServiceDesc for WorksheetService service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var WorksheetService_ServiceDesc = grpc.ServiceDesc{
+ ServiceName: "bytebase.v1.WorksheetService",
+ HandlerType: (*WorksheetServiceServer)(nil),
+ Methods: []grpc.MethodDesc{
+ {
+ MethodName: "CreateWorksheet",
+ Handler: _WorksheetService_CreateWorksheet_Handler,
+ },
+ {
+ MethodName: "GetWorksheet",
+ Handler: _WorksheetService_GetWorksheet_Handler,
+ },
+ {
+ MethodName: "SearchWorksheets",
+ Handler: _WorksheetService_SearchWorksheets_Handler,
+ },
+ {
+ MethodName: "UpdateWorksheet",
+ Handler: _WorksheetService_UpdateWorksheet_Handler,
+ },
+ {
+ MethodName: "UpdateWorksheetOrganizer",
+ Handler: _WorksheetService_UpdateWorksheetOrganizer_Handler,
+ },
+ {
+ MethodName: "DeleteWorksheet",
+ Handler: _WorksheetService_DeleteWorksheet_Handler,
+ },
+ },
+ Streams: []grpc.StreamDesc{},
+ Metadata: "v1/worksheet_service.proto",
+}
diff --git a/proto/v1/worksheet_service.proto b/proto/v1/worksheet_service.proto
new file mode 100644
index 0000000000..cb5a0469aa
--- /dev/null
+++ b/proto/v1/worksheet_service.proto
@@ -0,0 +1,202 @@
+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 WorksheetService {
+ rpc CreateWorksheet(CreateWorksheetRequest) returns (Worksheet) {
+ option (google.api.http) = {
+ post: "/v1/worksheets"
+ body: "worksheet"
+ };
+ option (google.api.method_signature) = "parent,worksheet";
+ }
+
+ rpc GetWorksheet(GetWorksheetRequest) returns (Worksheet) {
+ option (google.api.http) = {get: "/v1/{name=worksheets/*}"};
+ option (google.api.method_signature) = "name";
+ }
+
+ rpc SearchWorksheets(SearchWorksheetsRequest) returns (SearchWorksheetsResponse) {
+ option (google.api.http) = {get: "/v1/worksheets:search"};
+ }
+
+ rpc UpdateWorksheet(UpdateWorksheetRequest) returns (Worksheet) {
+ option (google.api.http) = {
+ patch: "/v1/{worksheet.name=worksheets/*}"
+ body: "worksheet"
+ };
+ option (google.api.method_signature) = "worksheet,update_mask";
+ }
+
+ rpc UpdateWorksheetOrganizer(UpdateWorksheetOrganizerRequest) returns (WorksheetOrganizer) {
+ option (google.api.http) = {
+ put: "/v1/{organizer.worksheet=worksheets/*}/organizer"
+ body: "organizer"
+ };
+ option (google.api.method_signature) = "organizer,update_mask";
+ }
+
+ rpc DeleteWorksheet(DeleteWorksheetRequest) returns (google.protobuf.Empty) {
+ option (google.api.http) = {delete: "/v1/{name=worksheets/*}"};
+ option (google.api.method_signature) = "name";
+ }
+}
+
+message CreateWorksheetRequest {
+ // The worksheet to create.
+ Worksheet worksheet = 1 [(google.api.field_behavior) = REQUIRED];
+}
+
+message GetWorksheetRequest {
+ // The name of the worksheet to retrieve.
+ // Format: worksheets/{worksheet}
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // By default, the content of the worksheet is cut off, set the `raw` to true to retrieve the full content.
+ bool raw = 2;
+}
+
+message UpdateWorksheetRequest {
+ // The worksheet to update.
+ //
+ // The worksheet's `name` field is used to identify the worksheet to update.
+ // Format: worksheets/{worksheet}
+ Worksheet worksheet = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The list of fields to be updated.
+ // Fields are specified relative to the worksheet.
+ // (e.g. `title`, `statement`; *not* `worksheet.title` or `worksheet.statement`)
+ // Only support update the following fields for now:
+ // - `title`
+ // - `statement`
+ // - `starred`
+ // - `visibility`
+ google.protobuf.FieldMask update_mask = 2;
+}
+
+message UpdateWorksheetOrganizerRequest {
+ // The organizer to update.
+ //
+ // The organizer's `worksheet` field is used to identify the worksheet.
+ // Format: worksheets/{worksheet}
+ WorksheetOrganizer organizer = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // The list of fields to be updated.
+ // Fields are specified relative to the worksheet organizer.
+ // Only support update the following fields for now:
+ // - `starred`
+ // - `pinned`
+ google.protobuf.FieldMask update_mask = 2;
+}
+
+message WorksheetOrganizer {
+ // The name of the worksheet.
+ // Format: worksheets/{worksheet}
+ string worksheet = 1 [(google.api.field_behavior) = REQUIRED];
+
+ // starred means if the worksheet is starred.
+ bool starred = 2;
+
+ // pinned means if the worksheet is pinned.
+ bool pinned = 3;
+}
+
+message DeleteWorksheetRequest {
+ // The name of the worksheet to delete.
+ // Format: worksheets/{worksheet}
+ string name = 1 [(google.api.field_behavior) = REQUIRED];
+}
+
+message SearchWorksheetsRequest {
+ // To filter the search result.
+ // Format: only support the following spec for now:
+ // - `creator = users/{email}`, `creator != users/{email}`
+ // - `starred = true`, `starred = false`.
+ // Not support empty filter for now.
+ string filter = 1;
+
+ // Not used. The maximum number of worksheets to return. The service may return fewer than
+ // this value.
+ // If unspecified, at most 50 worksheets 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 `SearchWorksheets` call.
+ // Provide this to retrieve the subsequent page.
+ //
+ // When paginating, all other parameters provided to `SearchWorksheets` must match
+ // the call that provided the page token.
+ string page_token = 3;
+}
+
+message SearchWorksheetsResponse {
+ // The worksheets that matched the search criteria.
+ repeated Worksheet worksheets = 1;
+
+ // 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 = 2;
+}
+
+message Worksheet {
+ // The name of the worksheet resource, generated by the server.
+ // Canonical parent is project.
+ // Format: worksheets/{worksheet}
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.field_behavior) = IMMUTABLE
+ ];
+
+ // The project resource name.
+ // Format: projects/{project}
+ string project = 2 [(google.api.field_behavior) = REQUIRED];
+
+ // The database resource name.
+ // Format: instances/{instance}/databases/{database}
+ // If the database parent doesn't exist, the database field is empty.
+ string database = 3;
+
+ // The title of the worksheet.
+ string title = 4 [(google.api.field_behavior) = REQUIRED];
+
+ // The creator of the Worksheet.
+ // Format: users/{email}
+ string creator = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The create time of the worksheet.
+ google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The last update time of the worksheet.
+ google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ // The content of the worksheet.
+ // By default, it will be cut off, if it doesn't match the `content_size`, you can
+ // set the `raw` to true in GetWorksheet request to retrieve the full content.
+ bytes content = 8 [(google.api.field_behavior) = REQUIRED];
+
+ // content_size is the full size of the content, may not match the size of the `content` field.
+ int64 content_size = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
+
+ enum Visibility {
+ VISIBILITY_UNSPECIFIED = 0;
+ // Public, worksheet OWNER can read/write, and all others can read.
+ VISIBILITY_PUBLIC = 1;
+ // Project, worksheet OWNER and project OWNER can read/write, and project DEVELOPER can read.
+ VISIBILITY_PROJECT = 2;
+ // Private, only worksheet OWNER can read/write.
+ VISIBILITY_PRIVATE = 3;
+ }
+ Visibility visibility = 10 [(google.api.field_behavior) = REQUIRED];
+
+ // starred indicates whether the worksheet is starred by the current authenticated user.
+ bool starred = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
+}