core-3nweb-client-lib 0.30.2 → 0.30.4
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/asmail.d.ts +9 -6
- package/build/core/app-files.d.ts +4 -4
- package/build/core/app-files.js +2 -2
- package/build/core/asmail/asmail-cap-ipc.d.ts +1 -1
- package/build/core/asmail/asmail-cap-ipc.js +2 -3
- package/build/core/asmail/config/common.d.ts +2 -2
- package/build/core/asmail/config/index.d.ts +1 -1
- package/build/core/asmail/config/invitations-anon.d.ts +1 -1
- package/build/core/asmail/config/invitations-anon.js +1 -2
- package/build/core/asmail/config/published-intro-key.d.ts +2 -2
- package/build/core/asmail/config/published-intro-key.js +1 -2
- package/build/core/asmail/delivery/common.d.ts +6 -6
- package/build/core/asmail/delivery/common.js +3 -3
- package/build/core/asmail/delivery/index.d.ts +4 -4
- package/build/core/asmail/delivery/msg.d.ts +4 -4
- package/build/core/asmail/delivery/msg.js +3 -3
- package/build/core/asmail/inbox/attachments/fs.d.ts +1 -1
- package/build/core/asmail/inbox/attachments/fs.js +1 -2
- package/build/core/asmail/inbox/inbox-events.d.ts +4 -3
- package/build/core/asmail/inbox/inbox-events.js +1 -1
- package/build/core/asmail/inbox/index.d.ts +2 -2
- package/build/core/asmail/inbox/index.js +7 -4
- package/build/core/asmail/inbox/msg-indexing/index.d.ts +2 -2
- package/build/core/asmail/inbox/msg-indexing/logs-n-entries.d.ts +3 -3
- package/build/core/asmail/inbox/msg-indexing/logs-n-entries.js +2 -2
- package/build/core/asmail/inbox/msg-indexing/sql-indexing.d.ts +1 -1
- package/build/core/asmail/inbox/msg-indexing/sql-indexing.js +1 -2
- package/build/core/asmail/inbox/msg-on-disk.d.ts +2 -2
- package/build/core/asmail/inbox/msg-on-disk.js +3 -3
- package/build/core/asmail/index.d.ts +3 -3
- package/build/core/asmail/key-verification.js +2 -3
- package/build/core/asmail/keyring/common.d.ts +1 -1
- package/build/core/asmail/keyring/common.js +7 -7
- package/build/core/asmail/keyring/correspondent-keys.d.ts +1 -1
- package/build/core/asmail/keyring/correspondent-keys.js +5 -5
- package/build/core/asmail/keyring/index.d.ts +3 -3
- package/build/core/asmail/keyring/index.js +2 -2
- package/build/core/asmail/keyring/keyring-storage.d.ts +1 -1
- package/build/core/asmail/keyring/keyring-storage.js +1 -2
- package/build/core/asmail/msg/attachments-container.d.ts +3 -3
- package/build/core/asmail/msg/attachments-container.js +7 -8
- package/build/core/asmail/msg/opener.js +2 -2
- package/build/core/asmail/msg/packer.d.ts +2 -2
- package/build/core/asmail/sending-params/index.d.ts +3 -3
- package/build/core/asmail/sending-params/own-params.d.ts +3 -3
- package/build/core/asmail/sending-params/params-from-others.d.ts +3 -3
- package/build/core/id-manager/index.d.ts +4 -4
- package/build/core/id-manager/key-storage.d.ts +1 -1
- package/build/core/id-manager/mailerid-cap-ipc.d.ts +1 -1
- package/build/core/id-manager/mailerid-cap-ipc.js +2 -3
- package/build/core/index.d.ts +3 -3
- package/build/core/startup/sign-in.d.ts +6 -6
- package/build/core/startup/sign-in.js +2 -2
- package/build/core/startup/sign-up.d.ts +1 -1
- package/build/core/startup/sign-up.js +6 -6
- package/build/core/startup/startup-cap.d.ts +2 -2
- package/build/core/startup/startup-cap.js +4 -5
- package/build/core/storage/common/obj-info-file.js +12 -13
- package/build/core/storage/common/utils.js +2 -3
- package/build/core/storage/index.d.ts +5 -5
- package/build/core/storage/index.js +2 -2
- package/build/core/storage/local/storage.d.ts +3 -3
- package/build/core/storage/storage-cap-ipc.d.ts +1 -1
- package/build/core/storage/storage-cap-ipc.js +3 -4
- package/build/core/storage/synced/obj-files.d.ts +1 -1
- package/build/core/storage/synced/obj-status.d.ts +2 -2
- package/build/core/storage/synced/obj-status.js +2 -2
- package/build/core/storage/synced/storage.d.ts +4 -4
- package/build/core/storage/synced/upload-header-file.js +3 -3
- package/build/core/storage/synced/upsyncer.d.ts +1 -1
- package/build/core/storage/system-folders/apps-data.d.ts +1 -1
- package/build/core/storage/system-folders/index.d.ts +2 -2
- package/build/core/storage/system-folders/index.js +4 -4
- package/build/core-ipc/bytes.d.ts +2 -2
- package/build/core-ipc/bytes.js +4 -5
- package/build/core-ipc/common-caps.d.ts +1 -1
- package/build/core-ipc/common-caps.js +3 -4
- package/build/core-ipc/file.d.ts +13 -14
- package/build/core-ipc/file.js +31 -31
- package/build/core-ipc/fs.d.ts +3 -3
- package/build/core-ipc/fs.js +6 -6
- package/build/core-ipc/generic.d.ts +4 -4
- package/build/core-ipc/generic.js +3 -4
- package/build/core-ipc/log-cap.d.ts +1 -1
- package/build/core-ipc/log-cap.js +2 -3
- package/build/core-ipc/startup-caps.d.ts +1 -1
- package/build/core-ipc/startup-caps.js +2 -3
- package/build/ipc-via-protobuf/connector.d.ts +6 -7
- package/build/ipc-via-protobuf/connector.js +3 -3
- package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -2
- package/build/ipc-via-protobuf/protobuf-msg.js +20 -20
- package/build/lib-client/3nstorage/exceptions.d.ts +1 -1
- package/build/lib-client/3nstorage/exceptions.js +9 -10
- package/build/lib-client/3nstorage/service.d.ts +2 -2
- package/build/lib-client/3nstorage/util/file-based-json.d.ts +3 -3
- package/build/lib-client/3nstorage/util/for-arrays.js +1 -2
- package/build/lib-client/3nstorage/xsp-fs/attrs.d.ts +1 -2
- package/build/lib-client/3nstorage/xsp-fs/common.d.ts +12 -12
- package/build/lib-client/3nstorage/xsp-fs/common.js +5 -5
- package/build/lib-client/3nstorage/xsp-fs/file-node.d.ts +4 -4
- package/build/lib-client/3nstorage/xsp-fs/file.d.ts +15 -15
- package/build/lib-client/3nstorage/xsp-fs/folder-node-serialization.js +2 -3
- package/build/lib-client/3nstorage/xsp-fs/folder-node.d.ts +7 -7
- package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +27 -27
- package/build/lib-client/3nstorage/xsp-fs/link-node.d.ts +2 -2
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +7 -7
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +11 -11
- package/build/lib-client/3nstorage/xsp-fs/node-persistence.d.ts +2 -2
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +1 -2
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +3 -4
- package/build/lib-client/3nweb-signup.js +4 -5
- package/build/lib-client/asmail/recipient.d.ts +1 -1
- package/build/lib-client/asmail/recipient.js +4 -4
- package/build/lib-client/asmail/sender.d.ts +3 -3
- package/build/lib-client/asmail/sender.js +9 -9
- package/build/lib-client/cryptor/cryptor-in-worker.d.ts +2 -2
- package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
- package/build/lib-client/cryptor/cryptor.d.ts +2 -2
- package/build/lib-client/cryptor/cryptor.js +3 -3
- package/build/lib-client/cryptor/cryptor.wasm +0 -0
- package/build/lib-client/cryptor/in-proc-js.js +1 -2
- package/build/lib-client/cryptor/in-proc-wasm.js +1 -2
- package/build/lib-client/cryptor/serialization-for-wasm.d.ts +1 -2
- package/build/lib-client/cryptor/serialization-for-wasm.js +6 -7
- package/build/lib-client/cryptor/wasm-mp1-modules.js +1 -2
- package/build/lib-client/cryptor-work-labels.js +1 -1
- package/build/lib-client/fs-utils/files-select.d.ts +3 -3
- package/build/lib-client/fs-utils/files-select.js +1 -2
- package/build/lib-client/fs-utils/files.d.ts +7 -7
- package/build/lib-client/fs-utils/files.js +7 -8
- package/build/lib-client/fs-utils/fs-collection.d.ts +1 -1
- package/build/lib-client/fs-utils/fs-collection.js +2 -3
- package/build/lib-client/fs-utils/fs-sync-utils.d.ts +5 -5
- package/build/lib-client/fs-utils/fs-sync-utils.js +4 -5
- package/build/lib-client/fs-utils/fs-view.d.ts +4 -4
- package/build/lib-client/fs-utils/fs-view.js +1 -2
- package/build/lib-client/key-derivation.js +3 -4
- package/build/lib-client/local-files/dev-file-sink.d.ts +2 -3
- package/build/lib-client/local-files/dev-file-src.d.ts +0 -1
- package/build/lib-client/local-files/device-fs.d.ts +18 -18
- package/build/lib-client/logging/log-to-file.d.ts +5 -5
- package/build/lib-client/logging/log-to-file.js +2 -2
- package/build/lib-client/mailer-id/login.js +2 -3
- package/build/lib-client/objs-on-disk/file-writing-proc.d.ts +1 -1
- package/build/lib-client/objs-on-disk/obj-folders.d.ts +1 -1
- package/build/lib-client/objs-on-disk/obj-folders.js +9 -5
- package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +1 -1
- package/build/lib-client/protobuf-type.d.ts +0 -1
- package/build/lib-client/request-utils.d.ts +2 -4
- package/build/lib-client/request-utils.js +6 -6
- package/build/lib-client/service-locator.d.ts +3 -4
- package/build/lib-client/service-locator.js +5 -6
- package/build/lib-client/user-with-mid-session.d.ts +1 -1
- package/build/lib-client/user-with-mid-session.js +17 -17
- package/build/lib-client/user-with-pkl-session.js +16 -16
- package/build/lib-client/ws-utils.js +1 -2
- package/build/lib-common/assert.js +1 -2
- package/build/lib-common/async-cryptor-wrap.js +4 -5
- package/build/lib-common/async-fs-node.d.ts +0 -3
- package/build/lib-common/async-fs-node.js +35 -35
- package/build/lib-common/async-iter.js +2 -3
- package/build/lib-common/big-endian.d.ts +0 -1
- package/build/lib-common/big-endian.js +10 -11
- package/build/lib-common/binding.js +1 -2
- package/build/lib-common/buffer-utils.d.ts +0 -1
- package/build/lib-common/buffer-utils.js +9 -9
- package/build/lib-common/byte-streaming/bytes-fifo-buffer.js +5 -5
- package/build/lib-common/byte-streaming/pipe.d.ts +2 -2
- package/build/lib-common/byte-streaming/pipe.js +1 -2
- package/build/lib-common/byte-streaming/wrapping.d.ts +2 -2
- package/build/lib-common/byte-streaming/wrapping.js +3 -4
- package/build/lib-common/bytes-equal.js +1 -2
- package/build/lib-common/canonical-address.js +3 -4
- package/build/lib-common/exceptions/error.js +3 -4
- package/build/lib-common/exceptions/file.d.ts +2 -2
- package/build/lib-common/exceptions/file.js +7 -7
- package/build/lib-common/exceptions/http.js +2 -3
- package/build/lib-common/exceptions/runtime.js +1 -2
- package/build/lib-common/ipc/generic-ipc.d.ts +3 -3
- package/build/lib-common/ipc/generic-ipc.js +11 -11
- package/build/lib-common/ipc/ws-ipc.js +2 -2
- package/build/lib-common/json-utils.js +4 -5
- package/build/lib-common/jwkeys.d.ts +1 -1
- package/build/lib-common/jwkeys.js +13 -13
- package/build/lib-common/mid-sigs-NaCl-Ed.d.ts +3 -3
- package/build/lib-common/mid-sigs-NaCl-Ed.js +5 -5
- package/build/lib-common/obj-streaming/sink-utils.d.ts +2 -2
- package/build/lib-common/obj-streaming/sink-utils.js +2 -3
- package/build/lib-common/obj-streaming/wrapping.js +1 -2
- package/build/lib-common/objs-on-disk/file-layout.d.ts +4 -5
- package/build/lib-common/objs-on-disk/obj-file.d.ts +0 -1
- package/build/lib-common/objs-on-disk/utils.d.ts +3 -5
- package/build/lib-common/objs-on-disk/utils.js +5 -6
- package/build/lib-common/objs-on-disk/v1-obj-file-format.d.ts +0 -1
- package/build/lib-common/objs-on-disk/v1-obj-file-format.js +1 -1
- package/build/lib-common/processes/deferred.js +1 -2
- package/build/lib-common/processes/sleep.js +1 -2
- package/build/lib-common/processes/synced.d.ts +1 -1
- package/build/lib-common/processes/synced.js +2 -2
- package/build/lib-common/processes/timeout.js +1 -2
- package/build/lib-common/random-node.js +10 -11
- package/build/lib-common/service-api/3nstorage/owner.js +19 -19
- package/build/lib-common/service-api/asmail/config.js +3 -3
- package/build/lib-common/service-api/asmail/delivery.js +8 -8
- package/build/lib-common/service-api/asmail/retrieval.js +11 -11
- package/build/lib-common/service-api/mailer-id/login.js +2 -2
- package/build/lib-common/service-api/mailer-id/provisioning.js +2 -2
- package/build/lib-common/service-api/pub-key-login.js +2 -2
- package/build/lib-common/service-api/web-socket-base.d.ts +1 -1
- package/build/lib-common/service-api/web-socket-base.js +3 -3
- package/build/lib-common/session-encryptor.js +1 -2
- package/build/lib-common/timed-cache.js +1 -2
- package/build/lib-common/user-admin-api/signup.js +4 -4
- package/build/lib-common/utils-for-observables.js +5 -5
- package/build/lib-sqlite-on-3nstorage/deferred.js +1 -2
- package/build/lib-sqlite-on-3nstorage/index.d.ts +5 -5
- package/build/lib-sqlite-on-3nstorage/index.js +2 -2
- package/build/lib-sqlite-on-3nstorage/synced.d.ts +1 -1
- package/build/lib-sqlite-on-3nstorage/synced.js +2 -2
- package/build/raw-3nweb-clients.d.ts +7 -7
- package/build/raw-3nweb-clients.js +2 -2
- package/package.json +2 -2
|
@@ -19,9 +19,9 @@ export interface MsgKeyInfo {
|
|
|
19
19
|
*/
|
|
20
20
|
msgKeyPackLen: number;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
type WritableFS = web3n.files.WritableFS;
|
|
23
|
+
type SendingResources = ResourcesForSending['correspondents'];
|
|
24
|
+
type ReceptionResources = ResourcesForReceiving['correspondents'];
|
|
25
25
|
export interface KeyRing {
|
|
26
26
|
needIntroKeyFor: SendingResources['needIntroKeyFor'];
|
|
27
27
|
generateKeysToSend: SendingResources['generateKeysToSend'];
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.KEY_USE = void 0;
|
|
20
|
+
exports.makeAndKeyRing = makeAndKeyRing;
|
|
20
21
|
const correspondent_keys_1 = require("./correspondent-keys");
|
|
21
22
|
const id_to_email_map_1 = require("./id-to-email-map");
|
|
22
23
|
const common_1 = require("./common");
|
|
@@ -34,7 +35,6 @@ Object.defineProperty(exports, "KEY_USE", { enumerable: true, get: function () {
|
|
|
34
35
|
function makeAndKeyRing(cryptor, fs, publishedKeys) {
|
|
35
36
|
return KRing.makeAndStart(cryptor, fs, publishedKeys);
|
|
36
37
|
}
|
|
37
|
-
exports.makeAndKeyRing = makeAndKeyRing;
|
|
38
38
|
class KRing {
|
|
39
39
|
constructor(cryptor, publishedKeys) {
|
|
40
40
|
this.cryptor = cryptor;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.makeKeyringStorage =
|
|
19
|
+
exports.makeKeyringStorage = makeKeyringStorage;
|
|
20
20
|
const synced_1 = require("../../../lib-common/processes/synced");
|
|
21
21
|
const KEYRING_FNAME = 'keyring.json';
|
|
22
22
|
function makeKeyringStorage(fs) {
|
|
@@ -35,7 +35,6 @@ function makeKeyringStorage(fs) {
|
|
|
35
35
|
};
|
|
36
36
|
return Object.freeze(storage);
|
|
37
37
|
}
|
|
38
|
-
exports.makeKeyringStorage = makeKeyringStorage;
|
|
39
38
|
/**
|
|
40
39
|
* This is a catch callback, which returns undefined on file(folder) not found
|
|
41
40
|
* exception, and re-throws all other exceptions/errors.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type AttachmentsContainer = web3n.asmail.AttachmentsContainer;
|
|
2
|
+
export type FS = web3n.files.FS;
|
|
3
|
+
export type File = web3n.files.File;
|
|
4
4
|
export declare function isContainerEmpty(c: AttachmentsContainer | undefined): boolean;
|
|
5
5
|
export declare function iterFilesIn(c: AttachmentsContainer | undefined): IterableIterator<{
|
|
6
6
|
fileName: string;
|
|
@@ -15,7 +15,13 @@
|
|
|
15
15
|
You should have received a copy of the GNU General Public License along with
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.isContainerEmpty = isContainerEmpty;
|
|
19
|
+
exports.iterFilesIn = iterFilesIn;
|
|
20
|
+
exports.iterFoldersIn = iterFoldersIn;
|
|
21
|
+
exports.addFileTo = addFileTo;
|
|
22
|
+
exports.addFolderTo = addFolderTo;
|
|
23
|
+
exports.renameFileIn = renameFileIn;
|
|
24
|
+
exports.renameFolderIn = renameFolderIn;
|
|
19
25
|
function isContainerEmpty(c) {
|
|
20
26
|
if (!c) {
|
|
21
27
|
return true;
|
|
@@ -28,7 +34,6 @@ function isContainerEmpty(c) {
|
|
|
28
34
|
}
|
|
29
35
|
return true;
|
|
30
36
|
}
|
|
31
|
-
exports.isContainerEmpty = isContainerEmpty;
|
|
32
37
|
function* iterFilesIn(c) {
|
|
33
38
|
if (!c || !c.files) {
|
|
34
39
|
return;
|
|
@@ -38,7 +43,6 @@ function* iterFilesIn(c) {
|
|
|
38
43
|
yield { fileName, file };
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
|
-
exports.iterFilesIn = iterFilesIn;
|
|
42
46
|
function* iterFoldersIn(c) {
|
|
43
47
|
if (!c || !c.folders) {
|
|
44
48
|
return;
|
|
@@ -48,7 +52,6 @@ function* iterFoldersIn(c) {
|
|
|
48
52
|
yield { folderName, folder };
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
|
-
exports.iterFoldersIn = iterFoldersIn;
|
|
52
55
|
function addFileTo(c, file, name) {
|
|
53
56
|
if (!c.files) {
|
|
54
57
|
c.files = {};
|
|
@@ -61,7 +64,6 @@ function addFileTo(c, file, name) {
|
|
|
61
64
|
}
|
|
62
65
|
c.files[name] = file;
|
|
63
66
|
}
|
|
64
|
-
exports.addFileTo = addFileTo;
|
|
65
67
|
function addFolderTo(c, folder, name) {
|
|
66
68
|
if (!c.folders) {
|
|
67
69
|
c.folders = {};
|
|
@@ -74,7 +76,6 @@ function addFolderTo(c, folder, name) {
|
|
|
74
76
|
}
|
|
75
77
|
c.folders[name] = folder;
|
|
76
78
|
}
|
|
77
|
-
exports.addFolderTo = addFolderTo;
|
|
78
79
|
function renameFileIn(c, initName, newName) {
|
|
79
80
|
if (!c.files || !c.files[initName]) {
|
|
80
81
|
throw new Error(`File ${initName} is not found`);
|
|
@@ -83,7 +84,6 @@ function renameFileIn(c, initName, newName) {
|
|
|
83
84
|
addFileTo(c, file, newName);
|
|
84
85
|
delete c.files[initName];
|
|
85
86
|
}
|
|
86
|
-
exports.renameFileIn = renameFileIn;
|
|
87
87
|
function renameFolderIn(c, initName, newName) {
|
|
88
88
|
if (!c.folders || !c.folders[initName]) {
|
|
89
89
|
throw new Error(`Folder ${initName} is not found`);
|
|
@@ -92,4 +92,3 @@ function renameFolderIn(c, initName, newName) {
|
|
|
92
92
|
addFolderTo(c, folder, newName);
|
|
93
93
|
delete c.folders[initName];
|
|
94
94
|
}
|
|
95
|
-
exports.renameFolderIn = renameFolderIn;
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.OpenedMsg = void 0;
|
|
20
|
+
exports.openMsg = openMsg;
|
|
20
21
|
const buffer_utils_1 = require("../../../lib-common/buffer-utils");
|
|
21
22
|
const error_1 = require("../../../lib-common/exceptions/error");
|
|
22
23
|
const xsp_files_1 = require("xsp-files");
|
|
@@ -91,5 +92,4 @@ async function openMsg(msgId, mainObjId, mainObj, headerOfs, fKey, cryptor) {
|
|
|
91
92
|
throw (0, error_1.errWithCause)(err, `Cannot open main object of message ${msgId}`);
|
|
92
93
|
}
|
|
93
94
|
}
|
|
94
|
-
exports.openMsg = openMsg;
|
|
95
95
|
Object.freeze(exports);
|
|
@@ -4,8 +4,8 @@ import { FolderInJSON } from '../../../lib-client/3nstorage/xsp-fs/common';
|
|
|
4
4
|
import * as confApi from '../../../lib-common/service-api/asmail/config';
|
|
5
5
|
import { MsgEnvelope, SuggestedNextKeyPair, SendingParams } from './common';
|
|
6
6
|
import { Encryptor } from '../../../lib-common/async-cryptor-wrap';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
type FS = web3n.files.FS;
|
|
8
|
+
type AttachmentsContainer = web3n.asmail.AttachmentsContainer;
|
|
9
9
|
/**
|
|
10
10
|
* This contains complete information of ids and keys set in the message during
|
|
11
11
|
* packing. This information can is used to continue message sending after app's
|
|
@@ -2,9 +2,9 @@ import { ResourcesForSending } from '../delivery/common';
|
|
|
2
2
|
import { ConfigOfASMailServer } from '../config/index';
|
|
3
3
|
import { ResourcesForReceiving } from '../inbox';
|
|
4
4
|
export { SendingParams } from './params-from-others';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type WritableFS = web3n.files.WritableFS;
|
|
6
|
+
type SendingResources = ResourcesForSending['correspondents'];
|
|
7
|
+
type ReceptionResources = ResourcesForReceiving['correspondents'];
|
|
8
8
|
export declare class SendingParamsHolder {
|
|
9
9
|
private paramsFromOthers;
|
|
10
10
|
private ownParams;
|
|
@@ -2,9 +2,9 @@ import { JsonFileProc } from '../../../lib-client/3nstorage/util/file-based-json
|
|
|
2
2
|
import { SendingParams } from '../msg/common';
|
|
3
3
|
import { ConfigOfASMailServer } from '../config/index';
|
|
4
4
|
import { SendingParamsHolder } from '../sending-params';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type ExposedFuncs = SendingParamsHolder['thisSide'];
|
|
6
|
+
type WritableFile = web3n.files.WritableFile;
|
|
7
|
+
type FileEvent = web3n.files.FileEvent;
|
|
8
8
|
interface ParamsForAcceptingMsgs {
|
|
9
9
|
address: string;
|
|
10
10
|
suggested?: SendingParams;
|
|
@@ -2,9 +2,9 @@ import { JsonFileProc } from '../../../lib-client/3nstorage/util/file-based-json
|
|
|
2
2
|
import { SendingParams } from '../msg/common';
|
|
3
3
|
import { SendingParamsHolder } from '../sending-params';
|
|
4
4
|
export { SendingParams } from '../msg/common';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type ExposedFuncs = SendingParamsHolder['otherSides'];
|
|
6
|
+
type WritableFile = web3n.files.WritableFile;
|
|
7
|
+
type FileEvent = web3n.files.FileEvent;
|
|
8
8
|
interface ParamsForSending extends SendingParams {
|
|
9
9
|
address: string;
|
|
10
10
|
}
|
|
@@ -4,7 +4,7 @@ import { GenerateKey } from '../startup/sign-in';
|
|
|
4
4
|
import { LogError, LogWarning } from '../../lib-client/logging/log-to-file';
|
|
5
5
|
import { NetClient } from '../../lib-client/request-utils';
|
|
6
6
|
import { ServiceLocator } from '../../lib-client/service-locator';
|
|
7
|
-
|
|
7
|
+
type WritableFS = web3n.files.WritableFS;
|
|
8
8
|
/**
|
|
9
9
|
* This function completes provisioning process, returning a promise, resolvable
|
|
10
10
|
* to either true, when all is done, or to false, when challenge reply is not
|
|
@@ -17,8 +17,8 @@ export interface CompleteProvisioning {
|
|
|
17
17
|
/**
|
|
18
18
|
* This returns a promise, resolvable to mailerId signer.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
21
|
-
export
|
|
20
|
+
export type GetSigner = () => Promise<mid.MailerIdSigner>;
|
|
21
|
+
export type SetupManagerStorage = (fs: WritableFS, keysToSave?: JsonKey[]) => Promise<void>;
|
|
22
22
|
export declare class IdManager {
|
|
23
23
|
private readonly store;
|
|
24
24
|
private readonly makeNet;
|
|
@@ -39,5 +39,5 @@ export declare class IdManager {
|
|
|
39
39
|
isProvisionedAndValid(): boolean;
|
|
40
40
|
makeMailerIdCAP(): Service;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
type Service = web3n.mailerid.Service;
|
|
43
43
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogError, LogWarning } from "../../lib-client/logging/log-to-file";
|
|
2
2
|
import { JsonKey } from "../../lib-common/jwkeys";
|
|
3
|
-
|
|
3
|
+
type WritableFS = web3n.files.WritableFS;
|
|
4
4
|
export interface LoginKeysJSON {
|
|
5
5
|
address: string;
|
|
6
6
|
keys: JsonKey[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Caller, ExposedObj } from "../../ipc-via-protobuf/connector";
|
|
2
|
-
|
|
2
|
+
type MailerId = web3n.mailerid.Service;
|
|
3
3
|
export declare function exposeMailerIdCAP(cap: MailerId): ExposedObj<MailerId>;
|
|
4
4
|
export declare function makeMailerIdCaller(caller: Caller, objPath: string[]): MailerId;
|
|
5
5
|
export {};
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.exposeMailerIdCAP = exposeMailerIdCAP;
|
|
20
|
+
exports.makeMailerIdCaller = makeMailerIdCaller;
|
|
20
21
|
const connector_1 = require("../../ipc-via-protobuf/connector");
|
|
21
22
|
const protobuf_type_1 = require("../../lib-client/protobuf-type");
|
|
22
23
|
const mailerid_proto_1 = require("../../protos/mailerid.proto");
|
|
@@ -27,14 +28,12 @@ function exposeMailerIdCAP(cap) {
|
|
|
27
28
|
login: login.wrapService(cap.login)
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
|
-
exports.exposeMailerIdCAP = exposeMailerIdCAP;
|
|
31
31
|
function makeMailerIdCaller(caller, objPath) {
|
|
32
32
|
return {
|
|
33
33
|
getUserId: getUserId.makeCaller(caller, objPath),
|
|
34
34
|
login: login.makeCaller(caller, objPath)
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
exports.makeMailerIdCaller = makeMailerIdCaller;
|
|
38
37
|
var getUserId;
|
|
39
38
|
(function (getUserId) {
|
|
40
39
|
function wrapService(fn) {
|
package/build/core/index.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import { FactoryOfFSs } from './storage';
|
|
|
2
2
|
import { makeCryptor } from '../lib-client/cryptor/cryptor';
|
|
3
3
|
import { NetClient } from '../lib-client/request-utils';
|
|
4
4
|
import { ServiceLocatorMaker } from '../lib-client/service-locator';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type RequestedCAPs = web3n.caps.common.RequestedCAPs;
|
|
6
|
+
type W3N = web3n.caps.common.W3N;
|
|
7
7
|
export interface CoreConf {
|
|
8
8
|
dataDir: string;
|
|
9
9
|
signUpUrl: string;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
11
|
+
export type MakeNet = () => NetClient;
|
|
12
12
|
export declare class Core {
|
|
13
13
|
private readonly makeNet;
|
|
14
14
|
private readonly makeResolver;
|
|
@@ -3,11 +3,11 @@ import { ScryptGenParams } from '../../lib-client/key-derivation';
|
|
|
3
3
|
import type { GetUsersOnDisk } from '../app-files';
|
|
4
4
|
import { Cryptor } from '../../lib-client/cryptor/cryptor';
|
|
5
5
|
import { LogError } from '../../lib-client/logging/log-to-file';
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
|
|
6
|
+
export type GenerateKey = (derivParams: ScryptGenParams) => Promise<Uint8Array>;
|
|
7
|
+
export type StartInitWithoutCache = (address: string) => Promise<CompleteInitWithoutCache | undefined>;
|
|
8
|
+
export type CompleteInitWithoutCache = (midLoginKey: GenerateKey, storageKey: GenerateKey) => Promise<IdManager | undefined>;
|
|
9
|
+
export type InitWithCache = (address: string, storageKey: GenerateKey) => Promise<IdManager | undefined>;
|
|
10
|
+
type SignInService = web3n.startup.SignInService;
|
|
11
11
|
export declare class SignIn {
|
|
12
12
|
private cryptor;
|
|
13
13
|
private startInitWithoutCache;
|
|
@@ -24,6 +24,6 @@ export declare class SignIn {
|
|
|
24
24
|
private useExistingStorage;
|
|
25
25
|
private logAndWrap;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type ProgressCB = (p: number) => void;
|
|
28
28
|
export declare function makeKeyGenProgressCB(progressStart: number, progressEnd: number, progressCB: ProgressCB): ProgressCB;
|
|
29
29
|
export {};
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.SignIn = void 0;
|
|
20
|
+
exports.makeKeyGenProgressCB = makeKeyGenProgressCB;
|
|
20
21
|
const key_derivation_1 = require("../../lib-client/key-derivation");
|
|
21
22
|
const rxjs_1 = require("rxjs");
|
|
22
23
|
const error_1 = require("../../lib-common/exceptions/error");
|
|
@@ -115,5 +116,4 @@ function makeKeyGenProgressCB(progressStart, progressEnd, progressCB) {
|
|
|
115
116
|
progressCB(totalProgress);
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
|
-
exports.makeKeyGenProgressCB = makeKeyGenProgressCB;
|
|
119
119
|
Object.freeze(exports);
|
|
@@ -57,6 +57,12 @@ async function makeLabeledMidLoginKey(cryptor) {
|
|
|
57
57
|
return { skey, pkey };
|
|
58
58
|
}
|
|
59
59
|
class SignUp {
|
|
60
|
+
get net() {
|
|
61
|
+
if (!this.netLazyInit) {
|
|
62
|
+
this.netLazyInit = this.makeNet();
|
|
63
|
+
}
|
|
64
|
+
return this.netLazyInit;
|
|
65
|
+
}
|
|
60
66
|
constructor(serviceURL, cryptor, makeNet, getUsersOnDisk, logError) {
|
|
61
67
|
this.cryptor = cryptor;
|
|
62
68
|
this.makeNet = makeNet;
|
|
@@ -104,12 +110,6 @@ class SignUp {
|
|
|
104
110
|
this.setServiceURL(serviceURL);
|
|
105
111
|
Object.seal(this);
|
|
106
112
|
}
|
|
107
|
-
get net() {
|
|
108
|
-
if (!this.netLazyInit) {
|
|
109
|
-
this.netLazyInit = this.makeNet();
|
|
110
|
-
}
|
|
111
|
-
return this.netLazyInit;
|
|
112
|
-
}
|
|
113
113
|
setServiceURL(serviceURL) {
|
|
114
114
|
const url = (0, url_1.parse)(serviceURL);
|
|
115
115
|
if (url.protocol !== 'https:') {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExposedObj, Caller } from "../../ipc-via-protobuf/connector";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type SignInService = web3n.startup.SignInService;
|
|
3
|
+
type SignUpService = web3n.startup.SignUpService;
|
|
4
4
|
export declare function wrapSignInCAP(cap: SignInService): ExposedObj<SignInService>;
|
|
5
5
|
export declare function makeSignInCaller(caller: Caller, objPath: string[]): SignInService;
|
|
6
6
|
export declare function wrapSignUpCAP(cap: SignUpService): ExposedObj<SignUpService>;
|
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.wrapSignInCAP = wrapSignInCAP;
|
|
20
|
+
exports.makeSignInCaller = makeSignInCaller;
|
|
21
|
+
exports.wrapSignUpCAP = wrapSignUpCAP;
|
|
22
|
+
exports.makeSignUpCaller = makeSignUpCaller;
|
|
20
23
|
const protobuf_msg_1 = require("../../ipc-via-protobuf/protobuf-msg");
|
|
21
24
|
const rxjs_1 = require("rxjs");
|
|
22
25
|
const operators_1 = require("rxjs/operators");
|
|
@@ -31,7 +34,6 @@ function wrapSignInCAP(cap) {
|
|
|
31
34
|
useExistingStorage: useExistingStorage.wrapService(cap.useExistingStorage)
|
|
32
35
|
};
|
|
33
36
|
}
|
|
34
|
-
exports.wrapSignInCAP = wrapSignInCAP;
|
|
35
37
|
function makeSignInCaller(caller, objPath) {
|
|
36
38
|
return {
|
|
37
39
|
completeLoginAndLocalSetup: completeLoginAndLocalSetup.makeCaller(caller, objPath),
|
|
@@ -40,7 +42,6 @@ function makeSignInCaller(caller, objPath) {
|
|
|
40
42
|
useExistingStorage: useExistingStorage.makeCaller(caller, objPath)
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
|
-
exports.makeSignInCaller = makeSignInCaller;
|
|
44
45
|
function wrapSignUpCAP(cap) {
|
|
45
46
|
return {
|
|
46
47
|
setSignUpServer: setSignUpServer.wrapService(cap.setSignUpServer),
|
|
@@ -51,7 +52,6 @@ function wrapSignUpCAP(cap) {
|
|
|
51
52
|
isActivated: isActivated.wrapService(cap.isActivated)
|
|
52
53
|
};
|
|
53
54
|
}
|
|
54
|
-
exports.wrapSignUpCAP = wrapSignUpCAP;
|
|
55
55
|
function makeSignUpCaller(caller, objPath) {
|
|
56
56
|
return {
|
|
57
57
|
setSignUpServer: setSignUpServer.makeCaller(caller, objPath),
|
|
@@ -62,7 +62,6 @@ function makeSignUpCaller(caller, objPath) {
|
|
|
62
62
|
isActivated: isActivated.makeCaller(caller, objPath)
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
exports.makeSignUpCaller = makeSignUpCaller;
|
|
66
65
|
var setSignUpServer;
|
|
67
66
|
(function (setSignUpServer) {
|
|
68
67
|
const requestType = protobuf_type_1.ProtoType.for(startup_proto_1.startup.SetSignUpServerRequestBody);
|
|
@@ -16,7 +16,18 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.readJSONInfoFileIn = readJSONInfoFileIn;
|
|
20
|
+
exports.addBaseToDiffLinkInVersInfo = addBaseToDiffLinkInVersInfo;
|
|
21
|
+
exports.isVersionIn = isVersionIn;
|
|
22
|
+
exports.rmNonArchVersionsIn = rmNonArchVersionsIn;
|
|
23
|
+
exports.rmArchVersionFrom = rmArchVersionFrom;
|
|
24
|
+
exports.setCurrentVersionIn = setCurrentVersionIn;
|
|
25
|
+
exports.rmCurrentVersionIn = rmCurrentVersionIn;
|
|
26
|
+
exports.rmVersionIn = rmVersionIn;
|
|
27
|
+
exports.nonGarbageVersionsIn = nonGarbageVersionsIn;
|
|
28
|
+
exports.addWithBasesTo = addWithBasesTo;
|
|
29
|
+
exports.addArchived = addArchived;
|
|
30
|
+
exports.isEmptyVersions = isEmptyVersions;
|
|
20
31
|
const fs = require("../../../lib-common/async-fs-node");
|
|
21
32
|
const path_1 = require("path");
|
|
22
33
|
const exceptions_1 = require("../../../lib-client/3nstorage/exceptions");
|
|
@@ -41,7 +52,6 @@ async function readJSONInfoFileIn(objFolder, fileName) {
|
|
|
41
52
|
});
|
|
42
53
|
}
|
|
43
54
|
}
|
|
44
|
-
exports.readJSONInfoFileIn = readJSONInfoFileIn;
|
|
45
55
|
/**
|
|
46
56
|
* This function adds base->diff link to given versions info.
|
|
47
57
|
* @param versions
|
|
@@ -55,7 +65,6 @@ function addBaseToDiffLinkInVersInfo(versions, diffVer, baseVer) {
|
|
|
55
65
|
versions.diffToBase[diffVer] = baseVer;
|
|
56
66
|
versions.baseToDiff[baseVer] = diffVer;
|
|
57
67
|
}
|
|
58
|
-
exports.addBaseToDiffLinkInVersInfo = addBaseToDiffLinkInVersInfo;
|
|
59
68
|
function isVersionIn(version, vers) {
|
|
60
69
|
if (vers.current === version) {
|
|
61
70
|
return true;
|
|
@@ -65,7 +74,6 @@ function isVersionIn(version, vers) {
|
|
|
65
74
|
}
|
|
66
75
|
return false;
|
|
67
76
|
}
|
|
68
|
-
exports.isVersionIn = isVersionIn;
|
|
69
77
|
/**
|
|
70
78
|
* This function removes given version from versions info, if it is neither
|
|
71
79
|
* archived, nor is a base for another version. If given version is itself
|
|
@@ -89,7 +97,6 @@ function rmNonArchVersionsIn(versions, ver) {
|
|
|
89
97
|
rmNonArchVersionsIn(versions, base);
|
|
90
98
|
}
|
|
91
99
|
}
|
|
92
|
-
exports.rmNonArchVersionsIn = rmNonArchVersionsIn;
|
|
93
100
|
function rmArchVersionFrom(versions, ver) {
|
|
94
101
|
if (!versions.archived) {
|
|
95
102
|
return false;
|
|
@@ -105,7 +112,6 @@ function rmArchVersionFrom(versions, ver) {
|
|
|
105
112
|
rmNonArchVersionsIn(versions, ver);
|
|
106
113
|
return true;
|
|
107
114
|
}
|
|
108
|
-
exports.rmArchVersionFrom = rmArchVersionFrom;
|
|
109
115
|
function setCurrentVersionIn(versions, version, baseVer) {
|
|
110
116
|
if (baseVer !== undefined) {
|
|
111
117
|
// base->diff links should be added before removals
|
|
@@ -117,7 +123,6 @@ function setCurrentVersionIn(versions, version, baseVer) {
|
|
|
117
123
|
}
|
|
118
124
|
versions.current = version;
|
|
119
125
|
}
|
|
120
|
-
exports.setCurrentVersionIn = setCurrentVersionIn;
|
|
121
126
|
function rmCurrentVersionIn(versions) {
|
|
122
127
|
const current = versions.current;
|
|
123
128
|
if (typeof current === 'number') {
|
|
@@ -126,7 +131,6 @@ function rmCurrentVersionIn(versions) {
|
|
|
126
131
|
}
|
|
127
132
|
return current;
|
|
128
133
|
}
|
|
129
|
-
exports.rmCurrentVersionIn = rmCurrentVersionIn;
|
|
130
134
|
function rmVersionIn(version, vers) {
|
|
131
135
|
if (vers.current === version) {
|
|
132
136
|
vers.current = undefined;
|
|
@@ -136,7 +140,6 @@ function rmVersionIn(version, vers) {
|
|
|
136
140
|
rmArchVersionFrom(vers, version);
|
|
137
141
|
}
|
|
138
142
|
}
|
|
139
|
-
exports.rmVersionIn = rmVersionIn;
|
|
140
143
|
function nonGarbageVersionsIn(versions) {
|
|
141
144
|
const nonGarbage = new Set();
|
|
142
145
|
addWithBasesTo(nonGarbage, versions.current, versions);
|
|
@@ -147,7 +150,6 @@ function nonGarbageVersionsIn(versions) {
|
|
|
147
150
|
}
|
|
148
151
|
return nonGarbage;
|
|
149
152
|
}
|
|
150
|
-
exports.nonGarbageVersionsIn = nonGarbageVersionsIn;
|
|
151
153
|
function addWithBasesTo(nonGarbage, ver, versions) {
|
|
152
154
|
while (typeof ver === 'number') {
|
|
153
155
|
if (nonGarbage.has(ver)) {
|
|
@@ -160,7 +162,6 @@ function addWithBasesTo(nonGarbage, ver, versions) {
|
|
|
160
162
|
ver = versions.diffToBase[ver];
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
|
-
exports.addWithBasesTo = addWithBasesTo;
|
|
164
165
|
function addArchived(versions, version) {
|
|
165
166
|
if (!versions.archived) {
|
|
166
167
|
versions.archived = [];
|
|
@@ -172,7 +173,6 @@ function addArchived(versions, version) {
|
|
|
172
173
|
versions.archived.sort();
|
|
173
174
|
return true;
|
|
174
175
|
}
|
|
175
|
-
exports.addArchived = addArchived;
|
|
176
176
|
function isEmptyVersions(versions) {
|
|
177
177
|
if (versions.current) {
|
|
178
178
|
return false;
|
|
@@ -188,5 +188,4 @@ function isEmptyVersions(versions) {
|
|
|
188
188
|
return true;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
exports.isEmptyVersions = isEmptyVersions;
|
|
192
191
|
Object.freeze(exports);
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.getAndRemoveOneFrom = getAndRemoveOneFrom;
|
|
20
|
+
exports.noop = noop;
|
|
20
21
|
function getAndRemoveOneFrom(set) {
|
|
21
22
|
const iter = set.values();
|
|
22
23
|
const { value, done } = iter.next();
|
|
@@ -26,7 +27,5 @@ function getAndRemoveOneFrom(set) {
|
|
|
26
27
|
set.delete(value);
|
|
27
28
|
return value;
|
|
28
29
|
}
|
|
29
|
-
exports.getAndRemoveOneFrom = getAndRemoveOneFrom;
|
|
30
30
|
function noop() { }
|
|
31
|
-
exports.noop = noop;
|
|
32
31
|
Object.freeze(exports);
|
|
@@ -7,9 +7,9 @@ import { AsyncSBoxCryptor } from 'xsp-files';
|
|
|
7
7
|
import { StoragePathForUser } from '../app-files';
|
|
8
8
|
import { LogError } from '../../lib-client/logging/log-to-file';
|
|
9
9
|
import { MakeNet } from '..';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
type WritableFS = web3n.files.WritableFS;
|
|
11
|
+
type StorageType = web3n.storage.StorageType;
|
|
12
|
+
type FSItem = web3n.files.FSItem;
|
|
13
13
|
export declare class Storages implements FactoryOfFSs {
|
|
14
14
|
private cryptor;
|
|
15
15
|
private storageDirForUser;
|
|
@@ -49,8 +49,8 @@ export interface FactoryOfFSs {
|
|
|
49
49
|
getSysFSs(type: StorageType): Promise<FSItem>;
|
|
50
50
|
}
|
|
51
51
|
export declare function reverseDomain(domain: string): string;
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
type Service = web3n.storage.Service;
|
|
53
|
+
type StoragePolicy = web3n.caps.common.StoragePolicy;
|
|
54
54
|
export declare class PerAppStorage {
|
|
55
55
|
private readonly appFSsFactory;
|
|
56
56
|
private readonly policy;
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.PerAppStorage = exports.
|
|
19
|
+
exports.PerAppStorage = exports.Storages = void 0;
|
|
20
|
+
exports.reverseDomain = reverseDomain;
|
|
20
21
|
const fs_1 = require("../../lib-client/3nstorage/xsp-fs/fs");
|
|
21
22
|
const storage_1 = require("./synced/storage");
|
|
22
23
|
const storage_2 = require("./local/storage");
|
|
@@ -362,7 +363,6 @@ Object.freeze(Storages);
|
|
|
362
363
|
function reverseDomain(domain) {
|
|
363
364
|
return domain.split('.').reverse().join('.');
|
|
364
365
|
}
|
|
365
|
-
exports.reverseDomain = reverseDomain;
|
|
366
366
|
class PerAppStorage {
|
|
367
367
|
constructor(appFSsFactory, appDomain, policy) {
|
|
368
368
|
this.appFSsFactory = appFSsFactory;
|
|
@@ -2,9 +2,9 @@ import { Storage, NodesContainer, StorageGetter, ObjId, NodeEvent, LocalObjStatu
|
|
|
2
2
|
import { LogError } from '../../../lib-client/logging/log-to-file';
|
|
3
3
|
import { AsyncSBoxCryptor, Subscribe, ObjSource } from 'xsp-files';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type FolderEvent = web3n.files.FolderEvent;
|
|
6
|
+
type FileEvent = web3n.files.FileEvent;
|
|
7
|
+
type FSType = web3n.files.FSType;
|
|
8
8
|
export declare class LocalStorage implements Storage {
|
|
9
9
|
private readonly files;
|
|
10
10
|
private readonly getStorages;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExposedObj, Caller, ExposedServices } from '../../ipc-via-protobuf/connector';
|
|
2
|
-
|
|
2
|
+
type Storage = web3n.storage.Service;
|
|
3
3
|
export declare function exposeStorageCAP(cap: Storage, expServices: ExposedServices): ExposedObj<Storage>;
|
|
4
4
|
export declare function makeStorageCaller(caller: Caller, objPath: string[]): Storage;
|
|
5
5
|
export declare function promiseStorageCaller(caller: Caller, objPath: string[]): Promise<Storage>;
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.exposeStorageCAP = exposeStorageCAP;
|
|
20
|
+
exports.makeStorageCaller = makeStorageCaller;
|
|
21
|
+
exports.promiseStorageCaller = promiseStorageCaller;
|
|
20
22
|
const protobuf_msg_1 = require("../../ipc-via-protobuf/protobuf-msg");
|
|
21
23
|
const fs_1 = require("../../core-ipc/fs");
|
|
22
24
|
const protobuf_type_1 = require("../../lib-client/protobuf-type");
|
|
@@ -34,17 +36,14 @@ function exposeStorageCAP(cap, expServices) {
|
|
|
34
36
|
}
|
|
35
37
|
return wrap;
|
|
36
38
|
}
|
|
37
|
-
exports.exposeStorageCAP = exposeStorageCAP;
|
|
38
39
|
function makeStorageCaller(caller, objPath) {
|
|
39
40
|
const lstStorageCAP = caller.listObj(objPath);
|
|
40
41
|
return instantiateStorageCaller(caller, lstStorageCAP, objPath);
|
|
41
42
|
}
|
|
42
|
-
exports.makeStorageCaller = makeStorageCaller;
|
|
43
43
|
async function promiseStorageCaller(caller, objPath) {
|
|
44
44
|
const lstStorageCAP = (await caller.listObjAsync(objPath));
|
|
45
45
|
return instantiateStorageCaller(caller, lstStorageCAP, objPath);
|
|
46
46
|
}
|
|
47
|
-
exports.promiseStorageCaller = promiseStorageCaller;
|
|
48
47
|
function instantiateStorageCaller(caller, lstStorageCAP, objPath) {
|
|
49
48
|
const sysFS = lstStorageCAP.includes('getSysFS');
|
|
50
49
|
const userFS = lstStorageCAP.includes('getUserFS');
|