Skip to content

Commit

Permalink
merge conflict resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
fourjae committed Jul 30, 2024
2 parents 96f70c4 + 52d2732 commit 6162e71
Show file tree
Hide file tree
Showing 26 changed files with 1,227 additions and 427 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and Yorkie adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [Unreleased]

## [0.4.28] - 2024-07-25

### Added

- Enhance housekeeping to add variety of tasks by @hackerwins in https://github.com/yorkie-team/yorkie/pull/932
- Enhance GetDocuments API by adding bulk retrieval by @kokodak in https://github.com/yorkie-team/yorkie/pull/931
- Improve performance for creating crdt.TreeNode by @m4ushold in https://github.com/yorkie-team/yorkie/pull/939

### Changed

- Update `updated_at` only when there are operations in changes by @window9u in https://github.com/yorkie-team/yorkie/pull/935

## [0.4.27] - 2024-07-11

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
YORKIE_VERSION := 0.4.27
YORKIE_VERSION := 0.4.28

GO_PROJECT = github.com/yorkie-team/yorkie

Expand Down
11 changes: 4 additions & 7 deletions api/converter/from_pb.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,18 +583,15 @@ func FromTreeNodes(pbNodes []*api.TreeNode) (*crdt.TreeNode, error) {
}

root := nodes[len(nodes)-1]
depthTable := make(map[int32]*crdt.TreeNode)
depthTable[pbNodes[len(nodes)-1].Depth] = nodes[len(nodes)-1]
for i := len(nodes) - 2; i >= 0; i-- {
var parent *crdt.TreeNode
for j := i + 1; j < len(nodes); j++ {
if pbNodes[i].Depth-1 == pbNodes[j].Depth {
parent = nodes[j]
break
}
}
var parent *crdt.TreeNode = depthTable[pbNodes[i].Depth-1]

if err := parent.Prepend(nodes[i]); err != nil {
return nil, err
}
depthTable[pbNodes[i].Depth] = nodes[i]
}

root.Index.UpdateDescendantsSize()
Expand Down
2 changes: 1 addition & 1 deletion api/docs/yorkie.base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.1.0
info:
title: Yorkie
description: "Yorkie is an open source document store for building collaborative editing applications."
version: v0.4.27
version: v0.4.28
servers:
- url: https://api.yorkie.dev
description: Production server
Expand Down
109 changes: 108 additions & 1 deletion api/docs/yorkie/v1/admin.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@ info:
description: Yorkie is an open source document store for building collaborative
editing applications.
title: Yorkie
version: v0.4.27
version: v0.4.28
servers:
- 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'
responses:
"200":
$ref: '#/components/responses/yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordResponse'
default:
$ref: '#/components/responses/connect.error'
tags:
- yorkie.v1.AdminService
/yorkie.v1.AdminService/CreateProject:
post:
description: ""
Expand All @@ -22,6 +34,18 @@ paths:
$ref: '#/components/responses/connect.error'
tags:
- yorkie.v1.AdminService
/yorkie.v1.AdminService/DeleteAccount:
post:
description: ""
requestBody:
$ref: '#/components/requestBodies/yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountRequest'
responses:
"200":
$ref: '#/components/responses/yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountResponse'
default:
$ref: '#/components/responses/connect.error'
tags:
- yorkie.v1.AdminService
/yorkie.v1.AdminService/GetDocument:
post:
description: ""
Expand Down Expand Up @@ -168,6 +192,15 @@ paths:
- yorkie.v1.AdminService
components:
requestBodies:
yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordRequest:
content:
application/json:
schema:
$ref: '#/components/schemas/yorkie.v1.ChangePasswordRequest'
application/proto:
schema:
$ref: '#/components/schemas/yorkie.v1.ChangePasswordRequest'
required: true
yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectRequest:
content:
application/json:
Expand All @@ -177,6 +210,15 @@ components:
schema:
$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'
application/proto:
schema:
$ref: '#/components/schemas/yorkie.v1.DeleteAccountRequest'
required: true
yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentRequest:
content:
application/json:
Expand Down Expand Up @@ -295,6 +337,15 @@ components:
schema:
$ref: '#/components/schemas/connect.error'
description: ""
yorkie.v1.AdminService.ChangePassword.yorkie.v1.ChangePasswordResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/yorkie.v1.ChangePasswordResponse'
application/proto:
schema:
$ref: '#/components/schemas/yorkie.v1.ChangePasswordResponse'
description: ""
yorkie.v1.AdminService.CreateProject.yorkie.v1.CreateProjectResponse:
content:
application/json:
Expand All @@ -304,6 +355,15 @@ components:
schema:
$ref: '#/components/schemas/yorkie.v1.CreateProjectResponse'
description: ""
yorkie.v1.AdminService.DeleteAccount.yorkie.v1.DeleteAccountResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/yorkie.v1.DeleteAccountResponse'
application/proto:
schema:
$ref: '#/components/schemas/yorkie.v1.DeleteAccountResponse'
description: ""
yorkie.v1.AdminService.GetDocument.yorkie.v1.GetDocumentResponse:
content:
application/json:
Expand Down Expand Up @@ -611,6 +671,32 @@ components:
title: server_seq
title: ChangeID
type: object
yorkie.v1.ChangePasswordRequest:
additionalProperties: false
description: ""
properties:
currentPassword:
additionalProperties: false
description: ""
title: current_password
type: string
newPassword:
additionalProperties: false
description: ""
title: new_password
type: string
username:
additionalProperties: false
description: ""
title: username
type: string
title: ChangePasswordRequest
type: object
yorkie.v1.ChangePasswordResponse:
additionalProperties: false
description: ""
title: ChangePasswordResponse
type: object
yorkie.v1.CreateProjectRequest:
additionalProperties: false
description: ""
Expand All @@ -634,6 +720,27 @@ components:
type: object
title: CreateProjectResponse
type: object
yorkie.v1.DeleteAccountRequest:
additionalProperties: false
description: ""
properties:
password:
additionalProperties: false
description: ""
title: password
type: string
username:
additionalProperties: false
description: ""
title: username
type: string
title: DeleteAccountRequest
type: object
yorkie.v1.DeleteAccountResponse:
additionalProperties: false
description: ""
title: DeleteAccountResponse
type: object
yorkie.v1.DocumentSummary:
additionalProperties: false
description: ""
Expand Down
2 changes: 1 addition & 1 deletion api/docs/yorkie/v1/resources.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ info:
description: Yorkie is an open source document store for building collaborative
editing applications.
title: Yorkie
version: v0.4.27
version: v0.4.28
servers:
- description: Production server
url: https://api.yorkie.dev
Expand Down
2 changes: 1 addition & 1 deletion api/docs/yorkie/v1/yorkie.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ info:
description: Yorkie is an open source document store for building collaborative
editing applications.
title: Yorkie
version: v0.4.27
version: v0.4.28
servers:
- description: Production server
url: https://api.yorkie.dev
Expand Down
8 changes: 4 additions & 4 deletions api/types/signup_fields.go → api/types/user_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ import (
"github.com/yorkie-team/yorkie/internal/validation"
)

