core-3nweb-client-lib 0.35.3 → 0.36.0
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.
|
@@ -100,7 +100,7 @@ class RecordsInSQL {
|
|
|
100
100
|
key, keyStatus,
|
|
101
101
|
mainObjHeaderOfs, removeAfter
|
|
102
102
|
}));
|
|
103
|
-
await db.saveToFile();
|
|
103
|
+
await db.saveToFile({ skipUpload: true });
|
|
104
104
|
}
|
|
105
105
|
async saveLatestWithAttr() {
|
|
106
106
|
// XXX
|
|
@@ -137,7 +137,7 @@ class RecordsInSQL {
|
|
|
137
137
|
const deliveryTS = findMsgAndGetDeliveryTS(db.db, msgId);
|
|
138
138
|
if (deliveryTS) {
|
|
139
139
|
deleteMsgFrom(db.db, msgId);
|
|
140
|
-
await db.saveToFile();
|
|
140
|
+
await db.saveToFile({ skipUpload: true });
|
|
141
141
|
return deliveryTS;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -231,7 +231,7 @@ class SqliteFiles {
|
|
|
231
231
|
const dbFile = await this.dbsFS.writableFile(LATEST_DB, { create: true, exclusive: true });
|
|
232
232
|
const latest = await lib_sqlite_on_3nstorage_1.SQLiteOn3NStorage.makeAndStart(dbFile);
|
|
233
233
|
latest.db.run(createIndexTab);
|
|
234
|
-
await latest.saveToFile();
|
|
234
|
+
await latest.saveToFile({ skipUpload: true });
|
|
235
235
|
return latest;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
@@ -219,15 +219,14 @@ var extAttrs;
|
|
|
219
219
|
}
|
|
220
220
|
function packNamedStrAttr(name, value) {
|
|
221
221
|
(0, assert_1.assert)((typeof name === 'string') && (name.length > 0) &&
|
|
222
|
-
(typeof value === 'string')
|
|
222
|
+
(typeof value === 'string'));
|
|
223
223
|
const nameBin = Buffer.from(name, 'utf8');
|
|
224
224
|
const valueBin = Buffer.from(value, 'utf8');
|
|
225
225
|
return packNamedAttr(NAMED_UTF8_STR, nameBin, valueBin);
|
|
226
226
|
}
|
|
227
227
|
extAttrs.packNamedStrAttr = packNamedStrAttr;
|
|
228
228
|
function packNamedBinaryAttr(name, value) {
|
|
229
|
-
(0, assert_1.assert)((typeof name === 'string') && (name.length > 0)
|
|
230
|
-
(value.length > 0));
|
|
229
|
+
(0, assert_1.assert)((typeof name === 'string') && (name.length > 0));
|
|
231
230
|
const nameBin = Buffer.from(name, 'utf8');
|
|
232
231
|
return packNamedAttr(NAMED_BINARY, nameBin, value);
|
|
233
232
|
}
|
|
@@ -304,27 +303,6 @@ var extAttrs;
|
|
|
304
303
|
(0, assert_1.assert)(false);
|
|
305
304
|
}
|
|
306
305
|
}
|
|
307
|
-
// export function pack(xattrs: XAttrs): Buffer {
|
|
308
|
-
// const ext: Buffer[] = [];
|
|
309
|
-
// for (const xattr of Object.values(xattrs)) {
|
|
310
|
-
// if (xattr.type === 'named-utf8str') {
|
|
311
|
-
// ext.push(packNamedStrAttr(xattr.name, xattr.value));
|
|
312
|
-
// } else if (xattr.type === 'named-json') {
|
|
313
|
-
// ext.push(packNamedJsonAttr(xattr.name, xattr.value));
|
|
314
|
-
// } else if (xattr.type === 'named-binary') {
|
|
315
|
-
// ext.push(packNamedBinaryAttr(xattr.name, xattr.value));
|
|
316
|
-
// } else {
|
|
317
|
-
// throw new Error(`Unknown type of named attribute`);
|
|
318
|
-
// }
|
|
319
|
-
// }
|
|
320
|
-
// const bytes = Buffer.allocUnsafe(ext.reduce((len, b) => len+b.length, 0));
|
|
321
|
-
// let ofs = 0;
|
|
322
|
-
// for (const buf of ext) {
|
|
323
|
-
// bytes.set(buf, ofs);
|
|
324
|
-
// ofs += buf.length;
|
|
325
|
-
// }
|
|
326
|
-
// return bytes;
|
|
327
|
-
// }
|
|
328
306
|
})(extAttrs || (extAttrs = {}));
|
|
329
307
|
Object.freeze(extAttrs);
|
|
330
308
|
function parsingException(msg, cause) {
|