diff --git a/.env b/.env index 2cedff8..f8a2d2c 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ # Common Environment Variables -VITE_JS_SDK_VERSION=0.5.1 +VITE_JS_SDK_VERSION=0.5.4 diff --git a/buf.gen.yaml b/buf.gen.yaml index 1b20df7..a08aca6 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -3,10 +3,10 @@ plugins: - plugin: es out: . opt: - - target=js+dts - - js_import_style=module + - target=ts + - import_extension=none - plugin: connect-es out: . opt: - - target=js+dts - - js_import_style=module + - target=ts + - import_extension=none diff --git a/package-lock.json b/package-lock.json index 266a765..a64db7e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dashboard", - "version": "0.5.1", + "version": "0.5.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "dashboard", - "version": "0.5.1", + "version": "0.5.4", "dependencies": { "@buf/googleapis_googleapis.connectrpc_es": "^1.4.0-20240524201209-f0e53af8f2fc.3", "@bufbuild/buf": "^1.34.0", @@ -45,7 +45,7 @@ "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.3.2", "vitest": "^1.6.0", - "yorkie-js-sdk": "^0.5.1" + "yorkie-js-sdk": "^0.5.4" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -5177,9 +5177,9 @@ } }, "node_modules/yorkie-js-sdk": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/yorkie-js-sdk/-/yorkie-js-sdk-0.5.1.tgz", - "integrity": "sha512-/GYo9deTs2QIz9jZTYM9wnTupnzifw9vgTx6/pZavy3W9YPH6qtuer4PKCX129VQAJGTXeOLiNCb28c/jq7QHg==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/yorkie-js-sdk/-/yorkie-js-sdk-0.5.4.tgz", + "integrity": "sha512-D7DwdeyE2/CrVIAva/yHAb8hgp/YdmIdvNpq1J8YlyEjsb9XmCMcsu+dG0vX8+0+JtugOuKxoF5Kq7B7WaI71w==", "dependencies": { "@bufbuild/protobuf": "^1.6.0", "@connectrpc/connect": "^1.4.0", @@ -8496,9 +8496,9 @@ "peer": true }, "yorkie-js-sdk": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/yorkie-js-sdk/-/yorkie-js-sdk-0.5.1.tgz", - "integrity": "sha512-/GYo9deTs2QIz9jZTYM9wnTupnzifw9vgTx6/pZavy3W9YPH6qtuer4PKCX129VQAJGTXeOLiNCb28c/jq7QHg==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/yorkie-js-sdk/-/yorkie-js-sdk-0.5.4.tgz", + "integrity": "sha512-D7DwdeyE2/CrVIAva/yHAb8hgp/YdmIdvNpq1J8YlyEjsb9XmCMcsu+dG0vX8+0+JtugOuKxoF5Kq7B7WaI71w==", "requires": { "@bufbuild/protobuf": "^1.6.0", "@connectrpc/connect": "^1.4.0", diff --git a/package.json b/package.json index 977e7a7..1e9d32c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dashboard", - "version": "0.5.1", + "version": "0.5.4", "private": true, "type": "module", "homepage": "https://yorkie.dev/dashboard", @@ -42,7 +42,7 @@ "vite-plugin-svgr": "^4.2.0", "vite-tsconfig-paths": "^4.3.2", "vitest": "^1.6.0", - "yorkie-js-sdk": "^0.5.1" + "yorkie-js-sdk": "^0.5.4" }, "husky": { "hooks": { diff --git a/src/api/index.ts b/src/api/index.ts index e7fb1dd..7e178c9 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -14,8 +14,7 @@ * limitations under the License. */ -import Long from 'long'; -import { Document, OpSource } from 'yorkie-js-sdk'; +import { Document, OpSource, VersionVector } from 'yorkie-js-sdk'; import { createPromiseClient } from '@connectrpc/connect'; import { createGrpcWebTransport } from '@connectrpc/connect-web'; import { AdminService } from './yorkie/v1/admin_connect'; @@ -141,7 +140,7 @@ export async function searchDocuments( export async function listDocumentHistories( projectName: string, documentKey: string, - previousSeq: string, + previousSeq: bigint, pageSize: number, isForward: boolean, ): Promise> { @@ -155,15 +154,15 @@ export async function listDocumentHistories( const pbChanges = res.changes; const changes = converter.fromChanges(pbChanges); - const seq = Long.fromString(pbChanges[0].id!.serverSeq).add(-1); + const seq = pbChanges[0].id!.serverSeq - 1n; const snapshotMeta = await client.getSnapshotMeta({ projectName, documentKey, - serverSeq: seq.toString(), + serverSeq: seq, }); const document = new Document(documentKey); - document.applySnapshot(seq, snapshotMeta.snapshot); + document.applySnapshot(seq, new VersionVector(new Map()), snapshotMeta.snapshot); const histories: Array = []; for (let i = 0; i < changes.length; i++) { diff --git a/src/api/types.ts b/src/api/types.ts index 2e75464..8aa1895 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -24,7 +24,7 @@ export type DocumentSummary = { }; export type DocumentHistory = { - serverSeq: string; + serverSeq: bigint; snapshot: string; }; diff --git a/src/api/yorkie/v1/admin.proto b/src/api/yorkie/v1/admin.proto index 5a57d1f..c55101f 100644 --- a/src/api/yorkie/v1/admin.proto +++ b/src/api/yorkie/v1/admin.proto @@ -156,12 +156,13 @@ message RemoveDocumentByAdminResponse {} message GetSnapshotMetaRequest { string project_name = 1; string document_key = 2; - int64 server_seq = 3 [jstype = JS_STRING]; + int64 server_seq = 3; } message GetSnapshotMetaResponse { bytes snapshot = 1; - int64 lamport = 2 [jstype = JS_STRING]; + int64 lamport = 2; + VersionVector version_vector = 3; } message SearchDocumentsRequest { @@ -178,7 +179,7 @@ message SearchDocumentsResponse { message ListChangesRequest { string project_name = 1; string document_key = 2; - int64 previous_seq = 3 [jstype = JS_STRING]; + int64 previous_seq = 3; int32 page_size = 4; bool is_forward = 5; } diff --git a/src/api/yorkie/v1/admin_connect.d.ts b/src/api/yorkie/v1/admin_connect.d.ts deleted file mode 100644 index b917390..0000000 --- a/src/api/yorkie/v1/admin_connect.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -// -// Copyright 2022 The Yorkie Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=js+dts,js_import_style=module" -// @generated from file src/api/yorkie/v1/admin.proto (package yorkie.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { ChangePasswordRequest, ChangePasswordResponse, CreateProjectRequest, CreateProjectResponse, DeleteAccountRequest, DeleteAccountResponse, GetDocumentRequest, GetDocumentResponse, GetDocumentsRequest, GetDocumentsResponse, GetProjectRequest, GetProjectResponse, GetServerVersionRequest, GetServerVersionResponse, GetSnapshotMetaRequest, GetSnapshotMetaResponse, ListChangesRequest, ListChangesResponse, ListDocumentsRequest, ListDocumentsResponse, ListProjectsRequest, ListProjectsResponse, LogInRequest, LogInResponse, RemoveDocumentByAdminRequest, RemoveDocumentByAdminResponse, SearchDocumentsRequest, SearchDocumentsResponse, SignUpRequest, SignUpResponse, UpdateProjectRequest, UpdateProjectResponse } from "./admin_pb.js"; -import { MethodKind } from "@bufbuild/protobuf"; - -/** - * Admin is a service that provides a API for Admin. - * - * @generated from service yorkie.v1.AdminService - */ -export declare const AdminService: { - readonly typeName: "yorkie.v1.AdminService", - readonly methods: { - /** - * @generated from rpc yorkie.v1.AdminService.SignUp - */ - readonly signUp: { - readonly name: "SignUp", - readonly I: typeof SignUpRequest, - readonly O: typeof SignUpResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.LogIn - */ - readonly logIn: { - readonly name: "LogIn", - readonly I: typeof LogInRequest, - readonly O: typeof LogInResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.DeleteAccount - */ - readonly deleteAccount: { - readonly name: "DeleteAccount", - readonly I: typeof DeleteAccountRequest, - readonly O: typeof DeleteAccountResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.ChangePassword - */ - readonly changePassword: { - readonly name: "ChangePassword", - readonly I: typeof ChangePasswordRequest, - readonly O: typeof ChangePasswordResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.CreateProject - */ - readonly createProject: { - readonly name: "CreateProject", - readonly I: typeof CreateProjectRequest, - readonly O: typeof CreateProjectResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.ListProjects - */ - readonly listProjects: { - readonly name: "ListProjects", - readonly I: typeof ListProjectsRequest, - readonly O: typeof ListProjectsResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.GetProject - */ - readonly getProject: { - readonly name: "GetProject", - readonly I: typeof GetProjectRequest, - readonly O: typeof GetProjectResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.UpdateProject - */ - readonly updateProject: { - readonly name: "UpdateProject", - readonly I: typeof UpdateProjectRequest, - readonly O: typeof UpdateProjectResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.ListDocuments - */ - readonly listDocuments: { - readonly name: "ListDocuments", - readonly I: typeof ListDocumentsRequest, - readonly O: typeof ListDocumentsResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.GetDocument - */ - readonly getDocument: { - readonly name: "GetDocument", - readonly I: typeof GetDocumentRequest, - readonly O: typeof GetDocumentResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.GetDocuments - */ - readonly getDocuments: { - readonly name: "GetDocuments", - readonly I: typeof GetDocumentsRequest, - readonly O: typeof GetDocumentsResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.RemoveDocumentByAdmin - */ - readonly removeDocumentByAdmin: { - readonly name: "RemoveDocumentByAdmin", - readonly I: typeof RemoveDocumentByAdminRequest, - readonly O: typeof RemoveDocumentByAdminResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.GetSnapshotMeta - */ - readonly getSnapshotMeta: { - readonly name: "GetSnapshotMeta", - readonly I: typeof GetSnapshotMetaRequest, - readonly O: typeof GetSnapshotMetaResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.SearchDocuments - */ - readonly searchDocuments: { - readonly name: "SearchDocuments", - readonly I: typeof SearchDocumentsRequest, - readonly O: typeof SearchDocumentsResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.ListChanges - */ - readonly listChanges: { - readonly name: "ListChanges", - readonly I: typeof ListChangesRequest, - readonly O: typeof ListChangesResponse, - readonly kind: MethodKind.Unary, - }, - /** - * @generated from rpc yorkie.v1.AdminService.GetServerVersion - */ - readonly getServerVersion: { - readonly name: "GetServerVersion", - readonly I: typeof GetServerVersionRequest, - readonly O: typeof GetServerVersionResponse, - readonly kind: MethodKind.Unary, - }, - } -}; - diff --git a/src/api/yorkie/v1/admin_connect.js b/src/api/yorkie/v1/admin_connect.ts similarity index 98% rename from src/api/yorkie/v1/admin_connect.js rename to src/api/yorkie/v1/admin_connect.ts index 16f28be..b611426 100644 --- a/src/api/yorkie/v1/admin_connect.js +++ b/src/api/yorkie/v1/admin_connect.ts @@ -13,12 +13,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=js+dts,js_import_style=module" +// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts,import_extension=none" // @generated from file src/api/yorkie/v1/admin.proto (package yorkie.v1, syntax proto3) /* eslint-disable */ // @ts-nocheck -import { ChangePasswordRequest, ChangePasswordResponse, CreateProjectRequest, CreateProjectResponse, DeleteAccountRequest, DeleteAccountResponse, GetDocumentRequest, GetDocumentResponse, GetDocumentsRequest, GetDocumentsResponse, GetProjectRequest, GetProjectResponse, GetServerVersionRequest, GetServerVersionResponse, GetSnapshotMetaRequest, GetSnapshotMetaResponse, ListChangesRequest, ListChangesResponse, ListDocumentsRequest, ListDocumentsResponse, ListProjectsRequest, ListProjectsResponse, LogInRequest, LogInResponse, RemoveDocumentByAdminRequest, RemoveDocumentByAdminResponse, SearchDocumentsRequest, SearchDocumentsResponse, SignUpRequest, SignUpResponse, UpdateProjectRequest, UpdateProjectResponse } from "./admin_pb.js"; +import { ChangePasswordRequest, ChangePasswordResponse, CreateProjectRequest, CreateProjectResponse, DeleteAccountRequest, DeleteAccountResponse, GetDocumentRequest, GetDocumentResponse, GetDocumentsRequest, GetDocumentsResponse, GetProjectRequest, GetProjectResponse, GetServerVersionRequest, GetServerVersionResponse, GetSnapshotMetaRequest, GetSnapshotMetaResponse, ListChangesRequest, ListChangesResponse, ListDocumentsRequest, ListDocumentsResponse, ListProjectsRequest, ListProjectsResponse, LogInRequest, LogInResponse, RemoveDocumentByAdminRequest, RemoveDocumentByAdminResponse, SearchDocumentsRequest, SearchDocumentsResponse, SignUpRequest, SignUpResponse, UpdateProjectRequest, UpdateProjectResponse } from "./admin_pb"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -174,5 +174,5 @@ export const AdminService = { kind: MethodKind.Unary, }, } -}; +} as const; diff --git a/src/api/yorkie/v1/admin_pb.d.ts b/src/api/yorkie/v1/admin_pb.d.ts deleted file mode 100644 index 96f1ccb..0000000 --- a/src/api/yorkie/v1/admin_pb.d.ts +++ /dev/null @@ -1,902 +0,0 @@ -// -// Copyright 2022 The Yorkie Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.10.0 with parameter "target=js+dts,js_import_style=module" -// @generated from file src/api/yorkie/v1/admin.proto (package yorkie.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; -import type { Change, DocumentSummary, Project, UpdatableProjectFields, User } from "./resources_pb.js"; - -/** - * @generated from message yorkie.v1.SignUpRequest - */ -export declare class SignUpRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - /** - * @generated from field: string password = 2; - */ - password: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.SignUpRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): SignUpRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): SignUpRequest; - - static fromJsonString(jsonString: string, options?: Partial): SignUpRequest; - - static equals(a: SignUpRequest | PlainMessage | undefined, b: SignUpRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.SignUpResponse - */ -export declare class SignUpResponse extends Message { - /** - * @generated from field: yorkie.v1.User user = 1; - */ - user?: User; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.SignUpResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): SignUpResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): SignUpResponse; - - static fromJsonString(jsonString: string, options?: Partial): SignUpResponse; - - static equals(a: SignUpResponse | PlainMessage | undefined, b: SignUpResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.LogInRequest - */ -export declare class LogInRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - /** - * @generated from field: string password = 2; - */ - password: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.LogInRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): LogInRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): LogInRequest; - - static fromJsonString(jsonString: string, options?: Partial): LogInRequest; - - static equals(a: LogInRequest | PlainMessage | undefined, b: LogInRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.LogInResponse - */ -export declare class LogInResponse extends Message { - /** - * @generated from field: string token = 1; - */ - token: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.LogInResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): LogInResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): LogInResponse; - - static fromJsonString(jsonString: string, options?: Partial): LogInResponse; - - static equals(a: LogInResponse | PlainMessage | undefined, b: LogInResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.DeleteAccountRequest - */ -export declare class DeleteAccountRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - /** - * @generated from field: string password = 2; - */ - password: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.DeleteAccountRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAccountRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAccountRequest; - - static fromJsonString(jsonString: string, options?: Partial): DeleteAccountRequest; - - static equals(a: DeleteAccountRequest | PlainMessage | undefined, b: DeleteAccountRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.DeleteAccountResponse - */ -export declare class DeleteAccountResponse extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.DeleteAccountResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAccountResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAccountResponse; - - static fromJsonString(jsonString: string, options?: Partial): DeleteAccountResponse; - - static equals(a: DeleteAccountResponse | PlainMessage | undefined, b: DeleteAccountResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ChangePasswordRequest - */ -export declare class ChangePasswordRequest extends Message { - /** - * @generated from field: string username = 1; - */ - username: string; - - /** - * @generated from field: string current_password = 2; - */ - currentPassword: string; - - /** - * @generated from field: string new_password = 3; - */ - newPassword: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ChangePasswordRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ChangePasswordRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangePasswordRequest; - - static fromJsonString(jsonString: string, options?: Partial): ChangePasswordRequest; - - static equals(a: ChangePasswordRequest | PlainMessage | undefined, b: ChangePasswordRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ChangePasswordResponse - */ -export declare class ChangePasswordResponse extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ChangePasswordResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ChangePasswordResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangePasswordResponse; - - static fromJsonString(jsonString: string, options?: Partial): ChangePasswordResponse; - - static equals(a: ChangePasswordResponse | PlainMessage | undefined, b: ChangePasswordResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.CreateProjectRequest - */ -export declare class CreateProjectRequest extends Message { - /** - * @generated from field: string name = 1; - */ - name: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.CreateProjectRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateProjectRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateProjectRequest; - - static fromJsonString(jsonString: string, options?: Partial): CreateProjectRequest; - - static equals(a: CreateProjectRequest | PlainMessage | undefined, b: CreateProjectRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.CreateProjectResponse - */ -export declare class CreateProjectResponse extends Message { - /** - * @generated from field: yorkie.v1.Project project = 1; - */ - project?: Project; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.CreateProjectResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateProjectResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateProjectResponse; - - static fromJsonString(jsonString: string, options?: Partial): CreateProjectResponse; - - static equals(a: CreateProjectResponse | PlainMessage | undefined, b: CreateProjectResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetProjectRequest - */ -export declare class GetProjectRequest extends Message { - /** - * @generated from field: string name = 1; - */ - name: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetProjectRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetProjectRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetProjectRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetProjectRequest; - - static equals(a: GetProjectRequest | PlainMessage | undefined, b: GetProjectRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetProjectResponse - */ -export declare class GetProjectResponse extends Message { - /** - * @generated from field: yorkie.v1.Project project = 1; - */ - project?: Project; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetProjectResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetProjectResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetProjectResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetProjectResponse; - - static equals(a: GetProjectResponse | PlainMessage | undefined, b: GetProjectResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ListProjectsRequest - */ -export declare class ListProjectsRequest extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ListProjectsRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListProjectsRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListProjectsRequest; - - static fromJsonString(jsonString: string, options?: Partial): ListProjectsRequest; - - static equals(a: ListProjectsRequest | PlainMessage | undefined, b: ListProjectsRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ListProjectsResponse - */ -export declare class ListProjectsResponse extends Message { - /** - * @generated from field: repeated yorkie.v1.Project projects = 1; - */ - projects: Project[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ListProjectsResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListProjectsResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListProjectsResponse; - - static fromJsonString(jsonString: string, options?: Partial): ListProjectsResponse; - - static equals(a: ListProjectsResponse | PlainMessage | undefined, b: ListProjectsResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.UpdateProjectRequest - */ -export declare class UpdateProjectRequest extends Message { - /** - * @generated from field: string id = 1; - */ - id: string; - - /** - * @generated from field: yorkie.v1.UpdatableProjectFields fields = 2; - */ - fields?: UpdatableProjectFields; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.UpdateProjectRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateProjectRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateProjectRequest; - - static fromJsonString(jsonString: string, options?: Partial): UpdateProjectRequest; - - static equals(a: UpdateProjectRequest | PlainMessage | undefined, b: UpdateProjectRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.UpdateProjectResponse - */ -export declare class UpdateProjectResponse extends Message { - /** - * @generated from field: yorkie.v1.Project project = 1; - */ - project?: Project; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.UpdateProjectResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdateProjectResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdateProjectResponse; - - static fromJsonString(jsonString: string, options?: Partial): UpdateProjectResponse; - - static equals(a: UpdateProjectResponse | PlainMessage | undefined, b: UpdateProjectResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ListDocumentsRequest - */ -export declare class ListDocumentsRequest extends Message { - /** - * @generated from field: string project_name = 1; - */ - projectName: string; - - /** - * @generated from field: string previous_id = 2; - */ - previousId: string; - - /** - * @generated from field: int32 page_size = 3; - */ - pageSize: number; - - /** - * @generated from field: bool is_forward = 4; - */ - isForward: boolean; - - /** - * @generated from field: bool include_snapshot = 5; - */ - includeSnapshot: boolean; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ListDocumentsRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsRequest; - - static fromJsonString(jsonString: string, options?: Partial): ListDocumentsRequest; - - static equals(a: ListDocumentsRequest | PlainMessage | undefined, b: ListDocumentsRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ListDocumentsResponse - */ -export declare class ListDocumentsResponse extends Message { - /** - * @generated from field: repeated yorkie.v1.DocumentSummary documents = 1; - */ - documents: DocumentSummary[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ListDocumentsResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsResponse; - - static fromJsonString(jsonString: string, options?: Partial): ListDocumentsResponse; - - static equals(a: ListDocumentsResponse | PlainMessage | undefined, b: ListDocumentsResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetDocumentRequest - */ -export declare class GetDocumentRequest extends Message { - /** - * @generated from field: string project_name = 1; - */ - projectName: string; - - /** - * @generated from field: string document_key = 2; - */ - documentKey: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetDocumentRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetDocumentRequest; - - static equals(a: GetDocumentRequest | PlainMessage | undefined, b: GetDocumentRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetDocumentResponse - */ -export declare class GetDocumentResponse extends Message { - /** - * @generated from field: yorkie.v1.DocumentSummary document = 1; - */ - document?: DocumentSummary; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetDocumentResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetDocumentResponse; - - static equals(a: GetDocumentResponse | PlainMessage | undefined, b: GetDocumentResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetDocumentsRequest - */ -export declare class GetDocumentsRequest extends Message { - /** - * @generated from field: string project_name = 1; - */ - projectName: string; - - /** - * @generated from field: repeated string document_keys = 2; - */ - documentKeys: string[]; - - /** - * @generated from field: bool include_snapshot = 3; - */ - includeSnapshot: boolean; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetDocumentsRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentsRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentsRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetDocumentsRequest; - - static equals(a: GetDocumentsRequest | PlainMessage | undefined, b: GetDocumentsRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetDocumentsResponse - */ -export declare class GetDocumentsResponse extends Message { - /** - * @generated from field: repeated yorkie.v1.DocumentSummary documents = 1; - */ - documents: DocumentSummary[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetDocumentsResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentsResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentsResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetDocumentsResponse; - - static equals(a: GetDocumentsResponse | PlainMessage | undefined, b: GetDocumentsResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.RemoveDocumentByAdminRequest - */ -export declare class RemoveDocumentByAdminRequest extends Message { - /** - * @generated from field: string project_name = 1; - */ - projectName: string; - - /** - * @generated from field: string document_key = 2; - */ - documentKey: string; - - /** - * @generated from field: bool force = 3; - */ - force: boolean; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.RemoveDocumentByAdminRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): RemoveDocumentByAdminRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): RemoveDocumentByAdminRequest; - - static fromJsonString(jsonString: string, options?: Partial): RemoveDocumentByAdminRequest; - - static equals(a: RemoveDocumentByAdminRequest | PlainMessage | undefined, b: RemoveDocumentByAdminRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.RemoveDocumentByAdminResponse - */ -export declare class RemoveDocumentByAdminResponse extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.RemoveDocumentByAdminResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): RemoveDocumentByAdminResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): RemoveDocumentByAdminResponse; - - static fromJsonString(jsonString: string, options?: Partial): RemoveDocumentByAdminResponse; - - static equals(a: RemoveDocumentByAdminResponse | PlainMessage | undefined, b: RemoveDocumentByAdminResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetSnapshotMetaRequest - */ -export declare class GetSnapshotMetaRequest extends Message { - /** - * @generated from field: string project_name = 1; - */ - projectName: string; - - /** - * @generated from field: string document_key = 2; - */ - documentKey: string; - - /** - * @generated from field: int64 server_seq = 3 [jstype = JS_STRING]; - */ - serverSeq: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetSnapshotMetaRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSnapshotMetaRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSnapshotMetaRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetSnapshotMetaRequest; - - static equals(a: GetSnapshotMetaRequest | PlainMessage | undefined, b: GetSnapshotMetaRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetSnapshotMetaResponse - */ -export declare class GetSnapshotMetaResponse extends Message { - /** - * @generated from field: bytes snapshot = 1; - */ - snapshot: Uint8Array; - - /** - * @generated from field: int64 lamport = 2 [jstype = JS_STRING]; - */ - lamport: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetSnapshotMetaResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetSnapshotMetaResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetSnapshotMetaResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetSnapshotMetaResponse; - - static equals(a: GetSnapshotMetaResponse | PlainMessage | undefined, b: GetSnapshotMetaResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.SearchDocumentsRequest - */ -export declare class SearchDocumentsRequest extends Message { - /** - * @generated from field: string project_name = 1; - */ - projectName: string; - - /** - * @generated from field: string query = 2; - */ - query: string; - - /** - * @generated from field: int32 page_size = 3; - */ - pageSize: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.SearchDocumentsRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): SearchDocumentsRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): SearchDocumentsRequest; - - static fromJsonString(jsonString: string, options?: Partial): SearchDocumentsRequest; - - static equals(a: SearchDocumentsRequest | PlainMessage | undefined, b: SearchDocumentsRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.SearchDocumentsResponse - */ -export declare class SearchDocumentsResponse extends Message { - /** - * @generated from field: int32 total_count = 1; - */ - totalCount: number; - - /** - * @generated from field: repeated yorkie.v1.DocumentSummary documents = 2; - */ - documents: DocumentSummary[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.SearchDocumentsResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): SearchDocumentsResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): SearchDocumentsResponse; - - static fromJsonString(jsonString: string, options?: Partial): SearchDocumentsResponse; - - static equals(a: SearchDocumentsResponse | PlainMessage | undefined, b: SearchDocumentsResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ListChangesRequest - */ -export declare class ListChangesRequest extends Message { - /** - * @generated from field: string project_name = 1; - */ - projectName: string; - - /** - * @generated from field: string document_key = 2; - */ - documentKey: string; - - /** - * @generated from field: int64 previous_seq = 3 [jstype = JS_STRING]; - */ - previousSeq: string; - - /** - * @generated from field: int32 page_size = 4; - */ - pageSize: number; - - /** - * @generated from field: bool is_forward = 5; - */ - isForward: boolean; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ListChangesRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListChangesRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListChangesRequest; - - static fromJsonString(jsonString: string, options?: Partial): ListChangesRequest; - - static equals(a: ListChangesRequest | PlainMessage | undefined, b: ListChangesRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ListChangesResponse - */ -export declare class ListChangesResponse extends Message { - /** - * @generated from field: repeated yorkie.v1.Change changes = 1; - */ - changes: Change[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ListChangesResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ListChangesResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): ListChangesResponse; - - static fromJsonString(jsonString: string, options?: Partial): ListChangesResponse; - - static equals(a: ListChangesResponse | PlainMessage | undefined, b: ListChangesResponse | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetServerVersionRequest - */ -export declare class GetServerVersionRequest extends Message { - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetServerVersionRequest"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetServerVersionRequest; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetServerVersionRequest; - - static fromJsonString(jsonString: string, options?: Partial): GetServerVersionRequest; - - static equals(a: GetServerVersionRequest | PlainMessage | undefined, b: GetServerVersionRequest | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.GetServerVersionResponse - */ -export declare class GetServerVersionResponse extends Message { - /** - * @generated from field: string yorkie_version = 1; - */ - yorkieVersion: string; - - /** - * @generated from field: string go_version = 2; - */ - goVersion: string; - - /** - * @generated from field: string build_date = 3; - */ - buildDate: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.GetServerVersionResponse"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): GetServerVersionResponse; - - static fromJson(jsonValue: JsonValue, options?: Partial): GetServerVersionResponse; - - static fromJsonString(jsonString: string, options?: Partial): GetServerVersionResponse; - - static equals(a: GetServerVersionResponse | PlainMessage | undefined, b: GetServerVersionResponse | PlainMessage | undefined): boolean; -} - diff --git a/src/api/yorkie/v1/admin_pb.js b/src/api/yorkie/v1/admin_pb.js deleted file mode 100644 index 8b7b2ac..0000000 --- a/src/api/yorkie/v1/admin_pb.js +++ /dev/null @@ -1,360 +0,0 @@ -// -// Copyright 2022 The Yorkie Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.10.0 with parameter "target=js+dts,js_import_style=module" -// @generated from file src/api/yorkie/v1/admin.proto (package yorkie.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3 } from "@bufbuild/protobuf"; -import { Change, DocumentSummary, Project, UpdatableProjectFields, User } from "./resources_pb.js"; - -/** - * @generated from message yorkie.v1.SignUpRequest - */ -export const SignUpRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.SignUpRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.SignUpResponse - */ -export const SignUpResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.SignUpResponse", - () => [ - { no: 1, name: "user", kind: "message", T: User }, - ], -); - -/** - * @generated from message yorkie.v1.LogInRequest - */ -export const LogInRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.LogInRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.LogInResponse - */ -export const LogInResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.LogInResponse", - () => [ - { no: 1, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.DeleteAccountRequest - */ -export const DeleteAccountRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.DeleteAccountRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.DeleteAccountResponse - */ -export const DeleteAccountResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.DeleteAccountResponse", - [], -); - -/** - * @generated from message yorkie.v1.ChangePasswordRequest - */ -export const ChangePasswordRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ChangePasswordRequest", - () => [ - { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "current_password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "new_password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.ChangePasswordResponse - */ -export const ChangePasswordResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ChangePasswordResponse", - [], -); - -/** - * @generated from message yorkie.v1.CreateProjectRequest - */ -export const CreateProjectRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.CreateProjectRequest", - () => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.CreateProjectResponse - */ -export const CreateProjectResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.CreateProjectResponse", - () => [ - { no: 1, name: "project", kind: "message", T: Project }, - ], -); - -/** - * @generated from message yorkie.v1.GetProjectRequest - */ -export const GetProjectRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetProjectRequest", - () => [ - { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.GetProjectResponse - */ -export const GetProjectResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetProjectResponse", - () => [ - { no: 1, name: "project", kind: "message", T: Project }, - ], -); - -/** - * @generated from message yorkie.v1.ListProjectsRequest - */ -export const ListProjectsRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ListProjectsRequest", - [], -); - -/** - * @generated from message yorkie.v1.ListProjectsResponse - */ -export const ListProjectsResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ListProjectsResponse", - () => [ - { no: 1, name: "projects", kind: "message", T: Project, repeated: true }, - ], -); - -/** - * @generated from message yorkie.v1.UpdateProjectRequest - */ -export const UpdateProjectRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.UpdateProjectRequest", - () => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "fields", kind: "message", T: UpdatableProjectFields }, - ], -); - -/** - * @generated from message yorkie.v1.UpdateProjectResponse - */ -export const UpdateProjectResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.UpdateProjectResponse", - () => [ - { no: 1, name: "project", kind: "message", T: Project }, - ], -); - -/** - * @generated from message yorkie.v1.ListDocumentsRequest - */ -export const ListDocumentsRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ListDocumentsRequest", - () => [ - { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "previous_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 4, name: "is_forward", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 5, name: "include_snapshot", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ], -); - -/** - * @generated from message yorkie.v1.ListDocumentsResponse - */ -export const ListDocumentsResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ListDocumentsResponse", - () => [ - { no: 1, name: "documents", kind: "message", T: DocumentSummary, repeated: true }, - ], -); - -/** - * @generated from message yorkie.v1.GetDocumentRequest - */ -export const GetDocumentRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetDocumentRequest", - () => [ - { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.GetDocumentResponse - */ -export const GetDocumentResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetDocumentResponse", - () => [ - { no: 1, name: "document", kind: "message", T: DocumentSummary }, - ], -); - -/** - * @generated from message yorkie.v1.GetDocumentsRequest - */ -export const GetDocumentsRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetDocumentsRequest", - () => [ - { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "document_keys", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 3, name: "include_snapshot", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ], -); - -/** - * @generated from message yorkie.v1.GetDocumentsResponse - */ -export const GetDocumentsResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetDocumentsResponse", - () => [ - { no: 1, name: "documents", kind: "message", T: DocumentSummary, repeated: true }, - ], -); - -/** - * @generated from message yorkie.v1.RemoveDocumentByAdminRequest - */ -export const RemoveDocumentByAdminRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.RemoveDocumentByAdminRequest", - () => [ - { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "force", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ], -); - -/** - * @generated from message yorkie.v1.RemoveDocumentByAdminResponse - */ -export const RemoveDocumentByAdminResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.RemoveDocumentByAdminResponse", - [], -); - -/** - * @generated from message yorkie.v1.GetSnapshotMetaRequest - */ -export const GetSnapshotMetaRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetSnapshotMetaRequest", - () => [ - { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "server_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */, L: 1 /* LongType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.GetSnapshotMetaResponse - */ -export const GetSnapshotMetaResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetSnapshotMetaResponse", - () => [ - { no: 1, name: "snapshot", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 2, name: "lamport", kind: "scalar", T: 3 /* ScalarType.INT64 */, L: 1 /* LongType.STRING */ }, - ], -); - -/** - * @generated from message yorkie.v1.SearchDocumentsRequest - */ -export const SearchDocumentsRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.SearchDocumentsRequest", - () => [ - { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "query", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - -/** - * @generated from message yorkie.v1.SearchDocumentsResponse - */ -export const SearchDocumentsResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.SearchDocumentsResponse", - () => [ - { no: 1, name: "total_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 2, name: "documents", kind: "message", T: DocumentSummary, repeated: true }, - ], -); - -/** - * @generated from message yorkie.v1.ListChangesRequest - */ -export const ListChangesRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ListChangesRequest", - () => [ - { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "previous_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */, L: 1 /* LongType.STRING */ }, - { no: 4, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 5, name: "is_forward", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ], -); - -/** - * @generated from message yorkie.v1.ListChangesResponse - */ -export const ListChangesResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ListChangesResponse", - () => [ - { no: 1, name: "changes", kind: "message", T: Change, repeated: true }, - ], -); - -/** - * @generated from message yorkie.v1.GetServerVersionRequest - */ -export const GetServerVersionRequest = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetServerVersionRequest", - [], -); - -/** - * @generated from message yorkie.v1.GetServerVersionResponse - */ -export const GetServerVersionResponse = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.GetServerVersionResponse", - () => [ - { no: 1, name: "yorkie_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "go_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "build_date", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ], -); - diff --git a/src/api/yorkie/v1/admin_pb.ts b/src/api/yorkie/v1/admin_pb.ts new file mode 100644 index 0000000..5412a97 --- /dev/null +++ b/src/api/yorkie/v1/admin_pb.ts @@ -0,0 +1,1346 @@ +// +// Copyright 2022 The Yorkie Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=none" +// @generated from file src/api/yorkie/v1/admin.proto (package yorkie.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; +import { Change, DocumentSummary, Project, UpdatableProjectFields, User, VersionVector } from "./resources_pb"; + +/** + * @generated from message yorkie.v1.SignUpRequest + */ +export class SignUpRequest extends Message { + /** + * @generated from field: string username = 1; + */ + username = ""; + + /** + * @generated from field: string password = 2; + */ + password = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.SignUpRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SignUpRequest { + return new SignUpRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SignUpRequest { + return new SignUpRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SignUpRequest { + return new SignUpRequest().fromJsonString(jsonString, options); + } + + static equals(a: SignUpRequest | PlainMessage | undefined, b: SignUpRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SignUpRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.SignUpResponse + */ +export class SignUpResponse extends Message { + /** + * @generated from field: yorkie.v1.User user = 1; + */ + user?: User; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.SignUpResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "user", kind: "message", T: User }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SignUpResponse { + return new SignUpResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SignUpResponse { + return new SignUpResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SignUpResponse { + return new SignUpResponse().fromJsonString(jsonString, options); + } + + static equals(a: SignUpResponse | PlainMessage | undefined, b: SignUpResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SignUpResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.LogInRequest + */ +export class LogInRequest extends Message { + /** + * @generated from field: string username = 1; + */ + username = ""; + + /** + * @generated from field: string password = 2; + */ + password = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.LogInRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LogInRequest { + return new LogInRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LogInRequest { + return new LogInRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LogInRequest { + return new LogInRequest().fromJsonString(jsonString, options); + } + + static equals(a: LogInRequest | PlainMessage | undefined, b: LogInRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(LogInRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.LogInResponse + */ +export class LogInResponse extends Message { + /** + * @generated from field: string token = 1; + */ + token = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.LogInResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): LogInResponse { + return new LogInResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): LogInResponse { + return new LogInResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): LogInResponse { + return new LogInResponse().fromJsonString(jsonString, options); + } + + static equals(a: LogInResponse | PlainMessage | undefined, b: LogInResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(LogInResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.DeleteAccountRequest + */ +export class DeleteAccountRequest extends Message { + /** + * @generated from field: string username = 1; + */ + username = ""; + + /** + * @generated from field: string password = 2; + */ + password = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.DeleteAccountRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAccountRequest { + return new DeleteAccountRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAccountRequest { + return new DeleteAccountRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteAccountRequest { + return new DeleteAccountRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteAccountRequest | PlainMessage | undefined, b: DeleteAccountRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteAccountRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.DeleteAccountResponse + */ +export class DeleteAccountResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.DeleteAccountResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteAccountResponse { + return new DeleteAccountResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteAccountResponse { + return new DeleteAccountResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteAccountResponse { + return new DeleteAccountResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteAccountResponse | PlainMessage | undefined, b: DeleteAccountResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteAccountResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.ChangePasswordRequest + */ +export class ChangePasswordRequest extends Message { + /** + * @generated from field: string username = 1; + */ + username = ""; + + /** + * @generated from field: string current_password = 2; + */ + currentPassword = ""; + + /** + * @generated from field: string new_password = 3; + */ + newPassword = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ChangePasswordRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "current_password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "new_password", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangePasswordRequest { + return new ChangePasswordRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangePasswordRequest { + return new ChangePasswordRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangePasswordRequest { + return new ChangePasswordRequest().fromJsonString(jsonString, options); + } + + static equals(a: ChangePasswordRequest | PlainMessage | undefined, b: ChangePasswordRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ChangePasswordRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.ChangePasswordResponse + */ +export class ChangePasswordResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ChangePasswordResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangePasswordResponse { + return new ChangePasswordResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangePasswordResponse { + return new ChangePasswordResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangePasswordResponse { + return new ChangePasswordResponse().fromJsonString(jsonString, options); + } + + static equals(a: ChangePasswordResponse | PlainMessage | undefined, b: ChangePasswordResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ChangePasswordResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.CreateProjectRequest + */ +export class CreateProjectRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.CreateProjectRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateProjectRequest { + return new CreateProjectRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateProjectRequest { + return new CreateProjectRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateProjectRequest { + return new CreateProjectRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateProjectRequest | PlainMessage | undefined, b: CreateProjectRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateProjectRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.CreateProjectResponse + */ +export class CreateProjectResponse extends Message { + /** + * @generated from field: yorkie.v1.Project project = 1; + */ + project?: Project; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.CreateProjectResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project", kind: "message", T: Project }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateProjectResponse { + return new CreateProjectResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateProjectResponse { + return new CreateProjectResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateProjectResponse { + return new CreateProjectResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateProjectResponse | PlainMessage | undefined, b: CreateProjectResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateProjectResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetProjectRequest + */ +export class GetProjectRequest extends Message { + /** + * @generated from field: string name = 1; + */ + name = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetProjectRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProjectRequest { + return new GetProjectRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProjectRequest { + return new GetProjectRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProjectRequest { + return new GetProjectRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetProjectRequest | PlainMessage | undefined, b: GetProjectRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProjectRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetProjectResponse + */ +export class GetProjectResponse extends Message { + /** + * @generated from field: yorkie.v1.Project project = 1; + */ + project?: Project; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetProjectResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project", kind: "message", T: Project }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetProjectResponse { + return new GetProjectResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetProjectResponse { + return new GetProjectResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetProjectResponse { + return new GetProjectResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetProjectResponse | PlainMessage | undefined, b: GetProjectResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetProjectResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.ListProjectsRequest + */ +export class ListProjectsRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ListProjectsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListProjectsRequest { + return new ListProjectsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListProjectsRequest { + return new ListProjectsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListProjectsRequest { + return new ListProjectsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListProjectsRequest | PlainMessage | undefined, b: ListProjectsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListProjectsRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.ListProjectsResponse + */ +export class ListProjectsResponse extends Message { + /** + * @generated from field: repeated yorkie.v1.Project projects = 1; + */ + projects: Project[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ListProjectsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "projects", kind: "message", T: Project, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListProjectsResponse { + return new ListProjectsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListProjectsResponse { + return new ListProjectsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListProjectsResponse { + return new ListProjectsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListProjectsResponse | PlainMessage | undefined, b: ListProjectsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListProjectsResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.UpdateProjectRequest + */ +export class UpdateProjectRequest extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: yorkie.v1.UpdatableProjectFields fields = 2; + */ + fields?: UpdatableProjectFields; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.UpdateProjectRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "fields", kind: "message", T: UpdatableProjectFields }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateProjectRequest { + return new UpdateProjectRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateProjectRequest { + return new UpdateProjectRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateProjectRequest { + return new UpdateProjectRequest().fromJsonString(jsonString, options); + } + + static equals(a: UpdateProjectRequest | PlainMessage | undefined, b: UpdateProjectRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateProjectRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.UpdateProjectResponse + */ +export class UpdateProjectResponse extends Message { + /** + * @generated from field: yorkie.v1.Project project = 1; + */ + project?: Project; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.UpdateProjectResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project", kind: "message", T: Project }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdateProjectResponse { + return new UpdateProjectResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdateProjectResponse { + return new UpdateProjectResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdateProjectResponse { + return new UpdateProjectResponse().fromJsonString(jsonString, options); + } + + static equals(a: UpdateProjectResponse | PlainMessage | undefined, b: UpdateProjectResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdateProjectResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.ListDocumentsRequest + */ +export class ListDocumentsRequest extends Message { + /** + * @generated from field: string project_name = 1; + */ + projectName = ""; + + /** + * @generated from field: string previous_id = 2; + */ + previousId = ""; + + /** + * @generated from field: int32 page_size = 3; + */ + pageSize = 0; + + /** + * @generated from field: bool is_forward = 4; + */ + isForward = false; + + /** + * @generated from field: bool include_snapshot = 5; + */ + includeSnapshot = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ListDocumentsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "previous_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 4, name: "is_forward", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 5, name: "include_snapshot", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsRequest { + return new ListDocumentsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsRequest { + return new ListDocumentsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentsRequest { + return new ListDocumentsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentsRequest | PlainMessage | undefined, b: ListDocumentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentsRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.ListDocumentsResponse + */ +export class ListDocumentsResponse extends Message { + /** + * @generated from field: repeated yorkie.v1.DocumentSummary documents = 1; + */ + documents: DocumentSummary[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ListDocumentsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "documents", kind: "message", T: DocumentSummary, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListDocumentsResponse { + return new ListDocumentsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListDocumentsResponse { + return new ListDocumentsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListDocumentsResponse { + return new ListDocumentsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListDocumentsResponse | PlainMessage | undefined, b: ListDocumentsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListDocumentsResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetDocumentRequest + */ +export class GetDocumentRequest extends Message { + /** + * @generated from field: string project_name = 1; + */ + projectName = ""; + + /** + * @generated from field: string document_key = 2; + */ + documentKey = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetDocumentRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentRequest { + return new GetDocumentRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentRequest { + return new GetDocumentRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDocumentRequest { + return new GetDocumentRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetDocumentRequest | PlainMessage | undefined, b: GetDocumentRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDocumentRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetDocumentResponse + */ +export class GetDocumentResponse extends Message { + /** + * @generated from field: yorkie.v1.DocumentSummary document = 1; + */ + document?: DocumentSummary; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetDocumentResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document", kind: "message", T: DocumentSummary }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentResponse { + return new GetDocumentResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentResponse { + return new GetDocumentResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDocumentResponse { + return new GetDocumentResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetDocumentResponse | PlainMessage | undefined, b: GetDocumentResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDocumentResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetDocumentsRequest + */ +export class GetDocumentsRequest extends Message { + /** + * @generated from field: string project_name = 1; + */ + projectName = ""; + + /** + * @generated from field: repeated string document_keys = 2; + */ + documentKeys: string[] = []; + + /** + * @generated from field: bool include_snapshot = 3; + */ + includeSnapshot = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetDocumentsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "document_keys", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 3, name: "include_snapshot", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentsRequest { + return new GetDocumentsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentsRequest { + return new GetDocumentsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDocumentsRequest { + return new GetDocumentsRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetDocumentsRequest | PlainMessage | undefined, b: GetDocumentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDocumentsRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetDocumentsResponse + */ +export class GetDocumentsResponse extends Message { + /** + * @generated from field: repeated yorkie.v1.DocumentSummary documents = 1; + */ + documents: DocumentSummary[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetDocumentsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "documents", kind: "message", T: DocumentSummary, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetDocumentsResponse { + return new GetDocumentsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetDocumentsResponse { + return new GetDocumentsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetDocumentsResponse { + return new GetDocumentsResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetDocumentsResponse | PlainMessage | undefined, b: GetDocumentsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetDocumentsResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.RemoveDocumentByAdminRequest + */ +export class RemoveDocumentByAdminRequest extends Message { + /** + * @generated from field: string project_name = 1; + */ + projectName = ""; + + /** + * @generated from field: string document_key = 2; + */ + documentKey = ""; + + /** + * @generated from field: bool force = 3; + */ + force = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.RemoveDocumentByAdminRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "force", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RemoveDocumentByAdminRequest { + return new RemoveDocumentByAdminRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RemoveDocumentByAdminRequest { + return new RemoveDocumentByAdminRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RemoveDocumentByAdminRequest { + return new RemoveDocumentByAdminRequest().fromJsonString(jsonString, options); + } + + static equals(a: RemoveDocumentByAdminRequest | PlainMessage | undefined, b: RemoveDocumentByAdminRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(RemoveDocumentByAdminRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.RemoveDocumentByAdminResponse + */ +export class RemoveDocumentByAdminResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.RemoveDocumentByAdminResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RemoveDocumentByAdminResponse { + return new RemoveDocumentByAdminResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RemoveDocumentByAdminResponse { + return new RemoveDocumentByAdminResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RemoveDocumentByAdminResponse { + return new RemoveDocumentByAdminResponse().fromJsonString(jsonString, options); + } + + static equals(a: RemoveDocumentByAdminResponse | PlainMessage | undefined, b: RemoveDocumentByAdminResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(RemoveDocumentByAdminResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetSnapshotMetaRequest + */ +export class GetSnapshotMetaRequest extends Message { + /** + * @generated from field: string project_name = 1; + */ + projectName = ""; + + /** + * @generated from field: string document_key = 2; + */ + documentKey = ""; + + /** + * @generated from field: int64 server_seq = 3; + */ + serverSeq = protoInt64.zero; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetSnapshotMetaRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "server_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSnapshotMetaRequest { + return new GetSnapshotMetaRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSnapshotMetaRequest { + return new GetSnapshotMetaRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSnapshotMetaRequest { + return new GetSnapshotMetaRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetSnapshotMetaRequest | PlainMessage | undefined, b: GetSnapshotMetaRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSnapshotMetaRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetSnapshotMetaResponse + */ +export class GetSnapshotMetaResponse extends Message { + /** + * @generated from field: bytes snapshot = 1; + */ + snapshot = new Uint8Array(0); + + /** + * @generated from field: int64 lamport = 2; + */ + lamport = protoInt64.zero; + + /** + * @generated from field: yorkie.v1.VersionVector version_vector = 3; + */ + versionVector?: VersionVector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetSnapshotMetaResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "snapshot", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 2, name: "lamport", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "version_vector", kind: "message", T: VersionVector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetSnapshotMetaResponse { + return new GetSnapshotMetaResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetSnapshotMetaResponse { + return new GetSnapshotMetaResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetSnapshotMetaResponse { + return new GetSnapshotMetaResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetSnapshotMetaResponse | PlainMessage | undefined, b: GetSnapshotMetaResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetSnapshotMetaResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.SearchDocumentsRequest + */ +export class SearchDocumentsRequest extends Message { + /** + * @generated from field: string project_name = 1; + */ + projectName = ""; + + /** + * @generated from field: string query = 2; + */ + query = ""; + + /** + * @generated from field: int32 page_size = 3; + */ + pageSize = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.SearchDocumentsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "query", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SearchDocumentsRequest { + return new SearchDocumentsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SearchDocumentsRequest { + return new SearchDocumentsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SearchDocumentsRequest { + return new SearchDocumentsRequest().fromJsonString(jsonString, options); + } + + static equals(a: SearchDocumentsRequest | PlainMessage | undefined, b: SearchDocumentsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SearchDocumentsRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.SearchDocumentsResponse + */ +export class SearchDocumentsResponse extends Message { + /** + * @generated from field: int32 total_count = 1; + */ + totalCount = 0; + + /** + * @generated from field: repeated yorkie.v1.DocumentSummary documents = 2; + */ + documents: DocumentSummary[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.SearchDocumentsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "total_count", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 2, name: "documents", kind: "message", T: DocumentSummary, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SearchDocumentsResponse { + return new SearchDocumentsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SearchDocumentsResponse { + return new SearchDocumentsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SearchDocumentsResponse { + return new SearchDocumentsResponse().fromJsonString(jsonString, options); + } + + static equals(a: SearchDocumentsResponse | PlainMessage | undefined, b: SearchDocumentsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SearchDocumentsResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.ListChangesRequest + */ +export class ListChangesRequest extends Message { + /** + * @generated from field: string project_name = 1; + */ + projectName = ""; + + /** + * @generated from field: string document_key = 2; + */ + documentKey = ""; + + /** + * @generated from field: int64 previous_seq = 3; + */ + previousSeq = protoInt64.zero; + + /** + * @generated from field: int32 page_size = 4; + */ + pageSize = 0; + + /** + * @generated from field: bool is_forward = 5; + */ + isForward = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ListChangesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "project_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "previous_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "page_size", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 5, name: "is_forward", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListChangesRequest { + return new ListChangesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListChangesRequest { + return new ListChangesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListChangesRequest { + return new ListChangesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListChangesRequest | PlainMessage | undefined, b: ListChangesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListChangesRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.ListChangesResponse + */ +export class ListChangesResponse extends Message { + /** + * @generated from field: repeated yorkie.v1.Change changes = 1; + */ + changes: Change[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ListChangesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "changes", kind: "message", T: Change, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListChangesResponse { + return new ListChangesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListChangesResponse { + return new ListChangesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListChangesResponse { + return new ListChangesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListChangesResponse | PlainMessage | undefined, b: ListChangesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListChangesResponse, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetServerVersionRequest + */ +export class GetServerVersionRequest extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetServerVersionRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetServerVersionRequest { + return new GetServerVersionRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetServerVersionRequest { + return new GetServerVersionRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetServerVersionRequest { + return new GetServerVersionRequest().fromJsonString(jsonString, options); + } + + static equals(a: GetServerVersionRequest | PlainMessage | undefined, b: GetServerVersionRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(GetServerVersionRequest, a, b); + } +} + +/** + * @generated from message yorkie.v1.GetServerVersionResponse + */ +export class GetServerVersionResponse extends Message { + /** + * @generated from field: string yorkie_version = 1; + */ + yorkieVersion = ""; + + /** + * @generated from field: string go_version = 2; + */ + goVersion = ""; + + /** + * @generated from field: string build_date = 3; + */ + buildDate = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.GetServerVersionResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "yorkie_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "go_version", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "build_date", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): GetServerVersionResponse { + return new GetServerVersionResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): GetServerVersionResponse { + return new GetServerVersionResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): GetServerVersionResponse { + return new GetServerVersionResponse().fromJsonString(jsonString, options); + } + + static equals(a: GetServerVersionResponse | PlainMessage | undefined, b: GetServerVersionResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(GetServerVersionResponse, a, b); + } +} + diff --git a/src/api/yorkie/v1/resources.proto b/src/api/yorkie/v1/resources.proto index d1a8c37..aac7681 100644 --- a/src/api/yorkie/v1/resources.proto +++ b/src/api/yorkie/v1/resources.proto @@ -46,6 +46,7 @@ message ChangePack { repeated Change changes = 4; TimeTicket min_synced_ticket = 5; bool is_removed = 6; + VersionVector version_vector = 7; } message Change { @@ -57,9 +58,14 @@ message Change { message ChangeID { uint32 client_seq = 1; - int64 server_seq = 2 [jstype = JS_STRING]; - int64 lamport = 3 [jstype = JS_STRING]; + int64 server_seq = 2; + int64 lamport = 3; bytes actor_id = 4; + VersionVector version_vector = 5; +} + +message VersionVector { + map vector = 1; } message Operation { @@ -136,6 +142,12 @@ message Operation { repeated string attributes_to_remove = 6; map created_at_map_by_actor = 7; } + message ArraySet { + TimeTicket parent_created_at = 1; + TimeTicket created_at = 2; + JSONElementSimple value = 3; + TimeTicket executed_at = 4; + } oneof body { Set set = 1; @@ -148,6 +160,7 @@ message Operation { Increase increase = 8; TreeEdit tree_edit = 9; TreeStyle tree_style = 10; + ArraySet array_set = 11; } } @@ -325,7 +338,7 @@ message Presence { } message Checkpoint { - int64 server_seq = 1 [jstype = JS_STRING]; + int64 server_seq = 1; uint32 client_seq = 2; } @@ -336,7 +349,7 @@ message TextNodePos { } message TimeTicket { - int64 lamport = 1 [jstype = JS_STRING]; + int64 lamport = 1; uint32 delimiter = 2; bytes actor_id = 3; } diff --git a/src/api/yorkie/v1/resources_pb.d.ts b/src/api/yorkie/v1/resources_pb.d.ts deleted file mode 100644 index fceb9ce..0000000 --- a/src/api/yorkie/v1/resources_pb.d.ts +++ /dev/null @@ -1,1912 +0,0 @@ -// -// Copyright 2022 The Yorkie Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.10.0 with parameter "target=js+dts,js_import_style=module" -// @generated from file src/api/yorkie/v1/resources.proto (package yorkie.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage, Timestamp } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from enum yorkie.v1.ValueType - */ -export declare enum ValueType { - /** - * @generated from enum value: VALUE_TYPE_NULL = 0; - */ - NULL = 0, - - /** - * @generated from enum value: VALUE_TYPE_BOOLEAN = 1; - */ - BOOLEAN = 1, - - /** - * @generated from enum value: VALUE_TYPE_INTEGER = 2; - */ - INTEGER = 2, - - /** - * @generated from enum value: VALUE_TYPE_LONG = 3; - */ - LONG = 3, - - /** - * @generated from enum value: VALUE_TYPE_DOUBLE = 4; - */ - DOUBLE = 4, - - /** - * @generated from enum value: VALUE_TYPE_STRING = 5; - */ - STRING = 5, - - /** - * @generated from enum value: VALUE_TYPE_BYTES = 6; - */ - BYTES = 6, - - /** - * @generated from enum value: VALUE_TYPE_DATE = 7; - */ - DATE = 7, - - /** - * @generated from enum value: VALUE_TYPE_JSON_OBJECT = 8; - */ - JSON_OBJECT = 8, - - /** - * @generated from enum value: VALUE_TYPE_JSON_ARRAY = 9; - */ - JSON_ARRAY = 9, - - /** - * @generated from enum value: VALUE_TYPE_TEXT = 10; - */ - TEXT = 10, - - /** - * @generated from enum value: VALUE_TYPE_INTEGER_CNT = 11; - */ - INTEGER_CNT = 11, - - /** - * @generated from enum value: VALUE_TYPE_LONG_CNT = 12; - */ - LONG_CNT = 12, - - /** - * @generated from enum value: VALUE_TYPE_TREE = 13; - */ - TREE = 13, -} - -/** - * @generated from enum yorkie.v1.DocEventType - */ -export declare enum DocEventType { - /** - * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_CHANGED = 0; - */ - DOCUMENT_CHANGED = 0, - - /** - * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_WATCHED = 1; - */ - DOCUMENT_WATCHED = 1, - - /** - * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_UNWATCHED = 2; - */ - DOCUMENT_UNWATCHED = 2, - - /** - * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_BROADCAST = 3; - */ - DOCUMENT_BROADCAST = 3, -} - -/** - * /////////////////////////////////////// - * Messages for Snapshot // - * /////////////////////////////////////// - * - * @generated from message yorkie.v1.Snapshot - */ -export declare class Snapshot extends Message { - /** - * @generated from field: yorkie.v1.JSONElement root = 1; - */ - root?: JSONElement; - - /** - * @generated from field: map presences = 2; - */ - presences: { [key: string]: Presence }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Snapshot"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Snapshot; - - static fromJson(jsonValue: JsonValue, options?: Partial): Snapshot; - - static fromJsonString(jsonString: string, options?: Partial): Snapshot; - - static equals(a: Snapshot | PlainMessage | undefined, b: Snapshot | PlainMessage | undefined): boolean; -} - -/** - * ChangePack is a message that contains all changes that occurred in a document. - * It is used to synchronize changes between clients and servers. - * - * @generated from message yorkie.v1.ChangePack - */ -export declare class ChangePack extends Message { - /** - * @generated from field: string document_key = 1; - */ - documentKey: string; - - /** - * @generated from field: yorkie.v1.Checkpoint checkpoint = 2; - */ - checkpoint?: Checkpoint; - - /** - * @generated from field: bytes snapshot = 3; - */ - snapshot: Uint8Array; - - /** - * @generated from field: repeated yorkie.v1.Change changes = 4; - */ - changes: Change[]; - - /** - * @generated from field: yorkie.v1.TimeTicket min_synced_ticket = 5; - */ - minSyncedTicket?: TimeTicket; - - /** - * @generated from field: bool is_removed = 6; - */ - isRemoved: boolean; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ChangePack"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ChangePack; - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangePack; - - static fromJsonString(jsonString: string, options?: Partial): ChangePack; - - static equals(a: ChangePack | PlainMessage | undefined, b: ChangePack | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Change - */ -export declare class Change extends Message { - /** - * @generated from field: yorkie.v1.ChangeID id = 1; - */ - id?: ChangeID; - - /** - * @generated from field: string message = 2; - */ - message: string; - - /** - * @generated from field: repeated yorkie.v1.Operation operations = 3; - */ - operations: Operation[]; - - /** - * @generated from field: yorkie.v1.PresenceChange presence_change = 4; - */ - presenceChange?: PresenceChange; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Change"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Change; - - static fromJson(jsonValue: JsonValue, options?: Partial): Change; - - static fromJsonString(jsonString: string, options?: Partial): Change; - - static equals(a: Change | PlainMessage | undefined, b: Change | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.ChangeID - */ -export declare class ChangeID extends Message { - /** - * @generated from field: uint32 client_seq = 1; - */ - clientSeq: number; - - /** - * @generated from field: int64 server_seq = 2 [jstype = JS_STRING]; - */ - serverSeq: string; - - /** - * @generated from field: int64 lamport = 3 [jstype = JS_STRING]; - */ - lamport: string; - - /** - * @generated from field: bytes actor_id = 4; - */ - actorId: Uint8Array; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.ChangeID"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): ChangeID; - - static fromJson(jsonValue: JsonValue, options?: Partial): ChangeID; - - static fromJsonString(jsonString: string, options?: Partial): ChangeID; - - static equals(a: ChangeID | PlainMessage | undefined, b: ChangeID | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation - */ -export declare class Operation extends Message { - /** - * @generated from oneof yorkie.v1.Operation.body - */ - body: { - /** - * @generated from field: yorkie.v1.Operation.Set set = 1; - */ - value: Operation_Set; - case: "set"; - } | { - /** - * @generated from field: yorkie.v1.Operation.Add add = 2; - */ - value: Operation_Add; - case: "add"; - } | { - /** - * @generated from field: yorkie.v1.Operation.Move move = 3; - */ - value: Operation_Move; - case: "move"; - } | { - /** - * @generated from field: yorkie.v1.Operation.Remove remove = 4; - */ - value: Operation_Remove; - case: "remove"; - } | { - /** - * @generated from field: yorkie.v1.Operation.Edit edit = 5; - */ - value: Operation_Edit; - case: "edit"; - } | { - /** - * @generated from field: yorkie.v1.Operation.Select select = 6; - */ - value: Operation_Select; - case: "select"; - } | { - /** - * @generated from field: yorkie.v1.Operation.Style style = 7; - */ - value: Operation_Style; - case: "style"; - } | { - /** - * @generated from field: yorkie.v1.Operation.Increase increase = 8; - */ - value: Operation_Increase; - case: "increase"; - } | { - /** - * @generated from field: yorkie.v1.Operation.TreeEdit tree_edit = 9; - */ - value: Operation_TreeEdit; - case: "treeEdit"; - } | { - /** - * @generated from field: yorkie.v1.Operation.TreeStyle tree_style = 10; - */ - value: Operation_TreeStyle; - case: "treeStyle"; - } | { case: undefined; value?: undefined }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation; - - static fromJsonString(jsonString: string, options?: Partial): Operation; - - static equals(a: Operation | PlainMessage | undefined, b: Operation | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.Set - */ -export declare class Operation_Set extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: string key = 2; - */ - key: string; - - /** - * @generated from field: yorkie.v1.JSONElementSimple value = 3; - */ - value?: JSONElementSimple; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 4; - */ - executedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Set"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Set; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Set; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Set; - - static equals(a: Operation_Set | PlainMessage | undefined, b: Operation_Set | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.Add - */ -export declare class Operation_Add extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket prev_created_at = 2; - */ - prevCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.JSONElementSimple value = 3; - */ - value?: JSONElementSimple; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 4; - */ - executedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Add"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Add; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Add; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Add; - - static equals(a: Operation_Add | PlainMessage | undefined, b: Operation_Add | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.Move - */ -export declare class Operation_Move extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket prev_created_at = 2; - */ - prevCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 3; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 4; - */ - executedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Move"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Move; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Move; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Move; - - static equals(a: Operation_Move | PlainMessage | undefined, b: Operation_Move | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.Remove - */ -export declare class Operation_Remove extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 2; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 3; - */ - executedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Remove"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Remove; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Remove; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Remove; - - static equals(a: Operation_Remove | PlainMessage | undefined, b: Operation_Remove | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.Edit - */ -export declare class Operation_Edit extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TextNodePos from = 2; - */ - from?: TextNodePos; - - /** - * @generated from field: yorkie.v1.TextNodePos to = 3; - */ - to?: TextNodePos; - - /** - * @generated from field: map created_at_map_by_actor = 4; - */ - createdAtMapByActor: { [key: string]: TimeTicket }; - - /** - * @generated from field: string content = 5; - */ - content: string; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 6; - */ - executedAt?: TimeTicket; - - /** - * @generated from field: map attributes = 7; - */ - attributes: { [key: string]: string }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Edit"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Edit; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Edit; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Edit; - - static equals(a: Operation_Edit | PlainMessage | undefined, b: Operation_Edit | PlainMessage | undefined): boolean; -} - -/** - * NOTE(hackerwins): Select Operation is not used in the current version. - * In the previous version, it was used to represent selection of Text. - * However, it has been replaced by Presence now. It is retained for backward - * compatibility purposes. - * - * @generated from message yorkie.v1.Operation.Select - */ -export declare class Operation_Select extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TextNodePos from = 2; - */ - from?: TextNodePos; - - /** - * @generated from field: yorkie.v1.TextNodePos to = 3; - */ - to?: TextNodePos; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 4; - */ - executedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Select"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Select; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Select; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Select; - - static equals(a: Operation_Select | PlainMessage | undefined, b: Operation_Select | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.Style - */ -export declare class Operation_Style extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TextNodePos from = 2; - */ - from?: TextNodePos; - - /** - * @generated from field: yorkie.v1.TextNodePos to = 3; - */ - to?: TextNodePos; - - /** - * @generated from field: map attributes = 4; - */ - attributes: { [key: string]: string }; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 5; - */ - executedAt?: TimeTicket; - - /** - * @generated from field: map created_at_map_by_actor = 6; - */ - createdAtMapByActor: { [key: string]: TimeTicket }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Style"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Style; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Style; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Style; - - static equals(a: Operation_Style | PlainMessage | undefined, b: Operation_Style | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.Increase - */ -export declare class Operation_Increase extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.JSONElementSimple value = 2; - */ - value?: JSONElementSimple; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 3; - */ - executedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.Increase"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Increase; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Increase; - - static fromJsonString(jsonString: string, options?: Partial): Operation_Increase; - - static equals(a: Operation_Increase | PlainMessage | undefined, b: Operation_Increase | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.TreeEdit - */ -export declare class Operation_TreeEdit extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TreePos from = 2; - */ - from?: TreePos; - - /** - * @generated from field: yorkie.v1.TreePos to = 3; - */ - to?: TreePos; - - /** - * @generated from field: map created_at_map_by_actor = 4; - */ - createdAtMapByActor: { [key: string]: TimeTicket }; - - /** - * @generated from field: repeated yorkie.v1.TreeNodes contents = 5; - */ - contents: TreeNodes[]; - - /** - * @generated from field: int32 split_level = 7; - */ - splitLevel: number; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 6; - */ - executedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.TreeEdit"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_TreeEdit; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_TreeEdit; - - static fromJsonString(jsonString: string, options?: Partial): Operation_TreeEdit; - - static equals(a: Operation_TreeEdit | PlainMessage | undefined, b: Operation_TreeEdit | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Operation.TreeStyle - */ -export declare class Operation_TreeStyle extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; - */ - parentCreatedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TreePos from = 2; - */ - from?: TreePos; - - /** - * @generated from field: yorkie.v1.TreePos to = 3; - */ - to?: TreePos; - - /** - * @generated from field: map attributes = 4; - */ - attributes: { [key: string]: string }; - - /** - * @generated from field: yorkie.v1.TimeTicket executed_at = 5; - */ - executedAt?: TimeTicket; - - /** - * @generated from field: repeated string attributes_to_remove = 6; - */ - attributesToRemove: string[]; - - /** - * @generated from field: map created_at_map_by_actor = 7; - */ - createdAtMapByActor: { [key: string]: TimeTicket }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Operation.TreeStyle"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Operation_TreeStyle; - - static fromJson(jsonValue: JsonValue, options?: Partial): Operation_TreeStyle; - - static fromJsonString(jsonString: string, options?: Partial): Operation_TreeStyle; - - static equals(a: Operation_TreeStyle | PlainMessage | undefined, b: Operation_TreeStyle | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElementSimple - */ -export declare class JSONElementSimple extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 1; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket moved_at = 2; - */ - movedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 3; - */ - removedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.ValueType type = 4; - */ - type: ValueType; - - /** - * @generated from field: bytes value = 5; - */ - value: Uint8Array; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElementSimple"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElementSimple; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElementSimple; - - static fromJsonString(jsonString: string, options?: Partial): JSONElementSimple; - - static equals(a: JSONElementSimple | PlainMessage | undefined, b: JSONElementSimple | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElement - */ -export declare class JSONElement extends Message { - /** - * @generated from oneof yorkie.v1.JSONElement.body - */ - body: { - /** - * @generated from field: yorkie.v1.JSONElement.JSONObject json_object = 1; - */ - value: JSONElement_JSONObject; - case: "jsonObject"; - } | { - /** - * @generated from field: yorkie.v1.JSONElement.JSONArray json_array = 2; - */ - value: JSONElement_JSONArray; - case: "jsonArray"; - } | { - /** - * @generated from field: yorkie.v1.JSONElement.Primitive primitive = 3; - */ - value: JSONElement_Primitive; - case: "primitive"; - } | { - /** - * @generated from field: yorkie.v1.JSONElement.Text text = 5; - */ - value: JSONElement_Text; - case: "text"; - } | { - /** - * @generated from field: yorkie.v1.JSONElement.Counter counter = 6; - */ - value: JSONElement_Counter; - case: "counter"; - } | { - /** - * @generated from field: yorkie.v1.JSONElement.Tree tree = 7; - */ - value: JSONElement_Tree; - case: "tree"; - } | { case: undefined; value?: undefined }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElement"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement; - - static fromJsonString(jsonString: string, options?: Partial): JSONElement; - - static equals(a: JSONElement | PlainMessage | undefined, b: JSONElement | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElement.JSONObject - */ -export declare class JSONElement_JSONObject extends Message { - /** - * @generated from field: repeated yorkie.v1.RHTNode nodes = 1; - */ - nodes: RHTNode[]; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 2; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket moved_at = 3; - */ - movedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 4; - */ - removedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElement.JSONObject"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_JSONObject; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_JSONObject; - - static fromJsonString(jsonString: string, options?: Partial): JSONElement_JSONObject; - - static equals(a: JSONElement_JSONObject | PlainMessage | undefined, b: JSONElement_JSONObject | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElement.JSONArray - */ -export declare class JSONElement_JSONArray extends Message { - /** - * @generated from field: repeated yorkie.v1.RGANode nodes = 1; - */ - nodes: RGANode[]; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 2; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket moved_at = 3; - */ - movedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 4; - */ - removedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElement.JSONArray"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_JSONArray; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_JSONArray; - - static fromJsonString(jsonString: string, options?: Partial): JSONElement_JSONArray; - - static equals(a: JSONElement_JSONArray | PlainMessage | undefined, b: JSONElement_JSONArray | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElement.Primitive - */ -export declare class JSONElement_Primitive extends Message { - /** - * @generated from field: yorkie.v1.ValueType type = 1; - */ - type: ValueType; - - /** - * @generated from field: bytes value = 2; - */ - value: Uint8Array; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 3; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket moved_at = 4; - */ - movedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 5; - */ - removedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElement.Primitive"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Primitive; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Primitive; - - static fromJsonString(jsonString: string, options?: Partial): JSONElement_Primitive; - - static equals(a: JSONElement_Primitive | PlainMessage | undefined, b: JSONElement_Primitive | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElement.Text - */ -export declare class JSONElement_Text extends Message { - /** - * @generated from field: repeated yorkie.v1.TextNode nodes = 1; - */ - nodes: TextNode[]; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 2; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket moved_at = 3; - */ - movedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 4; - */ - removedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElement.Text"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Text; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Text; - - static fromJsonString(jsonString: string, options?: Partial): JSONElement_Text; - - static equals(a: JSONElement_Text | PlainMessage | undefined, b: JSONElement_Text | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElement.Counter - */ -export declare class JSONElement_Counter extends Message { - /** - * @generated from field: yorkie.v1.ValueType type = 1; - */ - type: ValueType; - - /** - * @generated from field: bytes value = 2; - */ - value: Uint8Array; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 3; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket moved_at = 4; - */ - movedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 5; - */ - removedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElement.Counter"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Counter; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Counter; - - static fromJsonString(jsonString: string, options?: Partial): JSONElement_Counter; - - static equals(a: JSONElement_Counter | PlainMessage | undefined, b: JSONElement_Counter | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.JSONElement.Tree - */ -export declare class JSONElement_Tree extends Message { - /** - * @generated from field: repeated yorkie.v1.TreeNode nodes = 1; - */ - nodes: TreeNode[]; - - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 2; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket moved_at = 3; - */ - movedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 4; - */ - removedAt?: TimeTicket; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.JSONElement.Tree"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Tree; - - static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Tree; - - static fromJsonString(jsonString: string, options?: Partial): JSONElement_Tree; - - static equals(a: JSONElement_Tree | PlainMessage | undefined, b: JSONElement_Tree | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.RHTNode - */ -export declare class RHTNode extends Message { - /** - * @generated from field: string key = 1; - */ - key: string; - - /** - * @generated from field: yorkie.v1.JSONElement element = 2; - */ - element?: JSONElement; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.RHTNode"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): RHTNode; - - static fromJson(jsonValue: JsonValue, options?: Partial): RHTNode; - - static fromJsonString(jsonString: string, options?: Partial): RHTNode; - - static equals(a: RHTNode | PlainMessage | undefined, b: RHTNode | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.RGANode - */ -export declare class RGANode extends Message { - /** - * @generated from field: yorkie.v1.RGANode next = 1; - */ - next?: RGANode; - - /** - * @generated from field: yorkie.v1.JSONElement element = 2; - */ - element?: JSONElement; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.RGANode"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): RGANode; - - static fromJson(jsonValue: JsonValue, options?: Partial): RGANode; - - static fromJsonString(jsonString: string, options?: Partial): RGANode; - - static equals(a: RGANode | PlainMessage | undefined, b: RGANode | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.NodeAttr - */ -export declare class NodeAttr extends Message { - /** - * @generated from field: string value = 1; - */ - value: string; - - /** - * @generated from field: yorkie.v1.TimeTicket updated_at = 2; - */ - updatedAt?: TimeTicket; - - /** - * @generated from field: bool is_removed = 3; - */ - isRemoved: boolean; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.NodeAttr"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): NodeAttr; - - static fromJson(jsonValue: JsonValue, options?: Partial): NodeAttr; - - static fromJsonString(jsonString: string, options?: Partial): NodeAttr; - - static equals(a: NodeAttr | PlainMessage | undefined, b: NodeAttr | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TextNode - */ -export declare class TextNode extends Message { - /** - * @generated from field: yorkie.v1.TextNodeID id = 1; - */ - id?: TextNodeID; - - /** - * @generated from field: string value = 2; - */ - value: string; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 3; - */ - removedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TextNodeID ins_prev_id = 4; - */ - insPrevId?: TextNodeID; - - /** - * @generated from field: map attributes = 5; - */ - attributes: { [key: string]: NodeAttr }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TextNode"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TextNode; - - static fromJson(jsonValue: JsonValue, options?: Partial): TextNode; - - static fromJsonString(jsonString: string, options?: Partial): TextNode; - - static equals(a: TextNode | PlainMessage | undefined, b: TextNode | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TextNodeID - */ -export declare class TextNodeID extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 1; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: int32 offset = 2; - */ - offset: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TextNodeID"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TextNodeID; - - static fromJson(jsonValue: JsonValue, options?: Partial): TextNodeID; - - static fromJsonString(jsonString: string, options?: Partial): TextNodeID; - - static equals(a: TextNodeID | PlainMessage | undefined, b: TextNodeID | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TreeNode - */ -export declare class TreeNode extends Message { - /** - * @generated from field: yorkie.v1.TreeNodeID id = 1; - */ - id?: TreeNodeID; - - /** - * @generated from field: string type = 2; - */ - type: string; - - /** - * @generated from field: string value = 3; - */ - value: string; - - /** - * @generated from field: yorkie.v1.TimeTicket removed_at = 4; - */ - removedAt?: TimeTicket; - - /** - * @generated from field: yorkie.v1.TreeNodeID ins_prev_id = 5; - */ - insPrevId?: TreeNodeID; - - /** - * @generated from field: yorkie.v1.TreeNodeID ins_next_id = 6; - */ - insNextId?: TreeNodeID; - - /** - * @generated from field: int32 depth = 7; - */ - depth: number; - - /** - * @generated from field: map attributes = 8; - */ - attributes: { [key: string]: NodeAttr }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TreeNode"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TreeNode; - - static fromJson(jsonValue: JsonValue, options?: Partial): TreeNode; - - static fromJsonString(jsonString: string, options?: Partial): TreeNode; - - static equals(a: TreeNode | PlainMessage | undefined, b: TreeNode | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TreeNodes - */ -export declare class TreeNodes extends Message { - /** - * @generated from field: repeated yorkie.v1.TreeNode content = 1; - */ - content: TreeNode[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TreeNodes"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TreeNodes; - - static fromJson(jsonValue: JsonValue, options?: Partial): TreeNodes; - - static fromJsonString(jsonString: string, options?: Partial): TreeNodes; - - static equals(a: TreeNodes | PlainMessage | undefined, b: TreeNodes | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TreeNodeID - */ -export declare class TreeNodeID extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 1; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: int32 offset = 2; - */ - offset: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TreeNodeID"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TreeNodeID; - - static fromJson(jsonValue: JsonValue, options?: Partial): TreeNodeID; - - static fromJsonString(jsonString: string, options?: Partial): TreeNodeID; - - static equals(a: TreeNodeID | PlainMessage | undefined, b: TreeNodeID | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TreePos - */ -export declare class TreePos extends Message { - /** - * @generated from field: yorkie.v1.TreeNodeID parent_id = 1; - */ - parentId?: TreeNodeID; - - /** - * @generated from field: yorkie.v1.TreeNodeID left_sibling_id = 2; - */ - leftSiblingId?: TreeNodeID; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TreePos"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TreePos; - - static fromJson(jsonValue: JsonValue, options?: Partial): TreePos; - - static fromJsonString(jsonString: string, options?: Partial): TreePos; - - static equals(a: TreePos | PlainMessage | undefined, b: TreePos | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.User - */ -export declare class User extends Message { - /** - * @generated from field: string id = 1; - */ - id: string; - - /** - * @generated from field: string username = 2; - */ - username: string; - - /** - * @generated from field: google.protobuf.Timestamp created_at = 3; - */ - createdAt?: Timestamp; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.User"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): User; - - static fromJson(jsonValue: JsonValue, options?: Partial): User; - - static fromJsonString(jsonString: string, options?: Partial): User; - - static equals(a: User | PlainMessage | undefined, b: User | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Project - */ -export declare class Project extends Message { - /** - * @generated from field: string id = 1; - */ - id: string; - - /** - * @generated from field: string name = 2; - */ - name: string; - - /** - * @generated from field: string public_key = 3; - */ - publicKey: string; - - /** - * @generated from field: string secret_key = 4; - */ - secretKey: string; - - /** - * @generated from field: string auth_webhook_url = 5; - */ - authWebhookUrl: string; - - /** - * @generated from field: repeated string auth_webhook_methods = 6; - */ - authWebhookMethods: string[]; - - /** - * @generated from field: string client_deactivate_threshold = 7; - */ - clientDeactivateThreshold: string; - - /** - * @generated from field: google.protobuf.Timestamp created_at = 8; - */ - createdAt?: Timestamp; - - /** - * @generated from field: google.protobuf.Timestamp updated_at = 9; - */ - updatedAt?: Timestamp; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Project"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Project; - - static fromJson(jsonValue: JsonValue, options?: Partial): Project; - - static fromJsonString(jsonString: string, options?: Partial): Project; - - static equals(a: Project | PlainMessage | undefined, b: Project | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.UpdatableProjectFields - */ -export declare class UpdatableProjectFields extends Message { - /** - * @generated from field: google.protobuf.StringValue name = 1; - */ - name?: string; - - /** - * @generated from field: google.protobuf.StringValue auth_webhook_url = 2; - */ - authWebhookUrl?: string; - - /** - * @generated from field: yorkie.v1.UpdatableProjectFields.AuthWebhookMethods auth_webhook_methods = 3; - */ - authWebhookMethods?: UpdatableProjectFields_AuthWebhookMethods; - - /** - * @generated from field: google.protobuf.StringValue client_deactivate_threshold = 4; - */ - clientDeactivateThreshold?: string; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.UpdatableProjectFields"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdatableProjectFields; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdatableProjectFields; - - static fromJsonString(jsonString: string, options?: Partial): UpdatableProjectFields; - - static equals(a: UpdatableProjectFields | PlainMessage | undefined, b: UpdatableProjectFields | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.UpdatableProjectFields.AuthWebhookMethods - */ -export declare class UpdatableProjectFields_AuthWebhookMethods extends Message { - /** - * @generated from field: repeated string methods = 1; - */ - methods: string[]; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.UpdatableProjectFields.AuthWebhookMethods"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): UpdatableProjectFields_AuthWebhookMethods; - - static fromJson(jsonValue: JsonValue, options?: Partial): UpdatableProjectFields_AuthWebhookMethods; - - static fromJsonString(jsonString: string, options?: Partial): UpdatableProjectFields_AuthWebhookMethods; - - static equals(a: UpdatableProjectFields_AuthWebhookMethods | PlainMessage | undefined, b: UpdatableProjectFields_AuthWebhookMethods | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.DocumentSummary - */ -export declare class DocumentSummary extends Message { - /** - * @generated from field: string id = 1; - */ - id: string; - - /** - * @generated from field: string key = 2; - */ - key: string; - - /** - * @generated from field: string snapshot = 3; - */ - snapshot: string; - - /** - * @generated from field: google.protobuf.Timestamp created_at = 4; - */ - createdAt?: Timestamp; - - /** - * @generated from field: google.protobuf.Timestamp accessed_at = 5; - */ - accessedAt?: Timestamp; - - /** - * @generated from field: google.protobuf.Timestamp updated_at = 6; - */ - updatedAt?: Timestamp; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.DocumentSummary"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DocumentSummary; - - static fromJson(jsonValue: JsonValue, options?: Partial): DocumentSummary; - - static fromJsonString(jsonString: string, options?: Partial): DocumentSummary; - - static equals(a: DocumentSummary | PlainMessage | undefined, b: DocumentSummary | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.PresenceChange - */ -export declare class PresenceChange extends Message { - /** - * @generated from field: yorkie.v1.PresenceChange.ChangeType type = 1; - */ - type: PresenceChange_ChangeType; - - /** - * @generated from field: yorkie.v1.Presence presence = 2; - */ - presence?: Presence; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.PresenceChange"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): PresenceChange; - - static fromJson(jsonValue: JsonValue, options?: Partial): PresenceChange; - - static fromJsonString(jsonString: string, options?: Partial): PresenceChange; - - static equals(a: PresenceChange | PlainMessage | undefined, b: PresenceChange | PlainMessage | undefined): boolean; -} - -/** - * @generated from enum yorkie.v1.PresenceChange.ChangeType - */ -export declare enum PresenceChange_ChangeType { - /** - * @generated from enum value: CHANGE_TYPE_UNSPECIFIED = 0; - */ - UNSPECIFIED = 0, - - /** - * @generated from enum value: CHANGE_TYPE_PUT = 1; - */ - PUT = 1, - - /** - * @generated from enum value: CHANGE_TYPE_DELETE = 2; - */ - DELETE = 2, - - /** - * @generated from enum value: CHANGE_TYPE_CLEAR = 3; - */ - CLEAR = 3, -} - -/** - * @generated from message yorkie.v1.Presence - */ -export declare class Presence extends Message { - /** - * @generated from field: map data = 1; - */ - data: { [key: string]: string }; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Presence"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Presence; - - static fromJson(jsonValue: JsonValue, options?: Partial): Presence; - - static fromJsonString(jsonString: string, options?: Partial): Presence; - - static equals(a: Presence | PlainMessage | undefined, b: Presence | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.Checkpoint - */ -export declare class Checkpoint extends Message { - /** - * @generated from field: int64 server_seq = 1 [jstype = JS_STRING]; - */ - serverSeq: string; - - /** - * @generated from field: uint32 client_seq = 2; - */ - clientSeq: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.Checkpoint"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): Checkpoint; - - static fromJson(jsonValue: JsonValue, options?: Partial): Checkpoint; - - static fromJsonString(jsonString: string, options?: Partial): Checkpoint; - - static equals(a: Checkpoint | PlainMessage | undefined, b: Checkpoint | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TextNodePos - */ -export declare class TextNodePos extends Message { - /** - * @generated from field: yorkie.v1.TimeTicket created_at = 1; - */ - createdAt?: TimeTicket; - - /** - * @generated from field: int32 offset = 2; - */ - offset: number; - - /** - * @generated from field: int32 relative_offset = 3; - */ - relativeOffset: number; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TextNodePos"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TextNodePos; - - static fromJson(jsonValue: JsonValue, options?: Partial): TextNodePos; - - static fromJsonString(jsonString: string, options?: Partial): TextNodePos; - - static equals(a: TextNodePos | PlainMessage | undefined, b: TextNodePos | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.TimeTicket - */ -export declare class TimeTicket extends Message { - /** - * @generated from field: int64 lamport = 1 [jstype = JS_STRING]; - */ - lamport: string; - - /** - * @generated from field: uint32 delimiter = 2; - */ - delimiter: number; - - /** - * @generated from field: bytes actor_id = 3; - */ - actorId: Uint8Array; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.TimeTicket"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): TimeTicket; - - static fromJson(jsonValue: JsonValue, options?: Partial): TimeTicket; - - static fromJsonString(jsonString: string, options?: Partial): TimeTicket; - - static equals(a: TimeTicket | PlainMessage | undefined, b: TimeTicket | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.DocEventBody - */ -export declare class DocEventBody extends Message { - /** - * @generated from field: string topic = 1; - */ - topic: string; - - /** - * @generated from field: bytes payload = 2; - */ - payload: Uint8Array; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.DocEventBody"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DocEventBody; - - static fromJson(jsonValue: JsonValue, options?: Partial): DocEventBody; - - static fromJsonString(jsonString: string, options?: Partial): DocEventBody; - - static equals(a: DocEventBody | PlainMessage | undefined, b: DocEventBody | PlainMessage | undefined): boolean; -} - -/** - * @generated from message yorkie.v1.DocEvent - */ -export declare class DocEvent extends Message { - /** - * @generated from field: yorkie.v1.DocEventType type = 1; - */ - type: DocEventType; - - /** - * @generated from field: string publisher = 2; - */ - publisher: string; - - /** - * @generated from field: yorkie.v1.DocEventBody body = 3; - */ - body?: DocEventBody; - - constructor(data?: PartialMessage); - - static readonly runtime: typeof proto3; - static readonly typeName = "yorkie.v1.DocEvent"; - static readonly fields: FieldList; - - static fromBinary(bytes: Uint8Array, options?: Partial): DocEvent; - - static fromJson(jsonValue: JsonValue, options?: Partial): DocEvent; - - static fromJsonString(jsonString: string, options?: Partial): DocEvent; - - static equals(a: DocEvent | PlainMessage | undefined, b: DocEvent | PlainMessage | undefined): boolean; -} - diff --git a/src/api/yorkie/v1/resources_pb.js b/src/api/yorkie/v1/resources_pb.js deleted file mode 100644 index 2c9e87a..0000000 --- a/src/api/yorkie/v1/resources_pb.js +++ /dev/null @@ -1,674 +0,0 @@ -// -// Copyright 2022 The Yorkie Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// @generated by protoc-gen-es v1.10.0 with parameter "target=js+dts,js_import_style=module" -// @generated from file src/api/yorkie/v1/resources.proto (package yorkie.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { proto3, StringValue, Timestamp } from "@bufbuild/protobuf"; - -/** - * @generated from enum yorkie.v1.ValueType - */ -export const ValueType = /*@__PURE__*/ proto3.makeEnum( - "yorkie.v1.ValueType", - [ - {no: 0, name: "VALUE_TYPE_NULL", localName: "NULL"}, - {no: 1, name: "VALUE_TYPE_BOOLEAN", localName: "BOOLEAN"}, - {no: 2, name: "VALUE_TYPE_INTEGER", localName: "INTEGER"}, - {no: 3, name: "VALUE_TYPE_LONG", localName: "LONG"}, - {no: 4, name: "VALUE_TYPE_DOUBLE", localName: "DOUBLE"}, - {no: 5, name: "VALUE_TYPE_STRING", localName: "STRING"}, - {no: 6, name: "VALUE_TYPE_BYTES", localName: "BYTES"}, - {no: 7, name: "VALUE_TYPE_DATE", localName: "DATE"}, - {no: 8, name: "VALUE_TYPE_JSON_OBJECT", localName: "JSON_OBJECT"}, - {no: 9, name: "VALUE_TYPE_JSON_ARRAY", localName: "JSON_ARRAY"}, - {no: 10, name: "VALUE_TYPE_TEXT", localName: "TEXT"}, - {no: 11, name: "VALUE_TYPE_INTEGER_CNT", localName: "INTEGER_CNT"}, - {no: 12, name: "VALUE_TYPE_LONG_CNT", localName: "LONG_CNT"}, - {no: 13, name: "VALUE_TYPE_TREE", localName: "TREE"}, - ], -); - -/** - * @generated from enum yorkie.v1.DocEventType - */ -export const DocEventType = /*@__PURE__*/ proto3.makeEnum( - "yorkie.v1.DocEventType", - [ - {no: 0, name: "DOC_EVENT_TYPE_DOCUMENT_CHANGED", localName: "DOCUMENT_CHANGED"}, - {no: 1, name: "DOC_EVENT_TYPE_DOCUMENT_WATCHED", localName: "DOCUMENT_WATCHED"}, - {no: 2, name: "DOC_EVENT_TYPE_DOCUMENT_UNWATCHED", localName: "DOCUMENT_UNWATCHED"}, - {no: 3, name: "DOC_EVENT_TYPE_DOCUMENT_BROADCAST", localName: "DOCUMENT_BROADCAST"}, - ], -); - -/** - * /////////////////////////////////////// - * Messages for Snapshot // - * /////////////////////////////////////// - * - * @generated from message yorkie.v1.Snapshot - */ -export const Snapshot = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Snapshot", - () => [ - { no: 1, name: "root", kind: "message", T: JSONElement }, - { no: 2, name: "presences", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Presence} }, - ], -); - -/** - * ChangePack is a message that contains all changes that occurred in a document. - * It is used to synchronize changes between clients and servers. - * - * @generated from message yorkie.v1.ChangePack - */ -export const ChangePack = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ChangePack", - () => [ - { no: 1, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "checkpoint", kind: "message", T: Checkpoint }, - { no: 3, name: "snapshot", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 4, name: "changes", kind: "message", T: Change, repeated: true }, - { no: 5, name: "min_synced_ticket", kind: "message", T: TimeTicket }, - { no: 6, name: "is_removed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ], -); - -/** - * @generated from message yorkie.v1.Change - */ -export const Change = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Change", - () => [ - { no: 1, name: "id", kind: "message", T: ChangeID }, - { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "operations", kind: "message", T: Operation, repeated: true }, - { no: 4, name: "presence_change", kind: "message", T: PresenceChange }, - ], -); - -/** - * @generated from message yorkie.v1.ChangeID - */ -export const ChangeID = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.ChangeID", - () => [ - { no: 1, name: "client_seq", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "server_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */, L: 1 /* LongType.STRING */ }, - { no: 3, name: "lamport", kind: "scalar", T: 3 /* ScalarType.INT64 */, L: 1 /* LongType.STRING */ }, - { no: 4, name: "actor_id", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ], -); - -/** - * @generated from message yorkie.v1.Operation - */ -export const Operation = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation", - () => [ - { no: 1, name: "set", kind: "message", T: Operation_Set, oneof: "body" }, - { no: 2, name: "add", kind: "message", T: Operation_Add, oneof: "body" }, - { no: 3, name: "move", kind: "message", T: Operation_Move, oneof: "body" }, - { no: 4, name: "remove", kind: "message", T: Operation_Remove, oneof: "body" }, - { no: 5, name: "edit", kind: "message", T: Operation_Edit, oneof: "body" }, - { no: 6, name: "select", kind: "message", T: Operation_Select, oneof: "body" }, - { no: 7, name: "style", kind: "message", T: Operation_Style, oneof: "body" }, - { no: 8, name: "increase", kind: "message", T: Operation_Increase, oneof: "body" }, - { no: 9, name: "tree_edit", kind: "message", T: Operation_TreeEdit, oneof: "body" }, - { no: 10, name: "tree_style", kind: "message", T: Operation_TreeStyle, oneof: "body" }, - ], -); - -/** - * @generated from message yorkie.v1.Operation.Set - */ -export const Operation_Set = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Set", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "value", kind: "message", T: JSONElementSimple }, - { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, - ], - {localName: "Operation_Set"}, -); - -/** - * @generated from message yorkie.v1.Operation.Add - */ -export const Operation_Add = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Add", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "prev_created_at", kind: "message", T: TimeTicket }, - { no: 3, name: "value", kind: "message", T: JSONElementSimple }, - { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, - ], - {localName: "Operation_Add"}, -); - -/** - * @generated from message yorkie.v1.Operation.Move - */ -export const Operation_Move = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Move", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "prev_created_at", kind: "message", T: TimeTicket }, - { no: 3, name: "created_at", kind: "message", T: TimeTicket }, - { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, - ], - {localName: "Operation_Move"}, -); - -/** - * @generated from message yorkie.v1.Operation.Remove - */ -export const Operation_Remove = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Remove", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "created_at", kind: "message", T: TimeTicket }, - { no: 3, name: "executed_at", kind: "message", T: TimeTicket }, - ], - {localName: "Operation_Remove"}, -); - -/** - * @generated from message yorkie.v1.Operation.Edit - */ -export const Operation_Edit = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Edit", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "from", kind: "message", T: TextNodePos }, - { no: 3, name: "to", kind: "message", T: TextNodePos }, - { no: 4, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, - { no: 5, name: "content", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "executed_at", kind: "message", T: TimeTicket }, - { no: 7, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - ], - {localName: "Operation_Edit"}, -); - -/** - * NOTE(hackerwins): Select Operation is not used in the current version. - * In the previous version, it was used to represent selection of Text. - * However, it has been replaced by Presence now. It is retained for backward - * compatibility purposes. - * - * @generated from message yorkie.v1.Operation.Select - */ -export const Operation_Select = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Select", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "from", kind: "message", T: TextNodePos }, - { no: 3, name: "to", kind: "message", T: TextNodePos }, - { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, - ], - {localName: "Operation_Select"}, -); - -/** - * @generated from message yorkie.v1.Operation.Style - */ -export const Operation_Style = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Style", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "from", kind: "message", T: TextNodePos }, - { no: 3, name: "to", kind: "message", T: TextNodePos }, - { no: 4, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 5, name: "executed_at", kind: "message", T: TimeTicket }, - { no: 6, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, - ], - {localName: "Operation_Style"}, -); - -/** - * @generated from message yorkie.v1.Operation.Increase - */ -export const Operation_Increase = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.Increase", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "value", kind: "message", T: JSONElementSimple }, - { no: 3, name: "executed_at", kind: "message", T: TimeTicket }, - ], - {localName: "Operation_Increase"}, -); - -/** - * @generated from message yorkie.v1.Operation.TreeEdit - */ -export const Operation_TreeEdit = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.TreeEdit", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "from", kind: "message", T: TreePos }, - { no: 3, name: "to", kind: "message", T: TreePos }, - { no: 4, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, - { no: 5, name: "contents", kind: "message", T: TreeNodes, repeated: true }, - { no: 7, name: "split_level", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 6, name: "executed_at", kind: "message", T: TimeTicket }, - ], - {localName: "Operation_TreeEdit"}, -); - -/** - * @generated from message yorkie.v1.Operation.TreeStyle - */ -export const Operation_TreeStyle = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Operation.TreeStyle", - () => [ - { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "from", kind: "message", T: TreePos }, - { no: 3, name: "to", kind: "message", T: TreePos }, - { no: 4, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - { no: 5, name: "executed_at", kind: "message", T: TimeTicket }, - { no: 6, name: "attributes_to_remove", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 7, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, - ], - {localName: "Operation_TreeStyle"}, -); - -/** - * @generated from message yorkie.v1.JSONElementSimple - */ -export const JSONElementSimple = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElementSimple", - () => [ - { no: 1, name: "created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "moved_at", kind: "message", T: TimeTicket }, - { no: 3, name: "removed_at", kind: "message", T: TimeTicket }, - { no: 4, name: "type", kind: "enum", T: proto3.getEnumType(ValueType) }, - { no: 5, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ], -); - -/** - * @generated from message yorkie.v1.JSONElement - */ -export const JSONElement = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElement", - () => [ - { no: 1, name: "json_object", kind: "message", T: JSONElement_JSONObject, oneof: "body" }, - { no: 2, name: "json_array", kind: "message", T: JSONElement_JSONArray, oneof: "body" }, - { no: 3, name: "primitive", kind: "message", T: JSONElement_Primitive, oneof: "body" }, - { no: 5, name: "text", kind: "message", T: JSONElement_Text, oneof: "body" }, - { no: 6, name: "counter", kind: "message", T: JSONElement_Counter, oneof: "body" }, - { no: 7, name: "tree", kind: "message", T: JSONElement_Tree, oneof: "body" }, - ], -); - -/** - * @generated from message yorkie.v1.JSONElement.JSONObject - */ -export const JSONElement_JSONObject = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElement.JSONObject", - () => [ - { no: 1, name: "nodes", kind: "message", T: RHTNode, repeated: true }, - { no: 2, name: "created_at", kind: "message", T: TimeTicket }, - { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, - { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, - ], - {localName: "JSONElement_JSONObject"}, -); - -/** - * @generated from message yorkie.v1.JSONElement.JSONArray - */ -export const JSONElement_JSONArray = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElement.JSONArray", - () => [ - { no: 1, name: "nodes", kind: "message", T: RGANode, repeated: true }, - { no: 2, name: "created_at", kind: "message", T: TimeTicket }, - { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, - { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, - ], - {localName: "JSONElement_JSONArray"}, -); - -/** - * @generated from message yorkie.v1.JSONElement.Primitive - */ -export const JSONElement_Primitive = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElement.Primitive", - () => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(ValueType) }, - { no: 2, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 3, name: "created_at", kind: "message", T: TimeTicket }, - { no: 4, name: "moved_at", kind: "message", T: TimeTicket }, - { no: 5, name: "removed_at", kind: "message", T: TimeTicket }, - ], - {localName: "JSONElement_Primitive"}, -); - -/** - * @generated from message yorkie.v1.JSONElement.Text - */ -export const JSONElement_Text = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElement.Text", - () => [ - { no: 1, name: "nodes", kind: "message", T: TextNode, repeated: true }, - { no: 2, name: "created_at", kind: "message", T: TimeTicket }, - { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, - { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, - ], - {localName: "JSONElement_Text"}, -); - -/** - * @generated from message yorkie.v1.JSONElement.Counter - */ -export const JSONElement_Counter = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElement.Counter", - () => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(ValueType) }, - { no: 2, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - { no: 3, name: "created_at", kind: "message", T: TimeTicket }, - { no: 4, name: "moved_at", kind: "message", T: TimeTicket }, - { no: 5, name: "removed_at", kind: "message", T: TimeTicket }, - ], - {localName: "JSONElement_Counter"}, -); - -/** - * @generated from message yorkie.v1.JSONElement.Tree - */ -export const JSONElement_Tree = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.JSONElement.Tree", - () => [ - { no: 1, name: "nodes", kind: "message", T: TreeNode, repeated: true }, - { no: 2, name: "created_at", kind: "message", T: TimeTicket }, - { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, - { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, - ], - {localName: "JSONElement_Tree"}, -); - -/** - * @generated from message yorkie.v1.RHTNode - */ -export const RHTNode = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.RHTNode", - () => [ - { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "element", kind: "message", T: JSONElement }, - ], -); - -/** - * @generated from message yorkie.v1.RGANode - */ -export const RGANode = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.RGANode", - () => [ - { no: 1, name: "next", kind: "message", T: RGANode }, - { no: 2, name: "element", kind: "message", T: JSONElement }, - ], -); - -/** - * @generated from message yorkie.v1.NodeAttr - */ -export const NodeAttr = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.NodeAttr", - () => [ - { no: 1, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "updated_at", kind: "message", T: TimeTicket }, - { no: 3, name: "is_removed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ], -); - -/** - * @generated from message yorkie.v1.TextNode - */ -export const TextNode = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TextNode", - () => [ - { no: 1, name: "id", kind: "message", T: TextNodeID }, - { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "removed_at", kind: "message", T: TimeTicket }, - { no: 4, name: "ins_prev_id", kind: "message", T: TextNodeID }, - { no: 5, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: NodeAttr} }, - ], -); - -/** - * @generated from message yorkie.v1.TextNodeID - */ -export const TextNodeID = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TextNodeID", - () => [ - { no: 1, name: "created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - -/** - * @generated from message yorkie.v1.TreeNode - */ -export const TreeNode = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TreeNode", - () => [ - { no: 1, name: "id", kind: "message", T: TreeNodeID }, - { no: 2, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, - { no: 5, name: "ins_prev_id", kind: "message", T: TreeNodeID }, - { no: 6, name: "ins_next_id", kind: "message", T: TreeNodeID }, - { no: 7, name: "depth", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 8, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: NodeAttr} }, - ], -); - -/** - * @generated from message yorkie.v1.TreeNodes - */ -export const TreeNodes = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TreeNodes", - () => [ - { no: 1, name: "content", kind: "message", T: TreeNode, repeated: true }, - ], -); - -/** - * @generated from message yorkie.v1.TreeNodeID - */ -export const TreeNodeID = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TreeNodeID", - () => [ - { no: 1, name: "created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - -/** - * @generated from message yorkie.v1.TreePos - */ -export const TreePos = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TreePos", - () => [ - { no: 1, name: "parent_id", kind: "message", T: TreeNodeID }, - { no: 2, name: "left_sibling_id", kind: "message", T: TreeNodeID }, - ], -); - -/** - * @generated from message yorkie.v1.User - */ -export const User = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.User", - () => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "created_at", kind: "message", T: Timestamp }, - ], -); - -/** - * @generated from message yorkie.v1.Project - */ -export const Project = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Project", - () => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "public_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "secret_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 5, name: "auth_webhook_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 6, name: "auth_webhook_methods", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - { no: 7, name: "client_deactivate_threshold", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 8, name: "created_at", kind: "message", T: Timestamp }, - { no: 9, name: "updated_at", kind: "message", T: Timestamp }, - ], -); - -/** - * @generated from message yorkie.v1.UpdatableProjectFields - */ -export const UpdatableProjectFields = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.UpdatableProjectFields", - () => [ - { no: 1, name: "name", kind: "message", T: StringValue }, - { no: 2, name: "auth_webhook_url", kind: "message", T: StringValue }, - { no: 3, name: "auth_webhook_methods", kind: "message", T: UpdatableProjectFields_AuthWebhookMethods }, - { no: 4, name: "client_deactivate_threshold", kind: "message", T: StringValue }, - ], -); - -/** - * @generated from message yorkie.v1.UpdatableProjectFields.AuthWebhookMethods - */ -export const UpdatableProjectFields_AuthWebhookMethods = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.UpdatableProjectFields.AuthWebhookMethods", - () => [ - { no: 1, name: "methods", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, - ], - {localName: "UpdatableProjectFields_AuthWebhookMethods"}, -); - -/** - * @generated from message yorkie.v1.DocumentSummary - */ -export const DocumentSummary = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.DocumentSummary", - () => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "snapshot", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 4, name: "created_at", kind: "message", T: Timestamp }, - { no: 5, name: "accessed_at", kind: "message", T: Timestamp }, - { no: 6, name: "updated_at", kind: "message", T: Timestamp }, - ], -); - -/** - * @generated from message yorkie.v1.PresenceChange - */ -export const PresenceChange = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.PresenceChange", - () => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(PresenceChange_ChangeType) }, - { no: 2, name: "presence", kind: "message", T: Presence }, - ], -); - -/** - * @generated from enum yorkie.v1.PresenceChange.ChangeType - */ -export const PresenceChange_ChangeType = /*@__PURE__*/ proto3.makeEnum( - "yorkie.v1.PresenceChange.ChangeType", - [ - {no: 0, name: "CHANGE_TYPE_UNSPECIFIED", localName: "UNSPECIFIED"}, - {no: 1, name: "CHANGE_TYPE_PUT", localName: "PUT"}, - {no: 2, name: "CHANGE_TYPE_DELETE", localName: "DELETE"}, - {no: 3, name: "CHANGE_TYPE_CLEAR", localName: "CLEAR"}, - ], -); - -/** - * @generated from message yorkie.v1.Presence - */ -export const Presence = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Presence", - () => [ - { no: 1, name: "data", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, - ], -); - -/** - * @generated from message yorkie.v1.Checkpoint - */ -export const Checkpoint = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.Checkpoint", - () => [ - { no: 1, name: "server_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */, L: 1 /* LongType.STRING */ }, - { no: 2, name: "client_seq", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ], -); - -/** - * @generated from message yorkie.v1.TextNodePos - */ -export const TextNodePos = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TextNodePos", - () => [ - { no: 1, name: "created_at", kind: "message", T: TimeTicket }, - { no: 2, name: "offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - { no: 3, name: "relative_offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, - ], -); - -/** - * @generated from message yorkie.v1.TimeTicket - */ -export const TimeTicket = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.TimeTicket", - () => [ - { no: 1, name: "lamport", kind: "scalar", T: 3 /* ScalarType.INT64 */, L: 1 /* LongType.STRING */ }, - { no: 2, name: "delimiter", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 3, name: "actor_id", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ], -); - -/** - * @generated from message yorkie.v1.DocEventBody - */ -export const DocEventBody = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.DocEventBody", - () => [ - { no: 1, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, - ], -); - -/** - * @generated from message yorkie.v1.DocEvent - */ -export const DocEvent = /*@__PURE__*/ proto3.makeMessageType( - "yorkie.v1.DocEvent", - () => [ - { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(DocEventType) }, - { no: 2, name: "publisher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "body", kind: "message", T: DocEventBody }, - ], -); - diff --git a/src/api/yorkie/v1/resources_pb.ts b/src/api/yorkie/v1/resources_pb.ts new file mode 100644 index 0000000..9297e1f --- /dev/null +++ b/src/api/yorkie/v1/resources_pb.ts @@ -0,0 +1,2760 @@ +// +// Copyright 2022 The Yorkie Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// @generated by protoc-gen-es v1.10.0 with parameter "target=ts,import_extension=none" +// @generated from file src/api/yorkie/v1/resources.proto (package yorkie.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, protoInt64, StringValue, Timestamp } from "@bufbuild/protobuf"; + +/** + * @generated from enum yorkie.v1.ValueType + */ +export enum ValueType { + /** + * @generated from enum value: VALUE_TYPE_NULL = 0; + */ + NULL = 0, + + /** + * @generated from enum value: VALUE_TYPE_BOOLEAN = 1; + */ + BOOLEAN = 1, + + /** + * @generated from enum value: VALUE_TYPE_INTEGER = 2; + */ + INTEGER = 2, + + /** + * @generated from enum value: VALUE_TYPE_LONG = 3; + */ + LONG = 3, + + /** + * @generated from enum value: VALUE_TYPE_DOUBLE = 4; + */ + DOUBLE = 4, + + /** + * @generated from enum value: VALUE_TYPE_STRING = 5; + */ + STRING = 5, + + /** + * @generated from enum value: VALUE_TYPE_BYTES = 6; + */ + BYTES = 6, + + /** + * @generated from enum value: VALUE_TYPE_DATE = 7; + */ + DATE = 7, + + /** + * @generated from enum value: VALUE_TYPE_JSON_OBJECT = 8; + */ + JSON_OBJECT = 8, + + /** + * @generated from enum value: VALUE_TYPE_JSON_ARRAY = 9; + */ + JSON_ARRAY = 9, + + /** + * @generated from enum value: VALUE_TYPE_TEXT = 10; + */ + TEXT = 10, + + /** + * @generated from enum value: VALUE_TYPE_INTEGER_CNT = 11; + */ + INTEGER_CNT = 11, + + /** + * @generated from enum value: VALUE_TYPE_LONG_CNT = 12; + */ + LONG_CNT = 12, + + /** + * @generated from enum value: VALUE_TYPE_TREE = 13; + */ + TREE = 13, +} +// Retrieve enum metadata with: proto3.getEnumType(ValueType) +proto3.util.setEnumType(ValueType, "yorkie.v1.ValueType", [ + { no: 0, name: "VALUE_TYPE_NULL" }, + { no: 1, name: "VALUE_TYPE_BOOLEAN" }, + { no: 2, name: "VALUE_TYPE_INTEGER" }, + { no: 3, name: "VALUE_TYPE_LONG" }, + { no: 4, name: "VALUE_TYPE_DOUBLE" }, + { no: 5, name: "VALUE_TYPE_STRING" }, + { no: 6, name: "VALUE_TYPE_BYTES" }, + { no: 7, name: "VALUE_TYPE_DATE" }, + { no: 8, name: "VALUE_TYPE_JSON_OBJECT" }, + { no: 9, name: "VALUE_TYPE_JSON_ARRAY" }, + { no: 10, name: "VALUE_TYPE_TEXT" }, + { no: 11, name: "VALUE_TYPE_INTEGER_CNT" }, + { no: 12, name: "VALUE_TYPE_LONG_CNT" }, + { no: 13, name: "VALUE_TYPE_TREE" }, +]); + +/** + * @generated from enum yorkie.v1.DocEventType + */ +export enum DocEventType { + /** + * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_CHANGED = 0; + */ + DOCUMENT_CHANGED = 0, + + /** + * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_WATCHED = 1; + */ + DOCUMENT_WATCHED = 1, + + /** + * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_UNWATCHED = 2; + */ + DOCUMENT_UNWATCHED = 2, + + /** + * @generated from enum value: DOC_EVENT_TYPE_DOCUMENT_BROADCAST = 3; + */ + DOCUMENT_BROADCAST = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(DocEventType) +proto3.util.setEnumType(DocEventType, "yorkie.v1.DocEventType", [ + { no: 0, name: "DOC_EVENT_TYPE_DOCUMENT_CHANGED" }, + { no: 1, name: "DOC_EVENT_TYPE_DOCUMENT_WATCHED" }, + { no: 2, name: "DOC_EVENT_TYPE_DOCUMENT_UNWATCHED" }, + { no: 3, name: "DOC_EVENT_TYPE_DOCUMENT_BROADCAST" }, +]); + +/** + * /////////////////////////////////////// + * Messages for Snapshot // + * /////////////////////////////////////// + * + * @generated from message yorkie.v1.Snapshot + */ +export class Snapshot extends Message { + /** + * @generated from field: yorkie.v1.JSONElement root = 1; + */ + root?: JSONElement; + + /** + * @generated from field: map presences = 2; + */ + presences: { [key: string]: Presence } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Snapshot"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "root", kind: "message", T: JSONElement }, + { no: 2, name: "presences", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: Presence} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Snapshot { + return new Snapshot().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Snapshot { + return new Snapshot().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Snapshot { + return new Snapshot().fromJsonString(jsonString, options); + } + + static equals(a: Snapshot | PlainMessage | undefined, b: Snapshot | PlainMessage | undefined): boolean { + return proto3.util.equals(Snapshot, a, b); + } +} + +/** + * ChangePack is a message that contains all changes that occurred in a document. + * It is used to synchronize changes between clients and servers. + * + * @generated from message yorkie.v1.ChangePack + */ +export class ChangePack extends Message { + /** + * @generated from field: string document_key = 1; + */ + documentKey = ""; + + /** + * @generated from field: yorkie.v1.Checkpoint checkpoint = 2; + */ + checkpoint?: Checkpoint; + + /** + * @generated from field: bytes snapshot = 3; + */ + snapshot = new Uint8Array(0); + + /** + * @generated from field: repeated yorkie.v1.Change changes = 4; + */ + changes: Change[] = []; + + /** + * @generated from field: yorkie.v1.TimeTicket min_synced_ticket = 5; + */ + minSyncedTicket?: TimeTicket; + + /** + * @generated from field: bool is_removed = 6; + */ + isRemoved = false; + + /** + * @generated from field: yorkie.v1.VersionVector version_vector = 7; + */ + versionVector?: VersionVector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ChangePack"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "checkpoint", kind: "message", T: Checkpoint }, + { no: 3, name: "snapshot", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 4, name: "changes", kind: "message", T: Change, repeated: true }, + { no: 5, name: "min_synced_ticket", kind: "message", T: TimeTicket }, + { no: 6, name: "is_removed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 7, name: "version_vector", kind: "message", T: VersionVector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangePack { + return new ChangePack().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangePack { + return new ChangePack().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangePack { + return new ChangePack().fromJsonString(jsonString, options); + } + + static equals(a: ChangePack | PlainMessage | undefined, b: ChangePack | PlainMessage | undefined): boolean { + return proto3.util.equals(ChangePack, a, b); + } +} + +/** + * @generated from message yorkie.v1.Change + */ +export class Change extends Message { + /** + * @generated from field: yorkie.v1.ChangeID id = 1; + */ + id?: ChangeID; + + /** + * @generated from field: string message = 2; + */ + message = ""; + + /** + * @generated from field: repeated yorkie.v1.Operation operations = 3; + */ + operations: Operation[] = []; + + /** + * @generated from field: yorkie.v1.PresenceChange presence_change = 4; + */ + presenceChange?: PresenceChange; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Change"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "message", T: ChangeID }, + { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "operations", kind: "message", T: Operation, repeated: true }, + { no: 4, name: "presence_change", kind: "message", T: PresenceChange }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Change { + return new Change().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Change { + return new Change().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Change { + return new Change().fromJsonString(jsonString, options); + } + + static equals(a: Change | PlainMessage | undefined, b: Change | PlainMessage | undefined): boolean { + return proto3.util.equals(Change, a, b); + } +} + +/** + * @generated from message yorkie.v1.ChangeID + */ +export class ChangeID extends Message { + /** + * @generated from field: uint32 client_seq = 1; + */ + clientSeq = 0; + + /** + * @generated from field: int64 server_seq = 2; + */ + serverSeq = protoInt64.zero; + + /** + * @generated from field: int64 lamport = 3; + */ + lamport = protoInt64.zero; + + /** + * @generated from field: bytes actor_id = 4; + */ + actorId = new Uint8Array(0); + + /** + * @generated from field: yorkie.v1.VersionVector version_vector = 5; + */ + versionVector?: VersionVector; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.ChangeID"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "client_seq", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "server_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 3, name: "lamport", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 4, name: "actor_id", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 5, name: "version_vector", kind: "message", T: VersionVector }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ChangeID { + return new ChangeID().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ChangeID { + return new ChangeID().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ChangeID { + return new ChangeID().fromJsonString(jsonString, options); + } + + static equals(a: ChangeID | PlainMessage | undefined, b: ChangeID | PlainMessage | undefined): boolean { + return proto3.util.equals(ChangeID, a, b); + } +} + +/** + * @generated from message yorkie.v1.VersionVector + */ +export class VersionVector extends Message { + /** + * @generated from field: map vector = 1; + */ + vector: { [key: string]: bigint } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.VersionVector"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "vector", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 3 /* ScalarType.INT64 */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VersionVector { + return new VersionVector().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VersionVector { + return new VersionVector().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VersionVector { + return new VersionVector().fromJsonString(jsonString, options); + } + + static equals(a: VersionVector | PlainMessage | undefined, b: VersionVector | PlainMessage | undefined): boolean { + return proto3.util.equals(VersionVector, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation + */ +export class Operation extends Message { + /** + * @generated from oneof yorkie.v1.Operation.body + */ + body: { + /** + * @generated from field: yorkie.v1.Operation.Set set = 1; + */ + value: Operation_Set; + case: "set"; + } | { + /** + * @generated from field: yorkie.v1.Operation.Add add = 2; + */ + value: Operation_Add; + case: "add"; + } | { + /** + * @generated from field: yorkie.v1.Operation.Move move = 3; + */ + value: Operation_Move; + case: "move"; + } | { + /** + * @generated from field: yorkie.v1.Operation.Remove remove = 4; + */ + value: Operation_Remove; + case: "remove"; + } | { + /** + * @generated from field: yorkie.v1.Operation.Edit edit = 5; + */ + value: Operation_Edit; + case: "edit"; + } | { + /** + * @generated from field: yorkie.v1.Operation.Select select = 6; + */ + value: Operation_Select; + case: "select"; + } | { + /** + * @generated from field: yorkie.v1.Operation.Style style = 7; + */ + value: Operation_Style; + case: "style"; + } | { + /** + * @generated from field: yorkie.v1.Operation.Increase increase = 8; + */ + value: Operation_Increase; + case: "increase"; + } | { + /** + * @generated from field: yorkie.v1.Operation.TreeEdit tree_edit = 9; + */ + value: Operation_TreeEdit; + case: "treeEdit"; + } | { + /** + * @generated from field: yorkie.v1.Operation.TreeStyle tree_style = 10; + */ + value: Operation_TreeStyle; + case: "treeStyle"; + } | { + /** + * @generated from field: yorkie.v1.Operation.ArraySet array_set = 11; + */ + value: Operation_ArraySet; + case: "arraySet"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "set", kind: "message", T: Operation_Set, oneof: "body" }, + { no: 2, name: "add", kind: "message", T: Operation_Add, oneof: "body" }, + { no: 3, name: "move", kind: "message", T: Operation_Move, oneof: "body" }, + { no: 4, name: "remove", kind: "message", T: Operation_Remove, oneof: "body" }, + { no: 5, name: "edit", kind: "message", T: Operation_Edit, oneof: "body" }, + { no: 6, name: "select", kind: "message", T: Operation_Select, oneof: "body" }, + { no: 7, name: "style", kind: "message", T: Operation_Style, oneof: "body" }, + { no: 8, name: "increase", kind: "message", T: Operation_Increase, oneof: "body" }, + { no: 9, name: "tree_edit", kind: "message", T: Operation_TreeEdit, oneof: "body" }, + { no: 10, name: "tree_style", kind: "message", T: Operation_TreeStyle, oneof: "body" }, + { no: 11, name: "array_set", kind: "message", T: Operation_ArraySet, oneof: "body" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation { + return new Operation().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation { + return new Operation().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation { + return new Operation().fromJsonString(jsonString, options); + } + + static equals(a: Operation | PlainMessage | undefined, b: Operation | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.Set + */ +export class Operation_Set extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: string key = 2; + */ + key = ""; + + /** + * @generated from field: yorkie.v1.JSONElementSimple value = 3; + */ + value?: JSONElementSimple; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 4; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Set"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "value", kind: "message", T: JSONElementSimple }, + { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Set { + return new Operation_Set().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Set { + return new Operation_Set().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Set { + return new Operation_Set().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Set | PlainMessage | undefined, b: Operation_Set | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Set, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.Add + */ +export class Operation_Add extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket prev_created_at = 2; + */ + prevCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.JSONElementSimple value = 3; + */ + value?: JSONElementSimple; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 4; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Add"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "prev_created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "value", kind: "message", T: JSONElementSimple }, + { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Add { + return new Operation_Add().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Add { + return new Operation_Add().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Add { + return new Operation_Add().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Add | PlainMessage | undefined, b: Operation_Add | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Add, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.Move + */ +export class Operation_Move extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket prev_created_at = 2; + */ + prevCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 3; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 4; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Move"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "prev_created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "created_at", kind: "message", T: TimeTicket }, + { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Move { + return new Operation_Move().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Move { + return new Operation_Move().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Move { + return new Operation_Move().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Move | PlainMessage | undefined, b: Operation_Move | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Move, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.Remove + */ +export class Operation_Remove extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 2; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 3; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Remove"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Remove { + return new Operation_Remove().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Remove { + return new Operation_Remove().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Remove { + return new Operation_Remove().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Remove | PlainMessage | undefined, b: Operation_Remove | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Remove, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.Edit + */ +export class Operation_Edit extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TextNodePos from = 2; + */ + from?: TextNodePos; + + /** + * @generated from field: yorkie.v1.TextNodePos to = 3; + */ + to?: TextNodePos; + + /** + * @generated from field: map created_at_map_by_actor = 4; + */ + createdAtMapByActor: { [key: string]: TimeTicket } = {}; + + /** + * @generated from field: string content = 5; + */ + content = ""; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 6; + */ + executedAt?: TimeTicket; + + /** + * @generated from field: map attributes = 7; + */ + attributes: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Edit"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "from", kind: "message", T: TextNodePos }, + { no: 3, name: "to", kind: "message", T: TextNodePos }, + { no: 4, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, + { no: 5, name: "content", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "executed_at", kind: "message", T: TimeTicket }, + { no: 7, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Edit { + return new Operation_Edit().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Edit { + return new Operation_Edit().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Edit { + return new Operation_Edit().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Edit | PlainMessage | undefined, b: Operation_Edit | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Edit, a, b); + } +} + +/** + * NOTE(hackerwins): Select Operation is not used in the current version. + * In the previous version, it was used to represent selection of Text. + * However, it has been replaced by Presence now. It is retained for backward + * compatibility purposes. + * + * @generated from message yorkie.v1.Operation.Select + */ +export class Operation_Select extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TextNodePos from = 2; + */ + from?: TextNodePos; + + /** + * @generated from field: yorkie.v1.TextNodePos to = 3; + */ + to?: TextNodePos; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 4; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Select"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "from", kind: "message", T: TextNodePos }, + { no: 3, name: "to", kind: "message", T: TextNodePos }, + { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Select { + return new Operation_Select().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Select { + return new Operation_Select().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Select { + return new Operation_Select().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Select | PlainMessage | undefined, b: Operation_Select | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Select, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.Style + */ +export class Operation_Style extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TextNodePos from = 2; + */ + from?: TextNodePos; + + /** + * @generated from field: yorkie.v1.TextNodePos to = 3; + */ + to?: TextNodePos; + + /** + * @generated from field: map attributes = 4; + */ + attributes: { [key: string]: string } = {}; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 5; + */ + executedAt?: TimeTicket; + + /** + * @generated from field: map created_at_map_by_actor = 6; + */ + createdAtMapByActor: { [key: string]: TimeTicket } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Style"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "from", kind: "message", T: TextNodePos }, + { no: 3, name: "to", kind: "message", T: TextNodePos }, + { no: 4, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 5, name: "executed_at", kind: "message", T: TimeTicket }, + { no: 6, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Style { + return new Operation_Style().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Style { + return new Operation_Style().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Style { + return new Operation_Style().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Style | PlainMessage | undefined, b: Operation_Style | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Style, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.Increase + */ +export class Operation_Increase extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.JSONElementSimple value = 2; + */ + value?: JSONElementSimple; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 3; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.Increase"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "value", kind: "message", T: JSONElementSimple }, + { no: 3, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_Increase { + return new Operation_Increase().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_Increase { + return new Operation_Increase().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_Increase { + return new Operation_Increase().fromJsonString(jsonString, options); + } + + static equals(a: Operation_Increase | PlainMessage | undefined, b: Operation_Increase | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_Increase, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.TreeEdit + */ +export class Operation_TreeEdit extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TreePos from = 2; + */ + from?: TreePos; + + /** + * @generated from field: yorkie.v1.TreePos to = 3; + */ + to?: TreePos; + + /** + * @generated from field: map created_at_map_by_actor = 4; + */ + createdAtMapByActor: { [key: string]: TimeTicket } = {}; + + /** + * @generated from field: repeated yorkie.v1.TreeNodes contents = 5; + */ + contents: TreeNodes[] = []; + + /** + * @generated from field: int32 split_level = 7; + */ + splitLevel = 0; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 6; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.TreeEdit"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "from", kind: "message", T: TreePos }, + { no: 3, name: "to", kind: "message", T: TreePos }, + { no: 4, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, + { no: 5, name: "contents", kind: "message", T: TreeNodes, repeated: true }, + { no: 7, name: "split_level", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 6, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_TreeEdit { + return new Operation_TreeEdit().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_TreeEdit { + return new Operation_TreeEdit().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_TreeEdit { + return new Operation_TreeEdit().fromJsonString(jsonString, options); + } + + static equals(a: Operation_TreeEdit | PlainMessage | undefined, b: Operation_TreeEdit | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_TreeEdit, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.TreeStyle + */ +export class Operation_TreeStyle extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TreePos from = 2; + */ + from?: TreePos; + + /** + * @generated from field: yorkie.v1.TreePos to = 3; + */ + to?: TreePos; + + /** + * @generated from field: map attributes = 4; + */ + attributes: { [key: string]: string } = {}; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 5; + */ + executedAt?: TimeTicket; + + /** + * @generated from field: repeated string attributes_to_remove = 6; + */ + attributesToRemove: string[] = []; + + /** + * @generated from field: map created_at_map_by_actor = 7; + */ + createdAtMapByActor: { [key: string]: TimeTicket } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.TreeStyle"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "from", kind: "message", T: TreePos }, + { no: 3, name: "to", kind: "message", T: TreePos }, + { no: 4, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + { no: 5, name: "executed_at", kind: "message", T: TimeTicket }, + { no: 6, name: "attributes_to_remove", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 7, name: "created_at_map_by_actor", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: TimeTicket} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_TreeStyle { + return new Operation_TreeStyle().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_TreeStyle { + return new Operation_TreeStyle().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_TreeStyle { + return new Operation_TreeStyle().fromJsonString(jsonString, options); + } + + static equals(a: Operation_TreeStyle | PlainMessage | undefined, b: Operation_TreeStyle | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_TreeStyle, a, b); + } +} + +/** + * @generated from message yorkie.v1.Operation.ArraySet + */ +export class Operation_ArraySet extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket parent_created_at = 1; + */ + parentCreatedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 2; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.JSONElementSimple value = 3; + */ + value?: JSONElementSimple; + + /** + * @generated from field: yorkie.v1.TimeTicket executed_at = 4; + */ + executedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Operation.ArraySet"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "value", kind: "message", T: JSONElementSimple }, + { no: 4, name: "executed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Operation_ArraySet { + return new Operation_ArraySet().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Operation_ArraySet { + return new Operation_ArraySet().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Operation_ArraySet { + return new Operation_ArraySet().fromJsonString(jsonString, options); + } + + static equals(a: Operation_ArraySet | PlainMessage | undefined, b: Operation_ArraySet | PlainMessage | undefined): boolean { + return proto3.util.equals(Operation_ArraySet, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElementSimple + */ +export class JSONElementSimple extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 1; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket moved_at = 2; + */ + movedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 3; + */ + removedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.ValueType type = 4; + */ + type = ValueType.NULL; + + /** + * @generated from field: bytes value = 5; + */ + value = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElementSimple"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "moved_at", kind: "message", T: TimeTicket }, + { no: 3, name: "removed_at", kind: "message", T: TimeTicket }, + { no: 4, name: "type", kind: "enum", T: proto3.getEnumType(ValueType) }, + { no: 5, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElementSimple { + return new JSONElementSimple().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElementSimple { + return new JSONElementSimple().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElementSimple { + return new JSONElementSimple().fromJsonString(jsonString, options); + } + + static equals(a: JSONElementSimple | PlainMessage | undefined, b: JSONElementSimple | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElementSimple, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElement + */ +export class JSONElement extends Message { + /** + * @generated from oneof yorkie.v1.JSONElement.body + */ + body: { + /** + * @generated from field: yorkie.v1.JSONElement.JSONObject json_object = 1; + */ + value: JSONElement_JSONObject; + case: "jsonObject"; + } | { + /** + * @generated from field: yorkie.v1.JSONElement.JSONArray json_array = 2; + */ + value: JSONElement_JSONArray; + case: "jsonArray"; + } | { + /** + * @generated from field: yorkie.v1.JSONElement.Primitive primitive = 3; + */ + value: JSONElement_Primitive; + case: "primitive"; + } | { + /** + * @generated from field: yorkie.v1.JSONElement.Text text = 5; + */ + value: JSONElement_Text; + case: "text"; + } | { + /** + * @generated from field: yorkie.v1.JSONElement.Counter counter = 6; + */ + value: JSONElement_Counter; + case: "counter"; + } | { + /** + * @generated from field: yorkie.v1.JSONElement.Tree tree = 7; + */ + value: JSONElement_Tree; + case: "tree"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElement"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "json_object", kind: "message", T: JSONElement_JSONObject, oneof: "body" }, + { no: 2, name: "json_array", kind: "message", T: JSONElement_JSONArray, oneof: "body" }, + { no: 3, name: "primitive", kind: "message", T: JSONElement_Primitive, oneof: "body" }, + { no: 5, name: "text", kind: "message", T: JSONElement_Text, oneof: "body" }, + { no: 6, name: "counter", kind: "message", T: JSONElement_Counter, oneof: "body" }, + { no: 7, name: "tree", kind: "message", T: JSONElement_Tree, oneof: "body" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement { + return new JSONElement().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement { + return new JSONElement().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElement { + return new JSONElement().fromJsonString(jsonString, options); + } + + static equals(a: JSONElement | PlainMessage | undefined, b: JSONElement | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElement, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElement.JSONObject + */ +export class JSONElement_JSONObject extends Message { + /** + * @generated from field: repeated yorkie.v1.RHTNode nodes = 1; + */ + nodes: RHTNode[] = []; + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 2; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket moved_at = 3; + */ + movedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 4; + */ + removedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElement.JSONObject"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "nodes", kind: "message", T: RHTNode, repeated: true }, + { no: 2, name: "created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, + { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_JSONObject { + return new JSONElement_JSONObject().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_JSONObject { + return new JSONElement_JSONObject().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElement_JSONObject { + return new JSONElement_JSONObject().fromJsonString(jsonString, options); + } + + static equals(a: JSONElement_JSONObject | PlainMessage | undefined, b: JSONElement_JSONObject | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElement_JSONObject, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElement.JSONArray + */ +export class JSONElement_JSONArray extends Message { + /** + * @generated from field: repeated yorkie.v1.RGANode nodes = 1; + */ + nodes: RGANode[] = []; + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 2; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket moved_at = 3; + */ + movedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 4; + */ + removedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElement.JSONArray"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "nodes", kind: "message", T: RGANode, repeated: true }, + { no: 2, name: "created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, + { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_JSONArray { + return new JSONElement_JSONArray().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_JSONArray { + return new JSONElement_JSONArray().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElement_JSONArray { + return new JSONElement_JSONArray().fromJsonString(jsonString, options); + } + + static equals(a: JSONElement_JSONArray | PlainMessage | undefined, b: JSONElement_JSONArray | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElement_JSONArray, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElement.Primitive + */ +export class JSONElement_Primitive extends Message { + /** + * @generated from field: yorkie.v1.ValueType type = 1; + */ + type = ValueType.NULL; + + /** + * @generated from field: bytes value = 2; + */ + value = new Uint8Array(0); + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 3; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket moved_at = 4; + */ + movedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 5; + */ + removedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElement.Primitive"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(ValueType) }, + { no: 2, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 3, name: "created_at", kind: "message", T: TimeTicket }, + { no: 4, name: "moved_at", kind: "message", T: TimeTicket }, + { no: 5, name: "removed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Primitive { + return new JSONElement_Primitive().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Primitive { + return new JSONElement_Primitive().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElement_Primitive { + return new JSONElement_Primitive().fromJsonString(jsonString, options); + } + + static equals(a: JSONElement_Primitive | PlainMessage | undefined, b: JSONElement_Primitive | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElement_Primitive, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElement.Text + */ +export class JSONElement_Text extends Message { + /** + * @generated from field: repeated yorkie.v1.TextNode nodes = 1; + */ + nodes: TextNode[] = []; + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 2; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket moved_at = 3; + */ + movedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 4; + */ + removedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElement.Text"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "nodes", kind: "message", T: TextNode, repeated: true }, + { no: 2, name: "created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, + { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Text { + return new JSONElement_Text().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Text { + return new JSONElement_Text().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElement_Text { + return new JSONElement_Text().fromJsonString(jsonString, options); + } + + static equals(a: JSONElement_Text | PlainMessage | undefined, b: JSONElement_Text | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElement_Text, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElement.Counter + */ +export class JSONElement_Counter extends Message { + /** + * @generated from field: yorkie.v1.ValueType type = 1; + */ + type = ValueType.NULL; + + /** + * @generated from field: bytes value = 2; + */ + value = new Uint8Array(0); + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 3; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket moved_at = 4; + */ + movedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 5; + */ + removedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElement.Counter"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(ValueType) }, + { no: 2, name: "value", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + { no: 3, name: "created_at", kind: "message", T: TimeTicket }, + { no: 4, name: "moved_at", kind: "message", T: TimeTicket }, + { no: 5, name: "removed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Counter { + return new JSONElement_Counter().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Counter { + return new JSONElement_Counter().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElement_Counter { + return new JSONElement_Counter().fromJsonString(jsonString, options); + } + + static equals(a: JSONElement_Counter | PlainMessage | undefined, b: JSONElement_Counter | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElement_Counter, a, b); + } +} + +/** + * @generated from message yorkie.v1.JSONElement.Tree + */ +export class JSONElement_Tree extends Message { + /** + * @generated from field: repeated yorkie.v1.TreeNode nodes = 1; + */ + nodes: TreeNode[] = []; + + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 2; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket moved_at = 3; + */ + movedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 4; + */ + removedAt?: TimeTicket; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.JSONElement.Tree"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "nodes", kind: "message", T: TreeNode, repeated: true }, + { no: 2, name: "created_at", kind: "message", T: TimeTicket }, + { no: 3, name: "moved_at", kind: "message", T: TimeTicket }, + { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): JSONElement_Tree { + return new JSONElement_Tree().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): JSONElement_Tree { + return new JSONElement_Tree().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): JSONElement_Tree { + return new JSONElement_Tree().fromJsonString(jsonString, options); + } + + static equals(a: JSONElement_Tree | PlainMessage | undefined, b: JSONElement_Tree | PlainMessage | undefined): boolean { + return proto3.util.equals(JSONElement_Tree, a, b); + } +} + +/** + * @generated from message yorkie.v1.RHTNode + */ +export class RHTNode extends Message { + /** + * @generated from field: string key = 1; + */ + key = ""; + + /** + * @generated from field: yorkie.v1.JSONElement element = 2; + */ + element?: JSONElement; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.RHTNode"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "element", kind: "message", T: JSONElement }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RHTNode { + return new RHTNode().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RHTNode { + return new RHTNode().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RHTNode { + return new RHTNode().fromJsonString(jsonString, options); + } + + static equals(a: RHTNode | PlainMessage | undefined, b: RHTNode | PlainMessage | undefined): boolean { + return proto3.util.equals(RHTNode, a, b); + } +} + +/** + * @generated from message yorkie.v1.RGANode + */ +export class RGANode extends Message { + /** + * @generated from field: yorkie.v1.RGANode next = 1; + */ + next?: RGANode; + + /** + * @generated from field: yorkie.v1.JSONElement element = 2; + */ + element?: JSONElement; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.RGANode"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "next", kind: "message", T: RGANode }, + { no: 2, name: "element", kind: "message", T: JSONElement }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): RGANode { + return new RGANode().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): RGANode { + return new RGANode().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): RGANode { + return new RGANode().fromJsonString(jsonString, options); + } + + static equals(a: RGANode | PlainMessage | undefined, b: RGANode | PlainMessage | undefined): boolean { + return proto3.util.equals(RGANode, a, b); + } +} + +/** + * @generated from message yorkie.v1.NodeAttr + */ +export class NodeAttr extends Message { + /** + * @generated from field: string value = 1; + */ + value = ""; + + /** + * @generated from field: yorkie.v1.TimeTicket updated_at = 2; + */ + updatedAt?: TimeTicket; + + /** + * @generated from field: bool is_removed = 3; + */ + isRemoved = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.NodeAttr"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "updated_at", kind: "message", T: TimeTicket }, + { no: 3, name: "is_removed", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): NodeAttr { + return new NodeAttr().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): NodeAttr { + return new NodeAttr().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): NodeAttr { + return new NodeAttr().fromJsonString(jsonString, options); + } + + static equals(a: NodeAttr | PlainMessage | undefined, b: NodeAttr | PlainMessage | undefined): boolean { + return proto3.util.equals(NodeAttr, a, b); + } +} + +/** + * @generated from message yorkie.v1.TextNode + */ +export class TextNode extends Message { + /** + * @generated from field: yorkie.v1.TextNodeID id = 1; + */ + id?: TextNodeID; + + /** + * @generated from field: string value = 2; + */ + value = ""; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 3; + */ + removedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TextNodeID ins_prev_id = 4; + */ + insPrevId?: TextNodeID; + + /** + * @generated from field: map attributes = 5; + */ + attributes: { [key: string]: NodeAttr } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TextNode"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "message", T: TextNodeID }, + { no: 2, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "removed_at", kind: "message", T: TimeTicket }, + { no: 4, name: "ins_prev_id", kind: "message", T: TextNodeID }, + { no: 5, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: NodeAttr} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TextNode { + return new TextNode().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TextNode { + return new TextNode().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TextNode { + return new TextNode().fromJsonString(jsonString, options); + } + + static equals(a: TextNode | PlainMessage | undefined, b: TextNode | PlainMessage | undefined): boolean { + return proto3.util.equals(TextNode, a, b); + } +} + +/** + * @generated from message yorkie.v1.TextNodeID + */ +export class TextNodeID extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 1; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: int32 offset = 2; + */ + offset = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TextNodeID"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TextNodeID { + return new TextNodeID().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TextNodeID { + return new TextNodeID().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TextNodeID { + return new TextNodeID().fromJsonString(jsonString, options); + } + + static equals(a: TextNodeID | PlainMessage | undefined, b: TextNodeID | PlainMessage | undefined): boolean { + return proto3.util.equals(TextNodeID, a, b); + } +} + +/** + * @generated from message yorkie.v1.TreeNode + */ +export class TreeNode extends Message { + /** + * @generated from field: yorkie.v1.TreeNodeID id = 1; + */ + id?: TreeNodeID; + + /** + * @generated from field: string type = 2; + */ + type = ""; + + /** + * @generated from field: string value = 3; + */ + value = ""; + + /** + * @generated from field: yorkie.v1.TimeTicket removed_at = 4; + */ + removedAt?: TimeTicket; + + /** + * @generated from field: yorkie.v1.TreeNodeID ins_prev_id = 5; + */ + insPrevId?: TreeNodeID; + + /** + * @generated from field: yorkie.v1.TreeNodeID ins_next_id = 6; + */ + insNextId?: TreeNodeID; + + /** + * @generated from field: int32 depth = 7; + */ + depth = 0; + + /** + * @generated from field: map attributes = 8; + */ + attributes: { [key: string]: NodeAttr } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TreeNode"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "message", T: TreeNodeID }, + { no: 2, name: "type", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "value", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "removed_at", kind: "message", T: TimeTicket }, + { no: 5, name: "ins_prev_id", kind: "message", T: TreeNodeID }, + { no: 6, name: "ins_next_id", kind: "message", T: TreeNodeID }, + { no: 7, name: "depth", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 8, name: "attributes", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "message", T: NodeAttr} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TreeNode { + return new TreeNode().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TreeNode { + return new TreeNode().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TreeNode { + return new TreeNode().fromJsonString(jsonString, options); + } + + static equals(a: TreeNode | PlainMessage | undefined, b: TreeNode | PlainMessage | undefined): boolean { + return proto3.util.equals(TreeNode, a, b); + } +} + +/** + * @generated from message yorkie.v1.TreeNodes + */ +export class TreeNodes extends Message { + /** + * @generated from field: repeated yorkie.v1.TreeNode content = 1; + */ + content: TreeNode[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TreeNodes"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "content", kind: "message", T: TreeNode, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TreeNodes { + return new TreeNodes().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TreeNodes { + return new TreeNodes().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TreeNodes { + return new TreeNodes().fromJsonString(jsonString, options); + } + + static equals(a: TreeNodes | PlainMessage | undefined, b: TreeNodes | PlainMessage | undefined): boolean { + return proto3.util.equals(TreeNodes, a, b); + } +} + +/** + * @generated from message yorkie.v1.TreeNodeID + */ +export class TreeNodeID extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 1; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: int32 offset = 2; + */ + offset = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TreeNodeID"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TreeNodeID { + return new TreeNodeID().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TreeNodeID { + return new TreeNodeID().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TreeNodeID { + return new TreeNodeID().fromJsonString(jsonString, options); + } + + static equals(a: TreeNodeID | PlainMessage | undefined, b: TreeNodeID | PlainMessage | undefined): boolean { + return proto3.util.equals(TreeNodeID, a, b); + } +} + +/** + * @generated from message yorkie.v1.TreePos + */ +export class TreePos extends Message { + /** + * @generated from field: yorkie.v1.TreeNodeID parent_id = 1; + */ + parentId?: TreeNodeID; + + /** + * @generated from field: yorkie.v1.TreeNodeID left_sibling_id = 2; + */ + leftSiblingId?: TreeNodeID; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TreePos"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "parent_id", kind: "message", T: TreeNodeID }, + { no: 2, name: "left_sibling_id", kind: "message", T: TreeNodeID }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TreePos { + return new TreePos().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TreePos { + return new TreePos().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TreePos { + return new TreePos().fromJsonString(jsonString, options); + } + + static equals(a: TreePos | PlainMessage | undefined, b: TreePos | PlainMessage | undefined): boolean { + return proto3.util.equals(TreePos, a, b); + } +} + +/** + * @generated from message yorkie.v1.User + */ +export class User extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string username = 2; + */ + username = ""; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 3; + */ + createdAt?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.User"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "username", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "created_at", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): User { + return new User().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): User { + return new User().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): User { + return new User().fromJsonString(jsonString, options); + } + + static equals(a: User | PlainMessage | undefined, b: User | PlainMessage | undefined): boolean { + return proto3.util.equals(User, a, b); + } +} + +/** + * @generated from message yorkie.v1.Project + */ +export class Project extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string name = 2; + */ + name = ""; + + /** + * @generated from field: string public_key = 3; + */ + publicKey = ""; + + /** + * @generated from field: string secret_key = 4; + */ + secretKey = ""; + + /** + * @generated from field: string auth_webhook_url = 5; + */ + authWebhookUrl = ""; + + /** + * @generated from field: repeated string auth_webhook_methods = 6; + */ + authWebhookMethods: string[] = []; + + /** + * @generated from field: string client_deactivate_threshold = 7; + */ + clientDeactivateThreshold = ""; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 8; + */ + createdAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp updated_at = 9; + */ + updatedAt?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Project"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "public_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "secret_key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 5, name: "auth_webhook_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 6, name: "auth_webhook_methods", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + { no: 7, name: "client_deactivate_threshold", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 8, name: "created_at", kind: "message", T: Timestamp }, + { no: 9, name: "updated_at", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Project { + return new Project().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Project { + return new Project().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Project { + return new Project().fromJsonString(jsonString, options); + } + + static equals(a: Project | PlainMessage | undefined, b: Project | PlainMessage | undefined): boolean { + return proto3.util.equals(Project, a, b); + } +} + +/** + * @generated from message yorkie.v1.UpdatableProjectFields + */ +export class UpdatableProjectFields extends Message { + /** + * @generated from field: google.protobuf.StringValue name = 1; + */ + name?: string; + + /** + * @generated from field: google.protobuf.StringValue auth_webhook_url = 2; + */ + authWebhookUrl?: string; + + /** + * @generated from field: yorkie.v1.UpdatableProjectFields.AuthWebhookMethods auth_webhook_methods = 3; + */ + authWebhookMethods?: UpdatableProjectFields_AuthWebhookMethods; + + /** + * @generated from field: google.protobuf.StringValue client_deactivate_threshold = 4; + */ + clientDeactivateThreshold?: string; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.UpdatableProjectFields"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "name", kind: "message", T: StringValue }, + { no: 2, name: "auth_webhook_url", kind: "message", T: StringValue }, + { no: 3, name: "auth_webhook_methods", kind: "message", T: UpdatableProjectFields_AuthWebhookMethods }, + { no: 4, name: "client_deactivate_threshold", kind: "message", T: StringValue }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdatableProjectFields { + return new UpdatableProjectFields().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdatableProjectFields { + return new UpdatableProjectFields().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdatableProjectFields { + return new UpdatableProjectFields().fromJsonString(jsonString, options); + } + + static equals(a: UpdatableProjectFields | PlainMessage | undefined, b: UpdatableProjectFields | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdatableProjectFields, a, b); + } +} + +/** + * @generated from message yorkie.v1.UpdatableProjectFields.AuthWebhookMethods + */ +export class UpdatableProjectFields_AuthWebhookMethods extends Message { + /** + * @generated from field: repeated string methods = 1; + */ + methods: string[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.UpdatableProjectFields.AuthWebhookMethods"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "methods", kind: "scalar", T: 9 /* ScalarType.STRING */, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): UpdatableProjectFields_AuthWebhookMethods { + return new UpdatableProjectFields_AuthWebhookMethods().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): UpdatableProjectFields_AuthWebhookMethods { + return new UpdatableProjectFields_AuthWebhookMethods().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): UpdatableProjectFields_AuthWebhookMethods { + return new UpdatableProjectFields_AuthWebhookMethods().fromJsonString(jsonString, options); + } + + static equals(a: UpdatableProjectFields_AuthWebhookMethods | PlainMessage | undefined, b: UpdatableProjectFields_AuthWebhookMethods | PlainMessage | undefined): boolean { + return proto3.util.equals(UpdatableProjectFields_AuthWebhookMethods, a, b); + } +} + +/** + * @generated from message yorkie.v1.DocumentSummary + */ +export class DocumentSummary extends Message { + /** + * @generated from field: string id = 1; + */ + id = ""; + + /** + * @generated from field: string key = 2; + */ + key = ""; + + /** + * @generated from field: string snapshot = 3; + */ + snapshot = ""; + + /** + * @generated from field: google.protobuf.Timestamp created_at = 4; + */ + createdAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp accessed_at = 5; + */ + accessedAt?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp updated_at = 6; + */ + updatedAt?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.DocumentSummary"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "key", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "snapshot", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 4, name: "created_at", kind: "message", T: Timestamp }, + { no: 5, name: "accessed_at", kind: "message", T: Timestamp }, + { no: 6, name: "updated_at", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocumentSummary { + return new DocumentSummary().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocumentSummary { + return new DocumentSummary().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocumentSummary { + return new DocumentSummary().fromJsonString(jsonString, options); + } + + static equals(a: DocumentSummary | PlainMessage | undefined, b: DocumentSummary | PlainMessage | undefined): boolean { + return proto3.util.equals(DocumentSummary, a, b); + } +} + +/** + * @generated from message yorkie.v1.PresenceChange + */ +export class PresenceChange extends Message { + /** + * @generated from field: yorkie.v1.PresenceChange.ChangeType type = 1; + */ + type = PresenceChange_ChangeType.UNSPECIFIED; + + /** + * @generated from field: yorkie.v1.Presence presence = 2; + */ + presence?: Presence; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.PresenceChange"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(PresenceChange_ChangeType) }, + { no: 2, name: "presence", kind: "message", T: Presence }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): PresenceChange { + return new PresenceChange().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): PresenceChange { + return new PresenceChange().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): PresenceChange { + return new PresenceChange().fromJsonString(jsonString, options); + } + + static equals(a: PresenceChange | PlainMessage | undefined, b: PresenceChange | PlainMessage | undefined): boolean { + return proto3.util.equals(PresenceChange, a, b); + } +} + +/** + * @generated from enum yorkie.v1.PresenceChange.ChangeType + */ +export enum PresenceChange_ChangeType { + /** + * @generated from enum value: CHANGE_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: CHANGE_TYPE_PUT = 1; + */ + PUT = 1, + + /** + * @generated from enum value: CHANGE_TYPE_DELETE = 2; + */ + DELETE = 2, + + /** + * @generated from enum value: CHANGE_TYPE_CLEAR = 3; + */ + CLEAR = 3, +} +// Retrieve enum metadata with: proto3.getEnumType(PresenceChange_ChangeType) +proto3.util.setEnumType(PresenceChange_ChangeType, "yorkie.v1.PresenceChange.ChangeType", [ + { no: 0, name: "CHANGE_TYPE_UNSPECIFIED" }, + { no: 1, name: "CHANGE_TYPE_PUT" }, + { no: 2, name: "CHANGE_TYPE_DELETE" }, + { no: 3, name: "CHANGE_TYPE_CLEAR" }, +]); + +/** + * @generated from message yorkie.v1.Presence + */ +export class Presence extends Message { + /** + * @generated from field: map data = 1; + */ + data: { [key: string]: string } = {}; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Presence"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "data", kind: "map", K: 9 /* ScalarType.STRING */, V: {kind: "scalar", T: 9 /* ScalarType.STRING */} }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Presence { + return new Presence().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Presence { + return new Presence().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Presence { + return new Presence().fromJsonString(jsonString, options); + } + + static equals(a: Presence | PlainMessage | undefined, b: Presence | PlainMessage | undefined): boolean { + return proto3.util.equals(Presence, a, b); + } +} + +/** + * @generated from message yorkie.v1.Checkpoint + */ +export class Checkpoint extends Message { + /** + * @generated from field: int64 server_seq = 1; + */ + serverSeq = protoInt64.zero; + + /** + * @generated from field: uint32 client_seq = 2; + */ + clientSeq = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.Checkpoint"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "server_seq", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "client_seq", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): Checkpoint { + return new Checkpoint().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): Checkpoint { + return new Checkpoint().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): Checkpoint { + return new Checkpoint().fromJsonString(jsonString, options); + } + + static equals(a: Checkpoint | PlainMessage | undefined, b: Checkpoint | PlainMessage | undefined): boolean { + return proto3.util.equals(Checkpoint, a, b); + } +} + +/** + * @generated from message yorkie.v1.TextNodePos + */ +export class TextNodePos extends Message { + /** + * @generated from field: yorkie.v1.TimeTicket created_at = 1; + */ + createdAt?: TimeTicket; + + /** + * @generated from field: int32 offset = 2; + */ + offset = 0; + + /** + * @generated from field: int32 relative_offset = 3; + */ + relativeOffset = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TextNodePos"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "created_at", kind: "message", T: TimeTicket }, + { no: 2, name: "offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + { no: 3, name: "relative_offset", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TextNodePos { + return new TextNodePos().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TextNodePos { + return new TextNodePos().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TextNodePos { + return new TextNodePos().fromJsonString(jsonString, options); + } + + static equals(a: TextNodePos | PlainMessage | undefined, b: TextNodePos | PlainMessage | undefined): boolean { + return proto3.util.equals(TextNodePos, a, b); + } +} + +/** + * @generated from message yorkie.v1.TimeTicket + */ +export class TimeTicket extends Message { + /** + * @generated from field: int64 lamport = 1; + */ + lamport = protoInt64.zero; + + /** + * @generated from field: uint32 delimiter = 2; + */ + delimiter = 0; + + /** + * @generated from field: bytes actor_id = 3; + */ + actorId = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.TimeTicket"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "lamport", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, + { no: 2, name: "delimiter", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 3, name: "actor_id", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): TimeTicket { + return new TimeTicket().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): TimeTicket { + return new TimeTicket().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): TimeTicket { + return new TimeTicket().fromJsonString(jsonString, options); + } + + static equals(a: TimeTicket | PlainMessage | undefined, b: TimeTicket | PlainMessage | undefined): boolean { + return proto3.util.equals(TimeTicket, a, b); + } +} + +/** + * @generated from message yorkie.v1.DocEventBody + */ +export class DocEventBody extends Message { + /** + * @generated from field: string topic = 1; + */ + topic = ""; + + /** + * @generated from field: bytes payload = 2; + */ + payload = new Uint8Array(0); + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.DocEventBody"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocEventBody { + return new DocEventBody().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocEventBody { + return new DocEventBody().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocEventBody { + return new DocEventBody().fromJsonString(jsonString, options); + } + + static equals(a: DocEventBody | PlainMessage | undefined, b: DocEventBody | PlainMessage | undefined): boolean { + return proto3.util.equals(DocEventBody, a, b); + } +} + +/** + * @generated from message yorkie.v1.DocEvent + */ +export class DocEvent extends Message { + /** + * @generated from field: yorkie.v1.DocEventType type = 1; + */ + type = DocEventType.DOCUMENT_CHANGED; + + /** + * @generated from field: string publisher = 2; + */ + publisher = ""; + + /** + * @generated from field: yorkie.v1.DocEventBody body = 3; + */ + body?: DocEventBody; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "yorkie.v1.DocEvent"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "type", kind: "enum", T: proto3.getEnumType(DocEventType) }, + { no: 2, name: "publisher", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "body", kind: "message", T: DocEventBody }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DocEvent { + return new DocEvent().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DocEvent { + return new DocEvent().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DocEvent { + return new DocEvent().fromJsonString(jsonString, options); + } + + static equals(a: DocEvent | PlainMessage | undefined, b: DocEvent | PlainMessage | undefined): boolean { + return proto3.util.equals(DocEvent, a, b); + } +} + diff --git a/src/features/documents/documentsSlice.ts b/src/features/documents/documentsSlice.ts index b0aaa07..a62aa72 100644 --- a/src/features/documents/documentsSlice.ts +++ b/src/features/documents/documentsSlice.ts @@ -124,13 +124,13 @@ export const listDocumentHistoriesAsync = createAppThunk( projectName: string; documentKey: string; isForward: boolean; - previousSeq?: string; + previousSeq?: bigint; }): Promise<{ data: Array; hasNext: boolean; hasPrevious: boolean; }> => { - const { projectName, documentKey, isForward, previousSeq = '0' } = params; + const { projectName, documentKey, isForward, previousSeq = 0n } = params; const histories = await listDocumentHistories( projectName, documentKey, @@ -142,7 +142,7 @@ export const listDocumentHistoriesAsync = createAppThunk( return getPaginationData({ data: histories, isForward, - previousID: previousSeq, + previousID: String(previousSeq), pageSize: HISTORIES_LIMIT, reverse: true, }); diff --git a/tsconfig.json b/tsconfig.json index d4da069..a656d13 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es5", + "target": "ES2020", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,