diff --git a/api/converter/from_pb.go b/api/converter/from_pb.go index 21d0ef887..45e9fad14 100644 --- a/api/converter/from_pb.go +++ b/api/converter/from_pb.go @@ -54,6 +54,8 @@ func FromProject(pbProject *api.Project) *types.Project { Name: pbProject.Name, AuthWebhookURL: pbProject.AuthWebhookUrl, AuthWebhookMethods: pbProject.AuthWebhookMethods, + EventWebhookURL: pbProject.EventWebhookUrl, + EventWebhookEvents: pbProject.EventWebhookEvents, ClientDeactivateThreshold: pbProject.ClientDeactivateThreshold, PublicKey: pbProject.PublicKey, SecretKey: pbProject.SecretKey, @@ -921,6 +923,12 @@ func FromUpdatableProjectFields(pbProjectFields *api.UpdatableProjectFields) (*t if pbProjectFields.AuthWebhookMethods != nil { updatableProjectFields.AuthWebhookMethods = &pbProjectFields.AuthWebhookMethods.Methods } + if pbProjectFields.EventWebhookUrl != nil { + updatableProjectFields.EventWebhookURL = &pbProjectFields.EventWebhookUrl.Value + } + if pbProjectFields.EventWebhookEvents != nil { + updatableProjectFields.EventWebhookEvents = &pbProjectFields.EventWebhookEvents.Events + } if pbProjectFields.ClientDeactivateThreshold != nil { updatableProjectFields.ClientDeactivateThreshold = &pbProjectFields.ClientDeactivateThreshold.Value } diff --git a/api/converter/to_pb.go b/api/converter/to_pb.go index 0057a9e94..75817ccbd 100644 --- a/api/converter/to_pb.go +++ b/api/converter/to_pb.go @@ -561,6 +561,19 @@ func ToUpdatableProjectFields(fields *types.UpdatableProjectFields) (*api.Updata } else { pbUpdatableProjectFields.AuthWebhookMethods = nil } + if fields.EventWebhookURL != nil { + pbUpdatableProjectFields.EventWebhookUrl = &wrapperspb.StringValue{ + Value: *fields.EventWebhookURL, + } + } + if fields.EventWebhookEvents != nil { + pbUpdatableProjectFields.EventWebhookEvents = &api.UpdatableProjectFields_EventWebhookEvents{ + Events: *fields.EventWebhookEvents, + } + } else { + pbUpdatableProjectFields.EventWebhookEvents = nil + } + if fields.ClientDeactivateThreshold != nil { pbUpdatableProjectFields.ClientDeactivateThreshold = &wrapperspb.StringValue{ Value: *fields.ClientDeactivateThreshold, diff --git a/api/docs/yorkie/v1/admin.openapi.yaml b/api/docs/yorkie/v1/admin.openapi.yaml index d8e3b24c1..0960ef0d5 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.8 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,18 +689,18 @@ 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 versionVector: - $ref: "#/components/schemas/yorkie.v1.VersionVector" + $ref: '#/components/schemas/yorkie.v1.VersionVector' additionalProperties: false description: "" title: version_vector @@ -750,7 +749,7 @@ components: description: "" properties: project: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' additionalProperties: false description: "" title: project @@ -783,13 +782,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 @@ -810,7 +809,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 @@ -838,7 +837,7 @@ components: description: "" properties: document: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' additionalProperties: false description: "" title: document @@ -876,7 +875,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' type: object title: documents type: array @@ -898,7 +897,7 @@ components: description: "" properties: project: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' additionalProperties: false description: "" title: project @@ -949,8 +948,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: GetSnapshotMetaRequest type: object @@ -962,8 +961,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport snapshot: additionalProperties: false @@ -972,7 +971,7 @@ components: title: snapshot type: string versionVector: - $ref: "#/components/schemas/yorkie.v1.VersionVector" + $ref: '#/components/schemas/yorkie.v1.VersionVector' additionalProperties: false description: "" title: version_vector @@ -984,25 +983,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 @@ -1037,8 +1036,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: previous_seq projectName: additionalProperties: false @@ -1055,7 +1054,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Change" + $ref: '#/components/schemas/yorkie.v1.Change' type: object title: changes type: array @@ -1100,7 +1099,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' type: object title: documents type: array @@ -1119,7 +1118,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' type: object title: projects type: array @@ -1162,7 +1161,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 @@ -1179,67 +1178,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 @@ -1251,25 +1250,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 @@ -1281,25 +1280,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 @@ -1326,25 +1325,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 @@ -1377,7 +1376,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1389,19 +1388,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 @@ -1413,25 +1412,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 @@ -1443,19 +1442,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 @@ -1464,32 +1463,31 @@ components: type: object yorkie.v1.Operation.Select: additionalProperties: false - description: |- - NOTE(hackerwins): Select Operation is not used in the current version. - In the previous version, it was used to represent selection of Text. - However, it has been replaced by Presence now. It is retained for backward - compatibility purposes. + description: "NOTE(hackerwins): Select Operation is not used in the current + version.\r\n In the previous version, it was used to represent selection of + Text.\r\n However, it has been replaced by Presence now. It is retained for + backward\r\n 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 @@ -1501,7 +1499,7 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at @@ -1512,13 +1510,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 @@ -1540,25 +1538,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 @@ -1591,7 +1589,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1606,7 +1604,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNodes" + $ref: '#/components/schemas/yorkie.v1.TreeNodes' type: object title: contents type: array @@ -1616,19 +1614,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 @@ -1639,7 +1637,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 @@ -1656,7 +1654,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1685,25 +1683,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 @@ -1736,7 +1734,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1775,13 +1773,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 @@ -1790,14 +1788,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: @@ -1822,11 +1820,23 @@ 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 type: object + eventWebhookEvents: + additionalProperties: false + description: "" + items: + type: string + title: event_webhook_events + type: array + eventWebhookUrl: + additionalProperties: false + description: "" + title: event_webhook_url + type: string id: additionalProperties: false description: "" @@ -1848,7 +1858,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 @@ -1910,7 +1920,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' type: object title: documents type: array @@ -1942,7 +1952,7 @@ components: description: "" properties: user: - $ref: "#/components/schemas/yorkie.v1.User" + $ref: '#/components/schemas/yorkie.v1.User' additionalProperties: false description: "" title: user @@ -1954,7 +1964,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1990,8 +2000,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport title: TimeTicket type: object @@ -2010,25 +2020,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 @@ -2055,7 +2065,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -2067,7 +2077,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -2087,7 +2097,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNode" + $ref: '#/components/schemas/yorkie.v1.TreeNode' type: object title: content type: array @@ -2098,13 +2108,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 @@ -2116,25 +2126,37 @@ 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 + eventWebhookEvents: + $ref: '#/components/schemas/yorkie.v1.UpdatableProjectFields.EventWebhookEvents' + additionalProperties: false + description: "" + title: event_webhook_events + type: object + eventWebhookUrl: + $ref: '#/components/schemas/google.protobuf.StringValue' + additionalProperties: false + description: "" + title: event_webhook_url + type: object name: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: name @@ -2154,12 +2176,25 @@ components: type: array title: AuthWebhookMethods type: object + yorkie.v1.UpdatableProjectFields.EventWebhookEvents: + additionalProperties: false + description: "" + properties: + events: + additionalProperties: false + description: "" + items: + type: string + title: events + type: array + title: EventWebhookEvents + type: object yorkie.v1.UpdateProjectRequest: additionalProperties: false description: "" properties: fields: - $ref: "#/components/schemas/yorkie.v1.UpdatableProjectFields" + $ref: '#/components/schemas/yorkie.v1.UpdatableProjectFields' additionalProperties: false description: "" title: fields @@ -2176,7 +2211,7 @@ components: description: "" properties: project: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' additionalProperties: false description: "" title: project @@ -2188,7 +2223,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -2208,34 +2243,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.VersionVector: @@ -2262,8 +2297,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: value title: VectorEntry type: object @@ -2273,7 +2308,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 index 9f5234d7b..c1d1589f6 100644 --- a/api/docs/yorkie/v1/cluster.openapi.yaml +++ b/api/docs/yorkie/v1/cluster.openapi.yaml @@ -1,82 +1,81 @@ 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.8 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.ClusterService/DetachDocument: post: description: "" requestBody: - $ref: "#/components/requestBodies/yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentRequest" + $ref: '#/components/requestBodies/yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentRequest' responses: "200": - $ref: "#/components/responses/yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentResponse" + $ref: '#/components/responses/yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentResponse' default: - $ref: "#/components/responses/connect.error" + $ref: '#/components/responses/connect.error' tags: - - yorkie.v1.ClusterService + - yorkie.v1.ClusterService components: requestBodies: yorkie.v1.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentRequest: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentRequest' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentRequest" + $ref: '#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentRequest' 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.ClusterService.DetachDocument.yorkie.v1.ClusterServiceDetachDocumentResponse: content: application/json: schema: - $ref: "#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentResponse" + $ref: '#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentResponse' application/proto: schema: - $ref: "#/components/schemas/yorkie.v1.ClusterServiceDetachDocumentResponse" + $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" + 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 @@ -186,13 +185,13 @@ components: title: client_id type: string documentSummary: - $ref: "#/components/schemas/yorkie.v1.DocumentSummary" + $ref: '#/components/schemas/yorkie.v1.DocumentSummary' additionalProperties: false description: "" title: document_summary type: object project: - $ref: "#/components/schemas/yorkie.v1.Project" + $ref: '#/components/schemas/yorkie.v1.Project' additionalProperties: false description: "" title: project @@ -209,13 +208,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 @@ -236,7 +235,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 @@ -265,11 +264,23 @@ 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 type: object + eventWebhookEvents: + additionalProperties: false + description: "" + items: + type: string + title: event_webhook_events + type: array + eventWebhookUrl: + additionalProperties: false + description: "" + title: event_webhook_url + type: string id: additionalProperties: false description: "" @@ -291,7 +302,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 @@ -304,7 +315,7 @@ components: name: Authorization type: apiKey security: - - ApiKeyAuth: [] +- ApiKeyAuth: [] tags: - - description: ClusterService is a service that provides an API for Cluster. - name: yorkie.v1.ClusterService +- 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 ffec52094..04368482a 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.8 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,18 +208,18 @@ 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 versionVector: - $ref: "#/components/schemas/yorkie.v1.VersionVector" + $ref: '#/components/schemas/yorkie.v1.VersionVector' additionalProperties: false description: "" title: version_vector @@ -229,20 +228,19 @@ components: type: object yorkie.v1.ChangePack: additionalProperties: false - description: |- - ChangePack is a message that contains all changes that occurred in a document. - It is used to synchronize changes between clients and servers. + description: "ChangePack is a message that contains all changes that occurred + in a document.\r\n It is used to synchronize changes between clients and servers." properties: changes: 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 @@ -258,7 +256,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 @@ -270,7 +268,7 @@ components: title: snapshot type: string versionVector: - $ref: "#/components/schemas/yorkie.v1.VersionVector" + $ref: '#/components/schemas/yorkie.v1.VersionVector' additionalProperties: false description: "" title: version_vector @@ -290,8 +288,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: Checkpoint type: object @@ -300,7 +298,7 @@ components: description: "" properties: body: - $ref: "#/components/schemas/yorkie.v1.DocEventBody" + $ref: '#/components/schemas/yorkie.v1.DocEventBody' additionalProperties: false description: "" title: body @@ -311,7 +309,7 @@ components: title: publisher type: string type: - $ref: "#/components/schemas/yorkie.v1.DocEventType" + $ref: '#/components/schemas/yorkie.v1.DocEventType' additionalProperties: false description: "" title: type @@ -337,14 +335,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: @@ -352,13 +350,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 @@ -379,7 +377,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 @@ -391,37 +389,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 @@ -433,25 +431,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 @@ -468,13 +466,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 @@ -483,12 +481,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 @@ -500,13 +498,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 @@ -515,12 +513,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 @@ -532,25 +530,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 @@ -567,13 +565,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 @@ -582,12 +580,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 @@ -599,13 +597,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 @@ -614,12 +612,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 @@ -631,25 +629,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 @@ -671,7 +669,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 @@ -688,67 +686,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 @@ -760,25 +758,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 @@ -790,25 +788,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 @@ -835,25 +833,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 @@ -886,7 +884,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -898,19 +896,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 @@ -922,25 +920,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 @@ -952,19 +950,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 @@ -973,32 +971,31 @@ components: type: object yorkie.v1.Operation.Select: additionalProperties: false - description: |- - NOTE(hackerwins): Select Operation is not used in the current version. - In the previous version, it was used to represent selection of Text. - However, it has been replaced by Presence now. It is retained for backward - compatibility purposes. + description: "NOTE(hackerwins): Select Operation is not used in the current + version.\r\n In the previous version, it was used to represent selection of + Text.\r\n However, it has been replaced by Presence now. It is retained for + backward\r\n 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 @@ -1010,7 +1007,7 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at @@ -1021,13 +1018,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 @@ -1049,25 +1046,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 @@ -1100,7 +1097,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1115,7 +1112,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNodes" + $ref: '#/components/schemas/yorkie.v1.TreeNodes' type: object title: contents type: array @@ -1125,19 +1122,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 @@ -1148,7 +1145,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 @@ -1165,7 +1162,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1194,25 +1191,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 @@ -1245,7 +1242,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1284,13 +1281,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 @@ -1299,14 +1296,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: @@ -1331,11 +1328,23 @@ 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 type: object + eventWebhookEvents: + additionalProperties: false + description: "" + items: + type: string + title: event_webhook_events + type: array + eventWebhookUrl: + additionalProperties: false + description: "" + title: event_webhook_url + type: string id: additionalProperties: false description: "" @@ -1357,7 +1366,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 @@ -1369,13 +1378,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 @@ -1387,7 +1396,7 @@ components: description: "" properties: element: - $ref: "#/components/schemas/yorkie.v1.JSONElement" + $ref: '#/components/schemas/yorkie.v1.JSONElement' additionalProperties: false description: "" title: element @@ -1401,10 +1410,8 @@ components: type: object yorkie.v1.Snapshot: additionalProperties: false - description: |- - /////////////////////////////////////// - Messages for Snapshot // - /////////////////////////////////////// + description: "///////////////////////////////////////\r\n Messages for Snapshot + \ //\r\n///////////////////////////////////////" properties: presences: additionalProperties: false @@ -1412,7 +1419,7 @@ components: title: presences type: object root: - $ref: "#/components/schemas/yorkie.v1.JSONElement" + $ref: '#/components/schemas/yorkie.v1.JSONElement' additionalProperties: false description: "" title: root @@ -1429,7 +1436,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.Presence" + $ref: '#/components/schemas/yorkie.v1.Presence' additionalProperties: false description: "" title: value @@ -1446,19 +1453,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 @@ -1480,7 +1487,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -1492,7 +1499,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1509,7 +1516,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1545,8 +1552,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport title: TimeTicket type: object @@ -1565,25 +1572,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 @@ -1610,7 +1617,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -1622,7 +1629,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1642,7 +1649,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNode" + $ref: '#/components/schemas/yorkie.v1.TreeNode' type: object title: content type: array @@ -1653,13 +1660,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 @@ -1671,25 +1678,37 @@ 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 + eventWebhookEvents: + $ref: '#/components/schemas/yorkie.v1.UpdatableProjectFields.EventWebhookEvents' + additionalProperties: false + description: "" + title: event_webhook_events + type: object + eventWebhookUrl: + $ref: '#/components/schemas/google.protobuf.StringValue' + additionalProperties: false + description: "" + title: event_webhook_url + type: object name: - $ref: "#/components/schemas/google.protobuf.StringValue" + $ref: '#/components/schemas/google.protobuf.StringValue' additionalProperties: false description: "" title: name @@ -1709,12 +1728,25 @@ components: type: array title: AuthWebhookMethods type: object + yorkie.v1.UpdatableProjectFields.EventWebhookEvents: + additionalProperties: false + description: "" + properties: + events: + additionalProperties: false + description: "" + items: + type: string + title: events + type: array + title: EventWebhookEvents + type: object yorkie.v1.User: additionalProperties: false description: "" properties: createdAt: - $ref: "#/components/schemas/google.protobuf.Timestamp" + $ref: '#/components/schemas/google.protobuf.Timestamp' additionalProperties: false description: "" title: created_at @@ -1734,34 +1766,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.VersionVector: @@ -1788,8 +1820,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: value title: VectorEntry type: object @@ -1799,4 +1831,4 @@ components: name: Authorization type: apiKey security: - - ApiKeyAuth: [] +- ApiKeyAuth: [] diff --git a/api/docs/yorkie/v1/yorkie.openapi.yaml b/api/docs/yorkie/v1/yorkie.openapi.yaml index d13cfbc64..6e6e9d7cf 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.8 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,18 +416,18 @@ 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 versionVector: - $ref: "#/components/schemas/yorkie.v1.VersionVector" + $ref: '#/components/schemas/yorkie.v1.VersionVector' additionalProperties: false description: "" title: version_vector @@ -437,20 +436,19 @@ components: type: object yorkie.v1.ChangePack: additionalProperties: false - description: |- - ChangePack is a message that contains all changes that occurred in a document. - It is used to synchronize changes between clients and servers. + description: "ChangePack is a message that contains all changes that occurred + in a document.\r\n It is used to synchronize changes between clients and servers." properties: changes: 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 @@ -466,7 +464,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 @@ -478,7 +476,7 @@ components: title: snapshot type: string versionVector: - $ref: "#/components/schemas/yorkie.v1.VersionVector" + $ref: '#/components/schemas/yorkie.v1.VersionVector' additionalProperties: false description: "" title: version_vector @@ -498,8 +496,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: server_seq title: Checkpoint type: object @@ -524,7 +522,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 +549,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -563,7 +561,7 @@ components: description: "" properties: body: - $ref: "#/components/schemas/yorkie.v1.DocEventBody" + $ref: '#/components/schemas/yorkie.v1.DocEventBody' additionalProperties: false description: "" title: body @@ -574,7 +572,7 @@ components: title: publisher type: string type: - $ref: "#/components/schemas/yorkie.v1.DocEventType" + $ref: '#/components/schemas/yorkie.v1.DocEventType' additionalProperties: false description: "" title: type @@ -600,14 +598,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: @@ -615,25 +613,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 @@ -655,7 +653,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 @@ -672,67 +670,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 @@ -744,25 +742,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 @@ -774,25 +772,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 @@ -819,25 +817,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 @@ -870,7 +868,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -882,19 +880,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 @@ -906,25 +904,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 @@ -936,19 +934,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 @@ -957,32 +955,31 @@ components: type: object yorkie.v1.Operation.Select: additionalProperties: false - description: |- - NOTE(hackerwins): Select Operation is not used in the current version. - In the previous version, it was used to represent selection of Text. - However, it has been replaced by Presence now. It is retained for backward - compatibility purposes. + description: "NOTE(hackerwins): Select Operation is not used in the current + version.\r\n In the previous version, it was used to represent selection of + Text.\r\n However, it has been replaced by Presence now. It is retained for + backward\r\n 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 @@ -994,7 +991,7 @@ components: description: "" properties: executedAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: executed_at @@ -1005,13 +1002,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 @@ -1033,25 +1030,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 @@ -1084,7 +1081,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1099,7 +1096,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNodes" + $ref: '#/components/schemas/yorkie.v1.TreeNodes' type: object title: contents type: array @@ -1109,19 +1106,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 @@ -1132,7 +1129,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 @@ -1149,7 +1146,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1178,25 +1175,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 @@ -1229,7 +1226,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: value @@ -1268,13 +1265,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 @@ -1283,14 +1280,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: @@ -1298,7 +1295,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 +1322,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -1337,7 +1334,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 +1356,7 @@ components: description: "" properties: changePack: - $ref: "#/components/schemas/yorkie.v1.ChangePack" + $ref: '#/components/schemas/yorkie.v1.ChangePack' additionalProperties: false description: "" title: change_pack @@ -1371,7 +1368,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1407,8 +1404,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: lamport title: TimeTicket type: object @@ -1427,25 +1424,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 @@ -1472,7 +1469,7 @@ components: title: key type: string value: - $ref: "#/components/schemas/yorkie.v1.NodeAttr" + $ref: '#/components/schemas/yorkie.v1.NodeAttr' additionalProperties: false description: "" title: value @@ -1484,7 +1481,7 @@ components: description: "" properties: createdAt: - $ref: "#/components/schemas/yorkie.v1.TimeTicket" + $ref: '#/components/schemas/yorkie.v1.TimeTicket' additionalProperties: false description: "" title: created_at @@ -1504,7 +1501,7 @@ components: additionalProperties: false description: "" items: - $ref: "#/components/schemas/yorkie.v1.TreeNode" + $ref: '#/components/schemas/yorkie.v1.TreeNode' type: object title: content type: array @@ -1515,13 +1512,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 @@ -1531,34 +1528,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.VersionVector: @@ -1585,8 +1582,8 @@ components: additionalProperties: false description: "" oneOf: - - type: string - - type: number + - type: string + - type: number title: value title: VectorEntry type: object @@ -1611,13 +1608,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 @@ -1643,7 +1640,7 @@ components: name: Authorization type: apiKey security: - - ApiKeyAuth: [] +- ApiKeyAuth: [] tags: - - description: Yorkie is a service that provides an 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/types/project.go b/api/types/project.go index 7095cb830..e25c42c5c 100644 --- a/api/types/project.go +++ b/api/types/project.go @@ -38,6 +38,12 @@ type Project struct { // AuthWebhookMethods is the methods that run the authorization webhook. AuthWebhookMethods []string `json:"auth_webhook_methods"` + // EventWebhookURL is the url of the project event webhook. + EventWebhookURL string `json:"event_webhook_url"` + + // EventWebhookEvents is the events that run the project event webhook . + EventWebhookEvents []string `json:"event_webhook_events"` + // ClientDeactivateThreshold is the time after which clients in // specific project are considered deactivate for housekeeping. ClientDeactivateThreshold string `bson:"client_deactivate_threshold"` @@ -73,3 +79,22 @@ func (p *Project) RequireAuth(method Method) bool { return false } + +// RequireEventWebhook returns whether the given event requires webhook. +func (p *Project) RequireEventWebhook(event ProjectEvent) bool { + if len(p.EventWebhookURL) == 0 { + return false + } + + if len(p.EventWebhookEvents) == 0 { + return false + } + + for _, m := range p.EventWebhookEvents { + if ProjectEvent(m) == event { + return true + } + } + + return false +} diff --git a/api/types/project_event.go b/api/types/project_event.go new file mode 100644 index 000000000..f9ff1fe03 --- /dev/null +++ b/api/types/project_event.go @@ -0,0 +1,58 @@ +/* + * 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 types + +// ProjectEvent represents the event of the project. +type ProjectEvent string + +// ProjectEvent represents the event of the project. +const ( + DocumentCreated ProjectEvent = "DocumentCreated" + DocumentRemoved ProjectEvent = "DocumentRemoved" +) + +// IsProjectEvent returns whether the given event is valid event. +func IsProjectEvent(event string) bool { + for _, e := range ProjectEvents() { + if event == string(e) { + return true + } + } + return false +} + +// ProjectEvents is a set of events that use to update a project. +func ProjectEvents() []ProjectEvent { + return []ProjectEvent{ + DocumentCreated, + DocumentRemoved, + } +} + +// WebhookAttribute represents the attribute of the webhook. +type WebhookAttribute struct { + DocumentKey string `json:"documentKey"` + ClientKey string `json:"clientKey"` + IssuedAt string `json:"issuedAt"` +} + +// WebhookRequest represents the request of the webhook. +type WebhookRequest struct { + Type ProjectEvent `json:"type"` + Attributes WebhookAttribute `json:"attributes"` +} diff --git a/api/types/updatable_project_fields.go b/api/types/updatable_project_fields.go index ef3897973..e4c7fdd0a 100644 --- a/api/types/updatable_project_fields.go +++ b/api/types/updatable_project_fields.go @@ -37,7 +37,13 @@ type UpdatableProjectFields struct { AuthWebhookURL *string `bson:"auth_webhook_url,omitempty" validate:"omitempty,url|emptystring"` // AuthWebhookMethods is the methods that run the authorization webhook. - AuthWebhookMethods *[]string `bson:"auth_webhook_methods,omitempty" validate:"omitempty,invalid_webhook_method"` + AuthWebhookMethods *[]string `bson:"auth_webhook_methods,omitempty" validate:"omitempty,invalid_auth_webhook_method"` + + // EventWebhookURL is the url of the project events webhook. + EventWebhookURL *string `bson:"event_webhook_url,omitempty" validate:"omitempty,url|emptystring"` + + // EventWebhookEvents is the methods that run the project events webhook. + EventWebhookEvents *[]string `bson:"event_webhook_events,omitempty" validate:"omitempty,invalid_event_webhook_events"` // ClientDeactivateThreshold is the time after which clients in specific project are considered deactivate. ClientDeactivateThreshold *string `bson:"client_deactivate_threshold,omitempty" validate:"omitempty,min=2,duration"` @@ -45,7 +51,12 @@ type UpdatableProjectFields struct { // Validate validates the UpdatableProjectFields. func (i *UpdatableProjectFields) Validate() error { - if i.Name == nil && i.AuthWebhookURL == nil && i.AuthWebhookMethods == nil && i.ClientDeactivateThreshold == nil { + if i.Name == nil && + i.AuthWebhookURL == nil && + i.AuthWebhookMethods == nil && + i.EventWebhookURL == nil && + i.EventWebhookEvents == nil && + i.ClientDeactivateThreshold == nil { return ErrEmptyProjectFields } @@ -54,7 +65,7 @@ func (i *UpdatableProjectFields) Validate() error { func init() { if err := validation.RegisterValidation( - "invalid_webhook_method", + "invalid_auth_webhook_method", func(level validation.FieldLevel) bool { methods := level.Field().Interface().([]string) for _, method := range methods { @@ -68,8 +79,28 @@ func init() { fmt.Fprintln(os.Stderr, "updatable project fields: ", err) os.Exit(1) } - if err := validation.RegisterTranslation("invalid_webhook_method", "given {0} is invalid method"); err != nil { + if err := validation.RegisterTranslation("invalid_auth_webhook_method", "given {0} is invalid method"); err != nil { fmt.Fprintln(os.Stderr, "updatable project fields: ", err) os.Exit(1) } + if err := validation.RegisterValidation( + "invalid_event_webhook_events", + func(level validation.FieldLevel) bool { + events := level.Field().Interface().([]string) + for _, event := range events { + if !IsProjectEvent(event) { + return false + } + } + return true + }, + ); err != nil { + fmt.Fprintln(os.Stderr, "updatable project fields: ", err) + os.Exit(1) + } + if err := validation.RegisterTranslation("invalid_event_webhook_events", "given {0} is invalid event"); err != nil { + fmt.Fprintln(os.Stderr, "updatable project fields: ", err) + os.Exit(1) + } + } diff --git a/api/yorkie/v1/resources.pb.go b/api/yorkie/v1/resources.pb.go index 3b49d3086..59cd91091 100644 --- a/api/yorkie/v1/resources.pb.go +++ b/api/yorkie/v1/resources.pb.go @@ -1639,9 +1639,11 @@ type Project struct { SecretKey string `protobuf:"bytes,4,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` AuthWebhookUrl string `protobuf:"bytes,5,opt,name=auth_webhook_url,json=authWebhookUrl,proto3" json:"auth_webhook_url,omitempty"` AuthWebhookMethods []string `protobuf:"bytes,6,rep,name=auth_webhook_methods,json=authWebhookMethods,proto3" json:"auth_webhook_methods,omitempty"` - ClientDeactivateThreshold string `protobuf:"bytes,7,opt,name=client_deactivate_threshold,json=clientDeactivateThreshold,proto3" json:"client_deactivate_threshold,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` + EventWebhookUrl string `protobuf:"bytes,7,opt,name=event_webhook_url,json=eventWebhookUrl,proto3" json:"event_webhook_url,omitempty"` + EventWebhookEvents []string `protobuf:"bytes,8,rep,name=event_webhook_events,json=eventWebhookEvents,proto3" json:"event_webhook_events,omitempty"` + ClientDeactivateThreshold string `protobuf:"bytes,9,opt,name=client_deactivate_threshold,json=clientDeactivateThreshold,proto3" json:"client_deactivate_threshold,omitempty"` + CreatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` + UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,11,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` } func (x *Project) Reset() { @@ -1718,6 +1720,20 @@ func (x *Project) GetAuthWebhookMethods() []string { return nil } +func (x *Project) GetEventWebhookUrl() string { + if x != nil { + return x.EventWebhookUrl + } + return "" +} + +func (x *Project) GetEventWebhookEvents() []string { + if x != nil { + return x.EventWebhookEvents + } + return nil +} + func (x *Project) GetClientDeactivateThreshold() string { if x != nil { return x.ClientDeactivateThreshold @@ -1747,7 +1763,9 @@ type UpdatableProjectFields struct { Name *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` AuthWebhookUrl *wrapperspb.StringValue `protobuf:"bytes,2,opt,name=auth_webhook_url,json=authWebhookUrl,proto3" json:"auth_webhook_url,omitempty"` AuthWebhookMethods *UpdatableProjectFields_AuthWebhookMethods `protobuf:"bytes,3,opt,name=auth_webhook_methods,json=authWebhookMethods,proto3" json:"auth_webhook_methods,omitempty"` - ClientDeactivateThreshold *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=client_deactivate_threshold,json=clientDeactivateThreshold,proto3" json:"client_deactivate_threshold,omitempty"` + EventWebhookUrl *wrapperspb.StringValue `protobuf:"bytes,4,opt,name=event_webhook_url,json=eventWebhookUrl,proto3" json:"event_webhook_url,omitempty"` + EventWebhookEvents *UpdatableProjectFields_EventWebhookEvents `protobuf:"bytes,5,opt,name=event_webhook_events,json=eventWebhookEvents,proto3" json:"event_webhook_events,omitempty"` + ClientDeactivateThreshold *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=client_deactivate_threshold,json=clientDeactivateThreshold,proto3" json:"client_deactivate_threshold,omitempty"` } func (x *UpdatableProjectFields) Reset() { @@ -1803,6 +1821,20 @@ func (x *UpdatableProjectFields) GetAuthWebhookMethods() *UpdatableProjectFields return nil } +func (x *UpdatableProjectFields) GetEventWebhookUrl() *wrapperspb.StringValue { + if x != nil { + return x.EventWebhookUrl + } + return nil +} + +func (x *UpdatableProjectFields) GetEventWebhookEvents() *UpdatableProjectFields_EventWebhookEvents { + if x != nil { + return x.EventWebhookEvents + } + return nil +} + func (x *UpdatableProjectFields) GetClientDeactivateThreshold() *wrapperspb.StringValue { if x != nil { return x.ClientDeactivateThreshold @@ -3644,6 +3676,53 @@ func (x *UpdatableProjectFields_AuthWebhookMethods) GetMethods() []string { return nil } +type UpdatableProjectFields_EventWebhookEvents struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Events []string `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"` +} + +func (x *UpdatableProjectFields_EventWebhookEvents) Reset() { + *x = UpdatableProjectFields_EventWebhookEvents{} + if protoimpl.UnsafeEnabled { + mi := &file_yorkie_v1_resources_proto_msgTypes[57] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatableProjectFields_EventWebhookEvents) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatableProjectFields_EventWebhookEvents) ProtoMessage() {} + +func (x *UpdatableProjectFields_EventWebhookEvents) ProtoReflect() protoreflect.Message { + mi := &file_yorkie_v1_resources_proto_msgTypes[57] + 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 UpdatableProjectFields_EventWebhookEvents.ProtoReflect.Descriptor instead. +func (*UpdatableProjectFields_EventWebhookEvents) Descriptor() ([]byte, []int) { + return file_yorkie_v1_resources_proto_rawDescGZIP(), []int{19, 1} +} + +func (x *UpdatableProjectFields_EventWebhookEvents) GetEvents() []string { + if x != nil { + return x.Events + } + return nil +} + var File_yorkie_v1_resources_proto protoreflect.FileDescriptor var file_yorkie_v1_resources_proto_rawDesc = []byte{ @@ -4214,8 +4293,8 @@ var file_yorkie_v1_resources_proto_rawDesc = []byte{ 0x61, 0x6d, 0x65, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xfd, - 0x02, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xdb, + 0x03, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, @@ -4227,150 +4306,170 @@ var file_yorkie_v1_resources_proto_rawDesc = []byte{ 0x6f, 0x6f, 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x30, 0x0a, 0x14, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, - 0x6b, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x3e, 0x0a, 0x1b, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x68, - 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x63, - 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x54, - 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, - 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x88, - 0x03, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6a, - 0x65, 0x63, 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x61, - 0x75, 0x74, 0x68, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x6b, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x55, 0x72, 0x6c, 0x12, 0x30, 0x0a, 0x14, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x77, 0x65, + 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x08, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x12, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3e, 0x0a, 0x1b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, + 0x5f, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x19, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xe8, 0x04, 0x0a, + 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, + 0x74, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, - 0x55, 0x72, 0x6c, 0x12, 0x66, 0x0a, 0x14, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x77, 0x65, 0x62, 0x68, - 0x6f, 0x6f, 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x6c, 0x75, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x46, 0x0a, 0x10, 0x61, 0x75, 0x74, + 0x68, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x55, 0x72, + 0x6c, 0x12, 0x66, 0x0a, 0x14, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x34, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x4d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, 0x68, 0x6f, + 0x6f, 0x6b, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x48, 0x0a, 0x11, 0x65, 0x76, 0x65, + 0x6e, 0x74, 0x5f, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x0f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, + 0x55, 0x72, 0x6c, 0x12, 0x66, 0x0a, 0x14, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x77, 0x65, 0x62, + 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, - 0x68, 0x6f, 0x6f, 0x6b, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x5c, 0x0a, 0x1b, 0x63, + 0x65, 0x6c, 0x64, 0x73, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, + 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x12, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x57, 0x65, + 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x5c, 0x0a, 0x1b, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x64, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x19, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x44, 0x65, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x1a, 0x2e, 0x0a, 0x12, 0x41, 0x75, 0x74, 0x68, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, - 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x0f, 0x44, 0x6f, - 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x0e, 0x0a, - 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x1a, 0x0a, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, - 0x64, 0x41, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, - 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xea, - 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x24, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x73, - 0x65, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, - 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, + 0x52, 0x07, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x73, 0x1a, 0x2c, 0x0a, 0x12, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, + 0x16, 0x0a, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x82, 0x02, 0x0a, 0x0f, 0x44, 0x6f, 0x63, 0x75, + 0x6d, 0x65, 0x6e, 0x74, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, + 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x41, 0x74, 0x12, 0x3b, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, + 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x41, + 0x74, 0x12, 0x39, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xea, 0x01, 0x0a, + 0x0e, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, - 0x63, 0x65, 0x52, 0x08, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x6d, 0x0a, 0x0a, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x48, - 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, - 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x48, 0x41, 0x4e, 0x47, - 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, - 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, - 0x54, 0x45, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4c, 0x45, 0x41, 0x52, 0x10, 0x03, 0x22, 0x76, 0x0a, 0x08, 0x50, - 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, - 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, - 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x4a, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x71, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x71, - 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x71, 0x22, - 0x84, 0x01, 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x73, 0x12, - 0x34, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, - 0x54, 0x69, 0x6d, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x27, 0x0a, - 0x0f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, - 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x22, 0x5f, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x69, - 0x63, 0x6b, 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x61, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, - 0x0a, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0d, 0x52, 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, - 0x61, 0x63, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x61, 0x63, 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x0c, 0x44, 0x6f, 0x63, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x18, 0x0a, - 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, - 0x6f, 0x63, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, - 0x2b, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, - 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x2a, 0xd4, 0x02, 0x0a, - 0x09, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x41, - 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x00, 0x12, - 0x16, 0x0a, 0x12, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, - 0x4f, 0x4c, 0x45, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x41, 0x4c, 0x55, 0x45, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x10, 0x02, 0x12, - 0x13, 0x0a, 0x0f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, - 0x4e, 0x47, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x56, - 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, - 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x41, 0x4c, 0x55, - 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, 0x1a, 0x0a, - 0x16, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, - 0x5f, 0x4f, 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x08, 0x12, 0x19, 0x0a, 0x15, 0x56, 0x41, 0x4c, - 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x41, 0x52, 0x52, - 0x41, 0x59, 0x10, 0x09, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x0a, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x41, 0x4c, - 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x5f, - 0x43, 0x4e, 0x54, 0x10, 0x0b, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x5f, 0x43, 0x4e, 0x54, 0x10, 0x0c, 0x12, 0x13, - 0x0a, 0x0f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x45, - 0x45, 0x10, 0x0d, 0x2a, 0xa6, 0x01, 0x0a, 0x0c, 0x44, 0x6f, 0x63, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x4f, 0x43, 0x5f, 0x45, 0x56, 0x45, 0x4e, - 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, - 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x4f, 0x43, - 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x43, 0x55, - 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x57, 0x41, 0x54, 0x43, 0x48, 0x45, 0x44, 0x10, 0x01, 0x12, 0x25, - 0x0a, 0x21, 0x44, 0x4f, 0x43, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x57, 0x41, 0x54, 0x43, - 0x48, 0x45, 0x44, 0x10, 0x02, 0x12, 0x25, 0x0a, 0x21, 0x44, 0x4f, 0x43, 0x5f, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, - 0x5f, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x03, 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, + 0x63, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2f, 0x0a, 0x08, 0x70, 0x72, 0x65, + 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x79, 0x6f, + 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, + 0x52, 0x08, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x22, 0x6d, 0x0a, 0x0a, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x48, 0x41, 0x4e, + 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x50, 0x55, 0x54, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x43, 0x48, + 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45, + 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x43, 0x4c, 0x45, 0x41, 0x52, 0x10, 0x03, 0x22, 0x76, 0x0a, 0x08, 0x50, 0x72, 0x65, + 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x31, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, + 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x1a, 0x37, 0x0a, 0x09, 0x44, 0x61, 0x74, 0x61, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x22, 0x4a, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x65, 0x71, 0x12, 0x1d, + 0x0a, 0x0a, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x71, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x71, 0x22, 0x84, 0x01, + 0x0a, 0x0b, 0x54, 0x65, 0x78, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x6f, 0x73, 0x12, 0x34, 0x0a, + 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x69, + 0x6d, 0x65, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x64, 0x41, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x0f, 0x72, + 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x22, 0x5f, 0x0a, 0x0a, 0x54, 0x69, 0x6d, 0x65, 0x54, 0x69, 0x63, 0x6b, + 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x61, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x07, 0x6c, 0x61, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x0a, 0x09, + 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x09, 0x64, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x63, + 0x74, 0x6f, 0x72, 0x49, 0x64, 0x22, 0x3e, 0x0a, 0x0c, 0x44, 0x6f, 0x63, 0x45, 0x76, 0x65, 0x6e, + 0x74, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x18, 0x0a, 0x07, 0x70, + 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, + 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x82, 0x01, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x17, 0x2e, 0x79, 0x6f, 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x65, 0x72, 0x12, 0x2b, 0x0a, + 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x79, 0x6f, + 0x72, 0x6b, 0x69, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x6f, 0x63, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x2a, 0xd4, 0x02, 0x0a, 0x09, 0x56, + 0x61, 0x6c, 0x75, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x41, 0x4c, 0x55, + 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x10, 0x00, 0x12, 0x16, 0x0a, + 0x12, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, 0x4c, + 0x45, 0x41, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x10, 0x02, 0x12, 0x13, 0x0a, + 0x0f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, + 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x41, 0x4c, + 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x05, + 0x12, 0x14, 0x0a, 0x10, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, + 0x59, 0x54, 0x45, 0x53, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, 0x1a, 0x0a, 0x16, 0x56, + 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x4f, + 0x42, 0x4a, 0x45, 0x43, 0x54, 0x10, 0x08, 0x12, 0x19, 0x0a, 0x15, 0x56, 0x41, 0x4c, 0x55, 0x45, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x41, 0x52, 0x52, 0x41, 0x59, + 0x10, 0x09, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x54, 0x45, 0x58, 0x54, 0x10, 0x0a, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x41, 0x4c, 0x55, 0x45, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x45, 0x52, 0x5f, 0x43, 0x4e, + 0x54, 0x10, 0x0b, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x4c, 0x4f, 0x4e, 0x47, 0x5f, 0x43, 0x4e, 0x54, 0x10, 0x0c, 0x12, 0x13, 0x0a, 0x0f, + 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x45, 0x45, 0x10, + 0x0d, 0x2a, 0xa6, 0x01, 0x0a, 0x0c, 0x44, 0x6f, 0x63, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x4f, 0x43, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x43, 0x48, + 0x41, 0x4e, 0x47, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x44, 0x4f, 0x43, 0x5f, 0x45, + 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, + 0x4e, 0x54, 0x5f, 0x57, 0x41, 0x54, 0x43, 0x48, 0x45, 0x44, 0x10, 0x01, 0x12, 0x25, 0x0a, 0x21, + 0x44, 0x4f, 0x43, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, + 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x55, 0x4e, 0x57, 0x41, 0x54, 0x43, 0x48, 0x45, + 0x44, 0x10, 0x02, 0x12, 0x25, 0x0a, 0x21, 0x44, 0x4f, 0x43, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x43, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x42, + 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x03, 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 ( @@ -4386,7 +4485,7 @@ func file_yorkie_v1_resources_proto_rawDescGZIP() []byte { } var file_yorkie_v1_resources_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_yorkie_v1_resources_proto_msgTypes = make([]protoimpl.MessageInfo, 58) +var file_yorkie_v1_resources_proto_msgTypes = make([]protoimpl.MessageInfo, 59) var file_yorkie_v1_resources_proto_goTypes = []interface{}{ (ValueType)(0), // 0: yorkie.v1.ValueType (DocEventType)(0), // 1: yorkie.v1.DocEventType @@ -4448,9 +4547,10 @@ var file_yorkie_v1_resources_proto_goTypes = []interface{}{ nil, // 57: yorkie.v1.TextNode.AttributesEntry nil, // 58: yorkie.v1.TreeNode.AttributesEntry (*UpdatableProjectFields_AuthWebhookMethods)(nil), // 59: yorkie.v1.UpdatableProjectFields.AuthWebhookMethods - nil, // 60: yorkie.v1.Presence.DataEntry - (*timestamppb.Timestamp)(nil), // 61: google.protobuf.Timestamp - (*wrapperspb.StringValue)(nil), // 62: google.protobuf.StringValue + (*UpdatableProjectFields_EventWebhookEvents)(nil), // 60: yorkie.v1.UpdatableProjectFields.EventWebhookEvents + nil, // 61: yorkie.v1.Presence.DataEntry + (*timestamppb.Timestamp)(nil), // 62: google.protobuf.Timestamp + (*wrapperspb.StringValue)(nil), // 63: google.protobuf.StringValue } var file_yorkie_v1_resources_proto_depIdxs = []int32{ 10, // 0: yorkie.v1.Snapshot.root:type_name -> yorkie.v1.JSONElement @@ -4503,107 +4603,109 @@ var file_yorkie_v1_resources_proto_depIdxs = []int32{ 28, // 47: yorkie.v1.TreeNodeID.created_at:type_name -> yorkie.v1.TimeTicket 18, // 48: yorkie.v1.TreePos.parent_id:type_name -> yorkie.v1.TreeNodeID 18, // 49: yorkie.v1.TreePos.left_sibling_id:type_name -> yorkie.v1.TreeNodeID - 61, // 50: yorkie.v1.User.created_at:type_name -> google.protobuf.Timestamp - 61, // 51: yorkie.v1.Project.created_at:type_name -> google.protobuf.Timestamp - 61, // 52: yorkie.v1.Project.updated_at:type_name -> google.protobuf.Timestamp - 62, // 53: yorkie.v1.UpdatableProjectFields.name:type_name -> google.protobuf.StringValue - 62, // 54: yorkie.v1.UpdatableProjectFields.auth_webhook_url:type_name -> google.protobuf.StringValue + 62, // 50: yorkie.v1.User.created_at:type_name -> google.protobuf.Timestamp + 62, // 51: yorkie.v1.Project.created_at:type_name -> google.protobuf.Timestamp + 62, // 52: yorkie.v1.Project.updated_at:type_name -> google.protobuf.Timestamp + 63, // 53: yorkie.v1.UpdatableProjectFields.name:type_name -> google.protobuf.StringValue + 63, // 54: yorkie.v1.UpdatableProjectFields.auth_webhook_url:type_name -> google.protobuf.StringValue 59, // 55: yorkie.v1.UpdatableProjectFields.auth_webhook_methods:type_name -> yorkie.v1.UpdatableProjectFields.AuthWebhookMethods - 62, // 56: yorkie.v1.UpdatableProjectFields.client_deactivate_threshold:type_name -> google.protobuf.StringValue - 61, // 57: yorkie.v1.DocumentSummary.created_at:type_name -> google.protobuf.Timestamp - 61, // 58: yorkie.v1.DocumentSummary.accessed_at:type_name -> google.protobuf.Timestamp - 61, // 59: yorkie.v1.DocumentSummary.updated_at:type_name -> google.protobuf.Timestamp - 2, // 60: yorkie.v1.PresenceChange.type:type_name -> yorkie.v1.PresenceChange.ChangeType - 25, // 61: yorkie.v1.PresenceChange.presence:type_name -> yorkie.v1.Presence - 60, // 62: yorkie.v1.Presence.data:type_name -> yorkie.v1.Presence.DataEntry - 28, // 63: yorkie.v1.TextNodePos.created_at:type_name -> yorkie.v1.TimeTicket - 1, // 64: yorkie.v1.DocEvent.type:type_name -> yorkie.v1.DocEventType - 29, // 65: yorkie.v1.DocEvent.body:type_name -> yorkie.v1.DocEventBody - 25, // 66: yorkie.v1.Snapshot.PresencesEntry.value:type_name -> yorkie.v1.Presence - 28, // 67: yorkie.v1.Operation.Set.parent_created_at:type_name -> yorkie.v1.TimeTicket - 9, // 68: yorkie.v1.Operation.Set.value:type_name -> yorkie.v1.JSONElementSimple - 28, // 69: yorkie.v1.Operation.Set.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 70: yorkie.v1.Operation.Add.parent_created_at:type_name -> yorkie.v1.TimeTicket - 28, // 71: yorkie.v1.Operation.Add.prev_created_at:type_name -> yorkie.v1.TimeTicket - 9, // 72: yorkie.v1.Operation.Add.value:type_name -> yorkie.v1.JSONElementSimple - 28, // 73: yorkie.v1.Operation.Add.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 74: yorkie.v1.Operation.Move.parent_created_at:type_name -> yorkie.v1.TimeTicket - 28, // 75: yorkie.v1.Operation.Move.prev_created_at:type_name -> yorkie.v1.TimeTicket - 28, // 76: yorkie.v1.Operation.Move.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 77: yorkie.v1.Operation.Move.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 78: yorkie.v1.Operation.Remove.parent_created_at:type_name -> yorkie.v1.TimeTicket - 28, // 79: yorkie.v1.Operation.Remove.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 80: yorkie.v1.Operation.Remove.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 81: yorkie.v1.Operation.Edit.parent_created_at:type_name -> yorkie.v1.TimeTicket - 27, // 82: yorkie.v1.Operation.Edit.from:type_name -> yorkie.v1.TextNodePos - 27, // 83: yorkie.v1.Operation.Edit.to:type_name -> yorkie.v1.TextNodePos - 44, // 84: yorkie.v1.Operation.Edit.created_at_map_by_actor:type_name -> yorkie.v1.Operation.Edit.CreatedAtMapByActorEntry - 28, // 85: yorkie.v1.Operation.Edit.executed_at:type_name -> yorkie.v1.TimeTicket - 45, // 86: yorkie.v1.Operation.Edit.attributes:type_name -> yorkie.v1.Operation.Edit.AttributesEntry - 28, // 87: yorkie.v1.Operation.Select.parent_created_at:type_name -> yorkie.v1.TimeTicket - 27, // 88: yorkie.v1.Operation.Select.from:type_name -> yorkie.v1.TextNodePos - 27, // 89: yorkie.v1.Operation.Select.to:type_name -> yorkie.v1.TextNodePos - 28, // 90: yorkie.v1.Operation.Select.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 91: yorkie.v1.Operation.Style.parent_created_at:type_name -> yorkie.v1.TimeTicket - 27, // 92: yorkie.v1.Operation.Style.from:type_name -> yorkie.v1.TextNodePos - 27, // 93: yorkie.v1.Operation.Style.to:type_name -> yorkie.v1.TextNodePos - 46, // 94: yorkie.v1.Operation.Style.attributes:type_name -> yorkie.v1.Operation.Style.AttributesEntry - 28, // 95: yorkie.v1.Operation.Style.executed_at:type_name -> yorkie.v1.TimeTicket - 47, // 96: yorkie.v1.Operation.Style.created_at_map_by_actor:type_name -> yorkie.v1.Operation.Style.CreatedAtMapByActorEntry - 28, // 97: yorkie.v1.Operation.Increase.parent_created_at:type_name -> yorkie.v1.TimeTicket - 9, // 98: yorkie.v1.Operation.Increase.value:type_name -> yorkie.v1.JSONElementSimple - 28, // 99: yorkie.v1.Operation.Increase.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 100: yorkie.v1.Operation.TreeEdit.parent_created_at:type_name -> yorkie.v1.TimeTicket - 19, // 101: yorkie.v1.Operation.TreeEdit.from:type_name -> yorkie.v1.TreePos - 19, // 102: yorkie.v1.Operation.TreeEdit.to:type_name -> yorkie.v1.TreePos - 48, // 103: yorkie.v1.Operation.TreeEdit.created_at_map_by_actor:type_name -> yorkie.v1.Operation.TreeEdit.CreatedAtMapByActorEntry - 17, // 104: yorkie.v1.Operation.TreeEdit.contents:type_name -> yorkie.v1.TreeNodes - 28, // 105: yorkie.v1.Operation.TreeEdit.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 106: yorkie.v1.Operation.TreeStyle.parent_created_at:type_name -> yorkie.v1.TimeTicket - 19, // 107: yorkie.v1.Operation.TreeStyle.from:type_name -> yorkie.v1.TreePos - 19, // 108: yorkie.v1.Operation.TreeStyle.to:type_name -> yorkie.v1.TreePos - 49, // 109: yorkie.v1.Operation.TreeStyle.attributes:type_name -> yorkie.v1.Operation.TreeStyle.AttributesEntry - 28, // 110: yorkie.v1.Operation.TreeStyle.executed_at:type_name -> yorkie.v1.TimeTicket - 50, // 111: yorkie.v1.Operation.TreeStyle.created_at_map_by_actor:type_name -> yorkie.v1.Operation.TreeStyle.CreatedAtMapByActorEntry - 28, // 112: yorkie.v1.Operation.ArraySet.parent_created_at:type_name -> yorkie.v1.TimeTicket - 28, // 113: yorkie.v1.Operation.ArraySet.created_at:type_name -> yorkie.v1.TimeTicket - 9, // 114: yorkie.v1.Operation.ArraySet.value:type_name -> yorkie.v1.JSONElementSimple - 28, // 115: yorkie.v1.Operation.ArraySet.executed_at:type_name -> yorkie.v1.TimeTicket - 28, // 116: yorkie.v1.Operation.Edit.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket - 28, // 117: yorkie.v1.Operation.Style.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket - 28, // 118: yorkie.v1.Operation.TreeEdit.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket - 28, // 119: yorkie.v1.Operation.TreeStyle.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket - 11, // 120: yorkie.v1.JSONElement.JSONObject.nodes:type_name -> yorkie.v1.RHTNode - 28, // 121: yorkie.v1.JSONElement.JSONObject.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 122: yorkie.v1.JSONElement.JSONObject.moved_at:type_name -> yorkie.v1.TimeTicket - 28, // 123: yorkie.v1.JSONElement.JSONObject.removed_at:type_name -> yorkie.v1.TimeTicket - 12, // 124: yorkie.v1.JSONElement.JSONArray.nodes:type_name -> yorkie.v1.RGANode - 28, // 125: yorkie.v1.JSONElement.JSONArray.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 126: yorkie.v1.JSONElement.JSONArray.moved_at:type_name -> yorkie.v1.TimeTicket - 28, // 127: yorkie.v1.JSONElement.JSONArray.removed_at:type_name -> yorkie.v1.TimeTicket - 0, // 128: yorkie.v1.JSONElement.Primitive.type:type_name -> yorkie.v1.ValueType - 28, // 129: yorkie.v1.JSONElement.Primitive.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 130: yorkie.v1.JSONElement.Primitive.moved_at:type_name -> yorkie.v1.TimeTicket - 28, // 131: yorkie.v1.JSONElement.Primitive.removed_at:type_name -> yorkie.v1.TimeTicket - 14, // 132: yorkie.v1.JSONElement.Text.nodes:type_name -> yorkie.v1.TextNode - 28, // 133: yorkie.v1.JSONElement.Text.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 134: yorkie.v1.JSONElement.Text.moved_at:type_name -> yorkie.v1.TimeTicket - 28, // 135: yorkie.v1.JSONElement.Text.removed_at:type_name -> yorkie.v1.TimeTicket - 0, // 136: yorkie.v1.JSONElement.Counter.type:type_name -> yorkie.v1.ValueType - 28, // 137: yorkie.v1.JSONElement.Counter.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 138: yorkie.v1.JSONElement.Counter.moved_at:type_name -> yorkie.v1.TimeTicket - 28, // 139: yorkie.v1.JSONElement.Counter.removed_at:type_name -> yorkie.v1.TimeTicket - 16, // 140: yorkie.v1.JSONElement.Tree.nodes:type_name -> yorkie.v1.TreeNode - 28, // 141: yorkie.v1.JSONElement.Tree.created_at:type_name -> yorkie.v1.TimeTicket - 28, // 142: yorkie.v1.JSONElement.Tree.moved_at:type_name -> yorkie.v1.TimeTicket - 28, // 143: yorkie.v1.JSONElement.Tree.removed_at:type_name -> yorkie.v1.TimeTicket - 13, // 144: yorkie.v1.TextNode.AttributesEntry.value:type_name -> yorkie.v1.NodeAttr - 13, // 145: yorkie.v1.TreeNode.AttributesEntry.value:type_name -> yorkie.v1.NodeAttr - 146, // [146:146] is the sub-list for method output_type - 146, // [146:146] is the sub-list for method input_type - 146, // [146:146] is the sub-list for extension type_name - 146, // [146:146] is the sub-list for extension extendee - 0, // [0:146] is the sub-list for field type_name + 63, // 56: yorkie.v1.UpdatableProjectFields.event_webhook_url:type_name -> google.protobuf.StringValue + 60, // 57: yorkie.v1.UpdatableProjectFields.event_webhook_events:type_name -> yorkie.v1.UpdatableProjectFields.EventWebhookEvents + 63, // 58: yorkie.v1.UpdatableProjectFields.client_deactivate_threshold:type_name -> google.protobuf.StringValue + 62, // 59: yorkie.v1.DocumentSummary.created_at:type_name -> google.protobuf.Timestamp + 62, // 60: yorkie.v1.DocumentSummary.accessed_at:type_name -> google.protobuf.Timestamp + 62, // 61: yorkie.v1.DocumentSummary.updated_at:type_name -> google.protobuf.Timestamp + 2, // 62: yorkie.v1.PresenceChange.type:type_name -> yorkie.v1.PresenceChange.ChangeType + 25, // 63: yorkie.v1.PresenceChange.presence:type_name -> yorkie.v1.Presence + 61, // 64: yorkie.v1.Presence.data:type_name -> yorkie.v1.Presence.DataEntry + 28, // 65: yorkie.v1.TextNodePos.created_at:type_name -> yorkie.v1.TimeTicket + 1, // 66: yorkie.v1.DocEvent.type:type_name -> yorkie.v1.DocEventType + 29, // 67: yorkie.v1.DocEvent.body:type_name -> yorkie.v1.DocEventBody + 25, // 68: yorkie.v1.Snapshot.PresencesEntry.value:type_name -> yorkie.v1.Presence + 28, // 69: yorkie.v1.Operation.Set.parent_created_at:type_name -> yorkie.v1.TimeTicket + 9, // 70: yorkie.v1.Operation.Set.value:type_name -> yorkie.v1.JSONElementSimple + 28, // 71: yorkie.v1.Operation.Set.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 72: yorkie.v1.Operation.Add.parent_created_at:type_name -> yorkie.v1.TimeTicket + 28, // 73: yorkie.v1.Operation.Add.prev_created_at:type_name -> yorkie.v1.TimeTicket + 9, // 74: yorkie.v1.Operation.Add.value:type_name -> yorkie.v1.JSONElementSimple + 28, // 75: yorkie.v1.Operation.Add.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 76: yorkie.v1.Operation.Move.parent_created_at:type_name -> yorkie.v1.TimeTicket + 28, // 77: yorkie.v1.Operation.Move.prev_created_at:type_name -> yorkie.v1.TimeTicket + 28, // 78: yorkie.v1.Operation.Move.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 79: yorkie.v1.Operation.Move.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 80: yorkie.v1.Operation.Remove.parent_created_at:type_name -> yorkie.v1.TimeTicket + 28, // 81: yorkie.v1.Operation.Remove.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 82: yorkie.v1.Operation.Remove.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 83: yorkie.v1.Operation.Edit.parent_created_at:type_name -> yorkie.v1.TimeTicket + 27, // 84: yorkie.v1.Operation.Edit.from:type_name -> yorkie.v1.TextNodePos + 27, // 85: yorkie.v1.Operation.Edit.to:type_name -> yorkie.v1.TextNodePos + 44, // 86: yorkie.v1.Operation.Edit.created_at_map_by_actor:type_name -> yorkie.v1.Operation.Edit.CreatedAtMapByActorEntry + 28, // 87: yorkie.v1.Operation.Edit.executed_at:type_name -> yorkie.v1.TimeTicket + 45, // 88: yorkie.v1.Operation.Edit.attributes:type_name -> yorkie.v1.Operation.Edit.AttributesEntry + 28, // 89: yorkie.v1.Operation.Select.parent_created_at:type_name -> yorkie.v1.TimeTicket + 27, // 90: yorkie.v1.Operation.Select.from:type_name -> yorkie.v1.TextNodePos + 27, // 91: yorkie.v1.Operation.Select.to:type_name -> yorkie.v1.TextNodePos + 28, // 92: yorkie.v1.Operation.Select.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 93: yorkie.v1.Operation.Style.parent_created_at:type_name -> yorkie.v1.TimeTicket + 27, // 94: yorkie.v1.Operation.Style.from:type_name -> yorkie.v1.TextNodePos + 27, // 95: yorkie.v1.Operation.Style.to:type_name -> yorkie.v1.TextNodePos + 46, // 96: yorkie.v1.Operation.Style.attributes:type_name -> yorkie.v1.Operation.Style.AttributesEntry + 28, // 97: yorkie.v1.Operation.Style.executed_at:type_name -> yorkie.v1.TimeTicket + 47, // 98: yorkie.v1.Operation.Style.created_at_map_by_actor:type_name -> yorkie.v1.Operation.Style.CreatedAtMapByActorEntry + 28, // 99: yorkie.v1.Operation.Increase.parent_created_at:type_name -> yorkie.v1.TimeTicket + 9, // 100: yorkie.v1.Operation.Increase.value:type_name -> yorkie.v1.JSONElementSimple + 28, // 101: yorkie.v1.Operation.Increase.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 102: yorkie.v1.Operation.TreeEdit.parent_created_at:type_name -> yorkie.v1.TimeTicket + 19, // 103: yorkie.v1.Operation.TreeEdit.from:type_name -> yorkie.v1.TreePos + 19, // 104: yorkie.v1.Operation.TreeEdit.to:type_name -> yorkie.v1.TreePos + 48, // 105: yorkie.v1.Operation.TreeEdit.created_at_map_by_actor:type_name -> yorkie.v1.Operation.TreeEdit.CreatedAtMapByActorEntry + 17, // 106: yorkie.v1.Operation.TreeEdit.contents:type_name -> yorkie.v1.TreeNodes + 28, // 107: yorkie.v1.Operation.TreeEdit.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 108: yorkie.v1.Operation.TreeStyle.parent_created_at:type_name -> yorkie.v1.TimeTicket + 19, // 109: yorkie.v1.Operation.TreeStyle.from:type_name -> yorkie.v1.TreePos + 19, // 110: yorkie.v1.Operation.TreeStyle.to:type_name -> yorkie.v1.TreePos + 49, // 111: yorkie.v1.Operation.TreeStyle.attributes:type_name -> yorkie.v1.Operation.TreeStyle.AttributesEntry + 28, // 112: yorkie.v1.Operation.TreeStyle.executed_at:type_name -> yorkie.v1.TimeTicket + 50, // 113: yorkie.v1.Operation.TreeStyle.created_at_map_by_actor:type_name -> yorkie.v1.Operation.TreeStyle.CreatedAtMapByActorEntry + 28, // 114: yorkie.v1.Operation.ArraySet.parent_created_at:type_name -> yorkie.v1.TimeTicket + 28, // 115: yorkie.v1.Operation.ArraySet.created_at:type_name -> yorkie.v1.TimeTicket + 9, // 116: yorkie.v1.Operation.ArraySet.value:type_name -> yorkie.v1.JSONElementSimple + 28, // 117: yorkie.v1.Operation.ArraySet.executed_at:type_name -> yorkie.v1.TimeTicket + 28, // 118: yorkie.v1.Operation.Edit.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket + 28, // 119: yorkie.v1.Operation.Style.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket + 28, // 120: yorkie.v1.Operation.TreeEdit.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket + 28, // 121: yorkie.v1.Operation.TreeStyle.CreatedAtMapByActorEntry.value:type_name -> yorkie.v1.TimeTicket + 11, // 122: yorkie.v1.JSONElement.JSONObject.nodes:type_name -> yorkie.v1.RHTNode + 28, // 123: yorkie.v1.JSONElement.JSONObject.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 124: yorkie.v1.JSONElement.JSONObject.moved_at:type_name -> yorkie.v1.TimeTicket + 28, // 125: yorkie.v1.JSONElement.JSONObject.removed_at:type_name -> yorkie.v1.TimeTicket + 12, // 126: yorkie.v1.JSONElement.JSONArray.nodes:type_name -> yorkie.v1.RGANode + 28, // 127: yorkie.v1.JSONElement.JSONArray.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 128: yorkie.v1.JSONElement.JSONArray.moved_at:type_name -> yorkie.v1.TimeTicket + 28, // 129: yorkie.v1.JSONElement.JSONArray.removed_at:type_name -> yorkie.v1.TimeTicket + 0, // 130: yorkie.v1.JSONElement.Primitive.type:type_name -> yorkie.v1.ValueType + 28, // 131: yorkie.v1.JSONElement.Primitive.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 132: yorkie.v1.JSONElement.Primitive.moved_at:type_name -> yorkie.v1.TimeTicket + 28, // 133: yorkie.v1.JSONElement.Primitive.removed_at:type_name -> yorkie.v1.TimeTicket + 14, // 134: yorkie.v1.JSONElement.Text.nodes:type_name -> yorkie.v1.TextNode + 28, // 135: yorkie.v1.JSONElement.Text.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 136: yorkie.v1.JSONElement.Text.moved_at:type_name -> yorkie.v1.TimeTicket + 28, // 137: yorkie.v1.JSONElement.Text.removed_at:type_name -> yorkie.v1.TimeTicket + 0, // 138: yorkie.v1.JSONElement.Counter.type:type_name -> yorkie.v1.ValueType + 28, // 139: yorkie.v1.JSONElement.Counter.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 140: yorkie.v1.JSONElement.Counter.moved_at:type_name -> yorkie.v1.TimeTicket + 28, // 141: yorkie.v1.JSONElement.Counter.removed_at:type_name -> yorkie.v1.TimeTicket + 16, // 142: yorkie.v1.JSONElement.Tree.nodes:type_name -> yorkie.v1.TreeNode + 28, // 143: yorkie.v1.JSONElement.Tree.created_at:type_name -> yorkie.v1.TimeTicket + 28, // 144: yorkie.v1.JSONElement.Tree.moved_at:type_name -> yorkie.v1.TimeTicket + 28, // 145: yorkie.v1.JSONElement.Tree.removed_at:type_name -> yorkie.v1.TimeTicket + 13, // 146: yorkie.v1.TextNode.AttributesEntry.value:type_name -> yorkie.v1.NodeAttr + 13, // 147: yorkie.v1.TreeNode.AttributesEntry.value:type_name -> yorkie.v1.NodeAttr + 148, // [148:148] is the sub-list for method output_type + 148, // [148:148] is the sub-list for method input_type + 148, // [148:148] is the sub-list for extension type_name + 148, // [148:148] is the sub-list for extension extendee + 0, // [0:148] is the sub-list for field type_name } func init() { file_yorkie_v1_resources_proto_init() } @@ -5164,6 +5266,18 @@ func file_yorkie_v1_resources_proto_init() { return nil } } + file_yorkie_v1_resources_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatableProjectFields_EventWebhookEvents); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_yorkie_v1_resources_proto_msgTypes[5].OneofWrappers = []interface{}{ (*Operation_Set_)(nil), @@ -5192,7 +5306,7 @@ func file_yorkie_v1_resources_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_yorkie_v1_resources_proto_rawDesc, NumEnums: 3, - NumMessages: 58, + NumMessages: 59, NumExtensions: 0, NumServices: 0, }, diff --git a/api/yorkie/v1/resources.proto b/api/yorkie/v1/resources.proto index 547ec6c55..60e2c0518 100644 --- a/api/yorkie/v1/resources.proto +++ b/api/yorkie/v1/resources.proto @@ -297,20 +297,27 @@ message Project { string secret_key = 4; string auth_webhook_url = 5; repeated string auth_webhook_methods = 6; - string client_deactivate_threshold = 7; - google.protobuf.Timestamp created_at = 8; - google.protobuf.Timestamp updated_at = 9; + string event_webhook_url = 7; + repeated string event_webhook_events = 8; + string client_deactivate_threshold = 9; + google.protobuf.Timestamp created_at = 10; + google.protobuf.Timestamp updated_at = 11; } message UpdatableProjectFields { message AuthWebhookMethods { repeated string methods = 1; } + message EventWebhookEvents { + repeated string events = 1; + } google.protobuf.StringValue name = 1; google.protobuf.StringValue auth_webhook_url = 2; AuthWebhookMethods auth_webhook_methods = 3; - google.protobuf.StringValue client_deactivate_threshold = 4; + google.protobuf.StringValue event_webhook_url = 4; + EventWebhookEvents event_webhook_events = 5; + google.protobuf.StringValue client_deactivate_threshold = 6; } message DocumentSummary { diff --git a/cmd/yorkie/project/update.go b/cmd/yorkie/project/update.go index 6f0aee096..3625aff94 100644 --- a/cmd/yorkie/project/update.go +++ b/cmd/yorkie/project/update.go @@ -37,6 +37,9 @@ var ( flagAuthWebhookURL string flagAuthWebhookMethodsAdd []string flagAuthWebhookMethodsRm []string + flagEventWebhookURL string + flagEventWebhookEventsAdd []string + flagEventWebhookEventsRm []string flagName string flagClientDeactivateThreshold string ) @@ -52,6 +55,11 @@ var allAuthWebhookMethods = []string{ string(types.Broadcast), } +var allEventWebhookEvents = []string{ + string(types.DocumentCreated), + string(types.DocumentRemoved), +} + func newUpdateCommand() *cobra.Command { return &cobra.Command{ Use: "update [name]", @@ -95,31 +103,25 @@ func newUpdateCommand() *cobra.Command { newAuthWebhookURL = flagAuthWebhookURL } - methods := make(map[string]struct{}) - for _, m := range project.AuthWebhookMethods { - methods[m] = struct{}{} - } - for _, m := range flagAuthWebhookMethodsRm { - if m == "ALL" { - methods = make(map[string]struct{}) - } else { - delete(methods, m) - } - } - for _, m := range flagAuthWebhookMethodsAdd { - if m == "ALL" { - for _, m := range allAuthWebhookMethods { - methods[m] = struct{}{} - } - } else { - methods[m] = struct{}{} - } - } - newAuthWebhookMethods := make([]string, 0, len(methods)) - for m := range methods { - newAuthWebhookMethods = append(newAuthWebhookMethods, m) + newAuthWebhookMethods := updateStringSlice( + project.AuthWebhookMethods, // prev + flagAuthWebhookMethodsRm, // removes + flagAuthWebhookMethodsAdd, // adds + allAuthWebhookMethods, // all + ) + + newEventWebhookURL := project.EventWebhookURL + if cmd.Flags().Lookup("event-webhook-url").Changed { // allow empty string + newEventWebhookURL = flagEventWebhookURL } + newEventWebhookEvents := updateStringSlice( + project.EventWebhookEvents, // prev + flagEventWebhookEventsRm, // removes + flagEventWebhookEventsAdd, // adds + allEventWebhookEvents, // all + ) + newClientDeactivateThreshold := project.ClientDeactivateThreshold if flagClientDeactivateThreshold != "" { newClientDeactivateThreshold = flagClientDeactivateThreshold @@ -129,6 +131,8 @@ func newUpdateCommand() *cobra.Command { Name: &newName, AuthWebhookURL: &newAuthWebhookURL, AuthWebhookMethods: &newAuthWebhookMethods, + EventWebhookURL: &newEventWebhookURL, + EventWebhookEvents: &newEventWebhookEvents, ClientDeactivateThreshold: &newClientDeactivateThreshold, } @@ -179,6 +183,40 @@ func printUpdateProjectInfo(cmd *cobra.Command, output string, project *types.Pr return nil } +func updateStringSlice( + prev, removes, adds, all []string, +) []string { + stringSet := make(map[string]struct{}) + + for _, p := range prev { + stringSet[p] = struct{}{} + } + + for _, r := range removes { + if r == "ALL" { + stringSet = make(map[string]struct{}) + } else { + delete(stringSet, r) + } + } + + for _, a := range adds { + if a == "ALL" { + for _, m := range all { + stringSet[m] = struct{}{} + } + } else { + stringSet[a] = struct{}{} + } + } + + updated := make([]string, 0, len(stringSet)) + for s := range stringSet { + updated = append(updated, s) + } + return updated +} + func init() { cmd := newUpdateCommand() cmd.Flags().StringVar( @@ -205,6 +243,25 @@ func init() { []string{}, "authorization-webhook methods to remove ('ALL' for all methods)", ) + cmd.Flags().StringVar( + &flagEventWebhookURL, + "event-webhook-url", + "", + "project-event-webhook update url", + ) + cmd.Flags().StringArrayVar( + &flagEventWebhookEventsAdd, + "event-webhook-events-add", + []string{}, + "project-event-webhook methods to add ('ALL' for all events)", + ) + cmd.Flags().StringArrayVar( + &flagEventWebhookEventsRm, + "project-event-webhook-events-rm", + []string{}, + "project-event-webhook events to remove ('ALL' for all events)", + ) + cmd.Flags().StringVar( &flagClientDeactivateThreshold, "client-deactivate-threshold", diff --git a/cmd/yorkie/server.go b/cmd/yorkie/server.go index 54ea63094..859fab8df 100644 --- a/cmd/yorkie/server.go +++ b/cmd/yorkie/server.go @@ -47,10 +47,13 @@ var ( mongoYorkieDatabase string mongoPingTimeout time.Duration - authWebhookMaxWaitInterval time.Duration - authWebhookCacheAuthTTL time.Duration - authWebhookCacheUnauthTTL time.Duration - projectInfoCacheTTL time.Duration + authWebhookMaxWaitInterval time.Duration + authWebhookCacheAuthTTL time.Duration + authWebhookCacheUnauthTTL time.Duration + eventWebhookMaxWaitInterval time.Duration + eventWebhookBaseWaitInterval time.Duration + eventWebhookRequestTimeout time.Duration + projectInfoCacheTTL time.Duration conf = server.NewConfig() ) @@ -67,6 +70,9 @@ func newServerCmd() *cobra.Command { conf.Backend.AuthWebhookMaxWaitInterval = authWebhookMaxWaitInterval.String() conf.Backend.AuthWebhookCacheAuthTTL = authWebhookCacheAuthTTL.String() conf.Backend.AuthWebhookCacheUnauthTTL = authWebhookCacheUnauthTTL.String() + conf.Backend.EventWebhookMaxWaitInterval = eventWebhookMaxWaitInterval.String() + conf.Backend.EventWebhookBaseWaitInterval = eventWebhookBaseWaitInterval.String() + conf.Backend.EventWebhookRequestTimeout = eventWebhookRequestTimeout.String() conf.Backend.ProjectInfoCacheTTL = projectInfoCacheTTL.String() conf.Housekeeping.Interval = housekeepingInterval.String() @@ -327,6 +333,30 @@ func init() { server.DefaultAuthWebhookCacheUnauthTTL, "TTL value to set when caching unauthorized webhook response.", ) + cmd.Flags().Uint64Var( + &conf.Backend.EventWebhookMaxRetries, + "project-event-webhook-max-retries", + server.DefaultEventWebhookMaxRetries, + "Maximum number of retries for a project webhook.", + ) + cmd.Flags().DurationVar( + &eventWebhookBaseWaitInterval, + "project-event-webhook-base-wait-interval", + server.DefaultEventWebhookBaseWaitInterval, + "Base wait interval for retrying exponential backoff the project webhook.", + ) + cmd.Flags().DurationVar( + &eventWebhookMaxWaitInterval, + "project-event-webhook-max-wait-interval", + server.DefaultEventWebhookMaxWaitInterval, + "Maximum wait interval for project webhook.", + ) + cmd.Flags().DurationVar( + &eventWebhookRequestTimeout, + "project-event-webhook-request-timeout", + server.DefaultEventWebhookRequestTimeout, + "Time to wait for a response from the project webhook.", + ) cmd.Flags().IntVar( &conf.Backend.ProjectInfoCacheSize, "project-info-cache-size", diff --git a/pkg/webhook/client.go b/pkg/webhook/client.go new file mode 100644 index 000000000..da7f48d14 --- /dev/null +++ b/pkg/webhook/client.go @@ -0,0 +1,78 @@ +/* + * 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 webhook provides an webhook utilities. +package webhook + +import ( + "bytes" + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "net/http" + "time" +) + +// HMACTransport is a http.RoundTripper that adds an X-Signature +// header to each request using an HMAC-SHA256 signature. +type HMACTransport struct { + PrivateKey string +} + +// GenerateHMACSignature computes an HMAC-SHA256 signature for the given data +// using the specified secret key. +func GenerateHMACSignature(secret string, data []byte) string { + h := hmac.New(sha256.New, []byte(secret)) + h.Write(data) + return hex.EncodeToString(h.Sum(nil)) +} + +// RoundTrip implements the http.RoundTripper interface. It reads the request body +// to compute the HMAC signature, sets the "X-Signature" header, and restores +// the body for use by subsequent transports or handlers. +func (t *HMACTransport) RoundTrip(r *http.Request) (*http.Response, error) { + reqCopy := r.Clone(r.Context()) + + rawBody, err := io.ReadAll(r.Body) + if err != nil { + return nil, fmt.Errorf("failed to read request: %w", err) + } + reqCopy.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + + signature := GenerateHMACSignature(t.PrivateKey, rawBody) + reqCopy.Header.Set("X-Signature", signature) + + resp, err := http.DefaultTransport.RoundTrip(reqCopy) + if err != nil { + return nil, fmt.Errorf("failed to send request: %w", err) + } + + return resp, nil +} + +// NewClient creates an *http.Client configured with a custom HMAC transport +// and a specified timeout. The transport will add an "X-Signature" header to +// every request using the provided private key. +func NewClient(timeout time.Duration, privateKey string) *http.Client { + return &http.Client{ + Timeout: timeout, + Transport: &HMACTransport{ + PrivateKey: privateKey, + }, + } +} diff --git a/pkg/webhook/retry.go b/pkg/webhook/retry.go new file mode 100644 index 000000000..af77ca9af --- /dev/null +++ b/pkg/webhook/retry.go @@ -0,0 +1,106 @@ +/* + * 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 webhook + +import ( + "context" + "errors" + "fmt" + "math" + "net/http" + "syscall" + gotime "time" +) + +var ( + // ErrUnexpectedStatusCode is returned when the webhook returns an unexpected status code. + ErrUnexpectedStatusCode = errors.New("unexpected status code from webhook") + + // ErrMaxRetriesExceeded indicates we have retried up to the specified max retries + // without a successful outcome. + ErrMaxRetriesExceeded = errors.New("exponential backoff: maximum retries exceeded") +) + +// WithExponentialBackoff retries the given webhookFn with exponential backoff. +func WithExponentialBackoff( + ctx context.Context, + maxRetries uint64, + baseInterval, + maxInterval gotime.Duration, + webhookFn func() (int, error), +) error { + start := gotime.Now() + + var ( + retries uint64 + statusCode int + ) + + for retries < maxRetries { + statusCode, err := webhookFn() + if !shouldRetry(statusCode, err) { + if errors.Is(err, ErrUnexpectedStatusCode) { + return fmt.Errorf("%d: %w", statusCode, ErrUnexpectedStatusCode) + } + + return err + } + + waitBeforeRetry := waitInterval(retries, baseInterval, maxInterval) + + select { + case <-ctx.Done(): + return ctx.Err() + case <-gotime.After(waitBeforeRetry): + } + + retries++ + } + + return fmt.Errorf( + "maximum retries (%d) exceeded after %s; last status code = %d: %w", + maxRetries, + gotime.Since(start), + statusCode, + ErrMaxRetriesExceeded, + ) +} + +// waitInterval returns the interval of given retries. it returns maxWaitInterval +func waitInterval(retries uint64, baseInterval, maxWaitInterval gotime.Duration) gotime.Duration { + interval := gotime.Duration(math.Pow(2, float64(retries))) * baseInterval + if maxWaitInterval < interval { + return maxWaitInterval + } + + return interval +} + +// shouldRetry returns true if the given error should be retried. +// Refer to https://github.com/kubernetes/kubernetes/search?q=DefaultShouldRetry +func shouldRetry(statusCode int, err error) bool { + // If the connection is reset, we should retry. + var errno syscall.Errno + if errors.As(err, &errno) { + return errno == syscall.ECONNRESET + } + + return statusCode == http.StatusInternalServerError || + statusCode == http.StatusServiceUnavailable || + statusCode == http.StatusGatewayTimeout || + statusCode == http.StatusTooManyRequests +} diff --git a/server/backend/config.go b/server/backend/config.go index 8b5cbc511..e24ec498c 100644 --- a/server/backend/config.go +++ b/server/backend/config.go @@ -73,6 +73,18 @@ type Config struct { // AuthWebhookCacheUnauthTTL is the TTL value to set when caching the unauthorized result. AuthWebhookCacheUnauthTTL string `yaml:"AuthWebhookCacheUnauthTTL"` + // EventWebhookMaxRetries is the max count that retries the project event webhook. + EventWebhookMaxRetries uint64 `yaml:"EventWebhookMaxRetries"` + + // EventWebhookBaseWaitInterval is the base of retrying exponential backoff the project event webhook. + EventWebhookBaseWaitInterval string `yaml:"EventWebhookBaseWaitInterval"` + + // EventWebhookMaxWaitInterval is the max interval that waits before retrying the project event webhook. + EventWebhookMaxWaitInterval string `yaml:"EventWebhookMaxWaitInterval"` + + // EventWebhookRequestTimeout is the time that waits time for response the project webhook. + EventWebhookRequestTimeout string `yaml:"EventWebhookRequestTimeout"` + // ProjectInfoCacheSize is the cache size of the project info. ProjectInfoCacheSize int `yaml:"ProjectInfoCacheSize"` @@ -120,6 +132,30 @@ func (c *Config) Validate() error { ) } + if _, err := time.ParseDuration(c.EventWebhookBaseWaitInterval); err != nil { + return fmt.Errorf( + `invalid argument "%s" for "--event-webhook-base-wait-interval" flag: %w`, + c.EventWebhookBaseWaitInterval, + err, + ) + } + + if _, err := time.ParseDuration(c.EventWebhookMaxWaitInterval); err != nil { + return fmt.Errorf( + `invalid argument "%s" for "--event-webhook-max-wait-interval" flag: %w`, + c.EventWebhookMaxWaitInterval, + err, + ) + + } + if _, err := time.ParseDuration(c.EventWebhookRequestTimeout); err != nil { + return fmt.Errorf( + `invalid argument "%s" for "--event-webhook-request-timeout" flag: %w`, + c.EventWebhookRequestTimeout, + err, + ) + } + if _, err := time.ParseDuration(c.ProjectInfoCacheTTL); err != nil { return fmt.Errorf( `invalid argument "%s" for "--project-info-cache-ttl" flag: %w`, @@ -175,6 +211,39 @@ func (c *Config) ParseAuthWebhookCacheUnauthTTL() time.Duration { return result } +// ParseProjectWebhookMaxWaitInterval returns max wait interval. +func (c *Config) ParseProjectWebhookMaxWaitInterval() time.Duration { + result, err := time.ParseDuration(c.EventWebhookMaxWaitInterval) + if err != nil { + fmt.Fprintln(os.Stderr, "parse project webhook max wait interval: %w", err) + os.Exit(1) + } + + return result +} + +// ParseProjectWebhookBaseWaitInterval returns base wait interval. +func (c *Config) ParseProjectWebhookBaseWaitInterval() time.Duration { + result, err := time.ParseDuration(c.EventWebhookBaseWaitInterval) + if err != nil { + fmt.Fprintln(os.Stderr, "parse project webhook max wait interval: %w", err) + os.Exit(1) + } + + return result +} + +// ParseProjectWebhookTimeout returns timeout for request. +func (c *Config) ParseProjectWebhookTimeout() time.Duration { + result, err := time.ParseDuration(c.EventWebhookRequestTimeout) + if err != nil { + fmt.Fprintln(os.Stderr, "parse project webhook max wait interval: %w", err) + os.Exit(1) + } + + return result +} + // ParseProjectInfoCacheTTL returns TTL for project info cache. func (c *Config) ParseProjectInfoCacheTTL() time.Duration { result, err := time.ParseDuration(c.ProjectInfoCacheTTL) diff --git a/server/backend/config_test.go b/server/backend/config_test.go index 0a334212c..7d615c2e9 100644 --- a/server/backend/config_test.go +++ b/server/backend/config_test.go @@ -27,11 +27,14 @@ import ( func TestConfig(t *testing.T) { t.Run("validate test", func(t *testing.T) { validConf := backend.Config{ - ClientDeactivateThreshold: "1h", - AuthWebhookMaxWaitInterval: "0ms", - AuthWebhookCacheAuthTTL: "10s", - AuthWebhookCacheUnauthTTL: "10s", - ProjectInfoCacheTTL: "10m", + ClientDeactivateThreshold: "1h", + AuthWebhookMaxWaitInterval: "0ms", + AuthWebhookCacheAuthTTL: "10s", + AuthWebhookCacheUnauthTTL: "10s", + EventWebhookBaseWaitInterval: "10ms", + EventWebhookRequestTimeout: "10s", + EventWebhookMaxWaitInterval: "10ms", + ProjectInfoCacheTTL: "10m", } assert.NoError(t, validConf.Validate()) @@ -52,7 +55,19 @@ func TestConfig(t *testing.T) { assert.Error(t, conf4.Validate()) conf5 := validConf - conf5.ProjectInfoCacheTTL = "10 minutes" + conf5.EventWebhookBaseWaitInterval = "10 ms" assert.Error(t, conf5.Validate()) + + conf6 := validConf + conf6.EventWebhookRequestTimeout = "10 seconds" + assert.Error(t, conf6.Validate()) + + conf7 := validConf + conf7.EventWebhookMaxWaitInterval = "10 second" + assert.Error(t, conf7.Validate()) + + conf8 := validConf + conf8.ProjectInfoCacheTTL = "10 minutes" + assert.Error(t, conf8.Validate()) }) } diff --git a/server/backend/database/project_info.go b/server/backend/database/project_info.go index ade8590d5..0057b33c5 100644 --- a/server/backend/database/project_info.go +++ b/server/backend/database/project_info.go @@ -57,6 +57,12 @@ type ProjectInfo struct { // AuthWebhookMethods is the methods that run the authorization webhook. AuthWebhookMethods []string `bson:"auth_webhook_methods"` + // EventWebhookURL is the url of the project events webhook. + EventWebhookURL string `bson:"event_webhook_url"` + + // EventWebhookEvents is the methods that run the project events webhook. + EventWebhookEvents []string `bson:"event_webhook_events"` + // ClientDeactivateThreshold is the time after which clients in // specific project are considered deactivate for housekeeping. ClientDeactivateThreshold string `bson:"client_deactivate_threshold"` @@ -94,6 +100,8 @@ func (i *ProjectInfo) DeepCopy() *ProjectInfo { SecretKey: i.SecretKey, AuthWebhookURL: i.AuthWebhookURL, AuthWebhookMethods: i.AuthWebhookMethods, + EventWebhookURL: i.EventWebhookURL, + EventWebhookEvents: i.EventWebhookEvents, ClientDeactivateThreshold: i.ClientDeactivateThreshold, CreatedAt: i.CreatedAt, UpdatedAt: i.UpdatedAt, @@ -111,6 +119,12 @@ func (i *ProjectInfo) UpdateFields(fields *types.UpdatableProjectFields) { if fields.AuthWebhookMethods != nil { i.AuthWebhookMethods = *fields.AuthWebhookMethods } + if fields.EventWebhookURL != nil { + i.EventWebhookURL = *fields.EventWebhookURL + } + if fields.EventWebhookEvents != nil { + i.EventWebhookEvents = *fields.EventWebhookEvents + } if fields.ClientDeactivateThreshold != nil { i.ClientDeactivateThreshold = *fields.ClientDeactivateThreshold } @@ -124,6 +138,8 @@ func (i *ProjectInfo) ToProject() *types.Project { Owner: i.Owner, AuthWebhookURL: i.AuthWebhookURL, AuthWebhookMethods: i.AuthWebhookMethods, + EventWebhookURL: i.EventWebhookURL, + EventWebhookEvents: i.EventWebhookEvents, ClientDeactivateThreshold: i.ClientDeactivateThreshold, PublicKey: i.PublicKey, SecretKey: i.SecretKey, diff --git a/server/backend/database/project_info_test.go b/server/backend/database/project_info_test.go index 658e2bf33..b67a413a4 100644 --- a/server/backend/database/project_info_test.go +++ b/server/backend/database/project_info_test.go @@ -34,6 +34,7 @@ func TestProjectInfo(t *testing.T) { testName := "testName" testURL := "testUrl" testMethods := []string{"testMethod"} + testEvents := []string{"testEvent"} testClientDeactivateThreshold := "2h" project.UpdateFields(&types.UpdatableProjectFields{Name: &testName}) @@ -46,6 +47,12 @@ func TestProjectInfo(t *testing.T) { assert.Equal(t, testMethods, project.AuthWebhookMethods) assert.Equal(t, dummyOwnerID, project.Owner) + project.UpdateFields(&types.UpdatableProjectFields{EventWebhookURL: &testURL}) + assert.Equal(t, testURL, project.EventWebhookURL) + + project.UpdateFields(&types.UpdatableProjectFields{EventWebhookEvents: &testEvents}) + assert.Equal(t, testEvents, project.EventWebhookEvents) + project.UpdateFields(&types.UpdatableProjectFields{ ClientDeactivateThreshold: &testClientDeactivateThreshold, }) diff --git a/server/backend/database/testcases/testcases.go b/server/backend/database/testcases/testcases.go index 8f363db2f..87f915a44 100644 --- a/server/backend/database/testcases/testcases.go +++ b/server/backend/database/testcases/testcases.go @@ -767,6 +767,11 @@ func RunUpdateProjectInfoTest(t *testing.T, db database.Database) { string(types.AttachDocument), string(types.WatchDocuments), } + newEventWebhookURL := "http://localhost:3000" + newEventWebhookEvents := []string{ + string(types.DocumentCreated), + string(types.DocumentRemoved), + } newClientDeactivateThreshold := "1h" info, err := db.CreateProjectInfo(ctx, t.Name(), dummyOwnerID, clientDeactivateThreshold) @@ -781,6 +786,8 @@ func RunUpdateProjectInfoTest(t *testing.T, db database.Database) { Name: &newName, AuthWebhookURL: &newAuthWebhookURL, AuthWebhookMethods: &newAuthWebhookMethods, + EventWebhookURL: &newEventWebhookURL, + EventWebhookEvents: &newEventWebhookEvents, ClientDeactivateThreshold: &newClientDeactivateThreshold, } assert.NoError(t, fields.Validate()) @@ -792,6 +799,8 @@ func RunUpdateProjectInfoTest(t *testing.T, db database.Database) { assert.Equal(t, newName, updateInfo.Name) assert.Equal(t, newAuthWebhookURL, updateInfo.AuthWebhookURL) assert.Equal(t, newAuthWebhookMethods, updateInfo.AuthWebhookMethods) + assert.Equal(t, newEventWebhookURL, updateInfo.EventWebhookURL) + assert.Equal(t, newEventWebhookEvents, updateInfo.EventWebhookEvents) assert.Equal(t, newClientDeactivateThreshold, updateInfo.ClientDeactivateThreshold) // 02. Update name field test @@ -807,6 +816,8 @@ func RunUpdateProjectInfoTest(t *testing.T, db database.Database) { assert.NotEqual(t, newName, updateInfo.Name) assert.Equal(t, newAuthWebhookURL, updateInfo.AuthWebhookURL) assert.Equal(t, newAuthWebhookMethods, updateInfo.AuthWebhookMethods) + assert.Equal(t, newEventWebhookURL, updateInfo.EventWebhookURL) + assert.Equal(t, newEventWebhookEvents, updateInfo.EventWebhookEvents) assert.Equal(t, newClientDeactivateThreshold, updateInfo.ClientDeactivateThreshold) // 03. Update authWebhookURL test @@ -823,9 +834,49 @@ func RunUpdateProjectInfoTest(t *testing.T, db database.Database) { assert.Equal(t, newName2, updateInfo.Name) assert.NotEqual(t, newAuthWebhookURL, updateInfo.AuthWebhookURL) assert.Equal(t, newAuthWebhookMethods, updateInfo.AuthWebhookMethods) + assert.Equal(t, newEventWebhookURL, updateInfo.EventWebhookURL) + assert.Equal(t, newEventWebhookEvents, updateInfo.EventWebhookEvents) + assert.Equal(t, newClientDeactivateThreshold, updateInfo.ClientDeactivateThreshold) + + // 04. Update eventWebhookURL test + newEventWebhookURL2 := newEventWebhookURL + "2" + fields = &types.UpdatableProjectFields{ + EventWebhookURL: &newEventWebhookURL2, + } + assert.NoError(t, fields.Validate()) + res, err = db.UpdateProjectInfo(ctx, dummyOwnerID, id, fields) + assert.NoError(t, err) + updateInfo, err = db.FindProjectInfoByID(ctx, id) + assert.NoError(t, err) + assert.Equal(t, res, updateInfo) + assert.Equal(t, newName2, updateInfo.Name) + assert.Equal(t, newAuthWebhookURL2, updateInfo.AuthWebhookURL) + assert.Equal(t, newAuthWebhookMethods, updateInfo.AuthWebhookMethods) + assert.NotEqual(t, newEventWebhookURL, updateInfo.EventWebhookURL) + assert.Equal(t, newEventWebhookEvents, updateInfo.EventWebhookEvents) + assert.Equal(t, newClientDeactivateThreshold, updateInfo.ClientDeactivateThreshold) + + // 05. Update eventWebhookEvents test + newEventWebhookEvents2 := []string{ + string(types.DocumentCreated), + } + fields = &types.UpdatableProjectFields{ + EventWebhookEvents: &newEventWebhookEvents2, + } + assert.NoError(t, fields.Validate()) + res, err = db.UpdateProjectInfo(ctx, dummyOwnerID, id, fields) + assert.NoError(t, err) + updateInfo, err = db.FindProjectInfoByID(ctx, id) + assert.NoError(t, err) + assert.Equal(t, res, updateInfo) + assert.Equal(t, newName2, updateInfo.Name) + assert.Equal(t, newAuthWebhookURL2, updateInfo.AuthWebhookURL) + assert.Equal(t, newAuthWebhookMethods, updateInfo.AuthWebhookMethods) + assert.Equal(t, newEventWebhookURL2, updateInfo.EventWebhookURL) + assert.NotEqual(t, newEventWebhookEvents, updateInfo.EventWebhookEvents) assert.Equal(t, newClientDeactivateThreshold, updateInfo.ClientDeactivateThreshold) - // 04. Update clientDeactivateThreshold test + // 06. Update clientDeactivateThreshold test clientDeactivateThreshold2 := "2h" fields = &types.UpdatableProjectFields{ ClientDeactivateThreshold: &clientDeactivateThreshold2, @@ -839,14 +890,16 @@ func RunUpdateProjectInfoTest(t *testing.T, db database.Database) { assert.Equal(t, newName2, updateInfo.Name) assert.Equal(t, newAuthWebhookURL2, updateInfo.AuthWebhookURL) assert.Equal(t, newAuthWebhookMethods, updateInfo.AuthWebhookMethods) + assert.Equal(t, newEventWebhookURL2, updateInfo.EventWebhookURL) + assert.Equal(t, newEventWebhookEvents2, updateInfo.EventWebhookEvents) assert.NotEqual(t, newClientDeactivateThreshold, updateInfo.ClientDeactivateThreshold) - // 05. Duplicated name test + // 07. Duplicated name test fields = &types.UpdatableProjectFields{Name: &existName} _, err = db.UpdateProjectInfo(ctx, dummyOwnerID, id, fields) assert.ErrorIs(t, err, database.ErrProjectNameAlreadyExists) - // 06. OwnerID not match test + // 08. OwnerID not match test fields = &types.UpdatableProjectFields{Name: &existName} _, err = db.UpdateProjectInfo(ctx, otherOwnerID, id, fields) assert.ErrorIs(t, err, database.ErrProjectNotFound) diff --git a/server/config.go b/server/config.go index 425a2d947..c24f026d2 100644 --- a/server/config.go +++ b/server/config.go @@ -60,13 +60,17 @@ const ( DefaultSnapshotWithPurgingChanges = false DefaultSnapshotDisableGC = false - DefaultAuthWebhookMaxRetries = 10 - DefaultAuthWebhookMaxWaitInterval = 3000 * time.Millisecond - DefaultAuthWebhookCacheSize = 5000 - DefaultAuthWebhookCacheAuthTTL = 10 * time.Second - DefaultAuthWebhookCacheUnauthTTL = 10 * time.Second - DefaultProjectInfoCacheSize = 256 - DefaultProjectInfoCacheTTL = 10 * time.Minute + DefaultAuthWebhookMaxRetries = 10 + DefaultAuthWebhookMaxWaitInterval = 3000 * time.Millisecond + DefaultAuthWebhookCacheSize = 5000 + DefaultAuthWebhookCacheAuthTTL = 10 * time.Second + DefaultAuthWebhookCacheUnauthTTL = 10 * time.Second + DefaultEventWebhookMaxRetries = 10 + DefaultEventWebhookBaseWaitInterval = 3000 * time.Millisecond + DefaultEventWebhookMaxWaitInterval = 3000 * time.Millisecond + DefaultEventWebhookRequestTimeout = 10 * time.Second + DefaultProjectInfoCacheSize = 256 + DefaultProjectInfoCacheTTL = 10 * time.Minute DefaultHostname = "" DefaultGatewayAddr = "localhost:8080" @@ -194,6 +198,22 @@ func (c *Config) ensureDefaultValue() { c.Backend.AuthWebhookCacheUnauthTTL = DefaultAuthWebhookCacheUnauthTTL.String() } + if c.Backend.EventWebhookMaxRetries == 0 { + c.Backend.EventWebhookMaxRetries = DefaultEventWebhookMaxRetries + } + + if c.Backend.EventWebhookBaseWaitInterval == "" { + c.Backend.EventWebhookBaseWaitInterval = DefaultEventWebhookBaseWaitInterval.String() + } + + if c.Backend.EventWebhookMaxWaitInterval == "" { + c.Backend.EventWebhookMaxWaitInterval = DefaultEventWebhookMaxWaitInterval.String() + } + + if c.Backend.EventWebhookRequestTimeout == "" { + c.Backend.EventWebhookRequestTimeout = DefaultEventWebhookRequestTimeout.String() + } + if c.Backend.ProjectInfoCacheSize == 0 { c.Backend.ProjectInfoCacheSize = DefaultProjectInfoCacheSize } diff --git a/server/config_test.go b/server/config_test.go index 43d2103a7..da25ff356 100644 --- a/server/config_test.go +++ b/server/config_test.go @@ -61,6 +61,7 @@ func TestNewConfigFromFile(t *testing.T) { assert.Equal(t, conf.Backend.SnapshotThreshold, int64(server.DefaultSnapshotThreshold)) assert.Equal(t, conf.Backend.SnapshotInterval, int64(server.DefaultSnapshotInterval)) assert.Equal(t, conf.Backend.AuthWebhookMaxRetries, uint64(server.DefaultAuthWebhookMaxRetries)) + assert.Equal(t, conf.Backend.EventWebhookMaxRetries, uint64(server.DefaultEventWebhookMaxRetries)) ClientDeactivateThreshold := conf.Backend.ClientDeactivateThreshold assert.NoError(t, err) @@ -78,6 +79,18 @@ func TestNewConfigFromFile(t *testing.T) { assert.NoError(t, err) assert.Equal(t, authWebhookCacheUnauthTTL, server.DefaultAuthWebhookCacheUnauthTTL) + eventWebhookBaseWaitInterval, err := time.ParseDuration(conf.Backend.EventWebhookBaseWaitInterval) + assert.NoError(t, err) + assert.Equal(t, eventWebhookBaseWaitInterval, server.DefaultEventWebhookBaseWaitInterval) + + eventWebhookMaxWaitInterval, err := time.ParseDuration(conf.Backend.EventWebhookMaxWaitInterval) + assert.NoError(t, err) + assert.Equal(t, eventWebhookMaxWaitInterval, server.DefaultEventWebhookMaxWaitInterval) + + eventWebhookRequestTimeout, err := time.ParseDuration(conf.Backend.EventWebhookRequestTimeout) + assert.NoError(t, err) + assert.Equal(t, eventWebhookRequestTimeout, server.DefaultEventWebhookRequestTimeout) + projectInfoCacheTTL, err := time.ParseDuration(conf.Backend.ProjectInfoCacheTTL) assert.NoError(t, err) assert.Equal(t, projectInfoCacheTTL, server.DefaultProjectInfoCacheTTL) diff --git a/server/rpc/projectevent/webhook.go b/server/rpc/projectevent/webhook.go new file mode 100644 index 000000000..ec830009f --- /dev/null +++ b/server/rpc/projectevent/webhook.go @@ -0,0 +1,126 @@ +/* + * 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 projectevent provides the webhook event functions for the project. +package projectevent + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "net/http" + gotime "time" + + "github.com/yorkie-team/yorkie/api/types" + "github.com/yorkie-team/yorkie/pkg/webhook" + "github.com/yorkie-team/yorkie/server/backend" + "github.com/yorkie-team/yorkie/server/logging" + "github.com/yorkie-team/yorkie/server/projects" +) + +// DocumentCreated sends a webhook event when a document is created. +func DocumentCreated(ctx context.Context, be *backend.Backend, documentKey, clientKey string) { + project := projects.From(ctx) + if !project.RequireEventWebhook(types.DocumentCreated) { + return + } + + be.Background.AttachGoroutine(func(ctx context.Context) { + reqBody, err := json.Marshal(types.WebhookRequest{ + Type: types.DocumentCreated, + Attributes: types.WebhookAttribute{ + DocumentKey: documentKey, + ClientKey: clientKey, + IssuedAt: gotime.Now().String(), + }, + }) + if err != nil { + logging.From(ctx).Error(err) + return + } + + if err = sendWebhookEvent(ctx, be.Config, reqBody, project.SecretKey, project.EventWebhookURL); err != nil { + logging.From(ctx).Error(err) + //NOTE(window9u): I think we could send failed event to Yorkie dashboard server, so failed events could + // be recovered and resent. + } + }, "webhook") +} + +// DocumentRemoved sends a webhook event when a document is removed. +func DocumentRemoved(ctx context.Context, be *backend.Backend, documentKey, clientKey string) { + project := projects.From(ctx) + if !project.RequireEventWebhook(types.DocumentRemoved) { + return + } + + be.Background.AttachGoroutine(func(ctx context.Context) { + reqBody, err := json.Marshal(types.WebhookRequest{ + Type: types.DocumentRemoved, + Attributes: types.WebhookAttribute{ + DocumentKey: documentKey, + ClientKey: clientKey, + IssuedAt: gotime.Now().String(), + }, + }) + if err != nil { + logging.From(ctx).Error(err) + return + } + + if err = sendWebhookEvent(ctx, be.Config, reqBody, project.SecretKey, project.EventWebhookURL); err != nil { + logging.From(ctx).Error(err) + } + }, "webhook") +} + +// sendWebhookEvent sends the given request body to the provided webhook URL +// using a HMAC-based client, then retries with exponential backoff +// on transient errors or specific status codes. +func sendWebhookEvent(ctx context.Context, config *backend.Config, reqBody []byte, secretKey, endpoint string) error { + client := webhook.NewClient(config.ParseProjectWebhookTimeout(), secretKey) + + return webhook.WithExponentialBackoff( + ctx, + config.EventWebhookMaxRetries, + config.ParseProjectWebhookBaseWaitInterval(), + config.ParseProjectWebhookMaxWaitInterval(), + func() (int, error) { + resp, err := client.Post( + endpoint, + "application/json", + bytes.NewBuffer(reqBody), + ) + if err != nil { + return 0, fmt.Errorf("post to webhook: %w", err) + } + + defer func() { + if err = resp.Body.Close(); err != nil { + logging.From(ctx).Error(err) + } + }() + + if resp.StatusCode != http.StatusOK && + resp.StatusCode != http.StatusUnauthorized && + resp.StatusCode != http.StatusForbidden { + return resp.StatusCode, webhook.ErrUnexpectedStatusCode + } + + return resp.StatusCode, nil + }) +} diff --git a/server/rpc/yorkie_server.go b/server/rpc/yorkie_server.go index 4408fb38b..57e0283be 100644 --- a/server/rpc/yorkie_server.go +++ b/server/rpc/yorkie_server.go @@ -36,6 +36,7 @@ import ( "github.com/yorkie-team/yorkie/server/packs" "github.com/yorkie-team/yorkie/server/projects" "github.com/yorkie-team/yorkie/server/rpc/auth" + "github.com/yorkie-team/yorkie/server/rpc/projectevent" ) type yorkieServer struct { @@ -157,6 +158,10 @@ func (s *yorkieServer) AttachDocument( return nil, err } + if docInfo.ServerSeq == 0 { + projectevent.DocumentCreated(ctx, s.backend, docInfo.Key.String(), clientInfo.Key) + } + if err := clientInfo.AttachDocument(docInfo.ID, pack.IsAttached()); err != nil { return nil, err } @@ -558,6 +563,8 @@ func (s *yorkieServer) RemoveDocument( return nil, err } + projectevent.DocumentRemoved(ctx, s.backend, docInfo.Key.String(), clientInfo.Key) + pbChangePack, err := pulled.ToPBChangePack() if err != nil { return nil, err diff --git a/test/helper/helper.go b/test/helper/helper.go index 086cfd13e..75f2f3222 100644 --- a/test/helper/helper.go +++ b/test/helper/helper.go @@ -70,16 +70,19 @@ var ( HousekeepingCandidatesLimitPerProject = 10 HousekeepingProjectFetchSize = 10 - AdminTokenDuration = "10s" - ClientDeactivateThreshold = "10s" - SnapshotThreshold = int64(10) - SnapshotWithPurgingChanges = false - AuthWebhookMaxWaitInterval = 3 * gotime.Millisecond - AuthWebhookSize = 100 - AuthWebhookCacheAuthTTL = 10 * gotime.Second - AuthWebhookCacheUnauthTTL = 10 * gotime.Second - ProjectInfoCacheSize = 256 - ProjectInfoCacheTTL = 5 * gotime.Second + AdminTokenDuration = "10s" + ClientDeactivateThreshold = "10s" + SnapshotThreshold = int64(10) + SnapshotWithPurgingChanges = false + AuthWebhookMaxWaitInterval = 3 * gotime.Millisecond + AuthWebhookSize = 100 + AuthWebhookCacheAuthTTL = 10 * gotime.Second + AuthWebhookCacheUnauthTTL = 10 * gotime.Second + EventWebhookBaseWaitInterval = 3 * gotime.Millisecond + EventWebhookMaxWaitInterval = 3 * gotime.Millisecond + EventWebhookRequestTimeout = 10 * gotime.Second + ProjectInfoCacheSize = 256 + ProjectInfoCacheTTL = 5 * gotime.Second MongoConnectionURI = "mongodb://localhost:27017" MongoConnectionTimeout = "5s" @@ -255,22 +258,25 @@ func TestConfig() *server.Config { ProjectFetchSize: HousekeepingProjectFetchSize, }, Backend: &backend.Config{ - AdminUser: server.DefaultAdminUser, - AdminPassword: server.DefaultAdminPassword, - SecretKey: server.DefaultSecretKey, - AdminTokenDuration: server.DefaultAdminTokenDuration.String(), - UseDefaultProject: true, - ClientDeactivateThreshold: server.DefaultClientDeactivateThreshold, - SnapshotInterval: 10, - SnapshotThreshold: SnapshotThreshold, - SnapshotWithPurgingChanges: SnapshotWithPurgingChanges, - AuthWebhookMaxWaitInterval: AuthWebhookMaxWaitInterval.String(), - AuthWebhookCacheSize: AuthWebhookSize, - AuthWebhookCacheAuthTTL: AuthWebhookCacheAuthTTL.String(), - AuthWebhookCacheUnauthTTL: AuthWebhookCacheUnauthTTL.String(), - ProjectInfoCacheSize: ProjectInfoCacheSize, - ProjectInfoCacheTTL: ProjectInfoCacheTTL.String(), - GatewayAddr: fmt.Sprintf("localhost:%d", RPCPort+portOffset), + AdminUser: server.DefaultAdminUser, + AdminPassword: server.DefaultAdminPassword, + SecretKey: server.DefaultSecretKey, + AdminTokenDuration: server.DefaultAdminTokenDuration.String(), + UseDefaultProject: true, + ClientDeactivateThreshold: server.DefaultClientDeactivateThreshold, + SnapshotInterval: 10, + SnapshotThreshold: SnapshotThreshold, + SnapshotWithPurgingChanges: SnapshotWithPurgingChanges, + AuthWebhookMaxWaitInterval: AuthWebhookMaxWaitInterval.String(), + AuthWebhookCacheSize: AuthWebhookSize, + AuthWebhookCacheAuthTTL: AuthWebhookCacheAuthTTL.String(), + AuthWebhookCacheUnauthTTL: AuthWebhookCacheUnauthTTL.String(), + EventWebhookMaxWaitInterval: EventWebhookMaxWaitInterval.String(), + EventWebhookRequestTimeout: EventWebhookRequestTimeout.String(), + EventWebhookBaseWaitInterval: EventWebhookBaseWaitInterval.String(), + ProjectInfoCacheSize: ProjectInfoCacheSize, + ProjectInfoCacheTTL: ProjectInfoCacheTTL.String(), + GatewayAddr: fmt.Sprintf("localhost:%d", RPCPort+portOffset), }, Mongo: &mongo.Config{ ConnectionURI: MongoConnectionURI,