@yorkie-js/sdk 0.6.38 → 0.6.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/quill.html +53 -33
- package/dist/yorkie-js-sdk.d.ts +86 -0
- package/dist/yorkie-js-sdk.es.js +566 -2
- package/dist/yorkie-js-sdk.es.js.map +1 -1
- package/dist/yorkie-js-sdk.js +566 -2
- package/dist/yorkie-js-sdk.js.map +1 -1
- package/package.json +2 -2
package/dist/yorkie-js-sdk.js
CHANGED
|
@@ -6105,6 +6105,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6105
6105
|
* @generated from field: bool remove_on_detach = 16;
|
|
6106
6106
|
*/
|
|
6107
6107
|
__publicField(this, "removeOnDetach", false);
|
|
6108
|
+
/**
|
|
6109
|
+
* @generated from field: bool auto_revision_enabled = 27;
|
|
6110
|
+
*/
|
|
6111
|
+
__publicField(this, "autoRevisionEnabled", false);
|
|
6108
6112
|
/**
|
|
6109
6113
|
* @generated from field: repeated string allowed_origins = 14;
|
|
6110
6114
|
*/
|
|
@@ -6284,6 +6288,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6284
6288
|
T: 8
|
|
6285
6289
|
/* ScalarType.BOOL */
|
|
6286
6290
|
},
|
|
6291
|
+
{
|
|
6292
|
+
no: 27,
|
|
6293
|
+
name: "auto_revision_enabled",
|
|
6294
|
+
kind: "scalar",
|
|
6295
|
+
T: 8
|
|
6296
|
+
/* ScalarType.BOOL */
|
|
6297
|
+
},
|
|
6287
6298
|
{ no: 14, name: "allowed_origins", kind: "scalar", T: 9, repeated: true },
|
|
6288
6299
|
{ no: 12, name: "created_at", kind: "message", T: Timestamp },
|
|
6289
6300
|
{ no: 13, name: "updated_at", kind: "message", T: Timestamp }
|
|
@@ -6417,6 +6428,10 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6417
6428
|
* @generated from field: google.protobuf.BoolValue remove_on_detach = 11;
|
|
6418
6429
|
*/
|
|
6419
6430
|
__publicField(this, "removeOnDetach");
|
|
6431
|
+
/**
|
|
6432
|
+
* @generated from field: google.protobuf.BoolValue auto_revision_enabled = 22;
|
|
6433
|
+
*/
|
|
6434
|
+
__publicField(this, "autoRevisionEnabled");
|
|
6420
6435
|
/**
|
|
6421
6436
|
* @generated from field: yorkie.v1.UpdatableProjectFields.AllowedOrigins allowed_origins = 9;
|
|
6422
6437
|
*/
|
|
@@ -6459,6 +6474,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6459
6474
|
{ no: 8, name: "max_attachments_per_document", kind: "message", T: Int32Value },
|
|
6460
6475
|
{ no: 10, name: "max_size_per_document", kind: "message", T: Int32Value },
|
|
6461
6476
|
{ no: 11, name: "remove_on_detach", kind: "message", T: BoolValue },
|
|
6477
|
+
{ no: 22, name: "auto_revision_enabled", kind: "message", T: BoolValue },
|
|
6462
6478
|
{ no: 9, name: "allowed_origins", kind: "message", T: UpdatableProjectFields_AllowedOrigins }
|
|
6463
6479
|
]));
|
|
6464
6480
|
let UpdatableProjectFields = _UpdatableProjectFields;
|
|
@@ -6727,6 +6743,51 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
6727
6743
|
} }
|
|
6728
6744
|
]));
|
|
6729
6745
|
let Presence = _Presence;
|
|
6746
|
+
const _ChannelSummary = class _ChannelSummary extends Message {
|
|
6747
|
+
constructor(data) {
|
|
6748
|
+
super();
|
|
6749
|
+
/**
|
|
6750
|
+
* @generated from field: string key = 1;
|
|
6751
|
+
*/
|
|
6752
|
+
__publicField(this, "key", "");
|
|
6753
|
+
/**
|
|
6754
|
+
* @generated from field: int32 presence_count = 2;
|
|
6755
|
+
*/
|
|
6756
|
+
__publicField(this, "presenceCount", 0);
|
|
6757
|
+
proto3.util.initPartial(data, this);
|
|
6758
|
+
}
|
|
6759
|
+
static fromBinary(bytes, options) {
|
|
6760
|
+
return new _ChannelSummary().fromBinary(bytes, options);
|
|
6761
|
+
}
|
|
6762
|
+
static fromJson(jsonValue, options) {
|
|
6763
|
+
return new _ChannelSummary().fromJson(jsonValue, options);
|
|
6764
|
+
}
|
|
6765
|
+
static fromJsonString(jsonString, options) {
|
|
6766
|
+
return new _ChannelSummary().fromJsonString(jsonString, options);
|
|
6767
|
+
}
|
|
6768
|
+
static equals(a, b) {
|
|
6769
|
+
return proto3.util.equals(_ChannelSummary, a, b);
|
|
6770
|
+
}
|
|
6771
|
+
};
|
|
6772
|
+
__publicField(_ChannelSummary, "runtime", proto3);
|
|
6773
|
+
__publicField(_ChannelSummary, "typeName", "yorkie.v1.ChannelSummary");
|
|
6774
|
+
__publicField(_ChannelSummary, "fields", proto3.util.newFieldList(() => [
|
|
6775
|
+
{
|
|
6776
|
+
no: 1,
|
|
6777
|
+
name: "key",
|
|
6778
|
+
kind: "scalar",
|
|
6779
|
+
T: 9
|
|
6780
|
+
/* ScalarType.STRING */
|
|
6781
|
+
},
|
|
6782
|
+
{
|
|
6783
|
+
no: 2,
|
|
6784
|
+
name: "presence_count",
|
|
6785
|
+
kind: "scalar",
|
|
6786
|
+
T: 5
|
|
6787
|
+
/* ScalarType.INT32 */
|
|
6788
|
+
}
|
|
6789
|
+
]));
|
|
6790
|
+
let ChannelSummary = _ChannelSummary;
|
|
6730
6791
|
let Checkpoint$1 = (_g = class extends Message {
|
|
6731
6792
|
constructor(data) {
|
|
6732
6793
|
super();
|
|
@@ -7253,6 +7314,78 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7253
7314
|
}
|
|
7254
7315
|
]));
|
|
7255
7316
|
let Rule = _Rule;
|
|
7317
|
+
const _RevisionSummary = class _RevisionSummary extends Message {
|
|
7318
|
+
constructor(data) {
|
|
7319
|
+
super();
|
|
7320
|
+
/**
|
|
7321
|
+
* @generated from field: string id = 1;
|
|
7322
|
+
*/
|
|
7323
|
+
__publicField(this, "id", "");
|
|
7324
|
+
/**
|
|
7325
|
+
* @generated from field: string label = 2;
|
|
7326
|
+
*/
|
|
7327
|
+
__publicField(this, "label", "");
|
|
7328
|
+
/**
|
|
7329
|
+
* @generated from field: string description = 3;
|
|
7330
|
+
*/
|
|
7331
|
+
__publicField(this, "description", "");
|
|
7332
|
+
/**
|
|
7333
|
+
* @generated from field: string snapshot = 4;
|
|
7334
|
+
*/
|
|
7335
|
+
__publicField(this, "snapshot", "");
|
|
7336
|
+
/**
|
|
7337
|
+
* @generated from field: google.protobuf.Timestamp created_at = 5;
|
|
7338
|
+
*/
|
|
7339
|
+
__publicField(this, "createdAt");
|
|
7340
|
+
proto3.util.initPartial(data, this);
|
|
7341
|
+
}
|
|
7342
|
+
static fromBinary(bytes, options) {
|
|
7343
|
+
return new _RevisionSummary().fromBinary(bytes, options);
|
|
7344
|
+
}
|
|
7345
|
+
static fromJson(jsonValue, options) {
|
|
7346
|
+
return new _RevisionSummary().fromJson(jsonValue, options);
|
|
7347
|
+
}
|
|
7348
|
+
static fromJsonString(jsonString, options) {
|
|
7349
|
+
return new _RevisionSummary().fromJsonString(jsonString, options);
|
|
7350
|
+
}
|
|
7351
|
+
static equals(a, b) {
|
|
7352
|
+
return proto3.util.equals(_RevisionSummary, a, b);
|
|
7353
|
+
}
|
|
7354
|
+
};
|
|
7355
|
+
__publicField(_RevisionSummary, "runtime", proto3);
|
|
7356
|
+
__publicField(_RevisionSummary, "typeName", "yorkie.v1.RevisionSummary");
|
|
7357
|
+
__publicField(_RevisionSummary, "fields", proto3.util.newFieldList(() => [
|
|
7358
|
+
{
|
|
7359
|
+
no: 1,
|
|
7360
|
+
name: "id",
|
|
7361
|
+
kind: "scalar",
|
|
7362
|
+
T: 9
|
|
7363
|
+
/* ScalarType.STRING */
|
|
7364
|
+
},
|
|
7365
|
+
{
|
|
7366
|
+
no: 2,
|
|
7367
|
+
name: "label",
|
|
7368
|
+
kind: "scalar",
|
|
7369
|
+
T: 9
|
|
7370
|
+
/* ScalarType.STRING */
|
|
7371
|
+
},
|
|
7372
|
+
{
|
|
7373
|
+
no: 3,
|
|
7374
|
+
name: "description",
|
|
7375
|
+
kind: "scalar",
|
|
7376
|
+
T: 9
|
|
7377
|
+
/* ScalarType.STRING */
|
|
7378
|
+
},
|
|
7379
|
+
{
|
|
7380
|
+
no: 4,
|
|
7381
|
+
name: "snapshot",
|
|
7382
|
+
kind: "scalar",
|
|
7383
|
+
T: 9
|
|
7384
|
+
/* ScalarType.STRING */
|
|
7385
|
+
},
|
|
7386
|
+
{ no: 5, name: "created_at", kind: "message", T: Timestamp }
|
|
7387
|
+
]));
|
|
7388
|
+
let RevisionSummary = _RevisionSummary;
|
|
7256
7389
|
const _ActivateClientRequest = class _ActivateClientRequest extends Message {
|
|
7257
7390
|
constructor(data) {
|
|
7258
7391
|
super();
|
|
@@ -7860,6 +7993,274 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7860
7993
|
{ no: 1, name: "change_pack", kind: "message", T: ChangePack$1 }
|
|
7861
7994
|
]));
|
|
7862
7995
|
let PushPullChangesResponse = _PushPullChangesResponse;
|
|
7996
|
+
const _CreateRevisionRequest = class _CreateRevisionRequest extends Message {
|
|
7997
|
+
constructor(data) {
|
|
7998
|
+
super();
|
|
7999
|
+
/**
|
|
8000
|
+
* @generated from field: string client_id = 1;
|
|
8001
|
+
*/
|
|
8002
|
+
__publicField(this, "clientId", "");
|
|
8003
|
+
/**
|
|
8004
|
+
* @generated from field: string document_id = 2;
|
|
8005
|
+
*/
|
|
8006
|
+
__publicField(this, "documentId", "");
|
|
8007
|
+
/**
|
|
8008
|
+
* @generated from field: string label = 3;
|
|
8009
|
+
*/
|
|
8010
|
+
__publicField(this, "label", "");
|
|
8011
|
+
/**
|
|
8012
|
+
* @generated from field: string description = 4;
|
|
8013
|
+
*/
|
|
8014
|
+
__publicField(this, "description", "");
|
|
8015
|
+
proto3.util.initPartial(data, this);
|
|
8016
|
+
}
|
|
8017
|
+
static fromBinary(bytes, options) {
|
|
8018
|
+
return new _CreateRevisionRequest().fromBinary(bytes, options);
|
|
8019
|
+
}
|
|
8020
|
+
static fromJson(jsonValue, options) {
|
|
8021
|
+
return new _CreateRevisionRequest().fromJson(jsonValue, options);
|
|
8022
|
+
}
|
|
8023
|
+
static fromJsonString(jsonString, options) {
|
|
8024
|
+
return new _CreateRevisionRequest().fromJsonString(jsonString, options);
|
|
8025
|
+
}
|
|
8026
|
+
static equals(a, b) {
|
|
8027
|
+
return proto3.util.equals(_CreateRevisionRequest, a, b);
|
|
8028
|
+
}
|
|
8029
|
+
};
|
|
8030
|
+
__publicField(_CreateRevisionRequest, "runtime", proto3);
|
|
8031
|
+
__publicField(_CreateRevisionRequest, "typeName", "yorkie.v1.CreateRevisionRequest");
|
|
8032
|
+
__publicField(_CreateRevisionRequest, "fields", proto3.util.newFieldList(() => [
|
|
8033
|
+
{
|
|
8034
|
+
no: 1,
|
|
8035
|
+
name: "client_id",
|
|
8036
|
+
kind: "scalar",
|
|
8037
|
+
T: 9
|
|
8038
|
+
/* ScalarType.STRING */
|
|
8039
|
+
},
|
|
8040
|
+
{
|
|
8041
|
+
no: 2,
|
|
8042
|
+
name: "document_id",
|
|
8043
|
+
kind: "scalar",
|
|
8044
|
+
T: 9
|
|
8045
|
+
/* ScalarType.STRING */
|
|
8046
|
+
},
|
|
8047
|
+
{
|
|
8048
|
+
no: 3,
|
|
8049
|
+
name: "label",
|
|
8050
|
+
kind: "scalar",
|
|
8051
|
+
T: 9
|
|
8052
|
+
/* ScalarType.STRING */
|
|
8053
|
+
},
|
|
8054
|
+
{
|
|
8055
|
+
no: 4,
|
|
8056
|
+
name: "description",
|
|
8057
|
+
kind: "scalar",
|
|
8058
|
+
T: 9
|
|
8059
|
+
/* ScalarType.STRING */
|
|
8060
|
+
}
|
|
8061
|
+
]));
|
|
8062
|
+
let CreateRevisionRequest = _CreateRevisionRequest;
|
|
8063
|
+
const _CreateRevisionResponse = class _CreateRevisionResponse extends Message {
|
|
8064
|
+
constructor(data) {
|
|
8065
|
+
super();
|
|
8066
|
+
/**
|
|
8067
|
+
* @generated from field: yorkie.v1.RevisionSummary revision = 1;
|
|
8068
|
+
*/
|
|
8069
|
+
__publicField(this, "revision");
|
|
8070
|
+
proto3.util.initPartial(data, this);
|
|
8071
|
+
}
|
|
8072
|
+
static fromBinary(bytes, options) {
|
|
8073
|
+
return new _CreateRevisionResponse().fromBinary(bytes, options);
|
|
8074
|
+
}
|
|
8075
|
+
static fromJson(jsonValue, options) {
|
|
8076
|
+
return new _CreateRevisionResponse().fromJson(jsonValue, options);
|
|
8077
|
+
}
|
|
8078
|
+
static fromJsonString(jsonString, options) {
|
|
8079
|
+
return new _CreateRevisionResponse().fromJsonString(jsonString, options);
|
|
8080
|
+
}
|
|
8081
|
+
static equals(a, b) {
|
|
8082
|
+
return proto3.util.equals(_CreateRevisionResponse, a, b);
|
|
8083
|
+
}
|
|
8084
|
+
};
|
|
8085
|
+
__publicField(_CreateRevisionResponse, "runtime", proto3);
|
|
8086
|
+
__publicField(_CreateRevisionResponse, "typeName", "yorkie.v1.CreateRevisionResponse");
|
|
8087
|
+
__publicField(_CreateRevisionResponse, "fields", proto3.util.newFieldList(() => [
|
|
8088
|
+
{ no: 1, name: "revision", kind: "message", T: RevisionSummary }
|
|
8089
|
+
]));
|
|
8090
|
+
let CreateRevisionResponse = _CreateRevisionResponse;
|
|
8091
|
+
const _ListRevisionsRequest = class _ListRevisionsRequest extends Message {
|
|
8092
|
+
constructor(data) {
|
|
8093
|
+
super();
|
|
8094
|
+
/**
|
|
8095
|
+
* @generated from field: string project_id = 1;
|
|
8096
|
+
*/
|
|
8097
|
+
__publicField(this, "projectId", "");
|
|
8098
|
+
/**
|
|
8099
|
+
* @generated from field: string document_id = 2;
|
|
8100
|
+
*/
|
|
8101
|
+
__publicField(this, "documentId", "");
|
|
8102
|
+
/**
|
|
8103
|
+
* @generated from field: int32 page_size = 3;
|
|
8104
|
+
*/
|
|
8105
|
+
__publicField(this, "pageSize", 0);
|
|
8106
|
+
/**
|
|
8107
|
+
* @generated from field: int32 offset = 4;
|
|
8108
|
+
*/
|
|
8109
|
+
__publicField(this, "offset", 0);
|
|
8110
|
+
/**
|
|
8111
|
+
* @generated from field: bool is_forward = 5;
|
|
8112
|
+
*/
|
|
8113
|
+
__publicField(this, "isForward", false);
|
|
8114
|
+
proto3.util.initPartial(data, this);
|
|
8115
|
+
}
|
|
8116
|
+
static fromBinary(bytes, options) {
|
|
8117
|
+
return new _ListRevisionsRequest().fromBinary(bytes, options);
|
|
8118
|
+
}
|
|
8119
|
+
static fromJson(jsonValue, options) {
|
|
8120
|
+
return new _ListRevisionsRequest().fromJson(jsonValue, options);
|
|
8121
|
+
}
|
|
8122
|
+
static fromJsonString(jsonString, options) {
|
|
8123
|
+
return new _ListRevisionsRequest().fromJsonString(jsonString, options);
|
|
8124
|
+
}
|
|
8125
|
+
static equals(a, b) {
|
|
8126
|
+
return proto3.util.equals(_ListRevisionsRequest, a, b);
|
|
8127
|
+
}
|
|
8128
|
+
};
|
|
8129
|
+
__publicField(_ListRevisionsRequest, "runtime", proto3);
|
|
8130
|
+
__publicField(_ListRevisionsRequest, "typeName", "yorkie.v1.ListRevisionsRequest");
|
|
8131
|
+
__publicField(_ListRevisionsRequest, "fields", proto3.util.newFieldList(() => [
|
|
8132
|
+
{
|
|
8133
|
+
no: 1,
|
|
8134
|
+
name: "project_id",
|
|
8135
|
+
kind: "scalar",
|
|
8136
|
+
T: 9
|
|
8137
|
+
/* ScalarType.STRING */
|
|
8138
|
+
},
|
|
8139
|
+
{
|
|
8140
|
+
no: 2,
|
|
8141
|
+
name: "document_id",
|
|
8142
|
+
kind: "scalar",
|
|
8143
|
+
T: 9
|
|
8144
|
+
/* ScalarType.STRING */
|
|
8145
|
+
},
|
|
8146
|
+
{
|
|
8147
|
+
no: 3,
|
|
8148
|
+
name: "page_size",
|
|
8149
|
+
kind: "scalar",
|
|
8150
|
+
T: 5
|
|
8151
|
+
/* ScalarType.INT32 */
|
|
8152
|
+
},
|
|
8153
|
+
{
|
|
8154
|
+
no: 4,
|
|
8155
|
+
name: "offset",
|
|
8156
|
+
kind: "scalar",
|
|
8157
|
+
T: 5
|
|
8158
|
+
/* ScalarType.INT32 */
|
|
8159
|
+
},
|
|
8160
|
+
{
|
|
8161
|
+
no: 5,
|
|
8162
|
+
name: "is_forward",
|
|
8163
|
+
kind: "scalar",
|
|
8164
|
+
T: 8
|
|
8165
|
+
/* ScalarType.BOOL */
|
|
8166
|
+
}
|
|
8167
|
+
]));
|
|
8168
|
+
let ListRevisionsRequest = _ListRevisionsRequest;
|
|
8169
|
+
const _ListRevisionsResponse = class _ListRevisionsResponse extends Message {
|
|
8170
|
+
constructor(data) {
|
|
8171
|
+
super();
|
|
8172
|
+
/**
|
|
8173
|
+
* @generated from field: repeated yorkie.v1.RevisionSummary revisions = 1;
|
|
8174
|
+
*/
|
|
8175
|
+
__publicField(this, "revisions", []);
|
|
8176
|
+
proto3.util.initPartial(data, this);
|
|
8177
|
+
}
|
|
8178
|
+
static fromBinary(bytes, options) {
|
|
8179
|
+
return new _ListRevisionsResponse().fromBinary(bytes, options);
|
|
8180
|
+
}
|
|
8181
|
+
static fromJson(jsonValue, options) {
|
|
8182
|
+
return new _ListRevisionsResponse().fromJson(jsonValue, options);
|
|
8183
|
+
}
|
|
8184
|
+
static fromJsonString(jsonString, options) {
|
|
8185
|
+
return new _ListRevisionsResponse().fromJsonString(jsonString, options);
|
|
8186
|
+
}
|
|
8187
|
+
static equals(a, b) {
|
|
8188
|
+
return proto3.util.equals(_ListRevisionsResponse, a, b);
|
|
8189
|
+
}
|
|
8190
|
+
};
|
|
8191
|
+
__publicField(_ListRevisionsResponse, "runtime", proto3);
|
|
8192
|
+
__publicField(_ListRevisionsResponse, "typeName", "yorkie.v1.ListRevisionsResponse");
|
|
8193
|
+
__publicField(_ListRevisionsResponse, "fields", proto3.util.newFieldList(() => [
|
|
8194
|
+
{ no: 1, name: "revisions", kind: "message", T: RevisionSummary, repeated: true }
|
|
8195
|
+
]));
|
|
8196
|
+
let ListRevisionsResponse = _ListRevisionsResponse;
|
|
8197
|
+
const _RestoreRevisionRequest = class _RestoreRevisionRequest extends Message {
|
|
8198
|
+
constructor(data) {
|
|
8199
|
+
super();
|
|
8200
|
+
/**
|
|
8201
|
+
* @generated from field: string client_id = 1;
|
|
8202
|
+
*/
|
|
8203
|
+
__publicField(this, "clientId", "");
|
|
8204
|
+
/**
|
|
8205
|
+
* @generated from field: string revision_id = 2;
|
|
8206
|
+
*/
|
|
8207
|
+
__publicField(this, "revisionId", "");
|
|
8208
|
+
proto3.util.initPartial(data, this);
|
|
8209
|
+
}
|
|
8210
|
+
static fromBinary(bytes, options) {
|
|
8211
|
+
return new _RestoreRevisionRequest().fromBinary(bytes, options);
|
|
8212
|
+
}
|
|
8213
|
+
static fromJson(jsonValue, options) {
|
|
8214
|
+
return new _RestoreRevisionRequest().fromJson(jsonValue, options);
|
|
8215
|
+
}
|
|
8216
|
+
static fromJsonString(jsonString, options) {
|
|
8217
|
+
return new _RestoreRevisionRequest().fromJsonString(jsonString, options);
|
|
8218
|
+
}
|
|
8219
|
+
static equals(a, b) {
|
|
8220
|
+
return proto3.util.equals(_RestoreRevisionRequest, a, b);
|
|
8221
|
+
}
|
|
8222
|
+
};
|
|
8223
|
+
__publicField(_RestoreRevisionRequest, "runtime", proto3);
|
|
8224
|
+
__publicField(_RestoreRevisionRequest, "typeName", "yorkie.v1.RestoreRevisionRequest");
|
|
8225
|
+
__publicField(_RestoreRevisionRequest, "fields", proto3.util.newFieldList(() => [
|
|
8226
|
+
{
|
|
8227
|
+
no: 1,
|
|
8228
|
+
name: "client_id",
|
|
8229
|
+
kind: "scalar",
|
|
8230
|
+
T: 9
|
|
8231
|
+
/* ScalarType.STRING */
|
|
8232
|
+
},
|
|
8233
|
+
{
|
|
8234
|
+
no: 2,
|
|
8235
|
+
name: "revision_id",
|
|
8236
|
+
kind: "scalar",
|
|
8237
|
+
T: 9
|
|
8238
|
+
/* ScalarType.STRING */
|
|
8239
|
+
}
|
|
8240
|
+
]));
|
|
8241
|
+
let RestoreRevisionRequest = _RestoreRevisionRequest;
|
|
8242
|
+
const _RestoreRevisionResponse = class _RestoreRevisionResponse extends Message {
|
|
8243
|
+
constructor(data) {
|
|
8244
|
+
super();
|
|
8245
|
+
proto3.util.initPartial(data, this);
|
|
8246
|
+
}
|
|
8247
|
+
static fromBinary(bytes, options) {
|
|
8248
|
+
return new _RestoreRevisionResponse().fromBinary(bytes, options);
|
|
8249
|
+
}
|
|
8250
|
+
static fromJson(jsonValue, options) {
|
|
8251
|
+
return new _RestoreRevisionResponse().fromJson(jsonValue, options);
|
|
8252
|
+
}
|
|
8253
|
+
static fromJsonString(jsonString, options) {
|
|
8254
|
+
return new _RestoreRevisionResponse().fromJsonString(jsonString, options);
|
|
8255
|
+
}
|
|
8256
|
+
static equals(a, b) {
|
|
8257
|
+
return proto3.util.equals(_RestoreRevisionResponse, a, b);
|
|
8258
|
+
}
|
|
8259
|
+
};
|
|
8260
|
+
__publicField(_RestoreRevisionResponse, "runtime", proto3);
|
|
8261
|
+
__publicField(_RestoreRevisionResponse, "typeName", "yorkie.v1.RestoreRevisionResponse");
|
|
8262
|
+
__publicField(_RestoreRevisionResponse, "fields", proto3.util.newFieldList(() => []));
|
|
8263
|
+
let RestoreRevisionResponse = _RestoreRevisionResponse;
|
|
7863
8264
|
const _AttachChannelRequest = class _AttachChannelRequest extends Message {
|
|
7864
8265
|
constructor(data) {
|
|
7865
8266
|
super();
|
|
@@ -8404,6 +8805,33 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
8404
8805
|
O: WatchDocumentResponse,
|
|
8405
8806
|
kind: MethodKind.ServerStreaming
|
|
8406
8807
|
},
|
|
8808
|
+
/**
|
|
8809
|
+
* @generated from rpc yorkie.v1.YorkieService.CreateRevision
|
|
8810
|
+
*/
|
|
8811
|
+
createRevision: {
|
|
8812
|
+
name: "CreateRevision",
|
|
8813
|
+
I: CreateRevisionRequest,
|
|
8814
|
+
O: CreateRevisionResponse,
|
|
8815
|
+
kind: MethodKind.Unary
|
|
8816
|
+
},
|
|
8817
|
+
/**
|
|
8818
|
+
* @generated from rpc yorkie.v1.YorkieService.ListRevisions
|
|
8819
|
+
*/
|
|
8820
|
+
listRevisions: {
|
|
8821
|
+
name: "ListRevisions",
|
|
8822
|
+
I: ListRevisionsRequest,
|
|
8823
|
+
O: ListRevisionsResponse,
|
|
8824
|
+
kind: MethodKind.Unary
|
|
8825
|
+
},
|
|
8826
|
+
/**
|
|
8827
|
+
* @generated from rpc yorkie.v1.YorkieService.RestoreRevision
|
|
8828
|
+
*/
|
|
8829
|
+
restoreRevision: {
|
|
8830
|
+
name: "RestoreRevision",
|
|
8831
|
+
I: RestoreRevisionRequest,
|
|
8832
|
+
O: RestoreRevisionResponse,
|
|
8833
|
+
kind: MethodKind.Unary
|
|
8834
|
+
},
|
|
8407
8835
|
/**
|
|
8408
8836
|
* @generated from rpc yorkie.v1.YorkieService.AttachChannel
|
|
8409
8837
|
*/
|
|
@@ -17609,6 +18037,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
17609
18037
|
versionVector: toVersionVector(pack.getVersionVector())
|
|
17610
18038
|
});
|
|
17611
18039
|
}
|
|
18040
|
+
function toRevisionSummary(pbRevision) {
|
|
18041
|
+
var _a2;
|
|
18042
|
+
return {
|
|
18043
|
+
id: pbRevision.id,
|
|
18044
|
+
label: pbRevision.label,
|
|
18045
|
+
description: pbRevision.description,
|
|
18046
|
+
snapshot: pbRevision.snapshot,
|
|
18047
|
+
createdAt: ((_a2 = pbRevision.createdAt) == null ? void 0 : _a2.toDate()) || /* @__PURE__ */ new Date()
|
|
18048
|
+
};
|
|
18049
|
+
}
|
|
17612
18050
|
function errorMetadataOf(error) {
|
|
17613
18051
|
if (!(error instanceof ConnectError)) {
|
|
17614
18052
|
return {};
|
|
@@ -18238,7 +18676,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
18238
18676
|
bytesToOperation,
|
|
18239
18677
|
versionVectorToHex,
|
|
18240
18678
|
hexToVersionVector,
|
|
18241
|
-
fromSchemaRules
|
|
18679
|
+
fromSchemaRules,
|
|
18680
|
+
toRevisionSummary
|
|
18242
18681
|
};
|
|
18243
18682
|
var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
|
|
18244
18683
|
LogLevel2[LogLevel2["Trivial"] = 0] = "Trivial";
|
|
@@ -22276,7 +22715,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
22276
22715
|
};
|
|
22277
22716
|
}
|
|
22278
22717
|
const name = "@yorkie-js/sdk";
|
|
22279
|
-
const version = "0.6.
|
|
22718
|
+
const version = "0.6.40";
|
|
22280
22719
|
const pkg = {
|
|
22281
22720
|
name,
|
|
22282
22721
|
version
|
|
@@ -23134,6 +23573,131 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
23134
23573
|
getCondition(condition) {
|
|
23135
23574
|
return this.conditions[condition];
|
|
23136
23575
|
}
|
|
23576
|
+
/**
|
|
23577
|
+
* `createRevision` creates a new revision for the given document.
|
|
23578
|
+
*/
|
|
23579
|
+
async createRevision(doc, label, description) {
|
|
23580
|
+
if (!this.isActive()) {
|
|
23581
|
+
throw new YorkieError(
|
|
23582
|
+
Code.ErrClientNotActivated,
|
|
23583
|
+
`${this.key} is not active`
|
|
23584
|
+
);
|
|
23585
|
+
}
|
|
23586
|
+
const attachment = this.attachmentMap.get(doc.getKey());
|
|
23587
|
+
if (!attachment) {
|
|
23588
|
+
throw new YorkieError(
|
|
23589
|
+
Code.ErrNotAttached,
|
|
23590
|
+
`${doc.getKey()} is not attached`
|
|
23591
|
+
);
|
|
23592
|
+
}
|
|
23593
|
+
const task = async () => {
|
|
23594
|
+
try {
|
|
23595
|
+
const res = await this.rpcClient.createRevision(
|
|
23596
|
+
{
|
|
23597
|
+
clientId: this.id,
|
|
23598
|
+
documentId: attachment.resourceID,
|
|
23599
|
+
label,
|
|
23600
|
+
description: description || ""
|
|
23601
|
+
},
|
|
23602
|
+
{ headers: { "x-shard-key": `${this.apiKey}/${doc.getKey()}` } }
|
|
23603
|
+
);
|
|
23604
|
+
if (!res.revision) {
|
|
23605
|
+
throw new YorkieError(
|
|
23606
|
+
Code.ErrInvalidArgument,
|
|
23607
|
+
"revision is not returned"
|
|
23608
|
+
);
|
|
23609
|
+
}
|
|
23610
|
+
logger.info(
|
|
23611
|
+
`[CR] c:"${this.getKey()}" creates revision d:"${doc.getKey()}" l:"${label}"`
|
|
23612
|
+
);
|
|
23613
|
+
return converter.toRevisionSummary(res.revision);
|
|
23614
|
+
} catch (err) {
|
|
23615
|
+
logger.error(`[CR] c:"${this.getKey()}" err :`, err);
|
|
23616
|
+
await this.handleConnectError(err);
|
|
23617
|
+
throw err;
|
|
23618
|
+
}
|
|
23619
|
+
};
|
|
23620
|
+
return this.enqueueTask(task);
|
|
23621
|
+
}
|
|
23622
|
+
/**
|
|
23623
|
+
* `listRevisions` lists all revisions for the given document.
|
|
23624
|
+
*/
|
|
23625
|
+
async listRevisions(doc, options) {
|
|
23626
|
+
if (!this.isActive()) {
|
|
23627
|
+
throw new YorkieError(
|
|
23628
|
+
Code.ErrClientNotActivated,
|
|
23629
|
+
`${this.key} is not active`
|
|
23630
|
+
);
|
|
23631
|
+
}
|
|
23632
|
+
const attachment = this.attachmentMap.get(doc.getKey());
|
|
23633
|
+
if (!attachment) {
|
|
23634
|
+
throw new YorkieError(
|
|
23635
|
+
Code.ErrNotAttached,
|
|
23636
|
+
`${doc.getKey()} is not attached`
|
|
23637
|
+
);
|
|
23638
|
+
}
|
|
23639
|
+
const task = async () => {
|
|
23640
|
+
try {
|
|
23641
|
+
const res = await this.rpcClient.listRevisions(
|
|
23642
|
+
{
|
|
23643
|
+
projectId: "",
|
|
23644
|
+
// Will be filled by server from auth context
|
|
23645
|
+
documentId: attachment.resourceID,
|
|
23646
|
+
pageSize: (options == null ? void 0 : options.pageSize) || 10,
|
|
23647
|
+
offset: (options == null ? void 0 : options.offset) || 0,
|
|
23648
|
+
isForward: (options == null ? void 0 : options.isForward) ?? false
|
|
23649
|
+
},
|
|
23650
|
+
{ headers: { "x-shard-key": `${this.apiKey}/${doc.getKey()}` } }
|
|
23651
|
+
);
|
|
23652
|
+
logger.info(
|
|
23653
|
+
`[LR] c:"${this.getKey()}" lists revisions d:"${doc.getKey()}" count:${res.revisions.length}`
|
|
23654
|
+
);
|
|
23655
|
+
return res.revisions.map(converter.toRevisionSummary);
|
|
23656
|
+
} catch (err) {
|
|
23657
|
+
logger.error(`[LR] c:"${this.getKey()}" err :`, err);
|
|
23658
|
+
await this.handleConnectError(err);
|
|
23659
|
+
throw err;
|
|
23660
|
+
}
|
|
23661
|
+
};
|
|
23662
|
+
return this.enqueueTask(task);
|
|
23663
|
+
}
|
|
23664
|
+
/**
|
|
23665
|
+
* `restoreRevision` restores the document to the given revision.
|
|
23666
|
+
*/
|
|
23667
|
+
async restoreRevision(doc, revisionId) {
|
|
23668
|
+
if (!this.isActive()) {
|
|
23669
|
+
throw new YorkieError(
|
|
23670
|
+
Code.ErrClientNotActivated,
|
|
23671
|
+
`${this.key} is not active`
|
|
23672
|
+
);
|
|
23673
|
+
}
|
|
23674
|
+
const attachment = this.attachmentMap.get(doc.getKey());
|
|
23675
|
+
if (!attachment) {
|
|
23676
|
+
throw new YorkieError(
|
|
23677
|
+
Code.ErrNotAttached,
|
|
23678
|
+
`${doc.getKey()} is not attached`
|
|
23679
|
+
);
|
|
23680
|
+
}
|
|
23681
|
+
const task = async () => {
|
|
23682
|
+
try {
|
|
23683
|
+
await this.rpcClient.restoreRevision(
|
|
23684
|
+
{
|
|
23685
|
+
clientId: this.id,
|
|
23686
|
+
revisionId
|
|
23687
|
+
},
|
|
23688
|
+
{ headers: { "x-shard-key": `${this.apiKey}/${doc.getKey()}` } }
|
|
23689
|
+
);
|
|
23690
|
+
logger.info(
|
|
23691
|
+
`[RR] c:"${this.getKey()}" restores revision d:"${doc.getKey()}" r:"${revisionId}"`
|
|
23692
|
+
);
|
|
23693
|
+
} catch (err) {
|
|
23694
|
+
logger.error(`[RR] c:"${this.getKey()}" err :`, err);
|
|
23695
|
+
await this.handleConnectError(err);
|
|
23696
|
+
throw err;
|
|
23697
|
+
}
|
|
23698
|
+
};
|
|
23699
|
+
return this.enqueueTask(task);
|
|
23700
|
+
}
|
|
23137
23701
|
/**
|
|
23138
23702
|
* `broadcast` broadcasts the given payload to the given topic.
|
|
23139
23703
|
*/
|