Skip to content

Commit

Permalink
Bump up Yorkie to v0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
chacha912 committed Oct 28, 2024
1 parent 533e0fb commit fcac0d1
Show file tree
Hide file tree
Showing 18 changed files with 4,156 additions and 4,063 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Common Environment Variables
VITE_JS_SDK_VERSION=0.5.1
VITE_JS_SDK_VERSION=0.5.4
8 changes: 4 additions & 4 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ plugins:
- plugin: es
out: .
opt:
- target=js+dts
- js_import_style=module
- target=ts
- import_extension=none
- plugin: connect-es
out: .
opt:
- target=js+dts
- js_import_style=module
- target=ts
- import_extension=none
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dashboard",
"version": "0.5.1",
"version": "0.5.4",
"private": true,
"type": "module",
"homepage": "https://yorkie.dev/dashboard",
Expand Down Expand Up @@ -42,7 +42,7 @@
"vite-plugin-svgr": "^4.2.0",
"vite-tsconfig-paths": "^4.3.2",
"vitest": "^1.6.0",
"yorkie-js-sdk": "^0.5.1"
"yorkie-js-sdk": "^0.5.4"
},
"husky": {
"hooks": {
Expand Down
11 changes: 5 additions & 6 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* limitations under the License.
*/

import Long from 'long';
import { Document, OpSource } from 'yorkie-js-sdk';
import { Document, OpSource, VersionVector } from 'yorkie-js-sdk';
import { createPromiseClient } from '@connectrpc/connect';
import { createGrpcWebTransport } from '@connectrpc/connect-web';
import { AdminService } from './yorkie/v1/admin_connect';
Expand Down Expand Up @@ -141,7 +140,7 @@ export async function searchDocuments(
export async function listDocumentHistories(
projectName: string,
documentKey: string,
previousSeq: string,
previousSeq: bigint,
pageSize: number,
isForward: boolean,
): Promise<Array<DocumentHistory>> {
Expand All @@ -155,15 +154,15 @@ export async function listDocumentHistories(
const pbChanges = res.changes;
const changes = converter.fromChanges(pbChanges);

const seq = Long.fromString(pbChanges[0].id!.serverSeq).add(-1);
const seq = pbChanges[0].id!.serverSeq - 1n;
const snapshotMeta = await client.getSnapshotMeta({
projectName,
documentKey,
serverSeq: seq.toString(),
serverSeq: seq,
});

const document = new Document(documentKey);
document.applySnapshot(seq, snapshotMeta.snapshot);
document.applySnapshot(seq, new VersionVector(new Map()), snapshotMeta.snapshot);

const histories: Array<DocumentHistory> = [];
for (let i = 0; i < changes.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type DocumentSummary = {
};

export type DocumentHistory = {
serverSeq: string;
serverSeq: bigint;
snapshot: string;
};

Expand Down
7 changes: 4 additions & 3 deletions src/api/yorkie/v1/admin.proto
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,13 @@ message RemoveDocumentByAdminResponse {}
message GetSnapshotMetaRequest {
string project_name = 1;
string document_key = 2;
int64 server_seq = 3 [jstype = JS_STRING];
int64 server_seq = 3;
}

message GetSnapshotMetaResponse {
bytes snapshot = 1;
int64 lamport = 2 [jstype = JS_STRING];
int64 lamport = 2;
VersionVector version_vector = 3;
}

message SearchDocumentsRequest {
Expand All @@ -178,7 +179,7 @@ message SearchDocumentsResponse {
message ListChangesRequest {
string project_name = 1;
string document_key = 2;
int64 previous_seq = 3 [jstype = JS_STRING];
int64 previous_seq = 3;
int32 page_size = 4;
bool is_forward = 5;
}
Expand Down
178 changes: 0 additions & 178 deletions src/api/yorkie/v1/admin_connect.d.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=js+dts,js_import_style=module"
// @generated by protoc-gen-connect-es v1.4.0 with parameter "target=ts,import_extension=none"
// @generated from file src/api/yorkie/v1/admin.proto (package yorkie.v1, syntax proto3)
/* eslint-disable */
// @ts-nocheck

import { ChangePasswordRequest, ChangePasswordResponse, CreateProjectRequest, CreateProjectResponse, DeleteAccountRequest, DeleteAccountResponse, GetDocumentRequest, GetDocumentResponse, GetDocumentsRequest, GetDocumentsResponse, GetProjectRequest, GetProjectResponse, GetServerVersionRequest, GetServerVersionResponse, GetSnapshotMetaRequest, GetSnapshotMetaResponse, ListChangesRequest, ListChangesResponse, ListDocumentsRequest, ListDocumentsResponse, ListProjectsRequest, ListProjectsResponse, LogInRequest, LogInResponse, RemoveDocumentByAdminRequest, RemoveDocumentByAdminResponse, SearchDocumentsRequest, SearchDocumentsResponse, SignUpRequest, SignUpResponse, UpdateProjectRequest, UpdateProjectResponse } from "./admin_pb.js";
import { ChangePasswordRequest, ChangePasswordResponse, CreateProjectRequest, CreateProjectResponse, DeleteAccountRequest, DeleteAccountResponse, GetDocumentRequest, GetDocumentResponse, GetDocumentsRequest, GetDocumentsResponse, GetProjectRequest, GetProjectResponse, GetServerVersionRequest, GetServerVersionResponse, GetSnapshotMetaRequest, GetSnapshotMetaResponse, ListChangesRequest, ListChangesResponse, ListDocumentsRequest, ListDocumentsResponse, ListProjectsRequest, ListProjectsResponse, LogInRequest, LogInResponse, RemoveDocumentByAdminRequest, RemoveDocumentByAdminResponse, SearchDocumentsRequest, SearchDocumentsResponse, SignUpRequest, SignUpResponse, UpdateProjectRequest, UpdateProjectResponse } from "./admin_pb";
import { MethodKind } from "@bufbuild/protobuf";

/**
Expand Down Expand Up @@ -174,5 +174,5 @@ export const AdminService = {
kind: MethodKind.Unary,
},
}
};
} as const;

Loading

0 comments on commit fcac0d1

Please sign in to comment.