From d1b173bc425c45bece041c532d413394cc178a5d Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Fri, 18 Oct 2024 13:26:35 +0900 Subject: [PATCH] Detach documents when client is deactivated (#1036) This commit implements the detachment of documents attached to clients upon client deactivation. Previously, the status of the document was only changed to 'detach' within DB.clients.ClientDocInfo.Status, leading to issues where the deactivated client's presence remained active and presence change events were not communicated to other clients. With this change, on client deactivation, the document's packs.PushPull method is called directly to execute the complete detachment process. Moreover, since the Yorkie cluster sharding mechanism assigns specific documents to specific servers, the server managing client deactivation may not always be the one handling the document. Therefore, in such cases, a request will be made to the server currently responsible for the document to detach it properly. To facilitate this communication across the cluster, a new ClusterService has been added. Follow-up tasks that need to be addressed after this PR include: - Implementing authentication for cluster communication and preventing external exposure. - Eliminating redundant database resource requests between clients.Deactivate and server.DetachDocument. - Improving the p.Clear ChangePack creation logic. - Introducing a connection pool for clusterClient. --------- Co-authored-by: raararaara --- admin/client.go | 4 +- api/docs/yorkie/v1/admin.openapi.yaml | 603 +++++++++--------- api/docs/yorkie/v1/cluster.openapi.yaml | 309 +++++++++ api/docs/yorkie/v1/resources.openapi.yaml | 419 ++++++------ api/docs/yorkie/v1/system.openapi.yaml | 310 +++++++++ api/docs/yorkie/v1/yorkie.openapi.yaml | 463 +++++++------- api/yorkie/v1/cluster.pb.go | 257 ++++++++ api/yorkie/v1/cluster.proto | 38 ++ api/yorkie/v1/v1connect/cluster.connect.go | 120 ++++ api/yorkie/v1/yorkie.proto | 2 +- .../templates/yorkie/deployment.yaml | 2 + client/client.go | 2 +- cluster/client.go | 167 +++++ cmd/yorkie/server.go | 6 + pkg/document/document.go | 4 + pkg/document/internal_document.go | 19 + server/backend/config.go | 3 + server/backend/database/client_info.go | 11 + server/backend/database/memory/database.go | 7 - server/backend/database/mongo/client.go | 32 +- .../backend/database/testcases/testcases.go | 50 -- server/clients/clients.go | 68 +- server/clients/housekeeping.go | 31 +- server/config.go | 3 +- server/config.sample.yml | 3 + server/documents/documents.go | 8 +- server/packs/packs.go | 23 +- server/packs/packs_test.go | 6 +- server/packs/pushpull.go | 2 +- server/rpc/cluster_server.go | 128 ++++ server/rpc/server.go | 5 + server/rpc/yorkie_server.go | 16 +- server/server.go | 2 +- test/complex/main_test.go | 1 + test/helper/helper.go | 1 + test/integration/housekeeping_test.go | 7 +- 36 files changed, 2236 insertions(+), 896 deletions(-) create mode 100644 api/docs/yorkie/v1/cluster.openapi.yaml create mode 100644 api/docs/yorkie/v1/system.openapi.yaml create mode 100644 api/yorkie/v1/cluster.pb.go create mode 100644 api/yorkie/v1/cluster.proto create mode 100644 api/yorkie/v1/v1connect/cluster.connect.go create mode 100644 cluster/client.go create mode 100644 server/rpc/cluster_server.go diff --git a/admin/client.go b/admin/client.go index 1883d032b..fc967be11 100644 --- a/admin/client.go +++ b/admin/client.go @@ -72,6 +72,7 @@ type Client struct { client v1connect.AdminServiceClient authInterceptor *AuthInterceptor logger *zap.Logger + isInsecure bool } // New creates an instance of Client. @@ -100,6 +101,7 @@ func New(opts ...Option) (*Client, error) { conn: conn, logger: logger, authInterceptor: NewAuthInterceptor(options.Token), + isInsecure: options.IsInsecure, }, nil } @@ -120,7 +122,7 @@ func Dial(rpcAddr string, opts ...Option) (*Client, error) { // Dial dials to the admin service. func (c *Client) Dial(rpcAddr string) error { if !strings.Contains(rpcAddr, "://") { - if c.conn.Transport == nil { + if c.isInsecure { rpcAddr = "http://" + rpcAddr } else { rpcAddr = "https://" + rpcAddr diff --git a/api/docs/yorkie/v1/admin.openapi.yaml b/api/docs/yorkie/v1/admin.openapi.yaml index e3672c9f2..536d71435 100644 --- a/api/docs/yorkie/v1/admin.openapi.yaml +++ b/api/docs/yorkie/v1/admin.openapi.yaml @@ -1,532 +1,531 @@ openapi: 3.1.0 info: - description: - Yorkie is an open source document store for building collaborative + description: Yorkie is an open source document store for building collaborative editing applications. title: Yorkie version: v0.5.1 servers: - - description: Production server - url: https://api.yorkie.dev - - description: Local server - url: http://localhost:8080 +- description: Production server + url: https://api.yorkie.dev +- description: Local server + url: http://localhost:8080 paths: /yorkie.v1.AdminService/ChangePassword: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/CreateProject: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/DeleteAccount: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/GetDocument: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/GetDocuments: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.GetDocuments.yorkie.v1.GetDocumentsRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.GetDocuments.yorkie.v1.GetDocumentsRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.GetDocuments.yorkie.v1.GetDocumentsResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.GetDocuments.yorkie.v1.GetDocumentsResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/GetProject: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.GetProject.yorkie.v1.GetProjectRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.GetProject.yorkie.v1.GetProjectRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.GetProject.yorkie.v1.GetProjectResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.GetProject.yorkie.v1.GetProjectResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/GetServerVersion: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/GetSnapshotMeta: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/ListChanges: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.ListChanges.yorkie.v1.ListChangesRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.ListChanges.yorkie.v1.ListChangesRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.ListChanges.yorkie.v1.ListChangesResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.ListChanges.yorkie.v1.ListChangesResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/ListDocuments: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.ListDocuments.yorkie.v1.ListDocumentsRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.ListDocuments.yorkie.v1.ListDocumentsRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.ListDocuments.yorkie.v1.ListDocumentsResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.ListDocuments.yorkie.v1.ListDocumentsResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/ListProjects: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.ListProjects.yorkie.v1.ListProjectsRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.ListProjects.yorkie.v1.ListProjectsRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.ListProjects.yorkie.v1.ListProjectsResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.ListProjects.yorkie.v1.ListProjectsResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/LogIn: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.LogIn.yorkie.v1.LogInRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.LogIn.yorkie.v1.LogInRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.LogIn.yorkie.v1.LogInResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.LogIn.yorkie.v1.LogInResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/RemoveDocumentByAdmin: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.RemoveDocumentByAdmin.yorkie.v1.RemoveDocumentByAdminRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.RemoveDocumentByAdmin.yorkie.v1.RemoveDocumentByAdminRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.RemoveDocumentByAdmin.yorkie.v1.RemoveDocumentByAdminResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.RemoveDocumentByAdmin.yorkie.v1.RemoveDocumentByAdminResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/SearchDocuments: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.SearchDocuments.yorkie.v1.SearchDocumentsRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.SearchDocuments.yorkie.v1.SearchDocumentsRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.SearchDocuments.yorkie.v1.SearchDocumentsResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.SearchDocuments.yorkie.v1.SearchDocumentsResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/SignUp: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.SignUp.yorkie.v1.SignUpRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.SignUp.yorkie.v1.SignUpRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.SignUp.yorkie.v1.SignUpResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.SignUp.yorkie.v1.SignUpResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService /yorkie.v1.AdminService/UpdateProject: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.AdminService.UpdateProject.yorkie.v1.UpdateProjectRequest" + $ref: '#/components/requestBodies/yorkie.v1.AdminService.UpdateProject.yorkie.v1.UpdateProjectRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.AdminService.UpdateProject.yorkie.v1.UpdateProjectResponse" + $ref: '#/components/responses/yorkie.v1.AdminService.UpdateProject.yorkie.v1.UpdateProjectResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.AdminService + - yorkie.v1.AdminService components: requestBodies: yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ChangePasswordRequest" + $ref: '#/components/schemas/yorkie.v1.ChangePasswordRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ChangePasswordRequest" + $ref: '#/components/schemas/yorkie.v1.ChangePasswordRequest' required: true yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.CreateProjectRequest" + $ref: '#/components/schemas/yorkie.v1.CreateProjectRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.CreateProjectRequest" + $ref: '#/components/schemas/yorkie.v1.CreateProjectRequest' required: true yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.DeleteAccountRequest" + $ref: '#/components/schemas/yorkie.v1.DeleteAccountRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.DeleteAccountRequest" + $ref: '#/components/schemas/yorkie.v1.DeleteAccountRequest' required: true yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.GetDocumentRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.GetDocumentRequest' required: true yorkie.v1.AdminService.GetDocuments.yorkie.v1.GetDocumentsRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentsRequest" + $ref: '#/components/schemas/yorkie.v1.GetDocumentsRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentsRequest" + $ref: '#/components/schemas/yorkie.v1.GetDocumentsRequest' required: true yorkie.v1.AdminService.GetProject.yorkie.v1.GetProjectRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetProjectRequest" + $ref: '#/components/schemas/yorkie.v1.GetProjectRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetProjectRequest" + $ref: '#/components/schemas/yorkie.v1.GetProjectRequest' required: true yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetServerVersionRequest" + $ref: '#/components/schemas/yorkie.v1.GetServerVersionRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetServerVersionRequest" + $ref: '#/components/schemas/yorkie.v1.GetServerVersionRequest' required: true yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetSnapshotMetaRequest" + $ref: '#/components/schemas/yorkie.v1.GetSnapshotMetaRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetSnapshotMetaRequest" + $ref: '#/components/schemas/yorkie.v1.GetSnapshotMetaRequest' required: true yorkie.v1.AdminService.ListChanges.yorkie.v1.ListChangesRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ListChangesRequest" + $ref: '#/components/schemas/yorkie.v1.ListChangesRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ListChangesRequest" + $ref: '#/components/schemas/yorkie.v1.ListChangesRequest' required: true yorkie.v1.AdminService.ListDocuments.yorkie.v1.ListDocumentsRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ListDocumentsRequest" + $ref: '#/components/schemas/yorkie.v1.ListDocumentsRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ListDocumentsRequest" + $ref: '#/components/schemas/yorkie.v1.ListDocumentsRequest' required: true yorkie.v1.AdminService.ListProjects.yorkie.v1.ListProjectsRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ListProjectsRequest" + $ref: '#/components/schemas/yorkie.v1.ListProjectsRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ListProjectsRequest" + $ref: '#/components/schemas/yorkie.v1.ListProjectsRequest' required: true yorkie.v1.AdminService.LogIn.yorkie.v1.LogInRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.LogInRequest" + $ref: '#/components/schemas/yorkie.v1.LogInRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.LogInRequest" + $ref: '#/components/schemas/yorkie.v1.LogInRequest' required: true yorkie.v1.AdminService.RemoveDocumentByAdmin.yorkie.v1.RemoveDocumentByAdminRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentByAdminRequest" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentByAdminRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentByAdminRequest" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentByAdminRequest' required: true yorkie.v1.AdminService.SearchDocuments.yorkie.v1.SearchDocumentsRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.SearchDocumentsRequest" + $ref: '#/components/schemas/yorkie.v1.SearchDocumentsRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.SearchDocumentsRequest" + $ref: '#/components/schemas/yorkie.v1.SearchDocumentsRequest' required: true yorkie.v1.AdminService.SignUp.yorkie.v1.SignUpRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.SignUpRequest" + $ref: '#/components/schemas/yorkie.v1.SignUpRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.SignUpRequest" + $ref: '#/components/schemas/yorkie.v1.SignUpRequest' required: true yorkie.v1.AdminService.UpdateProject.yorkie.v1.UpdateProjectRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.UpdateProjectRequest" + $ref: '#/components/schemas/yorkie.v1.UpdateProjectRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.UpdateProjectRequest" + $ref: '#/components/schemas/yorkie.v1.UpdateProjectRequest' required: true responses: connect.error: content: application/json: schema: - $ref: "#/components/schemas/connect.error" + $ref: '#/components/schemas/connect.error' application/proto: schema: - $ref: "#/components/schemas/connect.error" + $ref: '#/components/schemas/connect.error' description: "" yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ChangePasswordResponse" + $ref: '#/components/schemas/yorkie.v1.ChangePasswordResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ChangePasswordResponse" + $ref: '#/components/schemas/yorkie.v1.ChangePasswordResponse' description: "" yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.CreateProjectResponse" + $ref: '#/components/schemas/yorkie.v1.CreateProjectResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.CreateProjectResponse" + $ref: '#/components/schemas/yorkie.v1.CreateProjectResponse' description: "" yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.DeleteAccountResponse" + $ref: '#/components/schemas/yorkie.v1.DeleteAccountResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.DeleteAccountResponse" + $ref: '#/components/schemas/yorkie.v1.DeleteAccountResponse' description: "" yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.GetDocumentResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.GetDocumentResponse' description: "" yorkie.v1.AdminService.GetDocuments.yorkie.v1.GetDocumentsResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentsResponse" + $ref: '#/components/schemas/yorkie.v1.GetDocumentsResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetDocumentsResponse" + $ref: '#/components/schemas/yorkie.v1.GetDocumentsResponse' description: "" yorkie.v1.AdminService.GetProject.yorkie.v1.GetProjectResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetProjectResponse" + $ref: '#/components/schemas/yorkie.v1.GetProjectResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetProjectResponse" + $ref: '#/components/schemas/yorkie.v1.GetProjectResponse' description: "" yorkie.v1.AdminService.GetServerVersion.yorkie.v1.GetServerVersionResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetServerVersionResponse" + $ref: '#/components/schemas/yorkie.v1.GetServerVersionResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetServerVersionResponse" + $ref: '#/components/schemas/yorkie.v1.GetServerVersionResponse' description: "" yorkie.v1.AdminService.GetSnapshotMeta.yorkie.v1.GetSnapshotMetaResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.GetSnapshotMetaResponse" + $ref: '#/components/schemas/yorkie.v1.GetSnapshotMetaResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.GetSnapshotMetaResponse" + $ref: '#/components/schemas/yorkie.v1.GetSnapshotMetaResponse' description: "" yorkie.v1.AdminService.ListChanges.yorkie.v1.ListChangesResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ListChangesResponse" + $ref: '#/components/schemas/yorkie.v1.ListChangesResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ListChangesResponse" + $ref: '#/components/schemas/yorkie.v1.ListChangesResponse' description: "" yorkie.v1.AdminService.ListDocuments.yorkie.v1.ListDocumentsResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ListDocumentsResponse" + $ref: '#/components/schemas/yorkie.v1.ListDocumentsResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ListDocumentsResponse" + $ref: '#/components/schemas/yorkie.v1.ListDocumentsResponse' description: "" yorkie.v1.AdminService.ListProjects.yorkie.v1.ListProjectsResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ListProjectsResponse" + $ref: '#/components/schemas/yorkie.v1.ListProjectsResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ListProjectsResponse" + $ref: '#/components/schemas/yorkie.v1.ListProjectsResponse' description: "" yorkie.v1.AdminService.LogIn.yorkie.v1.LogInResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.LogInResponse" + $ref: '#/components/schemas/yorkie.v1.LogInResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.LogInResponse" + $ref: '#/components/schemas/yorkie.v1.LogInResponse' description: "" yorkie.v1.AdminService.RemoveDocumentByAdmin.yorkie.v1.RemoveDocumentByAdminResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentByAdminResponse" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentByAdminResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentByAdminResponse" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentByAdminResponse' description: "" yorkie.v1.AdminService.SearchDocuments.yorkie.v1.SearchDocumentsResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.SearchDocumentsResponse" + $ref: '#/components/schemas/yorkie.v1.SearchDocumentsResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.SearchDocumentsResponse" + $ref: '#/components/schemas/yorkie.v1.SearchDocumentsResponse' description: "" yorkie.v1.AdminService.SignUp.yorkie.v1.SignUpResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.SignUpResponse" + $ref: '#/components/schemas/yorkie.v1.SignUpResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.SignUpResponse" + $ref: '#/components/schemas/yorkie.v1.SignUpResponse' description: "" yorkie.v1.AdminService.UpdateProject.yorkie.v1.UpdateProjectResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.UpdateProjectResponse" + $ref: '#/components/schemas/yorkie.v1.UpdateProjectResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.UpdateProjectResponse" + $ref: '#/components/schemas/yorkie.v1.UpdateProjectResponse' description: "" schemas: connect.error: additionalProperties: false - description: "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' properties: code: enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated + - CodeCanceled + - CodeUnknown + - CodeInvalidArgument + - CodeDeadlineExceeded + - CodeNotFound + - CodeAlreadyExists + - CodePermissionDenied + - CodeResourceExhausted + - CodeFailedPrecondition + - CodeAborted + - CodeOutOfRange + - CodeInternal + - CodeUnavailable + - CodeDataLoss + - CodeUnauthenticated examples: - - CodeNotFound + - CodeNotFound type: string message: type: string @@ -645,7 +644,7 @@ components: description: "" properties: id: - $ref: "#/components/schemas/yorkie.v1.ChangeID" + $ref: '#/components/schemas/yorkie.v1.ChangeID' additionalProperties: false description: "" title: id @@ -659,12 +658,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Operation" + $ref: '#/components/schemas/yorkie.v1.Operation' type: object title: operations type: array presenceChange: - $ref: "#/components/schemas/yorkie.v1.PresenceChange" + $ref: '#/components/schemas/yorkie.v1.PresenceChange' additionalProperties: false description: "" title: presence_change @@ -690,15 +689,15 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport serverSeq: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: ChangeID type: object @@ -744,7 +743,7 @@ components: description: "" properties: project: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' additionalProperties: false description: "" title: project @@ -777,13 +776,13 @@ components: description: "" properties: accessedAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: accessed_at type: object createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -804,7 +803,7 @@ components: title: snapshot type: string updatedAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: updated_at @@ -832,7 +831,7 @@ components: description: "" properties: document: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' additionalProperties: false description: "" title: document @@ -870,7 +869,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' type: object title: documents type: array @@ -892,7 +891,7 @@ components: description: "" properties: project: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' additionalProperties: false description: "" title: project @@ -943,8 +942,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: GetSnapshotMetaRequest type: object @@ -956,8 +955,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport snapshot: additionalProperties: false @@ -972,25 +971,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at type: object type: - $ref: "#/components/schemas/yorkie.v1.ValueType" + $ref: '#/components/schemas/yorkie.v1.ValueType' additionalProperties: false description: "" title: type @@ -1025,8 +1024,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: previous_seq projectName: additionalProperties: false @@ -1043,7 +1042,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Change" + $ref: '#/components/schemas/yorkie.v1.Change' type: object title: changes type: array @@ -1088,7 +1087,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' type: object title: documents type: array @@ -1107,7 +1106,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' type: object title: projects type: array @@ -1150,7 +1149,7 @@ components: title: is_removed type: boolean updatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: updated_at @@ -1167,67 +1166,67 @@ components: description: "" properties: add: - $ref: "#/components/schemas/yorkie.v1.Operation.Add" + $ref: '#/components/schemas/yorkie.v1.Operation.Add' additionalProperties: false description: "" title: add type: object arraySet: - $ref: "#/components/schemas/yorkie.v1.Operation.ArraySet" + $ref: '#/components/schemas/yorkie.v1.Operation.ArraySet' additionalProperties: false description: "" title: array_set type: object edit: - $ref: "#/components/schemas/yorkie.v1.Operation.Edit" + $ref: '#/components/schemas/yorkie.v1.Operation.Edit' additionalProperties: false description: "" title: edit type: object increase: - $ref: "#/components/schemas/yorkie.v1.Operation.Increase" + $ref: '#/components/schemas/yorkie.v1.Operation.Increase' additionalProperties: false description: "" title: increase type: object move: - $ref: "#/components/schemas/yorkie.v1.Operation.Move" + $ref: '#/components/schemas/yorkie.v1.Operation.Move' additionalProperties: false description: "" title: move type: object remove: - $ref: "#/components/schemas/yorkie.v1.Operation.Remove" + $ref: '#/components/schemas/yorkie.v1.Operation.Remove' additionalProperties: false description: "" title: remove type: object select: - $ref: "#/components/schemas/yorkie.v1.Operation.Select" + $ref: '#/components/schemas/yorkie.v1.Operation.Select' additionalProperties: false description: "" title: select type: object set: - $ref: "#/components/schemas/yorkie.v1.Operation.Set" + $ref: '#/components/schemas/yorkie.v1.Operation.Set' additionalProperties: false description: "" title: set type: object style: - $ref: "#/components/schemas/yorkie.v1.Operation.Style" + $ref: '#/components/schemas/yorkie.v1.Operation.Style' additionalProperties: false description: "" title: style type: object treeEdit: - $ref: "#/components/schemas/yorkie.v1.Operation.TreeEdit" + $ref: '#/components/schemas/yorkie.v1.Operation.TreeEdit' additionalProperties: false description: "" title: tree_edit type: object treeStyle: - $ref: "#/components/schemas/yorkie.v1.Operation.TreeStyle" + $ref: '#/components/schemas/yorkie.v1.Operation.TreeStyle' additionalProperties: false description: "" title: tree_style @@ -1239,25 +1238,25 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object prevCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: prev_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -1269,25 +1268,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -1314,25 +1313,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -1365,7 +1364,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1377,19 +1376,19 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -1401,25 +1400,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object prevCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: prev_created_at @@ -1431,19 +1430,19 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at @@ -1459,25 +1458,25 @@ components: compatibility purposes. properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -1489,7 +1488,7 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at @@ -1500,13 +1499,13 @@ components: title: key type: string parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -1528,25 +1527,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -1579,7 +1578,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1594,7 +1593,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNodes" + $ref: '#/components/schemas/yorkie.v1.TreeNodes' type: object title: contents type: array @@ -1604,19 +1603,19 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at @@ -1627,7 +1626,7 @@ components: title: split_level type: integer to: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: to @@ -1644,7 +1643,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1673,25 +1672,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: to @@ -1724,7 +1723,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1763,13 +1762,13 @@ components: description: "" properties: presence: - $ref: "#/components/schemas/yorkie.v1.Presence" + $ref: '#/components/schemas/yorkie.v1.Presence' additionalProperties: false description: "" title: presence type: object type: - $ref: "#/components/schemas/yorkie.v1.PresenceChange.ChangeType" + $ref: '#/components/schemas/yorkie.v1.PresenceChange.ChangeType' additionalProperties: false description: "" title: type @@ -1778,14 +1777,14 @@ components: yorkie.v1.PresenceChange.ChangeType: description: "" enum: - - - CHANGE_TYPE_UNSPECIFIED - - 0 - - CHANGE_TYPE_PUT - - 1 - - CHANGE_TYPE_DELETE - - 2 - - CHANGE_TYPE_CLEAR - - 3 + - - CHANGE_TYPE_UNSPECIFIED + - 0 + - CHANGE_TYPE_PUT + - 1 + - CHANGE_TYPE_DELETE + - 2 + - CHANGE_TYPE_CLEAR + - 3 title: ChangeType type: string yorkie.v1.Project: @@ -1810,7 +1809,7 @@ components: title: client_deactivate_threshold type: string createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -1836,7 +1835,7 @@ components: title: secret_key type: string updatedAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: updated_at @@ -1898,7 +1897,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' type: object title: documents type: array @@ -1930,7 +1929,7 @@ components: description: "" properties: user: - $ref: "#/components/schemas/yorkie.v1.User" + $ref: '#/components/schemas/yorkie.v1.User' additionalProperties: false description: "" title: user @@ -1942,7 +1941,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1978,8 +1977,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport title: TimeTicket type: object @@ -1998,25 +1997,25 @@ components: title: depth type: integer id: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: id type: object insNextId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: ins_next_id type: object insPrevId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: ins_prev_id type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -2043,7 +2042,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -2055,7 +2054,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -2075,7 +2074,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNode" + $ref: '#/components/schemas/yorkie.v1.TreeNode' type: object title: content type: array @@ -2086,13 +2085,13 @@ components: description: "" properties: leftSiblingId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: left_sibling_id type: object parentId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: parent_id @@ -2104,25 +2103,25 @@ components: description: "" properties: authWebhookMethods: - $ref: "#/components/schemas/yorkie.v1.UpdatableProjectFields.AuthWebhookMethods" + $ref: '#/components/schemas/yorkie.v1.UpdatableProjectFields.AuthWebhookMethods' additionalProperties: false description: "" title: auth_webhook_methods type: object authWebhookUrl: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: auth_webhook_url type: object clientDeactivateThreshold: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: client_deactivate_threshold type: object name: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: name @@ -2147,7 +2146,7 @@ components: description: "" properties: fields: - $ref: "#/components/schemas/yorkie.v1.UpdatableProjectFields" + $ref: '#/components/schemas/yorkie.v1.UpdatableProjectFields' additionalProperties: false description: "" title: fields @@ -2164,7 +2163,7 @@ components: description: "" properties: project: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' additionalProperties: false description: "" title: project @@ -2176,7 +2175,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -2196,34 +2195,34 @@ components: yorkie.v1.ValueType: description: "" enum: - - - VALUE_TYPE_NULL - - 0 - - VALUE_TYPE_BOOLEAN - - 1 - - VALUE_TYPE_INTEGER - - 2 - - VALUE_TYPE_LONG - - 3 - - VALUE_TYPE_DOUBLE - - 4 - - VALUE_TYPE_STRING - - 5 - - VALUE_TYPE_BYTES - - 6 - - VALUE_TYPE_DATE - - 7 - - VALUE_TYPE_JSON_OBJECT - - 8 - - VALUE_TYPE_JSON_ARRAY - - 9 - - VALUE_TYPE_TEXT - - 10 - - VALUE_TYPE_INTEGER_CNT - - 11 - - VALUE_TYPE_LONG_CNT - - 12 - - VALUE_TYPE_TREE - - 13 + - - VALUE_TYPE_NULL + - 0 + - VALUE_TYPE_BOOLEAN + - 1 + - VALUE_TYPE_INTEGER + - 2 + - VALUE_TYPE_LONG + - 3 + - VALUE_TYPE_DOUBLE + - 4 + - VALUE_TYPE_STRING + - 5 + - VALUE_TYPE_BYTES + - 6 + - VALUE_TYPE_DATE + - 7 + - VALUE_TYPE_JSON_OBJECT + - 8 + - VALUE_TYPE_JSON_ARRAY + - 9 + - VALUE_TYPE_TEXT + - 10 + - VALUE_TYPE_INTEGER_CNT + - 11 + - VALUE_TYPE_LONG_CNT + - 12 + - VALUE_TYPE_TREE + - 13 title: ValueType type: string securitySchemes: @@ -2232,7 +2231,7 @@ components: name: Authorization type: apiKey security: - - ApiKeyAuth: [] +- ApiKeyAuth: [] tags: - - description: Admin is a service that provides a API for Admin. - name: yorkie.v1.AdminService +- description: Admin is a service that provides a API for Admin. + name: yorkie.v1.AdminService diff --git a/api/docs/yorkie/v1/cluster.openapi.yaml b/api/docs/yorkie/v1/cluster.openapi.yaml new file mode 100644 index 000000000..faa1132cd --- /dev/null +++ b/api/docs/yorkie/v1/cluster.openapi.yaml @@ -0,0 +1,309 @@ +openapi: 3.1.0 +info: + description: Yorkie is an open source document store for building collaborative + editing applications. + title: Yorkie + version: v0.5.1 +servers: +- description: Production server + url: https://api.yorkie.dev +- description: Local server + url: http://localhost:8080 +paths: + /yorkie.v1.ClusterService/DetachDocument: + post: + description: "" + requestBody: + $ref: '#/components/requestBodies/yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentRequest' + responses: + "200": + $ref: '#/components/responses/yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentResponse' + default: + $ref: '#/components/responses/connect.error' + tags: + - yorkie.v1.ClusterService +components: + requestBodies: + yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentRequest' + application/proto: + schema: + $ref: '#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentRequest' + required: true + responses: + connect.error: + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + application/proto: + schema: + $ref: '#/components/schemas/connect.error' + description: "" + yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentResponse' + application/proto: + schema: + $ref: '#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentResponse' + description: "" + schemas: + connect.error: + additionalProperties: false + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + properties: + code: + enum: + - CodeCanceled + - CodeUnknown + - CodeInvalidArgument + - CodeDeadlineExceeded + - CodeNotFound + - CodeAlreadyExists + - CodePermissionDenied + - CodeResourceExhausted + - CodeFailedPrecondition + - CodeAborted + - CodeOutOfRange + - CodeInternal + - CodeUnavailable + - CodeDataLoss + - CodeUnauthenticated + examples: + - CodeNotFound + type: string + message: + type: string + title: Connect Error + type: object + google.protobuf.Timestamp: + additionalProperties: false + description: |- + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at + nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the + Gregorian calendar backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a [24-hour linear + smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from [RFC + 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + where {year} is always expressed using four digits while {month}, {day}, + {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + is required. A proto3 JSON serializer should always use UTC (as indicated by + "Z") when printing the Timestamp type and a proto3 JSON parser should be + able to accept both UTC and other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + 01:30 UTC on January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the + standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted + to this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + the Joda Time's [`ISODateTimeFormat.dateTime()`]( + http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + ) to obtain a formatter capable of generating timestamps in this format. + format: date-time + type: string + yorkie.v1.ClusterServiceDetachDocumentRequest: + additionalProperties: false + description: "" + properties: + clientId: + additionalProperties: false + description: "" + title: client_id + type: string + documentSummary: + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' + additionalProperties: false + description: "" + title: document_summary + type: object + project: + $ref: '#/components/schemas/yorkie.v1.Project' + additionalProperties: false + description: "" + title: project + type: object + title: ClusterServiceDetachDocumentRequest + type: object + yorkie.v1.ClusterServiceDetachDocumentResponse: + additionalProperties: false + description: "" + title: ClusterServiceDetachDocumentResponse + type: object + yorkie.v1.DocumentSummary: + additionalProperties: false + description: "" + properties: + accessedAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: accessed_at + type: object + createdAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: created_at + type: object + id: + additionalProperties: false + description: "" + title: id + type: string + key: + additionalProperties: false + description: "" + title: key + type: string + snapshot: + additionalProperties: false + description: "" + title: snapshot + type: string + updatedAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: updated_at + type: object + title: DocumentSummary + type: object + yorkie.v1.Project: + additionalProperties: false + description: "" + properties: + authWebhookMethods: + additionalProperties: false + description: "" + items: + type: string + title: auth_webhook_methods + type: array + authWebhookUrl: + additionalProperties: false + description: "" + title: auth_webhook_url + type: string + clientDeactivateThreshold: + additionalProperties: false + description: "" + title: client_deactivate_threshold + type: string + createdAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: created_at + type: object + id: + additionalProperties: false + description: "" + title: id + type: string + name: + additionalProperties: false + description: "" + title: name + type: string + publicKey: + additionalProperties: false + description: "" + title: public_key + type: string + secretKey: + additionalProperties: false + description: "" + title: secret_key + type: string + updatedAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: updated_at + type: object + title: Project + type: object + securitySchemes: + ApiKeyAuth: + in: header + name: Authorization + type: apiKey +security: +- ApiKeyAuth: [] +tags: +- description: ClusterService is a service that provides an API for Cluster. + name: yorkie.v1.ClusterService diff --git a/api/docs/yorkie/v1/resources.openapi.yaml b/api/docs/yorkie/v1/resources.openapi.yaml index 4252c0593..3ffb27254 100644 --- a/api/docs/yorkie/v1/resources.openapi.yaml +++ b/api/docs/yorkie/v1/resources.openapi.yaml @@ -1,15 +1,14 @@ openapi: 3.1.0 info: - description: - Yorkie is an open source document store for building collaborative + description: Yorkie is an open source document store for building collaborative editing applications. title: Yorkie version: v0.5.1 servers: - - description: Production server - url: https://api.yorkie.dev - - description: Local server - url: http://localhost:8080 +- description: Production server + url: https://api.yorkie.dev +- description: Local server + url: http://localhost:8080 paths: {} components: responses: @@ -17,35 +16,35 @@ components: content: application/json: schema: - $ref: "#/components/schemas/connect.error" + $ref: '#/components/schemas/connect.error' application/proto: schema: - $ref: "#/components/schemas/connect.error" + $ref: '#/components/schemas/connect.error' description: "" schemas: connect.error: additionalProperties: false - description: "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' properties: code: enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated + - CodeCanceled + - CodeUnknown + - CodeInvalidArgument + - CodeDeadlineExceeded + - CodeNotFound + - CodeAlreadyExists + - CodePermissionDenied + - CodeResourceExhausted + - CodeFailedPrecondition + - CodeAborted + - CodeOutOfRange + - CodeInternal + - CodeUnavailable + - CodeDataLoss + - CodeUnauthenticated examples: - - CodeNotFound + - CodeNotFound type: string message: type: string @@ -164,7 +163,7 @@ components: description: "" properties: id: - $ref: "#/components/schemas/yorkie.v1.ChangeID" + $ref: '#/components/schemas/yorkie.v1.ChangeID' additionalProperties: false description: "" title: id @@ -178,12 +177,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Operation" + $ref: '#/components/schemas/yorkie.v1.Operation' type: object title: operations type: array presenceChange: - $ref: "#/components/schemas/yorkie.v1.PresenceChange" + $ref: '#/components/schemas/yorkie.v1.PresenceChange' additionalProperties: false description: "" title: presence_change @@ -209,15 +208,15 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport serverSeq: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: ChangeID type: object @@ -231,12 +230,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Change" + $ref: '#/components/schemas/yorkie.v1.Change' type: object title: changes type: array checkpoint: - $ref: "#/components/schemas/yorkie.v1.Checkpoint" + $ref: '#/components/schemas/yorkie.v1.Checkpoint' additionalProperties: false description: "" title: checkpoint @@ -252,7 +251,7 @@ components: title: is_removed type: boolean minSyncedTicket: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: min_synced_ticket @@ -278,8 +277,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: Checkpoint type: object @@ -288,7 +287,7 @@ components: description: "" properties: body: - $ref: "#/components/schemas/yorkie.v1.DocEventBody" + $ref: '#/components/schemas/yorkie.v1.DocEventBody' additionalProperties: false description: "" title: body @@ -299,7 +298,7 @@ components: title: publisher type: string type: - $ref: "#/components/schemas/yorkie.v1.DocEventType" + $ref: '#/components/schemas/yorkie.v1.DocEventType' additionalProperties: false description: "" title: type @@ -325,14 +324,14 @@ components: yorkie.v1.DocEventType: description: "" enum: - - - DOC_EVENT_TYPE_DOCUMENT_CHANGED - - 0 - - DOC_EVENT_TYPE_DOCUMENT_WATCHED - - 1 - - DOC_EVENT_TYPE_DOCUMENT_UNWATCHED - - 2 - - DOC_EVENT_TYPE_DOCUMENT_BROADCAST - - 3 + - - DOC_EVENT_TYPE_DOCUMENT_CHANGED + - 0 + - DOC_EVENT_TYPE_DOCUMENT_WATCHED + - 1 + - DOC_EVENT_TYPE_DOCUMENT_UNWATCHED + - 2 + - DOC_EVENT_TYPE_DOCUMENT_BROADCAST + - 3 title: DocEventType type: string yorkie.v1.DocumentSummary: @@ -340,13 +339,13 @@ components: description: "" properties: accessedAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: accessed_at type: object createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -367,7 +366,7 @@ components: title: snapshot type: string updatedAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: updated_at @@ -379,37 +378,37 @@ components: description: "" properties: counter: - $ref: "#/components/schemas/yorkie.v1.JSONElement.Counter" + $ref: '#/components/schemas/yorkie.v1.JSONElement.Counter' additionalProperties: false description: "" title: counter type: object jsonArray: - $ref: "#/components/schemas/yorkie.v1.JSONElement.JSONArray" + $ref: '#/components/schemas/yorkie.v1.JSONElement.JSONArray' additionalProperties: false description: "" title: json_array type: object jsonObject: - $ref: "#/components/schemas/yorkie.v1.JSONElement.JSONObject" + $ref: '#/components/schemas/yorkie.v1.JSONElement.JSONObject' additionalProperties: false description: "" title: json_object type: object primitive: - $ref: "#/components/schemas/yorkie.v1.JSONElement.Primitive" + $ref: '#/components/schemas/yorkie.v1.JSONElement.Primitive' additionalProperties: false description: "" title: primitive type: object text: - $ref: "#/components/schemas/yorkie.v1.JSONElement.Text" + $ref: '#/components/schemas/yorkie.v1.JSONElement.Text' additionalProperties: false description: "" title: text type: object tree: - $ref: "#/components/schemas/yorkie.v1.JSONElement.Tree" + $ref: '#/components/schemas/yorkie.v1.JSONElement.Tree' additionalProperties: false description: "" title: tree @@ -421,25 +420,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at type: object type: - $ref: "#/components/schemas/yorkie.v1.ValueType" + $ref: '#/components/schemas/yorkie.v1.ValueType' additionalProperties: false description: "" title: type @@ -456,13 +455,13 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at @@ -471,12 +470,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.RGANode" + $ref: '#/components/schemas/yorkie.v1.RGANode' type: object title: nodes type: array removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -488,13 +487,13 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at @@ -503,12 +502,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.RHTNode" + $ref: '#/components/schemas/yorkie.v1.RHTNode' type: object title: nodes type: array removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -520,25 +519,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at type: object type: - $ref: "#/components/schemas/yorkie.v1.ValueType" + $ref: '#/components/schemas/yorkie.v1.ValueType' additionalProperties: false description: "" title: type @@ -555,13 +554,13 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at @@ -570,12 +569,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TextNode" + $ref: '#/components/schemas/yorkie.v1.TextNode' type: object title: nodes type: array removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -587,13 +586,13 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at @@ -602,12 +601,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNode" + $ref: '#/components/schemas/yorkie.v1.TreeNode' type: object title: nodes type: array removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -619,25 +618,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at type: object type: - $ref: "#/components/schemas/yorkie.v1.ValueType" + $ref: '#/components/schemas/yorkie.v1.ValueType' additionalProperties: false description: "" title: type @@ -659,7 +658,7 @@ components: title: is_removed type: boolean updatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: updated_at @@ -676,67 +675,67 @@ components: description: "" properties: add: - $ref: "#/components/schemas/yorkie.v1.Operation.Add" + $ref: '#/components/schemas/yorkie.v1.Operation.Add' additionalProperties: false description: "" title: add type: object arraySet: - $ref: "#/components/schemas/yorkie.v1.Operation.ArraySet" + $ref: '#/components/schemas/yorkie.v1.Operation.ArraySet' additionalProperties: false description: "" title: array_set type: object edit: - $ref: "#/components/schemas/yorkie.v1.Operation.Edit" + $ref: '#/components/schemas/yorkie.v1.Operation.Edit' additionalProperties: false description: "" title: edit type: object increase: - $ref: "#/components/schemas/yorkie.v1.Operation.Increase" + $ref: '#/components/schemas/yorkie.v1.Operation.Increase' additionalProperties: false description: "" title: increase type: object move: - $ref: "#/components/schemas/yorkie.v1.Operation.Move" + $ref: '#/components/schemas/yorkie.v1.Operation.Move' additionalProperties: false description: "" title: move type: object remove: - $ref: "#/components/schemas/yorkie.v1.Operation.Remove" + $ref: '#/components/schemas/yorkie.v1.Operation.Remove' additionalProperties: false description: "" title: remove type: object select: - $ref: "#/components/schemas/yorkie.v1.Operation.Select" + $ref: '#/components/schemas/yorkie.v1.Operation.Select' additionalProperties: false description: "" title: select type: object set: - $ref: "#/components/schemas/yorkie.v1.Operation.Set" + $ref: '#/components/schemas/yorkie.v1.Operation.Set' additionalProperties: false description: "" title: set type: object style: - $ref: "#/components/schemas/yorkie.v1.Operation.Style" + $ref: '#/components/schemas/yorkie.v1.Operation.Style' additionalProperties: false description: "" title: style type: object treeEdit: - $ref: "#/components/schemas/yorkie.v1.Operation.TreeEdit" + $ref: '#/components/schemas/yorkie.v1.Operation.TreeEdit' additionalProperties: false description: "" title: tree_edit type: object treeStyle: - $ref: "#/components/schemas/yorkie.v1.Operation.TreeStyle" + $ref: '#/components/schemas/yorkie.v1.Operation.TreeStyle' additionalProperties: false description: "" title: tree_style @@ -748,25 +747,25 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object prevCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: prev_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -778,25 +777,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -823,25 +822,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -874,7 +873,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -886,19 +885,19 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -910,25 +909,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object prevCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: prev_created_at @@ -940,19 +939,19 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at @@ -968,25 +967,25 @@ components: compatibility purposes. properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -998,7 +997,7 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at @@ -1009,13 +1008,13 @@ components: title: key type: string parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -1037,25 +1036,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -1088,7 +1087,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1103,7 +1102,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNodes" + $ref: '#/components/schemas/yorkie.v1.TreeNodes' type: object title: contents type: array @@ -1113,19 +1112,19 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at @@ -1136,7 +1135,7 @@ components: title: split_level type: integer to: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: to @@ -1153,7 +1152,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1182,25 +1181,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: to @@ -1233,7 +1232,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1272,13 +1271,13 @@ components: description: "" properties: presence: - $ref: "#/components/schemas/yorkie.v1.Presence" + $ref: '#/components/schemas/yorkie.v1.Presence' additionalProperties: false description: "" title: presence type: object type: - $ref: "#/components/schemas/yorkie.v1.PresenceChange.ChangeType" + $ref: '#/components/schemas/yorkie.v1.PresenceChange.ChangeType' additionalProperties: false description: "" title: type @@ -1287,14 +1286,14 @@ components: yorkie.v1.PresenceChange.ChangeType: description: "" enum: - - - CHANGE_TYPE_UNSPECIFIED - - 0 - - CHANGE_TYPE_PUT - - 1 - - CHANGE_TYPE_DELETE - - 2 - - CHANGE_TYPE_CLEAR - - 3 + - - CHANGE_TYPE_UNSPECIFIED + - 0 + - CHANGE_TYPE_PUT + - 1 + - CHANGE_TYPE_DELETE + - 2 + - CHANGE_TYPE_CLEAR + - 3 title: ChangeType type: string yorkie.v1.Project: @@ -1319,7 +1318,7 @@ components: title: client_deactivate_threshold type: string createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -1345,7 +1344,7 @@ components: title: secret_key type: string updatedAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: updated_at @@ -1357,13 +1356,13 @@ components: description: "" properties: element: - $ref: "#/components/schemas/yorkie.v1.JSONElement" + $ref: '#/components/schemas/yorkie.v1.JSONElement' additionalProperties: false description: "" title: element type: object next: - $ref: "#/components/schemas/yorkie.v1.RGANode" + $ref: '#/components/schemas/yorkie.v1.RGANode' additionalProperties: false description: "" title: next @@ -1375,7 +1374,7 @@ components: description: "" properties: element: - $ref: "#/components/schemas/yorkie.v1.JSONElement" + $ref: '#/components/schemas/yorkie.v1.JSONElement' additionalProperties: false description: "" title: element @@ -1400,7 +1399,7 @@ components: title: presences type: object root: - $ref: "#/components/schemas/yorkie.v1.JSONElement" + $ref: '#/components/schemas/yorkie.v1.JSONElement' additionalProperties: false description: "" title: root @@ -1417,7 +1416,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.Presence" + $ref: '#/components/schemas/yorkie.v1.Presence' additionalProperties: false description: "" title: value @@ -1434,19 +1433,19 @@ components: title: attributes type: object id: - $ref: "#/components/schemas/yorkie.v1.TextNodeID" + $ref: '#/components/schemas/yorkie.v1.TextNodeID' additionalProperties: false description: "" title: id type: object insPrevId: - $ref: "#/components/schemas/yorkie.v1.TextNodeID" + $ref: '#/components/schemas/yorkie.v1.TextNodeID' additionalProperties: false description: "" title: ins_prev_id type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -1468,7 +1467,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -1480,7 +1479,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1497,7 +1496,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1533,8 +1532,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport title: TimeTicket type: object @@ -1553,25 +1552,25 @@ components: title: depth type: integer id: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: id type: object insNextId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: ins_next_id type: object insPrevId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: ins_prev_id type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -1598,7 +1597,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -1610,7 +1609,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1630,7 +1629,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNode" + $ref: '#/components/schemas/yorkie.v1.TreeNode' type: object title: content type: array @@ -1641,13 +1640,13 @@ components: description: "" properties: leftSiblingId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: left_sibling_id type: object parentId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: parent_id @@ -1659,25 +1658,25 @@ components: description: "" properties: authWebhookMethods: - $ref: "#/components/schemas/yorkie.v1.UpdatableProjectFields.AuthWebhookMethods" + $ref: '#/components/schemas/yorkie.v1.UpdatableProjectFields.AuthWebhookMethods' additionalProperties: false description: "" title: auth_webhook_methods type: object authWebhookUrl: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: auth_webhook_url type: object clientDeactivateThreshold: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: client_deactivate_threshold type: object name: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: name @@ -1702,7 +1701,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -1722,34 +1721,34 @@ components: yorkie.v1.ValueType: description: "" enum: - - - VALUE_TYPE_NULL - - 0 - - VALUE_TYPE_BOOLEAN - - 1 - - VALUE_TYPE_INTEGER - - 2 - - VALUE_TYPE_LONG - - 3 - - VALUE_TYPE_DOUBLE - - 4 - - VALUE_TYPE_STRING - - 5 - - VALUE_TYPE_BYTES - - 6 - - VALUE_TYPE_DATE - - 7 - - VALUE_TYPE_JSON_OBJECT - - 8 - - VALUE_TYPE_JSON_ARRAY - - 9 - - VALUE_TYPE_TEXT - - 10 - - VALUE_TYPE_INTEGER_CNT - - 11 - - VALUE_TYPE_LONG_CNT - - 12 - - VALUE_TYPE_TREE - - 13 + - - VALUE_TYPE_NULL + - 0 + - VALUE_TYPE_BOOLEAN + - 1 + - VALUE_TYPE_INTEGER + - 2 + - VALUE_TYPE_LONG + - 3 + - VALUE_TYPE_DOUBLE + - 4 + - VALUE_TYPE_STRING + - 5 + - VALUE_TYPE_BYTES + - 6 + - VALUE_TYPE_DATE + - 7 + - VALUE_TYPE_JSON_OBJECT + - 8 + - VALUE_TYPE_JSON_ARRAY + - 9 + - VALUE_TYPE_TEXT + - 10 + - VALUE_TYPE_INTEGER_CNT + - 11 + - VALUE_TYPE_LONG_CNT + - 12 + - VALUE_TYPE_TREE + - 13 title: ValueType type: string securitySchemes: @@ -1758,4 +1757,4 @@ components: name: Authorization type: apiKey security: - - ApiKeyAuth: [] +- ApiKeyAuth: [] diff --git a/api/docs/yorkie/v1/system.openapi.yaml b/api/docs/yorkie/v1/system.openapi.yaml new file mode 100644 index 000000000..f25bc0899 --- /dev/null +++ b/api/docs/yorkie/v1/system.openapi.yaml @@ -0,0 +1,310 @@ +openapi: 3.1.0 +info: + description: Yorkie is an open source document store for building collaborative + editing applications. + title: Yorkie + version: v0.5.1 +servers: +- description: Production server + url: https://api.yorkie.dev +- description: Local server + url: http://localhost:8080 +paths: + /yorkie.v1.SystemService/DetachDocument: + post: + description: "" + requestBody: + $ref: '#/components/requestBodies/yorkie.v1.SystemService.DetachDocument.yorkie.v1.SystemServiceDetachDocumentRequest' + responses: + "200": + $ref: '#/components/responses/yorkie.v1.SystemService.DetachDocument.yorkie.v1.SystemServiceDetachDocumentResponse' + default: + $ref: '#/components/responses/connect.error' + tags: + - yorkie.v1.SystemService +components: + requestBodies: + yorkie.v1.SystemService.DetachDocument.yorkie.v1.SystemServiceDetachDocumentRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/yorkie.v1.SystemServiceDetachDocumentRequest' + application/proto: + schema: + $ref: '#/components/schemas/yorkie.v1.SystemServiceDetachDocumentRequest' + required: true + responses: + connect.error: + content: + application/json: + schema: + $ref: '#/components/schemas/connect.error' + application/proto: + schema: + $ref: '#/components/schemas/connect.error' + description: "" + yorkie.v1.SystemService.DetachDocument.yorkie.v1.SystemServiceDetachDocumentResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/yorkie.v1.SystemServiceDetachDocumentResponse' + application/proto: + schema: + $ref: '#/components/schemas/yorkie.v1.SystemServiceDetachDocumentResponse' + description: "" + schemas: + connect.error: + additionalProperties: false + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' + properties: + code: + enum: + - CodeCanceled + - CodeUnknown + - CodeInvalidArgument + - CodeDeadlineExceeded + - CodeNotFound + - CodeAlreadyExists + - CodePermissionDenied + - CodeResourceExhausted + - CodeFailedPrecondition + - CodeAborted + - CodeOutOfRange + - CodeInternal + - CodeUnavailable + - CodeDataLoss + - CodeUnauthenticated + examples: + - CodeNotFound + type: string + message: + type: string + title: Connect Error + type: object + google.protobuf.Timestamp: + additionalProperties: false + description: |- + A Timestamp represents a point in time independent of any time zone or local + calendar, encoded as a count of seconds and fractions of seconds at + nanosecond resolution. The count is relative to an epoch at UTC midnight on + January 1, 1970, in the proleptic Gregorian calendar which extends the + Gregorian calendar backwards to year one. + + All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap + second table is needed for interpretation, using a [24-hour linear + smear](https://developers.google.com/time/smear). + + The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By + restricting to that range, we ensure that we can convert to and from [RFC + 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. + + # Examples + + Example 1: Compute Timestamp from POSIX `time()`. + + Timestamp timestamp; + timestamp.set_seconds(time(NULL)); + timestamp.set_nanos(0); + + Example 2: Compute Timestamp from POSIX `gettimeofday()`. + + struct timeval tv; + gettimeofday(&tv, NULL); + + Timestamp timestamp; + timestamp.set_seconds(tv.tv_sec); + timestamp.set_nanos(tv.tv_usec * 1000); + + Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. + + FILETIME ft; + GetSystemTimeAsFileTime(&ft); + UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; + + // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z + // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. + Timestamp timestamp; + timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); + timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); + + Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. + + long millis = System.currentTimeMillis(); + + Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) + .setNanos((int) ((millis % 1000) * 1000000)).build(); + + Example 5: Compute Timestamp from Java `Instant.now()`. + + Instant now = Instant.now(); + + Timestamp timestamp = + Timestamp.newBuilder().setSeconds(now.getEpochSecond()) + .setNanos(now.getNano()).build(); + + Example 6: Compute Timestamp from current time in Python. + + timestamp = Timestamp() + timestamp.GetCurrentTime() + + # JSON Mapping + + In JSON format, the Timestamp type is encoded as a string in the + [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the + format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" + where {year} is always expressed using four digits while {month}, {day}, + {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional + seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), + are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone + is required. A proto3 JSON serializer should always use UTC (as indicated by + "Z") when printing the Timestamp type and a proto3 JSON parser should be + able to accept both UTC and other timezones (as indicated by an offset). + + For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past + 01:30 UTC on January 15, 2017. + + In JavaScript, one can convert a Date object to this format using the + standard + [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) + method. In Python, a standard `datetime.datetime` object can be converted + to this format using + [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with + the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use + the Joda Time's [`ISODateTimeFormat.dateTime()`]( + http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime() + ) to obtain a formatter capable of generating timestamps in this format. + format: date-time + type: string + yorkie.v1.DocumentSummary: + additionalProperties: false + description: "" + properties: + accessedAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: accessed_at + type: object + createdAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: created_at + type: object + id: + additionalProperties: false + description: "" + title: id + type: string + key: + additionalProperties: false + description: "" + title: key + type: string + snapshot: + additionalProperties: false + description: "" + title: snapshot + type: string + updatedAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: updated_at + type: object + title: DocumentSummary + type: object + yorkie.v1.Project: + additionalProperties: false + description: "" + properties: + authWebhookMethods: + additionalProperties: false + description: "" + items: + type: string + title: auth_webhook_methods + type: array + authWebhookUrl: + additionalProperties: false + description: "" + title: auth_webhook_url + type: string + clientDeactivateThreshold: + additionalProperties: false + description: "" + title: client_deactivate_threshold + type: string + createdAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: created_at + type: object + id: + additionalProperties: false + description: "" + title: id + type: string + name: + additionalProperties: false + description: "" + title: name + type: string + publicKey: + additionalProperties: false + description: "" + title: public_key + type: string + secretKey: + additionalProperties: false + description: "" + title: secret_key + type: string + updatedAt: + $ref: '#/components/schemas/google.protobuf.Timestamp' + additionalProperties: false + description: "" + title: updated_at + type: object + title: Project + type: object + yorkie.v1.SystemServiceDetachDocumentRequest: + additionalProperties: false + description: "" + properties: + clientId: + additionalProperties: false + description: "" + title: client_id + type: string + documentSummary: + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' + additionalProperties: false + description: "" + title: document_summary + type: object + project: + $ref: '#/components/schemas/yorkie.v1.Project' + additionalProperties: false + description: 'TODO(hackerwins): Consider to replace this fields with types.Project, + types.Client, types.DocumentSummary' + title: project + type: object + title: SystemServiceDetachDocumentRequest + type: object + yorkie.v1.SystemServiceDetachDocumentResponse: + additionalProperties: false + description: "" + title: SystemServiceDetachDocumentResponse + type: object + securitySchemes: + ApiKeyAuth: + in: header + name: Authorization + type: apiKey +security: +- ApiKeyAuth: [] +tags: +- description: System is a service that provides an API for Cluster. + name: yorkie.v1.SystemService diff --git a/api/docs/yorkie/v1/yorkie.openapi.yaml b/api/docs/yorkie/v1/yorkie.openapi.yaml index bdd4bca49..540d0ad16 100644 --- a/api/docs/yorkie/v1/yorkie.openapi.yaml +++ b/api/docs/yorkie/v1/yorkie.openapi.yaml @@ -1,176 +1,175 @@ openapi: 3.1.0 info: - description: - Yorkie is an open source document store for building collaborative + description: Yorkie is an open source document store for building collaborative editing applications. title: Yorkie version: v0.5.1 servers: - - description: Production server - url: https://api.yorkie.dev - - description: Local server - url: http://localhost:8080 +- description: Production server + url: https://api.yorkie.dev +- description: Local server + url: http://localhost:8080 paths: /yorkie.v1.YorkieService/ActivateClient: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.ActivateClient.yorkie.v1.ActivateClientRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.ActivateClient.yorkie.v1.ActivateClientRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.ActivateClient.yorkie.v1.ActivateClientResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.ActivateClient.yorkie.v1.ActivateClientResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService /yorkie.v1.YorkieService/AttachDocument: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.AttachDocument.yorkie.v1.AttachDocumentRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.AttachDocument.yorkie.v1.AttachDocumentRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.AttachDocument.yorkie.v1.AttachDocumentResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.AttachDocument.yorkie.v1.AttachDocumentResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService /yorkie.v1.YorkieService/Broadcast: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.Broadcast.yorkie.v1.BroadcastRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.Broadcast.yorkie.v1.BroadcastRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.Broadcast.yorkie.v1.BroadcastResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.Broadcast.yorkie.v1.BroadcastResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService /yorkie.v1.YorkieService/DeactivateClient: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.DeactivateClient.yorkie.v1.DeactivateClientRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.DeactivateClient.yorkie.v1.DeactivateClientRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.DeactivateClient.yorkie.v1.DeactivateClientResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.DeactivateClient.yorkie.v1.DeactivateClientResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService /yorkie.v1.YorkieService/DetachDocument: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.DetachDocument.yorkie.v1.DetachDocumentRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.DetachDocument.yorkie.v1.DetachDocumentRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.DetachDocument.yorkie.v1.DetachDocumentResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.DetachDocument.yorkie.v1.DetachDocumentResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService /yorkie.v1.YorkieService/PushPullChanges: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.PushPullChanges.yorkie.v1.PushPullChangesRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.PushPullChanges.yorkie.v1.PushPullChangesRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.PushPullChanges.yorkie.v1.PushPullChangesResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.PushPullChanges.yorkie.v1.PushPullChangesResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService /yorkie.v1.YorkieService/RemoveDocument: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.RemoveDocument.yorkie.v1.RemoveDocumentRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.RemoveDocument.yorkie.v1.RemoveDocumentRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.RemoveDocument.yorkie.v1.RemoveDocumentResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.RemoveDocument.yorkie.v1.RemoveDocumentResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService /yorkie.v1.YorkieService/WatchDocument: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.YorkieService.WatchDocument.yorkie.v1.WatchDocumentRequest" + $ref: '#/components/requestBodies/yorkie.v1.YorkieService.WatchDocument.yorkie.v1.WatchDocumentRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.YorkieService.WatchDocument.yorkie.v1.WatchDocumentResponse" + $ref: '#/components/responses/yorkie.v1.YorkieService.WatchDocument.yorkie.v1.WatchDocumentResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.YorkieService + - yorkie.v1.YorkieService components: requestBodies: yorkie.v1.YorkieService.ActivateClient.yorkie.v1.ActivateClientRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ActivateClientRequest" + $ref: '#/components/schemas/yorkie.v1.ActivateClientRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ActivateClientRequest" + $ref: '#/components/schemas/yorkie.v1.ActivateClientRequest' required: true yorkie.v1.YorkieService.AttachDocument.yorkie.v1.AttachDocumentRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.AttachDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.AttachDocumentRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.AttachDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.AttachDocumentRequest' required: true yorkie.v1.YorkieService.Broadcast.yorkie.v1.BroadcastRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.BroadcastRequest" + $ref: '#/components/schemas/yorkie.v1.BroadcastRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.BroadcastRequest" + $ref: '#/components/schemas/yorkie.v1.BroadcastRequest' required: true yorkie.v1.YorkieService.DeactivateClient.yorkie.v1.DeactivateClientRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.DeactivateClientRequest" + $ref: '#/components/schemas/yorkie.v1.DeactivateClientRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.DeactivateClientRequest" + $ref: '#/components/schemas/yorkie.v1.DeactivateClientRequest' required: true yorkie.v1.YorkieService.DetachDocument.yorkie.v1.DetachDocumentRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.DetachDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.DetachDocumentRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.DetachDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.DetachDocumentRequest' required: true yorkie.v1.YorkieService.PushPullChanges.yorkie.v1.PushPullChangesRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.PushPullChangesRequest" + $ref: '#/components/schemas/yorkie.v1.PushPullChangesRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.PushPullChangesRequest" + $ref: '#/components/schemas/yorkie.v1.PushPullChangesRequest' required: true yorkie.v1.YorkieService.RemoveDocument.yorkie.v1.RemoveDocumentRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentRequest' required: true yorkie.v1.YorkieService.WatchDocument.yorkie.v1.WatchDocumentRequest: content: {} @@ -180,100 +179,100 @@ components: content: application/json: schema: - $ref: "#/components/schemas/connect.error" + $ref: '#/components/schemas/connect.error' application/proto: schema: - $ref: "#/components/schemas/connect.error" + $ref: '#/components/schemas/connect.error' description: "" yorkie.v1.YorkieService.ActivateClient.yorkie.v1.ActivateClientResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ActivateClientResponse" + $ref: '#/components/schemas/yorkie.v1.ActivateClientResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ActivateClientResponse" + $ref: '#/components/schemas/yorkie.v1.ActivateClientResponse' description: "" yorkie.v1.YorkieService.AttachDocument.yorkie.v1.AttachDocumentResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.AttachDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.AttachDocumentResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.AttachDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.AttachDocumentResponse' description: "" yorkie.v1.YorkieService.Broadcast.yorkie.v1.BroadcastResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.BroadcastResponse" + $ref: '#/components/schemas/yorkie.v1.BroadcastResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.BroadcastResponse" + $ref: '#/components/schemas/yorkie.v1.BroadcastResponse' description: "" yorkie.v1.YorkieService.DeactivateClient.yorkie.v1.DeactivateClientResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.DeactivateClientResponse" + $ref: '#/components/schemas/yorkie.v1.DeactivateClientResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.DeactivateClientResponse" + $ref: '#/components/schemas/yorkie.v1.DeactivateClientResponse' description: "" yorkie.v1.YorkieService.DetachDocument.yorkie.v1.DetachDocumentResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.DetachDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.DetachDocumentResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.DetachDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.DetachDocumentResponse' description: "" yorkie.v1.YorkieService.PushPullChanges.yorkie.v1.PushPullChangesResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.PushPullChangesResponse" + $ref: '#/components/schemas/yorkie.v1.PushPullChangesResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.PushPullChangesResponse" + $ref: '#/components/schemas/yorkie.v1.PushPullChangesResponse' description: "" yorkie.v1.YorkieService.RemoveDocument.yorkie.v1.RemoveDocumentResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.RemoveDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.RemoveDocumentResponse' description: "" yorkie.v1.YorkieService.WatchDocument.yorkie.v1.WatchDocumentResponse: description: "" schemas: connect.error: additionalProperties: false - description: "Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation" + description: 'Error type returned by Connect: https://connectrpc.com/docs/go/errors/#http-representation' properties: code: enum: - - CodeCanceled - - CodeUnknown - - CodeInvalidArgument - - CodeDeadlineExceeded - - CodeNotFound - - CodeAlreadyExists - - CodePermissionDenied - - CodeResourceExhausted - - CodeFailedPrecondition - - CodeAborted - - CodeOutOfRange - - CodeInternal - - CodeUnavailable - - CodeDataLoss - - CodeUnauthenticated + - CodeCanceled + - CodeUnknown + - CodeInvalidArgument + - CodeDeadlineExceeded + - CodeNotFound + - CodeAlreadyExists + - CodePermissionDenied + - CodeResourceExhausted + - CodeFailedPrecondition + - CodeAborted + - CodeOutOfRange + - CodeInternal + - CodeUnavailable + - CodeDataLoss + - CodeUnauthenticated examples: - - CodeNotFound + - CodeNotFound type: string message: type: string @@ -306,7 +305,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -323,7 +322,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -372,7 +371,7 @@ components: description: "" properties: id: - $ref: "#/components/schemas/yorkie.v1.ChangeID" + $ref: '#/components/schemas/yorkie.v1.ChangeID' additionalProperties: false description: "" title: id @@ -386,12 +385,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Operation" + $ref: '#/components/schemas/yorkie.v1.Operation' type: object title: operations type: array presenceChange: - $ref: "#/components/schemas/yorkie.v1.PresenceChange" + $ref: '#/components/schemas/yorkie.v1.PresenceChange' additionalProperties: false description: "" title: presence_change @@ -417,15 +416,15 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport serverSeq: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: ChangeID type: object @@ -439,12 +438,12 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Change" + $ref: '#/components/schemas/yorkie.v1.Change' type: object title: changes type: array checkpoint: - $ref: "#/components/schemas/yorkie.v1.Checkpoint" + $ref: '#/components/schemas/yorkie.v1.Checkpoint' additionalProperties: false description: "" title: checkpoint @@ -460,7 +459,7 @@ components: title: is_removed type: boolean minSyncedTicket: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: min_synced_ticket @@ -486,8 +485,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: Checkpoint type: object @@ -512,7 +511,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -539,7 +538,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -551,7 +550,7 @@ components: description: "" properties: body: - $ref: "#/components/schemas/yorkie.v1.DocEventBody" + $ref: '#/components/schemas/yorkie.v1.DocEventBody' additionalProperties: false description: "" title: body @@ -562,7 +561,7 @@ components: title: publisher type: string type: - $ref: "#/components/schemas/yorkie.v1.DocEventType" + $ref: '#/components/schemas/yorkie.v1.DocEventType' additionalProperties: false description: "" title: type @@ -588,14 +587,14 @@ components: yorkie.v1.DocEventType: description: "" enum: - - - DOC_EVENT_TYPE_DOCUMENT_CHANGED - - 0 - - DOC_EVENT_TYPE_DOCUMENT_WATCHED - - 1 - - DOC_EVENT_TYPE_DOCUMENT_UNWATCHED - - 2 - - DOC_EVENT_TYPE_DOCUMENT_BROADCAST - - 3 + - - DOC_EVENT_TYPE_DOCUMENT_CHANGED + - 0 + - DOC_EVENT_TYPE_DOCUMENT_WATCHED + - 1 + - DOC_EVENT_TYPE_DOCUMENT_UNWATCHED + - 2 + - DOC_EVENT_TYPE_DOCUMENT_BROADCAST + - 3 title: DocEventType type: string yorkie.v1.JSONElementSimple: @@ -603,25 +602,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object movedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: moved_at type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at type: object type: - $ref: "#/components/schemas/yorkie.v1.ValueType" + $ref: '#/components/schemas/yorkie.v1.ValueType' additionalProperties: false description: "" title: type @@ -643,7 +642,7 @@ components: title: is_removed type: boolean updatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: updated_at @@ -660,67 +659,67 @@ components: description: "" properties: add: - $ref: "#/components/schemas/yorkie.v1.Operation.Add" + $ref: '#/components/schemas/yorkie.v1.Operation.Add' additionalProperties: false description: "" title: add type: object arraySet: - $ref: "#/components/schemas/yorkie.v1.Operation.ArraySet" + $ref: '#/components/schemas/yorkie.v1.Operation.ArraySet' additionalProperties: false description: "" title: array_set type: object edit: - $ref: "#/components/schemas/yorkie.v1.Operation.Edit" + $ref: '#/components/schemas/yorkie.v1.Operation.Edit' additionalProperties: false description: "" title: edit type: object increase: - $ref: "#/components/schemas/yorkie.v1.Operation.Increase" + $ref: '#/components/schemas/yorkie.v1.Operation.Increase' additionalProperties: false description: "" title: increase type: object move: - $ref: "#/components/schemas/yorkie.v1.Operation.Move" + $ref: '#/components/schemas/yorkie.v1.Operation.Move' additionalProperties: false description: "" title: move type: object remove: - $ref: "#/components/schemas/yorkie.v1.Operation.Remove" + $ref: '#/components/schemas/yorkie.v1.Operation.Remove' additionalProperties: false description: "" title: remove type: object select: - $ref: "#/components/schemas/yorkie.v1.Operation.Select" + $ref: '#/components/schemas/yorkie.v1.Operation.Select' additionalProperties: false description: "" title: select type: object set: - $ref: "#/components/schemas/yorkie.v1.Operation.Set" + $ref: '#/components/schemas/yorkie.v1.Operation.Set' additionalProperties: false description: "" title: set type: object style: - $ref: "#/components/schemas/yorkie.v1.Operation.Style" + $ref: '#/components/schemas/yorkie.v1.Operation.Style' additionalProperties: false description: "" title: style type: object treeEdit: - $ref: "#/components/schemas/yorkie.v1.Operation.TreeEdit" + $ref: '#/components/schemas/yorkie.v1.Operation.TreeEdit' additionalProperties: false description: "" title: tree_edit type: object treeStyle: - $ref: "#/components/schemas/yorkie.v1.Operation.TreeStyle" + $ref: '#/components/schemas/yorkie.v1.Operation.TreeStyle' additionalProperties: false description: "" title: tree_style @@ -732,25 +731,25 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object prevCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: prev_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -762,25 +761,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -807,25 +806,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -858,7 +857,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -870,19 +869,19 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -894,25 +893,25 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object prevCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: prev_created_at @@ -924,19 +923,19 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at @@ -952,25 +951,25 @@ components: compatibility purposes. properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -982,7 +981,7 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at @@ -993,13 +992,13 @@ components: title: key type: string parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object value: - $ref: "#/components/schemas/yorkie.v1.JSONElementSimple" + $ref: '#/components/schemas/yorkie.v1.JSONElementSimple' additionalProperties: false description: "" title: value @@ -1021,25 +1020,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TextNodePos" + $ref: '#/components/schemas/yorkie.v1.TextNodePos' additionalProperties: false description: "" title: to @@ -1072,7 +1071,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1087,7 +1086,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNodes" + $ref: '#/components/schemas/yorkie.v1.TreeNodes' type: object title: contents type: array @@ -1097,19 +1096,19 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at @@ -1120,7 +1119,7 @@ components: title: split_level type: integer to: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: to @@ -1137,7 +1136,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1166,25 +1165,25 @@ components: title: created_at_map_by_actor type: object executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at type: object from: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: from type: object parentCreatedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: parent_created_at type: object to: - $ref: "#/components/schemas/yorkie.v1.TreePos" + $ref: '#/components/schemas/yorkie.v1.TreePos' additionalProperties: false description: "" title: to @@ -1217,7 +1216,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1256,13 +1255,13 @@ components: description: "" properties: presence: - $ref: "#/components/schemas/yorkie.v1.Presence" + $ref: '#/components/schemas/yorkie.v1.Presence' additionalProperties: false description: "" title: presence type: object type: - $ref: "#/components/schemas/yorkie.v1.PresenceChange.ChangeType" + $ref: '#/components/schemas/yorkie.v1.PresenceChange.ChangeType' additionalProperties: false description: "" title: type @@ -1271,14 +1270,14 @@ components: yorkie.v1.PresenceChange.ChangeType: description: "" enum: - - - CHANGE_TYPE_UNSPECIFIED - - 0 - - CHANGE_TYPE_PUT - - 1 - - CHANGE_TYPE_DELETE - - 2 - - CHANGE_TYPE_CLEAR - - 3 + - - CHANGE_TYPE_UNSPECIFIED + - 0 + - CHANGE_TYPE_PUT + - 1 + - CHANGE_TYPE_DELETE + - 2 + - CHANGE_TYPE_CLEAR + - 3 title: ChangeType type: string yorkie.v1.PushPullChangesRequest: @@ -1286,7 +1285,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -1313,7 +1312,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -1325,7 +1324,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -1347,7 +1346,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -1359,7 +1358,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1395,8 +1394,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport title: TimeTicket type: object @@ -1415,25 +1414,25 @@ components: title: depth type: integer id: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: id type: object insNextId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: ins_next_id type: object insPrevId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: ins_prev_id type: object removedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: removed_at @@ -1460,7 +1459,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -1472,7 +1471,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1492,7 +1491,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNode" + $ref: '#/components/schemas/yorkie.v1.TreeNode' type: object title: content type: array @@ -1503,13 +1502,13 @@ components: description: "" properties: leftSiblingId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: left_sibling_id type: object parentId: - $ref: "#/components/schemas/yorkie.v1.TreeNodeID" + $ref: '#/components/schemas/yorkie.v1.TreeNodeID' additionalProperties: false description: "" title: parent_id @@ -1519,34 +1518,34 @@ components: yorkie.v1.ValueType: description: "" enum: - - - VALUE_TYPE_NULL - - 0 - - VALUE_TYPE_BOOLEAN - - 1 - - VALUE_TYPE_INTEGER - - 2 - - VALUE_TYPE_LONG - - 3 - - VALUE_TYPE_DOUBLE - - 4 - - VALUE_TYPE_STRING - - 5 - - VALUE_TYPE_BYTES - - 6 - - VALUE_TYPE_DATE - - 7 - - VALUE_TYPE_JSON_OBJECT - - 8 - - VALUE_TYPE_JSON_ARRAY - - 9 - - VALUE_TYPE_TEXT - - 10 - - VALUE_TYPE_INTEGER_CNT - - 11 - - VALUE_TYPE_LONG_CNT - - 12 - - VALUE_TYPE_TREE - - 13 + - - VALUE_TYPE_NULL + - 0 + - VALUE_TYPE_BOOLEAN + - 1 + - VALUE_TYPE_INTEGER + - 2 + - VALUE_TYPE_LONG + - 3 + - VALUE_TYPE_DOUBLE + - 4 + - VALUE_TYPE_STRING + - 5 + - VALUE_TYPE_BYTES + - 6 + - VALUE_TYPE_DATE + - 7 + - VALUE_TYPE_JSON_OBJECT + - 8 + - VALUE_TYPE_JSON_ARRAY + - 9 + - VALUE_TYPE_TEXT + - 10 + - VALUE_TYPE_INTEGER_CNT + - 11 + - VALUE_TYPE_LONG_CNT + - 12 + - VALUE_TYPE_TREE + - 13 title: ValueType type: string yorkie.v1.WatchDocumentRequest: @@ -1570,13 +1569,13 @@ components: description: "" properties: event: - $ref: "#/components/schemas/yorkie.v1.DocEvent" + $ref: '#/components/schemas/yorkie.v1.DocEvent' additionalProperties: false description: "" title: event type: object initialization: - $ref: "#/components/schemas/yorkie.v1.WatchDocumentResponse.Initialization" + $ref: '#/components/schemas/yorkie.v1.WatchDocumentResponse.Initialization' additionalProperties: false description: "" title: initialization @@ -1602,7 +1601,7 @@ components: name: Authorization type: apiKey security: - - ApiKeyAuth: [] +- ApiKeyAuth: [] tags: - - description: Yorkie is a service that provides a API for SDKs. - name: yorkie.v1.YorkieService +- description: Yorkie is a service that provides an API for SDKs. + name: yorkie.v1.YorkieService diff --git a/api/yorkie/v1/cluster.pb.go b/api/yorkie/v1/cluster.pb.go new file mode 100644 index 000000000..cb99cb55c --- /dev/null +++ b/api/yorkie/v1/cluster.pb.go @@ -0,0 +1,257 @@ +// +// Copyright 2024 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. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc (unknown) +// source: yorkie/v1/cluster.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type ClusterServiceDetachDocumentRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Project *Project `protobuf:"bytes,1,opt,name=project,proto3" json:"project,omitempty"` + ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"` + DocumentSummary *DocumentSummary `protobuf:"bytes,3,opt,name=document_summary,json=documentSummary,proto3" json:"document_summary,omitempty"` +} + +func (x *ClusterServiceDetachDocumentRequest) Reset() { + *x = ClusterServiceDetachDocumentRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_yorkie_v1_cluster_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterServiceDetachDocumentRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterServiceDetachDocumentRequest) ProtoMessage() {} + +func (x *ClusterServiceDetachDocumentRequest) ProtoReflect() protoreflect.Message { + mi := &file_yorkie_v1_cluster_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterServiceDetachDocumentRequest.ProtoReflect.Descriptor instead. +func (*ClusterServiceDetachDocumentRequest) Descriptor() ([]byte, []int) { + return file_yorkie_v1_cluster_proto_rawDescGZIP(), []int{0} +} + +func (x *ClusterServiceDetachDocumentRequest) GetProject() *Project { + if x != nil { + return x.Project + } + return nil +} + +func (x *ClusterServiceDetachDocumentRequest) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *ClusterServiceDetachDocumentRequest) GetDocumentSummary() *DocumentSummary { + if x != nil { + return x.DocumentSummary + } + return nil +} + +type ClusterServiceDetachDocumentResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *ClusterServiceDetachDocumentResponse) Reset() { + *x = ClusterServiceDetachDocumentResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_yorkie_v1_cluster_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ClusterServiceDetachDocumentResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClusterServiceDetachDocumentResponse) ProtoMessage() {} + +func (x *ClusterServiceDetachDocumentResponse) ProtoReflect() protoreflect.Message { + mi := &file_yorkie_v1_cluster_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ClusterServiceDetachDocumentResponse.ProtoReflect.Descriptor instead. +func (*ClusterServiceDetachDocumentResponse) Descriptor() ([]byte, []int) { + return file_yorkie_v1_cluster_proto_rawDescGZIP(), []int{1} +} + +var File_yorkie_v1_cluster_proto protoreflect.FileDescriptor + +var file_yorkie_v1_cluster_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6c, 0x75, 0x73, + 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x19, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2f, 0x76, 0x31, 0x2f, + 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0xb7, 0x01, 0x0a, 0x23, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, + 0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, + 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x49, 0x64, 0x12, 0x45, 0x0a, 0x10, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x73, + 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x79, + 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, + 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x52, 0x0f, 0x64, 0x6f, 0x63, 0x75, 0x6d, 0x65, + 0x6e, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x22, 0x26, 0x0a, 0x24, 0x43, 0x6c, 0x75, + 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x74, 0x61, 0x63, + 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x85, 0x01, 0x0a, 0x0e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x0e, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x44, 0x6f, + 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x2e, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x45, 0x0a, 0x11, 0x64, 0x65, 0x76, + 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x50, 0x01, + 0x5a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x79, 0x6f, 0x72, + 0x6b, 0x69, 0x65, 0x2d, 0x74, 0x65, 0x61, 0x6d, 0x2f, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2f, + 0x61, 0x70, 0x69, 0x2f, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_yorkie_v1_cluster_proto_rawDescOnce sync.Once + file_yorkie_v1_cluster_proto_rawDescData = file_yorkie_v1_cluster_proto_rawDesc +) + +func file_yorkie_v1_cluster_proto_rawDescGZIP() []byte { + file_yorkie_v1_cluster_proto_rawDescOnce.Do(func() { + file_yorkie_v1_cluster_proto_rawDescData = protoimpl.X.CompressGZIP(file_yorkie_v1_cluster_proto_rawDescData) + }) + return file_yorkie_v1_cluster_proto_rawDescData +} + +var file_yorkie_v1_cluster_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_yorkie_v1_cluster_proto_goTypes = []interface{}{ + (*ClusterServiceDetachDocumentRequest)(nil), // 0: yorkie.v1.ClusterServiceDetachDocumentRequest + (*ClusterServiceDetachDocumentResponse)(nil), // 1: yorkie.v1.ClusterServiceDetachDocumentResponse + (*Project)(nil), // 2: yorkie.v1.Project + (*DocumentSummary)(nil), // 3: yorkie.v1.DocumentSummary +} +var file_yorkie_v1_cluster_proto_depIdxs = []int32{ + 2, // 0: yorkie.v1.ClusterServiceDetachDocumentRequest.project:type_name -> yorkie.v1.Project + 3, // 1: yorkie.v1.ClusterServiceDetachDocumentRequest.document_summary:type_name -> yorkie.v1.DocumentSummary + 0, // 2: yorkie.v1.ClusterService.DetachDocument:input_type -> yorkie.v1.ClusterServiceDetachDocumentRequest + 1, // 3: yorkie.v1.ClusterService.DetachDocument:output_type -> yorkie.v1.ClusterServiceDetachDocumentResponse + 3, // [3:4] is the sub-list for method output_type + 2, // [2:3] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_yorkie_v1_cluster_proto_init() } +func file_yorkie_v1_cluster_proto_init() { + if File_yorkie_v1_cluster_proto != nil { + return + } + file_yorkie_v1_resources_proto_init() + if !protoimpl.UnsafeEnabled { + file_yorkie_v1_cluster_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterServiceDetachDocumentRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_yorkie_v1_cluster_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ClusterServiceDetachDocumentResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_yorkie_v1_cluster_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_yorkie_v1_cluster_proto_goTypes, + DependencyIndexes: file_yorkie_v1_cluster_proto_depIdxs, + MessageInfos: file_yorkie_v1_cluster_proto_msgTypes, + }.Build() + File_yorkie_v1_cluster_proto = out.File + file_yorkie_v1_cluster_proto_rawDesc = nil + file_yorkie_v1_cluster_proto_goTypes = nil + file_yorkie_v1_cluster_proto_depIdxs = nil +} diff --git a/api/yorkie/v1/cluster.proto b/api/yorkie/v1/cluster.proto new file mode 100644 index 000000000..2b565b838 --- /dev/null +++ b/api/yorkie/v1/cluster.proto @@ -0,0 +1,38 @@ +/* + * Copyright 2024 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. + */ +syntax = "proto3"; + +package yorkie.v1; + +import "yorkie/v1/resources.proto"; + +option go_package = "github.com/yorkie-team/yorkie/api/yorkie/v1;v1"; + +option java_multiple_files = true; +option java_package = "dev.yorkie.api.v1"; + +// ClusterService is a service that provides an API for Cluster. +service ClusterService { + rpc DetachDocument (ClusterServiceDetachDocumentRequest) returns (ClusterServiceDetachDocumentResponse) {} +} + +message ClusterServiceDetachDocumentRequest { + Project project = 1; + string client_id = 2; + DocumentSummary document_summary = 3; +} + +message ClusterServiceDetachDocumentResponse {} diff --git a/api/yorkie/v1/v1connect/cluster.connect.go b/api/yorkie/v1/v1connect/cluster.connect.go new file mode 100644 index 000000000..707d003dd --- /dev/null +++ b/api/yorkie/v1/v1connect/cluster.connect.go @@ -0,0 +1,120 @@ +// +// Copyright 2024 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. + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: yorkie/v1/cluster.proto + +package v1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "github.com/yorkie-team/yorkie/api/yorkie/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion0_1_0 + +const ( + // ClusterServiceName is the fully-qualified name of the ClusterService service. + ClusterServiceName = "yorkie.v1.ClusterService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // ClusterServiceDetachDocumentProcedure is the fully-qualified name of the ClusterService's + // DetachDocument RPC. + ClusterServiceDetachDocumentProcedure = "/yorkie.v1.ClusterService/DetachDocument" +) + +// ClusterServiceClient is a client for the yorkie.v1.ClusterService service. +type ClusterServiceClient interface { + DetachDocument(context.Context, *connect.Request[v1.ClusterServiceDetachDocumentRequest]) (*connect.Response[v1.ClusterServiceDetachDocumentResponse], error) +} + +// NewClusterServiceClient constructs a client for the yorkie.v1.ClusterService service. By default, +// it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and +// sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() +// or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewClusterServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) ClusterServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &clusterServiceClient{ + detachDocument: connect.NewClient[v1.ClusterServiceDetachDocumentRequest, v1.ClusterServiceDetachDocumentResponse]( + httpClient, + baseURL+ClusterServiceDetachDocumentProcedure, + opts..., + ), + } +} + +// clusterServiceClient implements ClusterServiceClient. +type clusterServiceClient struct { + detachDocument *connect.Client[v1.ClusterServiceDetachDocumentRequest, v1.ClusterServiceDetachDocumentResponse] +} + +// DetachDocument calls yorkie.v1.ClusterService.DetachDocument. +func (c *clusterServiceClient) DetachDocument(ctx context.Context, req *connect.Request[v1.ClusterServiceDetachDocumentRequest]) (*connect.Response[v1.ClusterServiceDetachDocumentResponse], error) { + return c.detachDocument.CallUnary(ctx, req) +} + +// ClusterServiceHandler is an implementation of the yorkie.v1.ClusterService service. +type ClusterServiceHandler interface { + DetachDocument(context.Context, *connect.Request[v1.ClusterServiceDetachDocumentRequest]) (*connect.Response[v1.ClusterServiceDetachDocumentResponse], error) +} + +// NewClusterServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewClusterServiceHandler(svc ClusterServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + clusterServiceDetachDocumentHandler := connect.NewUnaryHandler( + ClusterServiceDetachDocumentProcedure, + svc.DetachDocument, + opts..., + ) + return "/yorkie.v1.ClusterService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case ClusterServiceDetachDocumentProcedure: + clusterServiceDetachDocumentHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedClusterServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedClusterServiceHandler struct{} + +func (UnimplementedClusterServiceHandler) DetachDocument(context.Context, *connect.Request[v1.ClusterServiceDetachDocumentRequest]) (*connect.Response[v1.ClusterServiceDetachDocumentResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("yorkie.v1.ClusterService.DetachDocument is not implemented")) +} diff --git a/api/yorkie/v1/yorkie.proto b/api/yorkie/v1/yorkie.proto index 8ca20e120..876dc066a 100644 --- a/api/yorkie/v1/yorkie.proto +++ b/api/yorkie/v1/yorkie.proto @@ -24,7 +24,7 @@ option go_package = "github.com/yorkie-team/yorkie/api/yorkie/v1;v1"; option java_multiple_files = true; option java_package = "dev.yorkie.api.v1"; -// Yorkie is a service that provides a API for SDKs. +// Yorkie is a service that provides an API for SDKs. service YorkieService { rpc ActivateClient (ActivateClientRequest) returns (ActivateClientResponse) {} rpc DeactivateClient (DeactivateClientRequest) returns (DeactivateClientResponse) {} diff --git a/build/charts/yorkie-cluster/templates/yorkie/deployment.yaml b/build/charts/yorkie-cluster/templates/yorkie/deployment.yaml index a07c01a10..88807bf9e 100644 --- a/build/charts/yorkie-cluster/templates/yorkie/deployment.yaml +++ b/build/charts/yorkie-cluster/templates/yorkie/deployment.yaml @@ -45,6 +45,8 @@ spec: "{{ .Values.yorkie.ports.rpcPort }}", "--profiling-port", "{{ .Values.yorkie.ports.profilingPort }}", + "--backend-gateway-addr", + "yorkie-gateway.{{ .Values.yorkie.namespace }}.svc.cluster.local", ] ports: - containerPort: {{ .Values.yorkie.ports.rpcPort }} diff --git a/client/client.go b/client/client.go index 3f2f082b0..46b39d925 100644 --- a/client/client.go +++ b/client/client.go @@ -193,7 +193,7 @@ func Dial(rpcAddr string, opts ...Option) (*Client, error) { // Dial dials the given rpcAddr. func (c *Client) Dial(rpcAddr string) error { if !strings.Contains(rpcAddr, "://") { - if c.conn.Transport == nil { + if c.options.CertFile == "" { rpcAddr = "http://" + rpcAddr } else { rpcAddr = "https://" + rpcAddr diff --git a/cluster/client.go b/cluster/client.go new file mode 100644 index 000000000..998f82ee8 --- /dev/null +++ b/cluster/client.go @@ -0,0 +1,167 @@ +/* + * Copyright 2024 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. + */ + +// Package cluster is a package for the cluster service for communication between +// nodes in the Yorkie cluster. +package cluster + +import ( + "context" + "crypto/tls" + "fmt" + "net/http" + "strings" + + "connectrpc.com/connect" + "go.uber.org/zap" + "golang.org/x/net/http2" + + "github.com/yorkie-team/yorkie/api/converter" + "github.com/yorkie-team/yorkie/api/types" + api "github.com/yorkie-team/yorkie/api/yorkie/v1" + "github.com/yorkie-team/yorkie/api/yorkie/v1/v1connect" + "github.com/yorkie-team/yorkie/pkg/document/key" + "github.com/yorkie-team/yorkie/pkg/document/time" +) + +// Option configures Options. +type Option func(*Options) + +// WithLogger configures the Logger of the client. +func WithLogger(logger *zap.Logger) Option { + return func(o *Options) { o.Logger = logger } +} + +// WithSecure configures secure option of the client. +func WithSecure(isSecure bool) Option { + return func(o *Options) { o.IsSecure = isSecure } +} + +// Options configures how we set up the client. +type Options struct { + // Logger is the Logger of the client. + Logger *zap.Logger + + // IsSecure is whether to enable the TLS connection of the client. + IsSecure bool +} + +// Client is a client for admin service. +type Client struct { + conn *http.Client + client v1connect.ClusterServiceClient + logger *zap.Logger + isSecure bool +} + +// New creates an instance of Client. +func New(opts ...Option) (*Client, error) { + var options Options + for _, opt := range opts { + opt(&options) + } + + conn := &http.Client{} + if options.IsSecure { + tlsConfig := &tls.Config{MinVersion: tls.VersionTLS12} + conn.Transport = &http2.Transport{TLSClientConfig: tlsConfig} + } + + logger := options.Logger + if logger == nil { + l, err := zap.NewProduction() + if err != nil { + return nil, fmt.Errorf("create logger: %w", err) + } + logger = l + } + + return &Client{ + conn: conn, + logger: logger, + isSecure: options.IsSecure, + }, nil +} + +// Dial creates an instance of Client and dials to the admin service. +func Dial(rpcAddr string, opts ...Option) (*Client, error) { + cli, err := New(opts...) + if err != nil { + return nil, err + } + + if err := cli.Dial(rpcAddr); err != nil { + return nil, err + } + + return cli, nil +} + +// Dial dials to the admin service. +func (c *Client) Dial(rpcAddr string) error { + if !strings.Contains(rpcAddr, "://") { + if c.isSecure { + rpcAddr = "https://" + rpcAddr + } else { + rpcAddr = "http://" + rpcAddr + } + } + + c.client = v1connect.NewClusterServiceClient(c.conn, rpcAddr) + + return nil +} + +// Close closes the connection to the admin service. +func (c *Client) Close() { + c.conn.CloseIdleConnections() +} + +// DetachDocument detaches the given document from the client. +func (c *Client) DetachDocument( + ctx context.Context, + project *types.Project, + clientID *time.ActorID, + docID types.ID, + apiKey string, + docKey key.Key, +) error { + _, err := c.client.DetachDocument( + ctx, + withShardKey(connect.NewRequest(&api.ClusterServiceDetachDocumentRequest{ + Project: converter.ToProject(project), + ClientId: clientID.String(), + DocumentSummary: converter.ToDocumentSummary(&types.DocumentSummary{ + ID: docID, + Key: docKey, + }), + }, + ), apiKey, docKey.String())) + if err != nil { + return err + } + + return nil +} + +/** +* withShardKey returns a context with the given shard key in metadata. + */ +func withShardKey[T any](conn *connect.Request[T], keys ...string) *connect.Request[T] { + conn.Header().Add(types.ShardKey, strings.Join(keys, "/")) + + return conn +} diff --git a/cmd/yorkie/server.go b/cmd/yorkie/server.go index cca3b91d5..54ea63094 100644 --- a/cmd/yorkie/server.go +++ b/cmd/yorkie/server.go @@ -345,6 +345,12 @@ func init() { server.DefaultHostname, "Yorkie Server Hostname", ) + cmd.Flags().StringVar( + &conf.Backend.GatewayAddr, + "backend-gateway-addr", + server.DefaultGatewayAddr, + "Gateway address", + ) rootCmd.AddCommand(cmd) } diff --git a/pkg/document/document.go b/pkg/document/document.go index 00b0e0411..da34d265a 100644 --- a/pkg/document/document.go +++ b/pkg/document/document.go @@ -454,6 +454,10 @@ func (d *Document) BroadcastEventHandlers() map[string]func( return d.broadcastEventHandlers } +func (d *Document) setInternalDoc(internalDoc *InternalDocument) { + d.doc = internalDoc +} + func messageFromMsgAndArgs(msgAndArgs ...interface{}) string { if len(msgAndArgs) == 0 { return "" diff --git a/pkg/document/internal_document.go b/pkg/document/internal_document.go index 40697b809..296b5e642 100644 --- a/pkg/document/internal_document.go +++ b/pkg/document/internal_document.go @@ -136,6 +136,18 @@ func (d *InternalDocument) Checkpoint() change.Checkpoint { return d.checkpoint } +// SyncCheckpoint syncs the checkpoint and the changeID with the given serverSeq +// and clientSeq. +func (d *InternalDocument) SyncCheckpoint(serverSeq int64, clientSeq uint32) { + d.changeID = change.NewID( + clientSeq, + serverSeq, + d.changeID.Lamport(), + d.changeID.ActorID(), + ) + d.checkpoint = d.checkpoint.SyncClientSeq(clientSeq) +} + // HasLocalChanges returns whether this document has local changes or not. func (d *InternalDocument) HasLocalChanges() bool { return len(d.localChanges) > 0 @@ -372,3 +384,10 @@ func (d *InternalDocument) AddOnlineClient(clientID string) { func (d *InternalDocument) RemoveOnlineClient(clientID string) { d.onlineClients.Delete(clientID) } + +// ToDocument converts this document to Document. +func (d *InternalDocument) ToDocument() *Document { + doc := New(d.key) + doc.setInternalDoc(d) + return doc +} diff --git a/server/backend/config.go b/server/backend/config.go index 38d87b2d3..8b5cbc511 100644 --- a/server/backend/config.go +++ b/server/backend/config.go @@ -81,6 +81,9 @@ type Config struct { // Hostname is yorkie server hostname. hostname is used by metrics. Hostname string `yaml:"Hostname"` + + // GatewayAddr is the address of the gateway server. + GatewayAddr string `yaml:"GatewayAddr"` } // Validate validates this config. diff --git a/server/backend/database/client_info.go b/server/backend/database/client_info.go index f61c81769..5143cb435 100644 --- a/server/backend/database/client_info.go +++ b/server/backend/database/client_info.go @@ -200,6 +200,17 @@ func (i *ClientInfo) UpdateCheckpoint( return nil } +// ServerSeq returns the server sequence of the given document. +func (i *ClientInfo) ServerSeq( + docID types.ID, +) (int64, error) { + if !i.hasDocument(docID) { + return 0, fmt.Errorf("document not found %s: %w", docID, ErrDocumentNotFound) + } + + return i.Documents[docID].ServerSeq, nil +} + // EnsureActivated ensures the client is activated. func (i *ClientInfo) EnsureActivated() error { if i.Status != ClientActivated { diff --git a/server/backend/database/memory/database.go b/server/backend/database/memory/database.go index 13a04789c..51d31f030 100644 --- a/server/backend/database/memory/database.go +++ b/server/backend/database/memory/database.go @@ -569,13 +569,6 @@ func (d *DB) DeactivateClient(_ context.Context, refKey types.ClientRefKey) (*da // the stored objects are returned instead of new objects. This can cause // problems when directly modifying loaded objects. So, we need to DeepCopy. clientInfo = clientInfo.DeepCopy() - for docID := range clientInfo.Documents { - if clientInfo.Documents[docID].Status == database.DocumentAttached { - if err := clientInfo.DetachDocument(docID); err != nil { - return nil, err - } - } - } clientInfo.Deactivate() if err := txn.Insert(tblClients, clientInfo); err != nil { diff --git a/server/backend/database/mongo/client.go b/server/backend/database/mongo/client.go index 16ec85b63..fbf6cf527 100644 --- a/server/backend/database/mongo/client.go +++ b/server/backend/database/mongo/client.go @@ -554,34 +554,10 @@ func (c *Client) DeactivateClient(ctx context.Context, refKey types.ClientRefKey res := c.collection(ColClients).FindOneAndUpdate(ctx, bson.M{ "project_id": refKey.ProjectID, "_id": refKey.ClientID, - }, bson.A{ - bson.M{ - "$set": bson.M{ - "status": database.ClientDeactivated, - "updated_at": gotime.Now(), - "documents": bson.M{ - "$arrayToObject": bson.M{ - "$map": bson.M{ - "input": bson.M{"$objectToArray": "$documents"}, - "as": "doc", - "in": bson.M{ - "k": "$$doc.k", - "v": bson.M{ - "$cond": bson.M{ - "if": bson.M{"$eq": bson.A{"$$doc.v.status", database.DocumentAttached}}, - "then": bson.M{ - "client_seq": 0, - "server_seq": 0, - "status": database.DocumentDetached, - }, - "else": "$$doc.v", - }, - }, - }, - }, - }, - }, - }, + }, bson.M{ + "$set": bson.M{ + "status": database.ClientDeactivated, + "updated_at": gotime.Now(), }, }, options.FindOneAndUpdate().SetReturnDocument(options.After)) diff --git a/server/backend/database/testcases/testcases.go b/server/backend/database/testcases/testcases.go index 2108f8c83..839bbc43f 100644 --- a/server/backend/database/testcases/testcases.go +++ b/server/backend/database/testcases/testcases.go @@ -676,56 +676,6 @@ func RunActivateClientDeactivateClientTest(t *testing.T, db database.Database, p assert.Equal(t, t.Name(), clientInfo.Key) assert.Equal(t, database.ClientDeactivated, clientInfo.Status) }) - - t.Run("ensure document detached when deactivate client test", func(t *testing.T) { - ctx := context.Background() - - // 01. Create a client - clientInfo, err := db.ActivateClient(ctx, projectID, t.Name()) - assert.NoError(t, err) - assert.Equal(t, t.Name(), clientInfo.Key) - assert.Equal(t, database.ClientActivated, clientInfo.Status) - - // 02. Create documents and attach them to the client - for i := 0; i < 3; i++ { - docInfo, _ := db.FindDocInfoByKeyAndOwner(ctx, clientInfo.RefKey(), helper.TestDocKey(t, i), true) - assert.NoError(t, clientInfo.AttachDocument(docInfo.ID, false)) - clientInfo.Documents[docInfo.ID].ServerSeq = 1 - clientInfo.Documents[docInfo.ID].ClientSeq = 1 - assert.NoError(t, db.UpdateClientInfoAfterPushPull(ctx, clientInfo, docInfo)) - - result, err := db.FindClientInfoByRefKey(ctx, clientInfo.RefKey()) - assert.Equal(t, result.Documents[docInfo.ID].Status, database.DocumentAttached) - assert.Equal(t, result.Documents[docInfo.ID].ServerSeq, int64(1)) - assert.Equal(t, result.Documents[docInfo.ID].ClientSeq, uint32(1)) - assert.NoError(t, err) - } - - // 03. Remove one document - docInfo, err := db.FindDocInfoByKeyAndOwner(ctx, clientInfo.RefKey(), helper.TestDocKey(t, 2), true) - assert.NoError(t, err) - assert.NoError(t, clientInfo.RemoveDocument(docInfo.ID)) - assert.NoError(t, db.UpdateClientInfoAfterPushPull(ctx, clientInfo, docInfo)) - - // 04. Deactivate the client - result, err := db.DeactivateClient(ctx, types.ClientRefKey{ - ProjectID: projectID, - ClientID: clientInfo.ID, - }) - assert.NoError(t, err) - - // 05. Check whether doc.Status is reflected properly. - // If it was `DocumentAttached`, it should be changed to `DocumentDetached`. - for i := 0; i < 2; i++ { - docInfo, err := db.FindDocInfoByKeyAndOwner(ctx, clientInfo.RefKey(), helper.TestDocKey(t, i), true) - assert.NoError(t, err) - assert.Equal(t, result.Documents[docInfo.ID].Status, database.DocumentDetached) - } - // If it was `DocumentRemoved`, it should be remained `DocumentRemoved`. - docInfo, err = db.FindDocInfoByKeyAndOwner(ctx, clientInfo.RefKey(), helper.TestDocKey(t, 2), true) - assert.NoError(t, err) - assert.Equal(t, result.Documents[docInfo.ID].Status, database.DocumentRemoved) - }) } // RunUpdateProjectInfoTest runs the UpdateProjectInfo tests for the given db. diff --git a/server/clients/clients.go b/server/clients/clients.go index 83049d54d..7c47ee7b6 100644 --- a/server/clients/clients.go +++ b/server/clients/clients.go @@ -22,6 +22,8 @@ import ( "errors" "github.com/yorkie-team/yorkie/api/types" + "github.com/yorkie-team/yorkie/cluster" + "github.com/yorkie-team/yorkie/server/backend" "github.com/yorkie-team/yorkie/server/backend/database" ) @@ -36,61 +38,67 @@ var ( // Activate activates the given client. func Activate( ctx context.Context, - db database.Database, + be *backend.Backend, project *types.Project, clientKey string, ) (*database.ClientInfo, error) { - return db.ActivateClient(ctx, project.ID, clientKey) + return be.DB.ActivateClient(ctx, project.ID, clientKey) } // Deactivate deactivates the given client. func Deactivate( ctx context.Context, - db database.Database, + be *backend.Backend, + project *types.Project, refKey types.ClientRefKey, ) (*database.ClientInfo, error) { - // TODO(hackerwins): We need to remove the presence of the client from the document. - // Be careful that housekeeping is executed by the leader. And documents are sharded - // by the servers in the cluster. So, we need to consider the case where the leader is - // not the same as the server that handles the document. - - // TODO(raararaara): When deactivating a client, we need to update three DB properties - // (ClientInfo.Status, ClientInfo.Documents, SyncedSeq) in DB. - // Updating the sub-properties of ClientInfo guarantees atomicity as it involves a single MongoDB document. - // However, SyncedSeqs are stored in separate documents, so we can't ensure atomic updates for both. - // Currently, if SyncedSeqs update fails, it mainly impacts GC efficiency without causing major issues. - // We need to consider implementing a correction logic to remove SyncedSeqs in the future. - clientInfo, err := db.DeactivateClient(ctx, refKey) + info, err := FindActiveClientInfo(ctx, be, refKey) if err != nil { return nil, err } - // TODO(raararaara): We're currently updating SyncedSeq one by one. This approach is similar - // to n+1 query problem. We need to investigate if we can optimize this process by using a single query in the future. - for docID, clientDocInfo := range clientInfo.Documents { - if err := db.UpdateSyncedSeq( - ctx, - clientInfo, - types.DocRefKey{ - ProjectID: refKey.ProjectID, - DocID: docID, - }, - clientDocInfo.ServerSeq, - ); err != nil { + // TODO(hackerwins): Introduce cluster client pool. + // - https://connectrpc.com/docs/go/deployment/ + cli, err := cluster.Dial(be.Config.GatewayAddr) + if err != nil { + return nil, err + } + defer cli.Close() + + for docID, clientDocInfo := range info.Documents { + if clientDocInfo.Status != database.DocumentAttached { + continue + } + + // TODO(hackerwins): Solve N+1 + docInfo, err := be.DB.FindDocInfoByRefKey(ctx, types.DocRefKey{ + ProjectID: project.ID, + DocID: docID, + }) + if err != nil { + return nil, err + } + + actorID, err := info.ID.ToActorID() + if err != nil { + return nil, err + } + + if err := cli.DetachDocument(ctx, project, actorID, docID, project.PublicKey, docInfo.Key); err != nil { return nil, err } } - return clientInfo, err + return be.DB.DeactivateClient(ctx, refKey) } // FindActiveClientInfo find the active client info by the given ref key. func FindActiveClientInfo( ctx context.Context, - db database.Database, + be *backend.Backend, refKey types.ClientRefKey, ) (*database.ClientInfo, error) { - info, err := db.FindClientInfoByRefKey(ctx, refKey) + info, err := be.DB.FindClientInfoByRefKey(ctx, refKey) if err != nil { return nil, err } diff --git a/server/clients/housekeeping.go b/server/clients/housekeeping.go index 76ab28bd8..57a632ec7 100644 --- a/server/clients/housekeeping.go +++ b/server/clients/housekeeping.go @@ -68,8 +68,8 @@ func DeactivateInactives( } deactivatedCount := 0 - for _, clientInfo := range candidates { - if _, err := Deactivate(ctx, be.DB, clientInfo.RefKey()); err != nil { + for _, pair := range candidates { + if _, err := Deactivate(ctx, be, pair.Project.ToProject(), pair.Client.RefKey()); err != nil { return database.DefaultProjectID, err } @@ -88,6 +88,12 @@ func DeactivateInactives( return lastProjectID, nil } +// CandidatePair represents a pair of Project and Client. +type CandidatePair struct { + Project *database.ProjectInfo + Client *database.ClientInfo +} + // FindDeactivateCandidates finds candidates to deactivate from the database. func FindDeactivateCandidates( ctx context.Context, @@ -95,27 +101,32 @@ func FindDeactivateCandidates( candidatesLimitPerProject int, projectFetchSize int, lastProjectID types.ID, -) (types.ID, []*database.ClientInfo, error) { - projects, err := be.DB.FindNextNCyclingProjectInfos(ctx, projectFetchSize, lastProjectID) +) (types.ID, []CandidatePair, error) { + projectInfos, err := be.DB.FindNextNCyclingProjectInfos(ctx, projectFetchSize, lastProjectID) if err != nil { return database.DefaultProjectID, nil, err } - var candidates []*database.ClientInfo - for _, project := range projects { - infos, err := be.DB.FindDeactivateCandidatesPerProject(ctx, project, candidatesLimitPerProject) + var candidates []CandidatePair + for _, projectInfo := range projectInfos { + infos, err := be.DB.FindDeactivateCandidatesPerProject(ctx, projectInfo, candidatesLimitPerProject) if err != nil { return database.DefaultProjectID, nil, err } - candidates = append(candidates, infos...) + for _, info := range infos { + candidates = append(candidates, CandidatePair{ + Project: projectInfo, + Client: info, + }) + } } var topProjectID types.ID - if len(projects) < projectFetchSize { + if len(projectInfos) < projectFetchSize { topProjectID = database.DefaultProjectID } else { - topProjectID = projects[len(projects)-1].ID + topProjectID = projectInfos[len(projectInfos)-1].ID } return topProjectID, candidates, nil diff --git a/server/config.go b/server/config.go index eea4f3a25..118f63ea2 100644 --- a/server/config.go +++ b/server/config.go @@ -68,7 +68,8 @@ const ( DefaultProjectInfoCacheSize = 256 DefaultProjectInfoCacheTTL = 10 * time.Minute - DefaultHostname = "" + DefaultHostname = "" + DefaultGatewayAddr = "localhost:8080" ) // Config is the configuration for creating a Yorkie instance. diff --git a/server/config.sample.yml b/server/config.sample.yml index d5c72edbb..31497b197 100644 --- a/server/config.sample.yml +++ b/server/config.sample.yml @@ -87,6 +87,9 @@ Backend: # determined automatically by the OS (Optional, default: os.Hostname()). Hostname: "" + # GatewayAddr is the address of the gateway server. + GatewayAddr: "" + # Mongo is the MongoDB configuration (Optional). Mongo: # ConnectionTimeout is the timeout for connecting to MongoDB. diff --git a/server/documents/documents.go b/server/documents/documents.go index e73167e34..d10abe72a 100644 --- a/server/documents/documents.go +++ b/server/documents/documents.go @@ -71,7 +71,7 @@ func ListDocumentSummaries( } if includeSnapshot { - doc, err := packs.BuildDocumentForServerSeq(ctx, be, docInfo, docInfo.ServerSeq) + doc, err := packs.BuildInternalDocForServerSeq(ctx, be, docInfo, docInfo.ServerSeq) if err != nil { return nil, err } @@ -102,7 +102,7 @@ func GetDocumentSummary( return nil, err } - doc, err := packs.BuildDocumentForServerSeq(ctx, be, docInfo, docInfo.ServerSeq) + doc, err := packs.BuildInternalDocForServerSeq(ctx, be, docInfo, docInfo.ServerSeq) if err != nil { return nil, err } @@ -135,7 +135,7 @@ func GetDocumentSummaries( snapshot := "" if includeSnapshot { // TODO(hackerwins, kokodak): Resolve the N+1 problem. - doc, err := packs.BuildDocumentForServerSeq(ctx, be, docInfo, docInfo.ServerSeq) + doc, err := packs.BuildInternalDocForServerSeq(ctx, be, docInfo, docInfo.ServerSeq) if err != nil { return nil, err } @@ -179,7 +179,7 @@ func GetDocumentByServerSeq( return nil, err } - doc, err := packs.BuildDocumentForServerSeq(ctx, be, docInfo, serverSeq) + doc, err := packs.BuildInternalDocForServerSeq(ctx, be, docInfo, serverSeq) if err != nil { return nil, err } diff --git a/server/packs/packs.go b/server/packs/packs.go index 79425e572..de10a7d6a 100644 --- a/server/packs/packs.go +++ b/server/packs/packs.go @@ -30,6 +30,7 @@ import ( "github.com/yorkie-team/yorkie/pkg/document" "github.com/yorkie-team/yorkie/pkg/document/change" "github.com/yorkie-team/yorkie/pkg/document/key" + "github.com/yorkie-team/yorkie/pkg/document/time" "github.com/yorkie-team/yorkie/pkg/units" "github.com/yorkie-team/yorkie/server/backend" "github.com/yorkie-team/yorkie/server/backend/database" @@ -211,8 +212,26 @@ func PushPull( return respPack, nil } -// BuildDocumentForServerSeq returns a new document for the given serverSeq. -func BuildDocumentForServerSeq( +// BuildDocForCheckpoint returns a new document for the given checkpoint. +func BuildDocForCheckpoint( + ctx context.Context, + be *backend.Backend, + docInfo *database.DocInfo, + cp change.Checkpoint, + actorID *time.ActorID, +) (*document.Document, error) { + internalDoc, err := BuildInternalDocForServerSeq(ctx, be, docInfo, cp.ServerSeq) + if err != nil { + return nil, err + } + + internalDoc.SetActor(actorID) + internalDoc.SyncCheckpoint(cp.ServerSeq, cp.ClientSeq) + return internalDoc.ToDocument(), nil +} + +// BuildInternalDocForServerSeq returns a new document for the given serverSeq. +func BuildInternalDocForServerSeq( ctx context.Context, be *backend.Backend, docInfo *database.DocInfo, diff --git a/server/packs/packs_test.go b/server/packs/packs_test.go index 42a85b642..a207a1b15 100644 --- a/server/packs/packs_test.go +++ b/server/packs/packs_test.go @@ -231,7 +231,7 @@ func TestPacks(t *testing.T) { assert.NoError(t, err) assert.Equal(t, int64(1), docInfo.ServerSeq) - clientInfo, err := clients.FindActiveClientInfo(ctx, testBackend.DB, types.ClientRefKey{ + clientInfo, err := clients.FindActiveClientInfo(ctx, testBackend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) @@ -277,7 +277,7 @@ func TestPacks(t *testing.T) { assert.Equal(t, int64(2), docInfo.ServerSeq) // 2-4. clientInfo.Checkpoint has not been updated - clientInfo, err = clients.FindActiveClientInfo(ctx, testBackend.DB, types.ClientRefKey{ + clientInfo, err = clients.FindActiveClientInfo(ctx, testBackend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) @@ -303,7 +303,7 @@ func TestPacks(t *testing.T) { assert.Equal(t, int64(2), docInfo.ServerSeq) // 3-4. clientInfo.Checkpoint has been updated properly - clientInfo, err = clients.FindActiveClientInfo(ctx, testBackend.DB, types.ClientRefKey{ + clientInfo, err = clients.FindActiveClientInfo(ctx, testBackend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) diff --git a/server/packs/pushpull.go b/server/packs/pushpull.go index 20303689a..ebc2000d6 100644 --- a/server/packs/pushpull.go +++ b/server/packs/pushpull.go @@ -139,7 +139,7 @@ func pullSnapshot( initialServerSeq int64, ) (*ServerPack, error) { // Build document from DB if the size of changes for the response is greater than the snapshot threshold. - doc, err := BuildDocumentForServerSeq(ctx, be, docInfo, initialServerSeq) + doc, err := BuildInternalDocForServerSeq(ctx, be, docInfo, initialServerSeq) if err != nil { return nil, err } diff --git a/server/rpc/cluster_server.go b/server/rpc/cluster_server.go new file mode 100644 index 000000000..3d86178c0 --- /dev/null +++ b/server/rpc/cluster_server.go @@ -0,0 +1,128 @@ +/* + * Copyright 2024 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. + */ + +package rpc + +import ( + "context" + + "connectrpc.com/connect" + + "github.com/yorkie-team/yorkie/api/converter" + "github.com/yorkie-team/yorkie/api/types" + api "github.com/yorkie-team/yorkie/api/yorkie/v1" + "github.com/yorkie-team/yorkie/pkg/document" + "github.com/yorkie-team/yorkie/pkg/document/json" + "github.com/yorkie-team/yorkie/pkg/document/presence" + "github.com/yorkie-team/yorkie/pkg/document/time" + "github.com/yorkie-team/yorkie/server/backend" + "github.com/yorkie-team/yorkie/server/clients" + "github.com/yorkie-team/yorkie/server/documents" + "github.com/yorkie-team/yorkie/server/logging" + "github.com/yorkie-team/yorkie/server/packs" +) + +// clusterServer is a server that provides the internal Yorkie cluster service. +// This service is used for communication between nodes in the Yorkie cluster. +type clusterServer struct { + backend *backend.Backend +} + +// newClusterServer creates a new instance of clusterServer. +func newClusterServer(backend *backend.Backend) *clusterServer { + return &clusterServer{ + backend: backend, + } +} + +// DetachDocument detaches the given document from the given client. +func (s *clusterServer) DetachDocument( + ctx context.Context, + req *connect.Request[api.ClusterServiceDetachDocumentRequest], +) (*connect.Response[api.ClusterServiceDetachDocumentResponse], error) { + actorID, err := time.ActorIDFromHex(req.Msg.ClientId) + if err != nil { + return nil, err + } + + summary := converter.FromDocumentSummary(req.Msg.DocumentSummary) + project := converter.FromProject(req.Msg.Project) + + locker, err := s.backend.Coordinator.NewLocker(ctx, packs.PushPullKey(project.ID, summary.Key)) + if err != nil { + return nil, err + } + + if err := locker.Lock(ctx); err != nil { + return nil, err + } + defer func() { + if err := locker.Unlock(ctx); err != nil { + logging.DefaultLogger().Error(err) + } + }() + + clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend, types.ClientRefKey{ + ProjectID: project.ID, + ClientID: types.IDFromActorID(actorID), + }) + if err != nil { + return nil, err + } + + docRefKey := types.DocRefKey{ + ProjectID: project.ID, + DocID: summary.ID, + } + + docInfo, err := documents.FindDocInfoByRefKey(ctx, s.backend, docRefKey) + if err != nil { + return nil, err + } + + // TODO(hackerwins): BuildDocForCheckpoint is expensive because it reads the entire document. + // We need to optimize this by creating a ChangePack directly. + // 01. Create ChangePack with clear presence. + doc, err := packs.BuildDocForCheckpoint(ctx, s.backend, docInfo, clientInfo.Checkpoint(summary.ID), actorID) + if err != nil { + return nil, err + } + + if err := doc.Update(func(root *json.Object, p *presence.Presence) error { + p.Clear() + return nil + }); err != nil { + return nil, err + } + + // 02. PushPull with the created ChangePack. + if _, err := packs.PushPull( + ctx, + s.backend, + project, + clientInfo, + docInfo, + doc.CreateChangePack(), + packs.PushPullOptions{ + Mode: types.SyncModePushPull, + Status: document.StatusDetached, + }, + ); err != nil { + return nil, err + } + + return connect.NewResponse(&api.ClusterServiceDetachDocumentResponse{}), nil +} diff --git a/server/rpc/server.go b/server/rpc/server.go index cfd06ad88..8f8719b31 100644 --- a/server/rpc/server.go +++ b/server/rpc/server.go @@ -70,11 +70,16 @@ func NewServer(conf *Config, be *backend.Backend) (*Server, error) { ) yorkieServiceCtx, yorkieServiceCancel := context.WithCancel(context.Background()) + + // TODO(hackerwins): We need to block incoming requests to the cluster service, + // because the cluster service is for internal communication between Yorkie nodes. mux := http.NewServeMux() mux.Handle(v1connect.NewYorkieServiceHandler(newYorkieServer(yorkieServiceCtx, be), opts...)) mux.Handle(v1connect.NewAdminServiceHandler(newAdminServer(be, tokenManager), opts...)) + mux.Handle(v1connect.NewClusterServiceHandler(newClusterServer(be), opts...)) mux.Handle(grpchealth.NewHandler(healthChecker)) mux.Handle(httphealth.NewHandler(healthChecker)) + // TODO(hackerwins): We need to provide proper http server configuration. return &Server{ conf: conf, diff --git a/server/rpc/yorkie_server.go b/server/rpc/yorkie_server.go index 6303e58ea..4408fb38b 100644 --- a/server/rpc/yorkie_server.go +++ b/server/rpc/yorkie_server.go @@ -67,7 +67,7 @@ func (s *yorkieServer) ActivateClient( } project := projects.From(ctx) - cli, err := clients.Activate(ctx, s.backend.DB, project, req.Msg.ClientKey) + cli, err := clients.Activate(ctx, s.backend, project, req.Msg.ClientKey) if err != nil { return nil, err } @@ -94,7 +94,7 @@ func (s *yorkieServer) DeactivateClient( } project := projects.From(ctx) - _, err = clients.Deactivate(ctx, s.backend.DB, types.ClientRefKey{ + _, err = clients.Deactivate(ctx, s.backend, project, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) @@ -145,7 +145,7 @@ func (s *yorkieServer) AttachDocument( } }() - clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend.DB, types.ClientRefKey{ + clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) @@ -221,7 +221,7 @@ func (s *yorkieServer) DetachDocument( } }() - clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend.DB, types.ClientRefKey{ + clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) @@ -320,7 +320,7 @@ func (s *yorkieServer) PushPullChanges( }() } - clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend.DB, types.ClientRefKey{ + clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) @@ -386,7 +386,7 @@ func (s *yorkieServer) WatchDocument( DocID: docID, } - if _, err = clients.FindActiveClientInfo(ctx, s.backend.DB, types.ClientRefKey{ + if _, err = clients.FindActiveClientInfo(ctx, s.backend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(clientID), }); err != nil { @@ -533,7 +533,7 @@ func (s *yorkieServer) RemoveDocument( }() } - clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend.DB, types.ClientRefKey{ + clientInfo, err := clients.FindActiveClientInfo(ctx, s.backend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(actorID), }) @@ -664,7 +664,7 @@ func (s *yorkieServer) Broadcast( return nil, err } - if _, err = clients.FindActiveClientInfo(ctx, s.backend.DB, types.ClientRefKey{ + if _, err = clients.FindActiveClientInfo(ctx, s.backend, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(clientID), }); err != nil { diff --git a/server/server.go b/server/server.go index 6a777f5d5..fd14db3bf 100644 --- a/server/server.go +++ b/server/server.go @@ -150,7 +150,7 @@ func (r *Yorkie) DeactivateClient(ctx context.Context, c1 *client.Client) error return err } - _, err = clients.Deactivate(ctx, r.backend.DB, types.ClientRefKey{ + _, err = clients.Deactivate(ctx, r.backend, project, types.ClientRefKey{ ProjectID: project.ID, ClientID: types.IDFromActorID(c1.ID()), }) diff --git a/test/complex/main_test.go b/test/complex/main_test.go index 9ce84b62d..557925c74 100644 --- a/test/complex/main_test.go +++ b/test/complex/main_test.go @@ -82,6 +82,7 @@ func TestMain(m *testing.M) { ProjectInfoCacheSize: helper.ProjectInfoCacheSize, ProjectInfoCacheTTL: helper.ProjectInfoCacheTTL.String(), AdminTokenDuration: helper.AdminTokenDuration, + GatewayAddr: fmt.Sprintf("localhost:%d", helper.RPCPort), }, &mongo.Config{ ConnectionURI: helper.MongoConnectionURI, YorkieDatabase: shardedDBNameForServer, diff --git a/test/helper/helper.go b/test/helper/helper.go index 346074c52..5fb74fe4d 100644 --- a/test/helper/helper.go +++ b/test/helper/helper.go @@ -256,6 +256,7 @@ func TestConfig() *server.Config { AuthWebhookCacheUnauthTTL: AuthWebhookCacheUnauthTTL.String(), ProjectInfoCacheSize: ProjectInfoCacheSize, ProjectInfoCacheTTL: ProjectInfoCacheTTL.String(), + GatewayAddr: fmt.Sprintf("localhost:%d", RPCPort+portOffset), }, Mongo: &mongo.Config{ ConnectionURI: MongoConnectionURI, diff --git a/test/integration/housekeeping_test.go b/test/integration/housekeeping_test.go index add1a9a93..504b3a737 100644 --- a/test/integration/housekeeping_test.go +++ b/test/integration/housekeeping_test.go @@ -123,7 +123,7 @@ func TestHousekeeping(t *testing.T) { log.Fatal(err) } - clientC, err := be.DB.ActivateClient(ctx, projects[0].ID, fmt.Sprintf("%s-C", t.Name())) + _, err = be.DB.ActivateClient(ctx, projects[0].ID, fmt.Sprintf("%s-C", t.Name())) assert.NoError(t, err) _, candidates, err := clients.FindDeactivateCandidates( @@ -136,9 +136,8 @@ func TestHousekeeping(t *testing.T) { assert.NoError(t, err) assert.Len(t, candidates, 2) - assert.Equal(t, candidates[0].ID, clientA.ID) - assert.Equal(t, candidates[1].ID, clientB.ID) - assert.NotContains(t, candidates, clientC) + assert.Equal(t, candidates[0].Client.ID, clientA.ID) + assert.Equal(t, candidates[1].Client.ID, clientB.ID) }) }