@lix-js/sdk 0.16.0 → 0.16.1
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/README.md +54 -7
- package/dist/binding-types.d.ts +5 -1
- package/dist/bundled-plugins/plugin_csv.lixplugin +0 -0
- package/dist/bundled-plugins/plugin_markdown.lixplugin +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/lix.d.ts +7 -2
- package/dist/lix.js +28 -18
- package/dist/storage-adapter.d.ts +0 -4
- package/dist/types.d.ts +76 -0
- package/dist/wasm/lix_js_sdk.d.ts +16 -4
- package/dist/wasm/lix_js_sdk.js +86 -32
- package/dist/wasm/lix_js_sdk_bg.wasm +0 -0
- package/dist/wasm/lix_js_sdk_bg.wasm.d.ts +10 -4
- package/dist/worker/client.js +3 -0
- package/dist/worker/host.js +6 -0
- package/dist/worker/protocol.d.ts +8 -0
- package/package.json +5 -9
- package/dist/remote/server-protocol.d.ts +0 -185
- package/dist/remote/server-protocol.js +0 -417
package/dist/wasm/lix_js_sdk.js
CHANGED
|
@@ -82,6 +82,16 @@ export class WasmLix {
|
|
|
82
82
|
const ret = wasm.wasmlix_executeBatch(this.__wbg_ptr, addHeapObject(statements), isLikeNone(options) ? 0 : addHeapObject(options));
|
|
83
83
|
return takeObject(ret);
|
|
84
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* @param {string} id
|
|
87
|
+
* @returns {Promise<any>}
|
|
88
|
+
*/
|
|
89
|
+
exportReplicaRecovery(id) {
|
|
90
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
91
|
+
const len0 = WASM_VECTOR_LEN;
|
|
92
|
+
const ret = wasm.wasmlix_exportReplicaRecovery(this.__wbg_ptr, ptr0, len0);
|
|
93
|
+
return takeObject(ret);
|
|
94
|
+
}
|
|
85
95
|
/**
|
|
86
96
|
* @returns {WasmSnapshotExport}
|
|
87
97
|
*/
|
|
@@ -150,6 +160,16 @@ export class WasmLix {
|
|
|
150
160
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
151
161
|
}
|
|
152
162
|
}
|
|
163
|
+
/**
|
|
164
|
+
* @param {string} id
|
|
165
|
+
* @returns {Promise<any>}
|
|
166
|
+
*/
|
|
167
|
+
recoverReplica(id) {
|
|
168
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
169
|
+
const len0 = WASM_VECTOR_LEN;
|
|
170
|
+
const ret = wasm.wasmlix_recoverReplica(this.__wbg_ptr, ptr0, len0);
|
|
171
|
+
return takeObject(ret);
|
|
172
|
+
}
|
|
153
173
|
/**
|
|
154
174
|
* @returns {Promise<any>}
|
|
155
175
|
*/
|
|
@@ -157,6 +177,13 @@ export class WasmLix {
|
|
|
157
177
|
const ret = wasm.wasmlix_redo(this.__wbg_ptr);
|
|
158
178
|
return takeObject(ret);
|
|
159
179
|
}
|
|
180
|
+
/**
|
|
181
|
+
* @returns {Promise<any>}
|
|
182
|
+
*/
|
|
183
|
+
replicaRecoverySources() {
|
|
184
|
+
const ret = wasm.wasmlix_replicaRecoverySources(this.__wbg_ptr);
|
|
185
|
+
return takeObject(ret);
|
|
186
|
+
}
|
|
160
187
|
/**
|
|
161
188
|
* @param {any | null} [parent]
|
|
162
189
|
*/
|
|
@@ -364,6 +391,16 @@ export class WasmRemoteLix {
|
|
|
364
391
|
const ret = wasm.wasmremotelix_executeBatch(this.__wbg_ptr, addHeapObject(statements), isLikeNone(options) ? 0 : addHeapObject(options));
|
|
365
392
|
return takeObject(ret);
|
|
366
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* @param {string} _id
|
|
396
|
+
* @returns {Promise<any>}
|
|
397
|
+
*/
|
|
398
|
+
exportReplicaRecovery(_id) {
|
|
399
|
+
const ptr0 = passStringToWasm0(_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
400
|
+
const len0 = WASM_VECTOR_LEN;
|
|
401
|
+
const ret = wasm.wasmremotelix_exportReplicaRecovery(this.__wbg_ptr, ptr0, len0);
|
|
402
|
+
return takeObject(ret);
|
|
403
|
+
}
|
|
367
404
|
/**
|
|
368
405
|
* @returns {WasmSnapshotExport}
|
|
369
406
|
*/
|
|
@@ -414,6 +451,16 @@ export class WasmRemoteLix {
|
|
|
414
451
|
const ret = wasm.wasmremotelix_openAnotherSession(this.__wbg_ptr, addHeapObject(options));
|
|
415
452
|
return takeObject(ret);
|
|
416
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* @param {string} _id
|
|
456
|
+
* @returns {Promise<any>}
|
|
457
|
+
*/
|
|
458
|
+
recoverReplica(_id) {
|
|
459
|
+
const ptr0 = passStringToWasm0(_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
460
|
+
const len0 = WASM_VECTOR_LEN;
|
|
461
|
+
const ret = wasm.wasmremotelix_recoverReplica(this.__wbg_ptr, ptr0, len0);
|
|
462
|
+
return takeObject(ret);
|
|
463
|
+
}
|
|
417
464
|
/**
|
|
418
465
|
* @returns {Promise<any>}
|
|
419
466
|
*/
|
|
@@ -421,6 +468,13 @@ export class WasmRemoteLix {
|
|
|
421
468
|
const ret = wasm.wasmremotelix_redo(this.__wbg_ptr);
|
|
422
469
|
return takeObject(ret);
|
|
423
470
|
}
|
|
471
|
+
/**
|
|
472
|
+
* @returns {Promise<any>}
|
|
473
|
+
*/
|
|
474
|
+
replicaRecoverySources() {
|
|
475
|
+
const ret = wasm.wasmremotelix_replicaRecoverySources(this.__wbg_ptr);
|
|
476
|
+
return takeObject(ret);
|
|
477
|
+
}
|
|
424
478
|
/**
|
|
425
479
|
* @param {any | null} [_parent]
|
|
426
480
|
*/
|
|
@@ -793,19 +847,19 @@ function __wbg_get_imports() {
|
|
|
793
847
|
__wbg__wbg_cb_unref_61db23ac97f16c31: function(arg0) {
|
|
794
848
|
getObject(arg0)._wbg_cb_unref();
|
|
795
849
|
},
|
|
796
|
-
|
|
850
|
+
__wbg_acquireSession_23e79c33392e697b: function(arg0) {
|
|
797
851
|
const ret = getObject(arg0).acquireSession();
|
|
798
852
|
return addHeapObject(ret);
|
|
799
853
|
},
|
|
800
|
-
|
|
854
|
+
__wbg_beginRead_a07540d6b7276aa8: function(arg0, arg1) {
|
|
801
855
|
const ret = getObject(arg0).beginRead(takeObject(arg1));
|
|
802
856
|
return addHeapObject(ret);
|
|
803
857
|
},
|
|
804
|
-
|
|
858
|
+
__wbg_beginScan_fe1d6b306d24f1d8: function(arg0, arg1, arg2, arg3) {
|
|
805
859
|
const ret = getObject(arg0).beginScan(takeObject(arg1), takeObject(arg2), takeObject(arg3));
|
|
806
860
|
return addHeapObject(ret);
|
|
807
861
|
},
|
|
808
|
-
|
|
862
|
+
__wbg_beginWrite_accabb884da53d0d: function(arg0, arg1) {
|
|
809
863
|
const ret = getObject(arg0).beginWrite(takeObject(arg1));
|
|
810
864
|
return addHeapObject(ret);
|
|
811
865
|
},
|
|
@@ -821,18 +875,18 @@ function __wbg_get_imports() {
|
|
|
821
875
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
822
876
|
return addHeapObject(ret);
|
|
823
877
|
}, arguments); },
|
|
824
|
-
|
|
878
|
+
__wbg_changed_611eb1bd688d481b: function(arg0) {
|
|
825
879
|
const ret = getObject(arg0).changed();
|
|
826
880
|
return addHeapObject(ret);
|
|
827
881
|
},
|
|
828
|
-
|
|
882
|
+
__wbg_close_312ad1c70f8567ec: function(arg0) {
|
|
829
883
|
getObject(arg0).close();
|
|
830
884
|
},
|
|
831
|
-
|
|
885
|
+
__wbg_close_60c048095d05207d: function(arg0) {
|
|
832
886
|
const ret = getObject(arg0).close();
|
|
833
887
|
return addHeapObject(ret);
|
|
834
888
|
},
|
|
835
|
-
|
|
889
|
+
__wbg_commit_786079320b8e0b9b: function(arg0) {
|
|
836
890
|
const ret = getObject(arg0).commit();
|
|
837
891
|
return addHeapObject(ret);
|
|
838
892
|
},
|
|
@@ -840,11 +894,11 @@ function __wbg_get_imports() {
|
|
|
840
894
|
const ret = Reflect.construct(getObject(arg0), getObject(arg1));
|
|
841
895
|
return addHeapObject(ret);
|
|
842
896
|
}, arguments); },
|
|
843
|
-
|
|
897
|
+
__wbg_deleteMany_556f48be1c237ec7: function(arg0, arg1, arg2) {
|
|
844
898
|
const ret = getObject(arg0).deleteMany(takeObject(arg1), takeObject(arg2));
|
|
845
899
|
return addHeapObject(ret);
|
|
846
900
|
},
|
|
847
|
-
|
|
901
|
+
__wbg_deleteRange_7fdc05ce4261d0da: function(arg0, arg1, arg2) {
|
|
848
902
|
const ret = getObject(arg0).deleteRange(takeObject(arg1), takeObject(arg2));
|
|
849
903
|
return addHeapObject(ret);
|
|
850
904
|
},
|
|
@@ -871,7 +925,7 @@ function __wbg_get_imports() {
|
|
|
871
925
|
const ret = Array.from(getObject(arg0));
|
|
872
926
|
return addHeapObject(ret);
|
|
873
927
|
},
|
|
874
|
-
|
|
928
|
+
__wbg_getMany_235250e3424e09ca: function(arg0, arg1) {
|
|
875
929
|
const ret = getObject(arg0).getMany(takeObject(arg1));
|
|
876
930
|
return addHeapObject(ret);
|
|
877
931
|
},
|
|
@@ -996,7 +1050,7 @@ function __wbg_get_imports() {
|
|
|
996
1050
|
const a = state0.a;
|
|
997
1051
|
state0.a = 0;
|
|
998
1052
|
try {
|
|
999
|
-
return
|
|
1053
|
+
return __wasm_bindgen_func_elem_95814(a, state0.b, arg0, arg1);
|
|
1000
1054
|
} finally {
|
|
1001
1055
|
state0.a = a;
|
|
1002
1056
|
}
|
|
@@ -1026,7 +1080,7 @@ function __wbg_get_imports() {
|
|
|
1026
1080
|
const a = state0.a;
|
|
1027
1081
|
state0.a = 0;
|
|
1028
1082
|
try {
|
|
1029
|
-
return
|
|
1083
|
+
return __wasm_bindgen_func_elem_95814(a, state0.b, arg0, arg1);
|
|
1030
1084
|
} finally {
|
|
1031
1085
|
state0.a = a;
|
|
1032
1086
|
}
|
|
@@ -1037,7 +1091,7 @@ function __wbg_get_imports() {
|
|
|
1037
1091
|
state0.a = 0;
|
|
1038
1092
|
}
|
|
1039
1093
|
},
|
|
1040
|
-
|
|
1094
|
+
__wbg_nextPage_13fba4fc5bb93a4e: function(arg0, arg1) {
|
|
1041
1095
|
const ret = getObject(arg0).nextPage(arg1 >>> 0);
|
|
1042
1096
|
return addHeapObject(ret);
|
|
1043
1097
|
},
|
|
@@ -1076,7 +1130,7 @@ function __wbg_get_imports() {
|
|
|
1076
1130
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
1077
1131
|
return ret;
|
|
1078
1132
|
},
|
|
1079
|
-
|
|
1133
|
+
__wbg_putMany_899cb0bea0c14903: function(arg0, arg1, arg2) {
|
|
1080
1134
|
const ret = getObject(arg0).putMany(takeObject(arg1), takeObject(arg2));
|
|
1081
1135
|
return addHeapObject(ret);
|
|
1082
1136
|
},
|
|
@@ -1087,7 +1141,7 @@ function __wbg_get_imports() {
|
|
|
1087
1141
|
const ret = getObject(arg0).queueMicrotask;
|
|
1088
1142
|
return addHeapObject(ret);
|
|
1089
1143
|
},
|
|
1090
|
-
|
|
1144
|
+
__wbg_replaceMany_cc9b2f5513501e0c: function(arg0, arg1, arg2) {
|
|
1091
1145
|
const ret = getObject(arg0).replaceMany(takeObject(arg1), takeObject(arg2));
|
|
1092
1146
|
return addHeapObject(ret);
|
|
1093
1147
|
},
|
|
@@ -1095,7 +1149,7 @@ function __wbg_get_imports() {
|
|
|
1095
1149
|
const ret = Promise.resolve(getObject(arg0));
|
|
1096
1150
|
return addHeapObject(ret);
|
|
1097
1151
|
},
|
|
1098
|
-
|
|
1152
|
+
__wbg_rollback_32c62a16e328ea97: function(arg0) {
|
|
1099
1153
|
const ret = getObject(arg0).rollback();
|
|
1100
1154
|
return addHeapObject(ret);
|
|
1101
1155
|
},
|
|
@@ -1179,23 +1233,23 @@ function __wbg_get_imports() {
|
|
|
1179
1233
|
const ret = WasmRemoteObserveEvents.__wrap(arg0);
|
|
1180
1234
|
return addHeapObject(ret);
|
|
1181
1235
|
},
|
|
1182
|
-
|
|
1236
|
+
__wbg_watchForChanges_1a153bdf7830e63a: function(arg0) {
|
|
1183
1237
|
const ret = getObject(arg0).watchForChanges();
|
|
1184
1238
|
return addHeapObject(ret);
|
|
1185
1239
|
},
|
|
1186
1240
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1187
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1188
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1241
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1312, ret: NamedExternref("Promise<any>"), inner_ret: Some(NamedExternref("Promise<any>")) }, mutable: true }) -> Externref`.
|
|
1242
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_17860);
|
|
1189
1243
|
return addHeapObject(ret);
|
|
1190
1244
|
},
|
|
1191
1245
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
1192
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1193
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1246
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 21212, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1247
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_95812);
|
|
1194
1248
|
return addHeapObject(ret);
|
|
1195
1249
|
},
|
|
1196
1250
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
1197
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
1198
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1251
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1311, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
1252
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_17859);
|
|
1199
1253
|
return addHeapObject(ret);
|
|
1200
1254
|
},
|
|
1201
1255
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -1244,19 +1298,19 @@ function __wbg_get_imports() {
|
|
|
1244
1298
|
};
|
|
1245
1299
|
}
|
|
1246
1300
|
|
|
1247
|
-
function
|
|
1248
|
-
wasm.
|
|
1301
|
+
function __wasm_bindgen_func_elem_17859(arg0, arg1) {
|
|
1302
|
+
wasm.__wasm_bindgen_func_elem_17859(arg0, arg1);
|
|
1249
1303
|
}
|
|
1250
1304
|
|
|
1251
|
-
function
|
|
1252
|
-
const ret = wasm.
|
|
1305
|
+
function __wasm_bindgen_func_elem_17860(arg0, arg1, arg2) {
|
|
1306
|
+
const ret = wasm.__wasm_bindgen_func_elem_17860(arg0, arg1, addHeapObject(arg2));
|
|
1253
1307
|
return takeObject(ret);
|
|
1254
1308
|
}
|
|
1255
1309
|
|
|
1256
|
-
function
|
|
1310
|
+
function __wasm_bindgen_func_elem_95812(arg0, arg1, arg2) {
|
|
1257
1311
|
try {
|
|
1258
1312
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1259
|
-
wasm.
|
|
1313
|
+
wasm.__wasm_bindgen_func_elem_95812(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1260
1314
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1261
1315
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1262
1316
|
if (r1) {
|
|
@@ -1267,8 +1321,8 @@ function __wasm_bindgen_func_elem_95597(arg0, arg1, arg2) {
|
|
|
1267
1321
|
}
|
|
1268
1322
|
}
|
|
1269
1323
|
|
|
1270
|
-
function
|
|
1271
|
-
wasm.
|
|
1324
|
+
function __wasm_bindgen_func_elem_95814(arg0, arg1, arg2, arg3) {
|
|
1325
|
+
wasm.__wasm_bindgen_func_elem_95814(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1272
1326
|
}
|
|
1273
1327
|
|
|
1274
1328
|
const WasmLixFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
Binary file
|
|
@@ -24,6 +24,7 @@ export const wasmlix_createBranch: (a: number, b: number) => number;
|
|
|
24
24
|
export const wasmlix_createHosted: (a: number, b: number) => number;
|
|
25
25
|
export const wasmlix_execute: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
26
26
|
export const wasmlix_executeBatch: (a: number, b: number, c: number) => number;
|
|
27
|
+
export const wasmlix_exportReplicaRecovery: (a: number, b: number, c: number) => number;
|
|
27
28
|
export const wasmlix_exportSnapshot: (a: number) => number;
|
|
28
29
|
export const wasmlix_importFilesystemPaths: (a: number, b: number) => number;
|
|
29
30
|
export const wasmlix_mergeBranch: (a: number, b: number) => number;
|
|
@@ -31,7 +32,9 @@ export const wasmlix_mergeBranchPreview: (a: number, b: number) => number;
|
|
|
31
32
|
export const wasmlix_observe: (a: number, b: number, c: number, d: number) => number;
|
|
32
33
|
export const wasmlix_openAnotherSession: (a: number, b: number) => number;
|
|
33
34
|
export const wasmlix_openReport: (a: number, b: number) => void;
|
|
35
|
+
export const wasmlix_recoverReplica: (a: number, b: number, c: number) => number;
|
|
34
36
|
export const wasmlix_redo: (a: number) => number;
|
|
37
|
+
export const wasmlix_replicaRecoverySources: (a: number) => number;
|
|
35
38
|
export const wasmlix_setTelemetryParent: (a: number, b: number, c: number) => void;
|
|
36
39
|
export const wasmlix_switchBranch: (a: number, b: number) => number;
|
|
37
40
|
export const wasmlix_syncDiskToLix: (a: number) => number;
|
|
@@ -49,13 +52,16 @@ export const wasmremotelix_close: (a: number) => number;
|
|
|
49
52
|
export const wasmremotelix_createBranch: (a: number, b: number) => number;
|
|
50
53
|
export const wasmremotelix_execute: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
51
54
|
export const wasmremotelix_executeBatch: (a: number, b: number, c: number) => number;
|
|
55
|
+
export const wasmremotelix_exportReplicaRecovery: (a: number, b: number, c: number) => number;
|
|
52
56
|
export const wasmremotelix_exportSnapshot: (a: number) => number;
|
|
53
57
|
export const wasmremotelix_importFilesystemPaths: (a: number, b: number) => number;
|
|
54
58
|
export const wasmremotelix_mergeBranch: (a: number, b: number) => number;
|
|
55
59
|
export const wasmremotelix_mergeBranchPreview: (a: number, b: number) => number;
|
|
56
60
|
export const wasmremotelix_observe: (a: number, b: number, c: number, d: number) => number;
|
|
57
61
|
export const wasmremotelix_openAnotherSession: (a: number, b: number) => number;
|
|
62
|
+
export const wasmremotelix_recoverReplica: (a: number, b: number, c: number) => number;
|
|
58
63
|
export const wasmremotelix_redo: (a: number) => number;
|
|
64
|
+
export const wasmremotelix_replicaRecoverySources: (a: number) => number;
|
|
59
65
|
export const wasmremotelix_setTelemetryParent: (a: number, b: number) => void;
|
|
60
66
|
export const wasmremotelix_switchBranch: (a: number, b: number) => number;
|
|
61
67
|
export const wasmremotelix_syncDiskToLix: (a: number) => number;
|
|
@@ -72,10 +78,10 @@ export const wasmsnapshotrestore_cancel: (a: number) => number;
|
|
|
72
78
|
export const wasmsnapshotrestore_finish: (a: number) => number;
|
|
73
79
|
export const wasmsnapshotrestore_isComplete: (a: number) => number;
|
|
74
80
|
export const wasmsnapshotrestore_write: (a: number, b: number, c: number) => number;
|
|
75
|
-
export const
|
|
76
|
-
export const
|
|
77
|
-
export const
|
|
78
|
-
export const
|
|
81
|
+
export const __wasm_bindgen_func_elem_95812: (a: number, b: number, c: number, d: number) => void;
|
|
82
|
+
export const __wasm_bindgen_func_elem_95814: (a: number, b: number, c: number, d: number) => void;
|
|
83
|
+
export const __wasm_bindgen_func_elem_17860: (a: number, b: number, c: number) => number;
|
|
84
|
+
export const __wasm_bindgen_func_elem_17859: (a: number, b: number) => void;
|
|
79
85
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
80
86
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
81
87
|
export const __wbindgen_export3: (a: number) => void;
|
package/dist/worker/client.js
CHANGED
|
@@ -274,6 +274,9 @@ export function workerBinding(client, lease, sessionId) {
|
|
|
274
274
|
});
|
|
275
275
|
return workerTransactionBinding(request, transactionId);
|
|
276
276
|
},
|
|
277
|
+
replicaRecoverySources: () => request({ kind: "replicaRecoverySources" }),
|
|
278
|
+
exportReplicaRecovery: (id) => request({ kind: "exportReplicaRecovery", id }),
|
|
279
|
+
recoverReplica: (id) => request({ kind: "recoverReplica", id }),
|
|
277
280
|
activeBranchId: () => request({ kind: "activeBranchId" }),
|
|
278
281
|
activeAccountId: () => request({ kind: "activeAccountId" }),
|
|
279
282
|
createBranch: (options) => request({ kind: "createBranch", options }),
|
package/dist/worker/host.js
CHANGED
|
@@ -230,6 +230,12 @@ export function startWorkerHost(endpoint, openBinding = openLixBinding) {
|
|
|
230
230
|
await transaction.rollback();
|
|
231
231
|
return undefined;
|
|
232
232
|
}
|
|
233
|
+
case "replicaRecoverySources":
|
|
234
|
+
return requiredLix(sessionId).replicaRecoverySources();
|
|
235
|
+
case "exportReplicaRecovery":
|
|
236
|
+
return requiredLix(sessionId).exportReplicaRecovery(operation.id);
|
|
237
|
+
case "recoverReplica":
|
|
238
|
+
return requiredLix(sessionId).recoverReplica(operation.id);
|
|
233
239
|
case "activeBranchId":
|
|
234
240
|
return requiredLix(sessionId).activeBranchId();
|
|
235
241
|
case "activeAccountId":
|
|
@@ -84,6 +84,14 @@ export type WorkerOperation = {
|
|
|
84
84
|
} | {
|
|
85
85
|
kind: "transaction.rollback";
|
|
86
86
|
transactionId: number;
|
|
87
|
+
} | {
|
|
88
|
+
kind: "replicaRecoverySources";
|
|
89
|
+
} | {
|
|
90
|
+
kind: "exportReplicaRecovery";
|
|
91
|
+
id: string;
|
|
92
|
+
} | {
|
|
93
|
+
kind: "recoverReplica";
|
|
94
|
+
id: string;
|
|
87
95
|
} | {
|
|
88
96
|
kind: "activeBranchId";
|
|
89
97
|
} | {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lix-js/sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -11,10 +11,6 @@
|
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./dist/index.d.ts",
|
|
13
13
|
"default": "./dist/index.js"
|
|
14
|
-
},
|
|
15
|
-
"./server-protocol": {
|
|
16
|
-
"types": "./dist/remote/server-protocol.d.ts",
|
|
17
|
-
"default": "./dist/remote/server-protocol.js"
|
|
18
14
|
}
|
|
19
15
|
},
|
|
20
16
|
"imports": {
|
|
@@ -49,10 +45,10 @@
|
|
|
49
45
|
"typecheck": "tsc -p tsconfig.test.json --noEmit"
|
|
50
46
|
},
|
|
51
47
|
"optionalDependencies": {
|
|
52
|
-
"@lix-js/sdk-darwin-arm64": "0.16.
|
|
53
|
-
"@lix-js/sdk-linux-arm64": "0.16.
|
|
54
|
-
"@lix-js/sdk-linux-x64": "0.16.
|
|
55
|
-
"@lix-js/sdk-win32-x64": "0.16.
|
|
48
|
+
"@lix-js/sdk-darwin-arm64": "0.16.1",
|
|
49
|
+
"@lix-js/sdk-linux-arm64": "0.16.1",
|
|
50
|
+
"@lix-js/sdk-linux-x64": "0.16.1",
|
|
51
|
+
"@lix-js/sdk-win32-x64": "0.16.1"
|
|
56
52
|
},
|
|
57
53
|
"devDependencies": {
|
|
58
54
|
"@vitest/browser-playwright": "4.1.10",
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import type { BindingExecuteResult, BindingObserveEvent } from "../binding-types.js";
|
|
2
|
-
import type { NativeLixValue } from "../value.js";
|
|
3
|
-
export declare const SERVER_PROTOCOL_VERSION = 7;
|
|
4
|
-
export type WireValue = {
|
|
5
|
-
kind: "null";
|
|
6
|
-
value: null;
|
|
7
|
-
} | {
|
|
8
|
-
kind: "bool";
|
|
9
|
-
value: boolean;
|
|
10
|
-
} | {
|
|
11
|
-
kind: "int";
|
|
12
|
-
value: number;
|
|
13
|
-
} | {
|
|
14
|
-
kind: "float";
|
|
15
|
-
value: number;
|
|
16
|
-
} | {
|
|
17
|
-
kind: "text";
|
|
18
|
-
value: string;
|
|
19
|
-
} | {
|
|
20
|
-
kind: "jsonb";
|
|
21
|
-
value: unknown;
|
|
22
|
-
} | {
|
|
23
|
-
kind: "row_ref";
|
|
24
|
-
value: string;
|
|
25
|
-
} | {
|
|
26
|
-
kind: "timestamptz";
|
|
27
|
-
value: string;
|
|
28
|
-
} | {
|
|
29
|
-
kind: "blob";
|
|
30
|
-
base64: string;
|
|
31
|
-
};
|
|
32
|
-
export type WireRequestBlobSplice = {
|
|
33
|
-
kind: "blob-splice";
|
|
34
|
-
baseSha256: string;
|
|
35
|
-
resultSha256: string;
|
|
36
|
-
prefixBytes: number;
|
|
37
|
-
suffixBytes: number;
|
|
38
|
-
insertBase64: string;
|
|
39
|
-
};
|
|
40
|
-
export type WireRequestValue = WireValue | WireRequestBlobSplice;
|
|
41
|
-
export type ServerProtocolHandshake = {
|
|
42
|
-
protocolVersion: number;
|
|
43
|
-
activeBranchId: string;
|
|
44
|
-
activeAccountId: string;
|
|
45
|
-
sessionId: string;
|
|
46
|
-
};
|
|
47
|
-
export type ServerProtocolHandshakeRequest = {
|
|
48
|
-
activeBranchId?: string;
|
|
49
|
-
};
|
|
50
|
-
export type ServerProtocolExecuteRequest = {
|
|
51
|
-
sql: string;
|
|
52
|
-
params: WireRequestValue[];
|
|
53
|
-
options?: {
|
|
54
|
-
originKey?: string;
|
|
55
|
-
};
|
|
56
|
-
cacheBlobs?: true;
|
|
57
|
-
};
|
|
58
|
-
export type ServerProtocolExecuteBatchRequest = {
|
|
59
|
-
statements: Array<{
|
|
60
|
-
sql: string;
|
|
61
|
-
params: WireRequestValue[];
|
|
62
|
-
label?: string;
|
|
63
|
-
}>;
|
|
64
|
-
options?: {
|
|
65
|
-
originKey?: string;
|
|
66
|
-
};
|
|
67
|
-
cacheBlobs?: true;
|
|
68
|
-
};
|
|
69
|
-
export type ServerProtocolExecuteResponse = {
|
|
70
|
-
columns: BindingExecuteResult["columns"];
|
|
71
|
-
rows: WireValue[][];
|
|
72
|
-
rowsAffected: number;
|
|
73
|
-
notices: Array<{
|
|
74
|
-
code: string;
|
|
75
|
-
message: string;
|
|
76
|
-
hint?: string;
|
|
77
|
-
}>;
|
|
78
|
-
};
|
|
79
|
-
export type ServerProtocolExecuteBatchResponse = ServerProtocolExecuteResponse & {
|
|
80
|
-
statementIndex: number;
|
|
81
|
-
label?: string;
|
|
82
|
-
};
|
|
83
|
-
export type ServerProtocolObserveRequest = {
|
|
84
|
-
sql: string;
|
|
85
|
-
params: WireValue[];
|
|
86
|
-
};
|
|
87
|
-
export type ServerProtocolObserveSubscription = ServerProtocolObserveRequest & {
|
|
88
|
-
id: string;
|
|
89
|
-
};
|
|
90
|
-
export type ServerProtocolMultiplexObserveRequest = {
|
|
91
|
-
subscriptions: ServerProtocolObserveSubscription[];
|
|
92
|
-
};
|
|
93
|
-
type ServerProtocolObserveEventBase = {
|
|
94
|
-
sequence: number;
|
|
95
|
-
mutationSequence: number;
|
|
96
|
-
};
|
|
97
|
-
export type ServerProtocolObserveBlobDelta = {
|
|
98
|
-
kind: "single-blob-splice";
|
|
99
|
-
baseSequence: number;
|
|
100
|
-
prefixBytes: number;
|
|
101
|
-
suffixBytes: number;
|
|
102
|
-
insertBase64: string;
|
|
103
|
-
};
|
|
104
|
-
type ServerProtocolObserveRowSplice = {
|
|
105
|
-
kind: "row-splice";
|
|
106
|
-
baseSequence: number;
|
|
107
|
-
prefixRows: number;
|
|
108
|
-
deleteRows: number;
|
|
109
|
-
insertRows: WireValue[][];
|
|
110
|
-
};
|
|
111
|
-
type ServerProtocolObserveDelta = ServerProtocolObserveBlobDelta | ServerProtocolObserveRowSplice;
|
|
112
|
-
export type ServerProtocolObserveEvent = ServerProtocolObserveEventBase & ({
|
|
113
|
-
result: ServerProtocolExecuteResponse;
|
|
114
|
-
delta?: never;
|
|
115
|
-
} | {
|
|
116
|
-
result?: never;
|
|
117
|
-
delta: ServerProtocolObserveDelta;
|
|
118
|
-
});
|
|
119
|
-
export type ServerProtocolMultiplexObserveEvent = ServerProtocolObserveEvent & {
|
|
120
|
-
subscriptionId: string;
|
|
121
|
-
};
|
|
122
|
-
export type ServerProtocolCreateBranchRequest = {
|
|
123
|
-
id?: string;
|
|
124
|
-
name: string;
|
|
125
|
-
fromCommitId?: string;
|
|
126
|
-
};
|
|
127
|
-
export type ServerProtocolCreateBranchResponse = {
|
|
128
|
-
id: string;
|
|
129
|
-
name: string;
|
|
130
|
-
hidden: boolean;
|
|
131
|
-
commitId: string;
|
|
132
|
-
};
|
|
133
|
-
export type ServerProtocolUndoResponse = {
|
|
134
|
-
branchId: string;
|
|
135
|
-
targetCommitId: string;
|
|
136
|
-
inverseCommitId: string;
|
|
137
|
-
};
|
|
138
|
-
export type ServerProtocolRedoResponse = {
|
|
139
|
-
branchId: string;
|
|
140
|
-
targetCommitId: string;
|
|
141
|
-
replayCommitId: string;
|
|
142
|
-
};
|
|
143
|
-
export type ServerProtocolSwitchBranchRequest = {
|
|
144
|
-
branchId: string;
|
|
145
|
-
};
|
|
146
|
-
export type ServerProtocolSwitchBranchResponse = {
|
|
147
|
-
branchId: string;
|
|
148
|
-
};
|
|
149
|
-
export type ServerProtocolErrorBody = {
|
|
150
|
-
error: {
|
|
151
|
-
code?: string;
|
|
152
|
-
message?: string;
|
|
153
|
-
hint?: string;
|
|
154
|
-
details?: unknown;
|
|
155
|
-
};
|
|
156
|
-
};
|
|
157
|
-
export type ServerProtocolObserveErrorEvent = ServerProtocolErrorBody & {
|
|
158
|
-
retryable?: boolean;
|
|
159
|
-
};
|
|
160
|
-
export type ServerProtocolMultiplexObserveErrorEvent = ServerProtocolObserveErrorEvent & {
|
|
161
|
-
subscriptionId?: string;
|
|
162
|
-
};
|
|
163
|
-
export declare function encodeWireValue(value: NativeLixValue): WireValue;
|
|
164
|
-
export declare function decodeExecuteResult(value: unknown): BindingExecuteResult;
|
|
165
|
-
export declare function decodeExecuteBatchResult(value: unknown): BindingExecuteResult;
|
|
166
|
-
export declare function decodeHandshake(value: unknown): ServerProtocolHandshake;
|
|
167
|
-
export declare function decodeObserveEvent(value: unknown, base?: BindingObserveEvent): BindingObserveEvent;
|
|
168
|
-
export declare function remoteError(code: string, message: string, options?: {
|
|
169
|
-
hint?: string;
|
|
170
|
-
details?: unknown;
|
|
171
|
-
status?: number;
|
|
172
|
-
}): Error & {
|
|
173
|
-
code: string;
|
|
174
|
-
hint?: string;
|
|
175
|
-
details?: unknown;
|
|
176
|
-
status?: number;
|
|
177
|
-
};
|
|
178
|
-
export declare function protocolError(message: string): Error & {
|
|
179
|
-
code: string;
|
|
180
|
-
};
|
|
181
|
-
export declare function errorFromResponseBody(value: unknown, status?: number): Error & {
|
|
182
|
-
code: string;
|
|
183
|
-
};
|
|
184
|
-
export declare function record(value: unknown, description: string): Record<string, unknown>;
|
|
185
|
-
export {};
|