Skip to content

Commit

Permalink
Restore interface changes due to server DB sharding (#740)
Browse files Browse the repository at this point in the history
This commit restores passing sharding keys to the SDK in accordance
with yorkie-team/yorkie#776.
  • Loading branch information
sejongk authored Jan 26, 2024
1 parent 1f465d7 commit 2882578
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 70 deletions.
9 changes: 0 additions & 9 deletions src/api/yorkie/v1/yorkie.proto
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ message ActivateClientResponse {
}

message DeactivateClientRequest {
string client_key = 2;
string client_id = 1;
}

message DeactivateClientResponse {
}

message AttachDocumentRequest {
string client_key = 3;
string client_id = 1;
ChangePack change_pack = 2;
}
Expand All @@ -67,7 +65,6 @@ message AttachDocumentResponse {
}

message DetachDocumentRequest {
string client_key = 5;
string client_id = 1;
string document_id = 2;
ChangePack change_pack = 3;
Expand All @@ -79,9 +76,7 @@ message DetachDocumentResponse {
}

message WatchDocumentRequest {
string client_key = 4;
string client_id = 1;
string document_key = 3;
string document_id = 2;
}

Expand All @@ -97,7 +92,6 @@ message WatchDocumentResponse {
}

message RemoveDocumentRequest {
string client_key = 4;
string client_id = 1;
string document_id = 2;
ChangePack change_pack = 3;
Expand All @@ -108,7 +102,6 @@ message RemoveDocumentResponse {
}

message PushPullChangesRequest {
string client_key = 5;
string client_id = 1;
string document_id = 2;
ChangePack change_pack = 3;
Expand All @@ -120,9 +113,7 @@ message PushPullChangesResponse {
}

message BroadcastRequest {
string client_key = 6;
string client_id = 1;
string document_key = 5;
string document_id = 2;
string topic = 3;
bytes payload = 4;
Expand Down
45 changes: 0 additions & 45 deletions src/api/yorkie/v1/yorkie_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,6 @@ export declare class ActivateClientResponse extends Message<ActivateClientRespon
* @generated from message yorkie.v1.DeactivateClientRequest
*/
export declare class DeactivateClientRequest extends Message<DeactivateClientRequest> {
/**
* @generated from field: string client_key = 2;
*/
clientKey: string;

/**
* @generated from field: string client_id = 1;
*/
Expand Down Expand Up @@ -122,11 +117,6 @@ export declare class DeactivateClientResponse extends Message<DeactivateClientRe
* @generated from message yorkie.v1.AttachDocumentRequest
*/
export declare class AttachDocumentRequest extends Message<AttachDocumentRequest> {
/**
* @generated from field: string client_key = 3;
*/
clientKey: string;

/**
* @generated from field: string client_id = 1;
*/
Expand Down Expand Up @@ -185,11 +175,6 @@ export declare class AttachDocumentResponse extends Message<AttachDocumentRespon
* @generated from message yorkie.v1.DetachDocumentRequest
*/
export declare class DetachDocumentRequest extends Message<DetachDocumentRequest> {
/**
* @generated from field: string client_key = 5;
*/
clientKey: string;

/**
* @generated from field: string client_id = 1;
*/
Expand Down Expand Up @@ -253,21 +238,11 @@ export declare class DetachDocumentResponse extends Message<DetachDocumentRespon
* @generated from message yorkie.v1.WatchDocumentRequest
*/
export declare class WatchDocumentRequest extends Message<WatchDocumentRequest> {
/**
* @generated from field: string client_key = 4;
*/
clientKey: string;

/**
* @generated from field: string client_id = 1;
*/
clientId: string;

/**
* @generated from field: string document_key = 3;
*/
documentKey: string;

/**
* @generated from field: string document_id = 2;
*/
Expand Down Expand Up @@ -352,11 +327,6 @@ export declare class WatchDocumentResponse_Initialization extends Message<WatchD
* @generated from message yorkie.v1.RemoveDocumentRequest
*/
export declare class RemoveDocumentRequest extends Message<RemoveDocumentRequest> {
/**
* @generated from field: string client_key = 4;
*/
clientKey: string;

/**
* @generated from field: string client_id = 1;
*/
Expand Down Expand Up @@ -415,11 +385,6 @@ export declare class RemoveDocumentResponse extends Message<RemoveDocumentRespon
* @generated from message yorkie.v1.PushPullChangesRequest
*/
export declare class PushPullChangesRequest extends Message<PushPullChangesRequest> {
/**
* @generated from field: string client_key = 5;
*/
clientKey: string;

/**
* @generated from field: string client_id = 1;
*/
Expand Down Expand Up @@ -483,21 +448,11 @@ export declare class PushPullChangesResponse extends Message<PushPullChangesResp
* @generated from message yorkie.v1.BroadcastRequest
*/
export declare class BroadcastRequest extends Message<BroadcastRequest> {
/**
* @generated from field: string client_key = 6;
*/
clientKey: string;

/**
* @generated from field: string client_id = 1;
*/
clientId: string;

/**
* @generated from field: string document_key = 5;
*/
documentKey: string;

/**
* @generated from field: string document_id = 2;
*/
Expand Down
9 changes: 0 additions & 9 deletions src/api/yorkie/v1/yorkie_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ const ActivateClientResponse = proto3.makeMessageType(
const DeactivateClientRequest = proto3.makeMessageType(
"yorkie.v1.DeactivateClientRequest",
() => [
{ no: 2, name: "client_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
],
);
Expand All @@ -69,7 +68,6 @@ const DeactivateClientResponse = proto3.makeMessageType(
const AttachDocumentRequest = proto3.makeMessageType(
"yorkie.v1.AttachDocumentRequest",
() => [
{ no: 3, name: "client_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "change_pack", kind: "message", T: ChangePack },
],
Expand All @@ -92,7 +90,6 @@ const AttachDocumentResponse = proto3.makeMessageType(
const DetachDocumentRequest = proto3.makeMessageType(
"yorkie.v1.DetachDocumentRequest",
() => [
{ no: 5, name: "client_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "change_pack", kind: "message", T: ChangePack },
Expand All @@ -116,9 +113,7 @@ const DetachDocumentResponse = proto3.makeMessageType(
const WatchDocumentRequest = proto3.makeMessageType(
"yorkie.v1.WatchDocumentRequest",
() => [
{ no: 4, name: "client_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
],
);
Expand Down Expand Up @@ -151,7 +146,6 @@ const WatchDocumentResponse_Initialization = proto3.makeMessageType(
const RemoveDocumentRequest = proto3.makeMessageType(
"yorkie.v1.RemoveDocumentRequest",
() => [
{ no: 4, name: "client_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "change_pack", kind: "message", T: ChangePack },
Expand All @@ -174,7 +168,6 @@ const RemoveDocumentResponse = proto3.makeMessageType(
const PushPullChangesRequest = proto3.makeMessageType(
"yorkie.v1.PushPullChangesRequest",
() => [
{ no: 5, name: "client_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "change_pack", kind: "message", T: ChangePack },
Expand All @@ -198,9 +191,7 @@ const PushPullChangesResponse = proto3.makeMessageType(
const BroadcastRequest = proto3.makeMessageType(
"yorkie.v1.BroadcastRequest",
() => [
{ no: 6, name: "client_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 1, name: "client_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 5, name: "document_key", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 2, name: "document_id", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 3, name: "topic", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 4, name: "payload", kind: "scalar", T: 12 /* ScalarType.BYTES */ },
Expand Down
7 changes: 0 additions & 7 deletions src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ export class Client implements Observable<ClientEvent> {
return this.rpcClient
.deactivateClient(
{
clientKey: this.key!,
clientId: this.id!,
},
{ headers: { 'x-shard-key': this.apiKey } },
Expand Down Expand Up @@ -436,7 +435,6 @@ export class Client implements Observable<ClientEvent> {
return this.rpcClient
.attachDocument(
{
clientKey: this.key!,
clientId: this.id!,
changePack: converter.toChangePack(doc.createChangePack()),
},
Expand Down Expand Up @@ -504,7 +502,6 @@ export class Client implements Observable<ClientEvent> {
return this.rpcClient
.detachDocument(
{
clientKey: this.key!,
clientId: this.id!,
documentId: attachment.docID,
changePack: converter.toChangePack(doc.createChangePack()),
Expand Down Expand Up @@ -694,7 +691,6 @@ export class Client implements Observable<ClientEvent> {
return this.rpcClient
.removeDocument(
{
clientKey: this.key!,
clientId: this.id!,
documentId: attachment.docID,
changePack: pbChangePack,
Expand Down Expand Up @@ -810,9 +806,7 @@ export class Client implements Observable<ClientEvent> {
const ac = new AbortController();
const stream = this.rpcClient.watchDocument(
{
clientKey: this.key!,
clientId: this.id!,
documentKey: docKey,
documentId: attachment.docID,
},
{
Expand Down Expand Up @@ -948,7 +942,6 @@ export class Client implements Observable<ClientEvent> {
return this.rpcClient
.pushPullChanges(
{
clientKey: this.key!,
clientId: this.id!,
documentId: docID,
changePack: converter.toChangePack(reqPack),
Expand Down

0 comments on commit 2882578

Please sign in to comment.