core-3nweb-client-lib 0.44.5 → 0.44.7
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/build/api-defs/files.d.ts +5 -1
- package/build/core/asmail/inbox/inbox-events.d.ts +2 -0
- package/build/core/asmail/inbox/inbox-events.js +15 -2
- package/build/core/asmail/inbox/index.js +4 -3
- package/build/core/asmail/inbox/msg-downloader.d.ts +2 -1
- package/build/core/asmail/inbox/msg-downloader.js +4 -2
- package/build/core/storage/synced/downloader.d.ts +2 -1
- package/build/core/storage/synced/downloader.js +2 -1
- package/build/core/storage/synced/obj-files.d.ts +1 -1
- package/build/core/storage/synced/obj-files.js +6 -6
- package/build/core/storage/synced/obj-status.d.ts +1 -0
- package/build/core/storage/synced/obj-status.js +5 -1
- package/build/core/storage/synced/remote-events.d.ts +1 -2
- package/build/core/storage/synced/remote-events.js +7 -16
- package/build/core/storage/synced/storage.js +3 -3
- package/build/core/storage/synced/upsyncer.d.ts +2 -6
- package/build/core/storage/synced/upsyncer.js +31 -28
- package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
- package/build/lib-client/cryptor/cryptor.wasm +0 -0
- package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +1 -0
- package/build/lib-client/objs-on-disk/obj-on-disk.js +7 -2
- package/build/lib-client/xsp-fs/exceptions.js +2 -0
- package/build/lib-client/xsp-fs/fs.js +13 -0
- package/build/lib-common/async-iter.js +2 -1
- package/build/lib-common/awaitable-state.d.ts +7 -0
- package/build/lib-common/awaitable-state.js +43 -0
- package/package.json +1 -1
|
Binary file
|
|
@@ -73,6 +73,7 @@ export interface ObjDownloader {
|
|
|
73
73
|
getSegs: (objId: ObjId, version: number, start: number, end: number) => Promise<Uint8Array>;
|
|
74
74
|
splitSegsDownloads: (start: number, end: number) => Section[];
|
|
75
75
|
schedule: (download: Download) => void;
|
|
76
|
+
whenConnected: () => Promise<void>;
|
|
76
77
|
}
|
|
77
78
|
export interface InitDownloadParts {
|
|
78
79
|
layout: Layout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright (C) 2018 - 2020, 2022, 2025 3NSoft Inc.
|
|
3
|
+
Copyright (C) 2018 - 2020, 2022, 2025 - 2026 3NSoft Inc.
|
|
4
4
|
|
|
5
5
|
This program is free software: you can redistribute it and/or modify it under
|
|
6
6
|
the terms of the GNU General Public License as published by the Free Software
|
|
@@ -423,7 +423,12 @@ class Download {
|
|
|
423
423
|
this.inBkgrnd.runData.currentDownload.deferred.resolve(bytes);
|
|
424
424
|
}
|
|
425
425
|
catch (exc) {
|
|
426
|
-
|
|
426
|
+
if (exc.type === 'connect') {
|
|
427
|
+
await this.downloader.whenConnected();
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
this.inBkgrnd.runData.currentDownload.deferred.reject(exc);
|
|
431
|
+
}
|
|
427
432
|
}
|
|
428
433
|
finally {
|
|
429
434
|
this.inBkgrnd.runData.currentDownload = undefined;
|
|
@@ -33,6 +33,8 @@ function makeStorageException(fields) {
|
|
|
33
33
|
for (const [key, value] of Object.entries(fields)) {
|
|
34
34
|
exc[key] = value;
|
|
35
35
|
}
|
|
36
|
+
const err = new Error(`runtime exception stack`);
|
|
37
|
+
exc['stack'] = err.stack;
|
|
36
38
|
return exc;
|
|
37
39
|
}
|
|
38
40
|
function makeObjNotFoundExc(objId, remoteStorage) {
|
|
@@ -818,6 +818,19 @@ class S {
|
|
|
818
818
|
throw (0, common_1.setPathInExc)(exc, path);
|
|
819
819
|
}
|
|
820
820
|
}
|
|
821
|
+
// XXX WIP
|
|
822
|
+
// async compareLocalAndRemoteFileItems(
|
|
823
|
+
// path: string, itemName: string, remoteVersion?: number
|
|
824
|
+
// ): Promise<FileDiff> {
|
|
825
|
+
// const folderNode = await this.getFolderNode(path);
|
|
826
|
+
// const localChild = (await folderNode.getFile(itemName))!;
|
|
827
|
+
// const remoteChild = await folderNode.getRemoteItemNode(itemName, remoteVersion);
|
|
828
|
+
// if (remoteChild.type === 'file') {
|
|
829
|
+
// return await localChild.compareWithRemote(remoteChild);
|
|
830
|
+
// } else {
|
|
831
|
+
// throw makeFileException('notFile', `${path}/${itemName}`);
|
|
832
|
+
// }
|
|
833
|
+
// }
|
|
821
834
|
async adoptRemoteFolderItem(path, itemName, opts) {
|
|
822
835
|
const node = await this.getFolderNode(path);
|
|
823
836
|
try {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
See the GNU General Public License for more details.
|
|
14
14
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
|
-
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
17
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
19
|
exports.asyncIteration = asyncIteration;
|
|
19
20
|
exports.asyncFind = asyncFind;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (C) 2017 3NSoft Inc.
|
|
4
|
+
|
|
5
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
6
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
7
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
8
|
+
version.
|
|
9
|
+
|
|
10
|
+
This program is distributed in the hope that it will be useful, but
|
|
11
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
13
|
+
See the GNU General Public License for more details.
|
|
14
|
+
|
|
15
|
+
You should have received a copy of the GNU General Public License along with
|
|
16
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.AwaitableState = void 0;
|
|
20
|
+
const deferred_1 = require("./processes/deferred");
|
|
21
|
+
class AwaitableState {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.deferredStateSetPoint = (0, deferred_1.defer)();
|
|
24
|
+
Object.seal(this);
|
|
25
|
+
}
|
|
26
|
+
setState() {
|
|
27
|
+
if (this.deferredStateSetPoint) {
|
|
28
|
+
this.deferredStateSetPoint.resolve();
|
|
29
|
+
this.deferredStateSetPoint = undefined;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
clearState() {
|
|
33
|
+
if (!this.deferredStateSetPoint) {
|
|
34
|
+
this.deferredStateSetPoint = (0, deferred_1.defer)();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
async whenStateIsSet() {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_a = this.deferredStateSetPoint) === null || _a === void 0 ? void 0 : _a.promise;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.AwaitableState = AwaitableState;
|
|
43
|
+
Object.freeze(exports);
|