// SignupFields is a set of fields that use to sign up to yorkie server.
type SignupFields struct {
// UserFields is a set of fields that use to sign up or change password to yorkie server.
type UserFields struct {
// Username is the name of user.
Username *string `bson:"username" validate:"required,min=2,max=30,slug"`

// Password is the password of user.
Password *string `bson:"password" validate:"required,min=8,max=30,alpha_num_special"`
}

// Validate validates the SignupFields.
func (i *SignupFields) Validate() error {
// Validate validates the UserFields.
func (i *UserFields) Validate() error {
return validation.ValidateStruct(i)
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,56 +31,56 @@ func TestSignupFields(t *testing.T) {
t.Run("password validation test", func(t *testing.T) {
validUsername := "test"
validPassword := "pass123!"
fields := &types.SignupFields{
fields := &types.UserFields{
Username: &validUsername,
Password: &validPassword,
}
assert.NoError(t, fields.Validate())

invalidPassword := "1234"
fields = &types.SignupFields{
fields = &types.UserFields{
Username: &validUsername,
Password: &invalidPassword,
}
assert.ErrorAs(t, fields.Validate(), &structError)

invalidPassword = "abcd"
fields = &types.SignupFields{
fields = &types.UserFields{
Username: &validUsername,
Password: &invalidPassword,
}
assert.ErrorAs(t, fields.Validate(), &structError)

invalidPassword = "!@#$"
fields = &types.SignupFields{
fields = &types.UserFields{
Username: &validUsername,
Password: &invalidPassword,
}
assert.ErrorAs(t, fields.Validate(), &structError)

invalidPassword = "abcd1234"
fields = &types.SignupFields{
fields = &types.UserFields{
Username: &validUsername,
Password: &invalidPassword,
}
assert.ErrorAs(t, fields.Validate(), &structError)

invalidPassword = "abcd!@#$"
fields = &types.SignupFields{
fields = &types.UserFields{
Username: &validUsername,
Password: &invalidPassword,
}
assert.ErrorAs(t, fields.Validate(), &structError)

invalidPassword = "1234!@#$"
fields = &types.SignupFields{
fields = &types.UserFields{
Username: &validUsername,
Password: &invalidPassword,
}
assert.ErrorAs(t, fields.Validate(), &structError)

invalidPassword = "abcd1234!@abcd1234!@abcd1234!@1"
fields = &types.SignupFields{
fields = &types.UserFields{
Username: &validUsername,
Password: &invalidPassword,
}
Expand Down
Loading

0 comments on commit 6162e71

Please sign in to comment.