core-3nweb-client-lib 0.34.2 → 0.35.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.
- package/build/api-defs/asmail.d.ts +70 -5
- package/build/api-defs/common-caps.d.ts +3 -0
- package/build/api-defs/keys.d.ts +154 -0
- package/build/api-defs/mailerid.d.ts +8 -0
- package/build/api-defs/web3n.d.ts +1 -0
- package/build/core/asmail/asmail-cap-ipc.js +20 -1
- package/build/core/asmail/config.d.ts +16 -0
- package/build/core/asmail/config.js +43 -0
- package/build/core/asmail/delivery/common.d.ts +2 -2
- package/build/core/asmail/delivery/common.js +2 -1
- package/build/core/asmail/delivery/index.d.ts +2 -1
- package/build/core/asmail/delivery/index.js +4 -1
- package/build/core/asmail/delivery/per-recipient-wip.js +1 -1
- package/build/core/asmail/inbox/attachments/fs.d.ts +1 -1
- package/build/core/asmail/inbox/attachments/fs.js +2 -2
- package/build/core/asmail/inbox/index.d.ts +6 -6
- package/build/core/asmail/inbox/index.js +1 -1
- package/build/core/asmail/inbox/msg-indexing/index.d.ts +1 -1
- package/build/core/asmail/inbox/msg-indexing/logs-n-entries.d.ts +1 -1
- package/build/core/asmail/index.d.ts +4 -4
- package/build/core/asmail/index.js +11 -22
- package/build/core/asmail/key-verification.d.ts +5 -4
- package/build/core/asmail/key-verification.js +2 -1
- package/build/core/asmail/msg/common.d.ts +5 -4
- package/build/core/asmail/msg/opener.d.ts +4 -4
- package/build/core/asmail/msg/opener.js +1 -1
- package/build/core/asmail/msg/packer.d.ts +3 -3
- package/build/core/asmail/msg/packer.js +2 -2
- package/build/core/asmail/sending-params/index.d.ts +7 -6
- package/build/core/asmail/sending-params/index.js +21 -12
- package/build/core/asmail/sending-params/invitations-anon.d.ts +35 -0
- package/build/core/asmail/sending-params/invitations-anon.js +164 -0
- package/build/core/asmail/sending-params/own-params.d.ts +10 -19
- package/build/core/asmail/sending-params/own-params.js +27 -20
- package/build/core/asmail/sending-params/params-from-others.d.ts +7 -11
- package/build/core/asmail/sending-params/params-from-others.js +32 -23
- package/build/core/id-manager/index.d.ts +1 -1
- package/build/core/id-manager/key-storage.d.ts +1 -1
- package/build/core/index.d.ts +3 -0
- package/build/core/index.js +39 -11
- package/build/core/{asmail/keyring → keyring}/common.d.ts +3 -1
- package/build/core/{asmail/keyring → keyring}/common.js +2 -2
- package/build/core/{asmail/keyring → keyring}/correspondent-keys.d.ts +5 -3
- package/build/core/{asmail/keyring → keyring}/correspondent-keys.js +5 -5
- package/build/core/keyring/index.d.ts +72 -0
- package/build/core/{asmail/keyring → keyring}/index.js +68 -59
- package/build/core/{asmail/keyring → keyring}/keyring-storage.js +1 -1
- package/build/core/keyring/keyrings-cap-ipc.d.ts +5 -0
- package/build/core/keyring/keyrings-cap-ipc.js +50 -0
- package/build/core/keyring/published-intro-key.d.ts +43 -0
- package/build/core/keyring/published-intro-key.js +176 -0
- package/build/core/startup/sign-up.d.ts +1 -1
- package/build/core/storage/common/constants.d.ts +4 -0
- package/build/core/storage/common/constants.js +24 -0
- package/build/core/storage/common/obj-info-file.js +1 -1
- package/build/core/storage/index.d.ts +7 -1
- package/build/core/storage/index.js +33 -3
- package/build/core/storage/local/obj-files.d.ts +1 -1
- package/build/core/storage/local/obj-status.d.ts +1 -1
- package/build/core/storage/local/obj-status.js +1 -1
- package/build/core/storage/local/storage.d.ts +1 -1
- package/build/core/storage/local/storage.js +2 -2
- package/build/core/storage/synced/downloader.d.ts +2 -2
- package/build/core/storage/synced/obj-files.d.ts +3 -3
- package/build/core/storage/synced/obj-files.js +1 -1
- package/build/core/storage/synced/obj-status.d.ts +1 -1
- package/build/core/storage/synced/obj-status.js +1 -1
- package/build/core/storage/synced/remote-events.d.ts +2 -2
- package/build/core/storage/synced/storage.d.ts +2 -2
- package/build/core/storage/synced/storage.js +5 -5
- package/build/core/storage/synced/upload-header-file.d.ts +1 -1
- package/build/core/storage/synced/upsyncer.d.ts +1 -1
- package/build/core/storage/synced/upsyncer.js +1 -1
- package/build/core-ipc/common-caps.js +4 -0
- package/build/lib-client/3nstorage/{service.d.ts → storage-owner.d.ts} +1 -4
- package/build/lib-client/3nstorage/{service.js → storage-owner.js} +21 -25
- package/build/lib-client/asmail/recipient.d.ts +0 -3
- package/build/lib-client/asmail/recipient.js +19 -17
- package/build/lib-client/asmail/service-config.d.ts +9 -5
- package/build/lib-client/asmail/service-config.js +42 -17
- package/build/lib-client/cryptor/cryptor-in-worker.js +1 -1
- package/build/lib-client/cryptor/in-proc-js.js +1 -1
- package/build/lib-client/cryptor/in-proc-wasm.js +1 -1
- package/build/lib-client/fs-utils/fs-sync-utils.js +1 -1
- package/build/lib-client/key-derivation.d.ts +2 -1
- package/build/lib-client/objs-on-disk/obj-folders.d.ts +1 -1
- package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +1 -1
- package/build/lib-client/request-utils.js +4 -2
- package/build/lib-client/service-locator.d.ts +2 -1
- package/build/lib-client/user-with-mid-session.d.ts +6 -5
- package/build/lib-client/user-with-mid-session.js +4 -4
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/attrs.js +3 -3
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/common.d.ts +2 -2
- package/build/lib-client/{3nstorage → xsp-fs}/exceptions.d.ts +1 -1
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/file-node.d.ts +1 -1
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/file-node.js +4 -4
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/file.d.ts +1 -1
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/file.js +5 -5
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/folder-node-serialization.js +3 -3
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/folder-node.d.ts +1 -1
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/folder-node.js +9 -9
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/fs.d.ts +1 -1
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/fs.js +6 -6
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/link-node.d.ts +1 -1
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/link-node.js +2 -2
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/node-in-fs.js +6 -6
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/node-persistence.js +4 -4
- package/build/lib-client/{3nstorage → xsp-fs}/util/file-based-json.d.ts +10 -4
- package/build/lib-client/{3nstorage → xsp-fs}/util/file-based-json.js +33 -15
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/xsp-payload-v1.js +3 -3
- package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/xsp-payload-v2.js +5 -5
- package/build/lib-common/jwkeys.d.ts +6 -106
- package/build/lib-common/mid-sigs-NaCl-Ed.d.ts +4 -1
- package/build/lib-common/service-api/asmail/config.d.ts +9 -30
- package/build/lib-common/service-api/asmail/config.js +4 -1
- package/build/lib-common/service-api/asmail/delivery.d.ts +5 -12
- package/build/lib-common/service-api/asmail/delivery.js +3 -0
- package/build/lib-common/service-api/mailer-id/login.d.ts +3 -6
- package/build/lib-common/service-api/mailer-id/provisioning.d.ts +6 -7
- package/build/lib-common/service-api/mailer-id/provisioning.js +3 -0
- package/build/lib-common/user-admin-api/signup.d.ts +2 -1
- package/build/raw-3nweb-clients.d.ts +1 -1
- package/build/raw-3nweb-clients.js +2 -2
- package/package.json +2 -2
- package/build/core/asmail/config/common.d.ts +0 -24
- package/build/core/asmail/config/common.js +0 -87
- package/build/core/asmail/config/index.d.ts +0 -47
- package/build/core/asmail/config/index.js +0 -69
- package/build/core/asmail/config/invitations-anon.d.ts +0 -13
- package/build/core/asmail/config/invitations-anon.js +0 -99
- package/build/core/asmail/config/published-intro-key.d.ts +0 -17
- package/build/core/asmail/config/published-intro-key.js +0 -104
- package/build/core/asmail/keyring/index.d.ts +0 -36
- /package/build/core/{asmail/keyring → keyring}/id-to-email-map.d.ts +0 -0
- /package/build/core/{asmail/keyring → keyring}/id-to-email-map.js +0 -0
- /package/build/core/{asmail/keyring → keyring}/keyring-storage.d.ts +0 -0
- /package/build/lib-client/{cryptor-work-labels.d.ts → cryptor/cryptor-work-labels.d.ts} +0 -0
- /package/build/lib-client/{cryptor-work-labels.js → cryptor/cryptor-work-labels.js} +0 -0
- /package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/attrs.d.ts +0 -0
- /package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/common.js +0 -0
- /package/build/lib-client/{3nstorage → xsp-fs}/exceptions.js +0 -0
- /package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/folder-node-serialization.d.ts +0 -0
- /package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/node-in-fs.d.ts +0 -0
- /package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/node-persistence.d.ts +0 -0
- /package/build/lib-client/{3nstorage → xsp-fs}/util/for-arrays.d.ts +0 -0
- /package/build/lib-client/{3nstorage → xsp-fs}/util/for-arrays.js +0 -0
- /package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/xsp-payload-v1.d.ts +0 -0
- /package/build/lib-client/{3nstorage/xsp-fs → xsp-fs}/xsp-payload-v2.d.ts +0 -0
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.LocalStorage = void 0;
|
|
20
|
-
const common_1 = require("../../../lib-client/
|
|
21
|
-
const exceptions_1 = require("../../../lib-client/
|
|
20
|
+
const common_1 = require("../../../lib-client/xsp-fs/common");
|
|
21
|
+
const exceptions_1 = require("../../../lib-client/xsp-fs/exceptions");
|
|
22
22
|
const random_node_1 = require("../../../lib-common/random-node");
|
|
23
23
|
const ecma_nacl_1 = require("ecma-nacl");
|
|
24
24
|
const buffer_utils_1 = require("../../../lib-common/buffer-utils");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StorageOwner } from '../../../lib-client/3nstorage/
|
|
2
|
-
import { ObjId } from '../../../lib-client/
|
|
1
|
+
import { StorageOwner } from '../../../lib-client/3nstorage/storage-owner';
|
|
2
|
+
import { ObjId } from '../../../lib-client/xsp-fs/common';
|
|
3
3
|
import { ObjDownloader, InitDownloadParts } from '../../../lib-client/objs-on-disk/obj-on-disk';
|
|
4
4
|
import { Layout } from 'xsp-files';
|
|
5
5
|
export declare class Downloader implements ObjDownloader {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ObjId, SyncedObjStatus } from '../../../lib-client/
|
|
2
|
+
import { ObjId, SyncedObjStatus } from '../../../lib-client/xsp-fs/common';
|
|
3
3
|
import { InitDownloadParts } from '../../../lib-client/objs-on-disk/obj-on-disk';
|
|
4
4
|
import { ObjSource, Subscribe } from 'xsp-files';
|
|
5
5
|
import { Downloader } from './downloader';
|
|
@@ -9,8 +9,8 @@ import { ObjStatus } from './obj-status';
|
|
|
9
9
|
import { LogError } from '../../../lib-client/logging/log-to-file';
|
|
10
10
|
import { DiffInfo } from '../../../lib-common/service-api/3nstorage/owner';
|
|
11
11
|
import { FiniteChunk } from '../../../lib-common/objs-on-disk/file-layout';
|
|
12
|
-
import { StorageOwner as RemoteStorage } from '../../../lib-client/3nstorage/
|
|
13
|
-
import { UploadHeaderChange } from '../../../lib-client/
|
|
12
|
+
import { StorageOwner as RemoteStorage } from '../../../lib-client/3nstorage/storage-owner';
|
|
13
|
+
import { UploadHeaderChange } from '../../../lib-client/xsp-fs/common';
|
|
14
14
|
export declare const UNSYNCED_FILE_NAME_EXT = "unsynced";
|
|
15
15
|
export declare const REMOTE_FILE_NAME_EXT = "v";
|
|
16
16
|
/**
|
|
@@ -32,7 +32,7 @@ const obj_status_1 = require("./obj-status");
|
|
|
32
32
|
const timed_cache_1 = require("../../../lib-common/timed-cache");
|
|
33
33
|
const upload_header_file_1 = require("./upload-header-file");
|
|
34
34
|
const utils_1 = require("../common/utils");
|
|
35
|
-
const exceptions_1 = require("../../../lib-client/
|
|
35
|
+
const exceptions_1 = require("../../../lib-client/xsp-fs/exceptions");
|
|
36
36
|
exports.UNSYNCED_FILE_NAME_EXT = 'unsynced';
|
|
37
37
|
exports.REMOTE_FILE_NAME_EXT = 'v';
|
|
38
38
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ObjId, SyncedObjStatus } from '../../../lib-client/
|
|
1
|
+
import { ObjId, SyncedObjStatus } from '../../../lib-client/xsp-fs/common';
|
|
2
2
|
import { NonGarbageVersions, VersionsInfo } from '../common/obj-info-file';
|
|
3
3
|
import { LogError } from '../../../lib-client/logging/log-to-file';
|
|
4
4
|
import { DiffInfo, ObjStatus as RemoteObjStatus } from '../../../lib-common/service-api/3nstorage/owner';
|
|
@@ -19,7 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
exports.ObjStatus = exports.STATUS_FILE_NAME = void 0;
|
|
20
20
|
exports.readAndCheckStatus = readAndCheckStatus;
|
|
21
21
|
const path_1 = require("path");
|
|
22
|
-
const exceptions_1 = require("../../../lib-client/
|
|
22
|
+
const exceptions_1 = require("../../../lib-client/xsp-fs/exceptions");
|
|
23
23
|
const json_saving_1 = require("../common/json-saving");
|
|
24
24
|
const obj_info_file_1 = require("../common/obj-info-file");
|
|
25
25
|
const assert_1 = require("../../../lib-common/assert");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { StorageOwner } from '../../../lib-client/3nstorage/
|
|
1
|
+
import { StorageOwner } from '../../../lib-client/3nstorage/storage-owner';
|
|
2
2
|
import { ObjFiles } from './obj-files';
|
|
3
|
-
import { Storage } from '../../../lib-client/
|
|
3
|
+
import { Storage } from '../../../lib-client/xsp-fs/common';
|
|
4
4
|
import { LogError } from '../../../lib-client/logging/log-to-file';
|
|
5
5
|
/**
|
|
6
6
|
* Remote events are absorbed into objects' statuses, broadcasting respective
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { IGetMailerIdSigner } from '../../../lib-client/user-with-mid-session';
|
|
2
|
-
import { SyncedStorage as ISyncedStorage, NodesContainer, Storage as IStorage, StorageGetter, ObjId, NodeEvent, SyncedObjStatus } from '../../../lib-client/
|
|
2
|
+
import { SyncedStorage as ISyncedStorage, NodesContainer, Storage as IStorage, StorageGetter, ObjId, NodeEvent, SyncedObjStatus } from '../../../lib-client/xsp-fs/common';
|
|
3
3
|
import { ScryptGenParams } from '../../../lib-client/key-derivation';
|
|
4
4
|
import { LogError } from '../../../lib-client/logging/log-to-file';
|
|
5
5
|
import { AsyncSBoxCryptor, Subscribe, ObjSource } from 'xsp-files';
|
|
6
6
|
import { NetClient } from '../../../lib-client/request-utils';
|
|
7
7
|
import { Observable } from 'rxjs';
|
|
8
|
-
import { UploadHeaderChange } from '../../../lib-client/
|
|
8
|
+
import { UploadHeaderChange } from '../../../lib-client/xsp-fs/common';
|
|
9
9
|
type FolderEvent = web3n.files.FolderEvent;
|
|
10
10
|
type FileEvent = web3n.files.FileEvent;
|
|
11
11
|
type SyncStatus = web3n.files.SyncStatus;
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.SyncedStore = void 0;
|
|
20
|
-
const common_1 = require("../../../lib-client/
|
|
21
|
-
const exceptions_1 = require("../../../lib-client/
|
|
22
|
-
const
|
|
20
|
+
const common_1 = require("../../../lib-client/xsp-fs/common");
|
|
21
|
+
const exceptions_1 = require("../../../lib-client/xsp-fs/exceptions");
|
|
22
|
+
const storage_owner_1 = require("../../../lib-client/3nstorage/storage-owner");
|
|
23
23
|
const obj_files_1 = require("./obj-files");
|
|
24
24
|
const random_node_1 = require("../../../lib-common/random-node");
|
|
25
25
|
const buffer_utils_1 = require("../../../lib-common/buffer-utils");
|
|
@@ -44,7 +44,7 @@ class SyncedStore {
|
|
|
44
44
|
Object.seal(this);
|
|
45
45
|
}
|
|
46
46
|
static async makeAndStart(path, user, getSigner, getStorages, cryptor, remoteServiceUrl, net, logError) {
|
|
47
|
-
const remote =
|
|
47
|
+
const remote = storage_owner_1.StorageOwner.make(user, getSigner, remoteServiceUrl, net);
|
|
48
48
|
const objFiles = await obj_files_1.ObjFiles.makeFor(path, remote, logError);
|
|
49
49
|
const s = new SyncedStore(objFiles, remote, getStorages, cryptor, logError);
|
|
50
50
|
s.uploader.start();
|
|
@@ -56,7 +56,7 @@ class SyncedStore {
|
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
58
|
static async makeAndStartWithoutRemote(path, user, getStorages, cryptor, remoteServiceUrl, net, logError) {
|
|
59
|
-
const { remote, setMid } =
|
|
59
|
+
const { remote, setMid } = storage_owner_1.StorageOwner.makeBeforeMidSetup(user, remoteServiceUrl, net);
|
|
60
60
|
const objFiles = await obj_files_1.ObjFiles.makeFor(path, remote, logError);
|
|
61
61
|
const s = new SyncedStore(objFiles, remote, getStorages, cryptor, logError);
|
|
62
62
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UploadHeaderChange } from "../../../lib-client/
|
|
1
|
+
import { UploadHeaderChange } from "../../../lib-client/xsp-fs/common";
|
|
2
2
|
export declare const UPLOAD_HEADER_FILE_NAME_EXT = "upload";
|
|
3
3
|
export declare function saveUploadHeaderFile(objFolder: string, headers: UploadHeaderChange): Promise<void>;
|
|
4
4
|
export declare function readUploadHeaderFromFile(objFolder: string, uploadVersion: number): Promise<UploadHeaderChange | undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StorageOwner } from "../../../lib-client/3nstorage/
|
|
1
|
+
import { StorageOwner } from "../../../lib-client/3nstorage/storage-owner";
|
|
2
2
|
import { SyncedObj } from "./obj-files";
|
|
3
3
|
import { MonoTypeOperatorFunction } from "rxjs";
|
|
4
4
|
import { FileWrite } from "../../../lib-client/objs-on-disk/file-writing-proc";
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.UpSyncer = void 0;
|
|
20
20
|
const labelled_exec_pools_1 = require("../../../lib-common/processes/labelled-exec-pools");
|
|
21
|
-
const exceptions_1 = require("../../../lib-client/
|
|
21
|
+
const exceptions_1 = require("../../../lib-client/xsp-fs/exceptions");
|
|
22
22
|
const assert_1 = require("../../../lib-common/assert");
|
|
23
23
|
const deferred_1 = require("../../../lib-common/processes/deferred");
|
|
24
24
|
const buffer_utils_1 = require("../../../lib-common/buffer-utils");
|
|
@@ -25,12 +25,14 @@ const asmail_cap_ipc_1 = require("../core/asmail/asmail-cap-ipc");
|
|
|
25
25
|
const storage_cap_ipc_1 = require("../core/storage/storage-cap-ipc");
|
|
26
26
|
const mailerid_cap_ipc_1 = require("../core/id-manager/mailerid-cap-ipc");
|
|
27
27
|
const generic_1 = require("./generic");
|
|
28
|
+
const keyrings_cap_ipc_1 = require("../core/keyring/keyrings-cap-ipc");
|
|
28
29
|
function exposeW3N(coreSide, w3n, extraCAPs) {
|
|
29
30
|
const commonCAPsExposures = {
|
|
30
31
|
log: log_cap_1.exposeLogger,
|
|
31
32
|
mail: asmail_cap_ipc_1.exposeASMailCAP,
|
|
32
33
|
mailerid: mailerid_cap_ipc_1.exposeMailerIdCAP,
|
|
33
34
|
storage: storage_cap_ipc_1.exposeStorageCAP,
|
|
35
|
+
keyrings: keyrings_cap_ipc_1.exposeKeyringsCAP,
|
|
34
36
|
};
|
|
35
37
|
(0, generic_1.exposeCAPs)(coreSide, w3n, commonCAPsExposures, extraCAPs);
|
|
36
38
|
}
|
|
@@ -43,6 +45,7 @@ function makeW3Nclient(clientSide, extraCAPs) {
|
|
|
43
45
|
mail: asmail_cap_ipc_1.makeASMailCaller,
|
|
44
46
|
mailerid: mailerid_cap_ipc_1.makeMailerIdCaller,
|
|
45
47
|
storage: storage_cap_ipc_1.makeStorageCaller,
|
|
48
|
+
keyrings: keyrings_cap_ipc_1.makeKeyringsCaller,
|
|
46
49
|
};
|
|
47
50
|
const clientW3N = (0, generic_1.makeClientSide)(clientSide, mainCAPs, extraCAPs);
|
|
48
51
|
addLogToConsoleToLogCap(clientW3N);
|
|
@@ -54,6 +57,7 @@ async function promiseW3Nclient(clientSide, extraCAPs) {
|
|
|
54
57
|
mail: asmail_cap_ipc_1.makeASMailCaller,
|
|
55
58
|
mailerid: mailerid_cap_ipc_1.makeMailerIdCaller,
|
|
56
59
|
storage: storage_cap_ipc_1.promiseStorageCaller,
|
|
60
|
+
keyrings: keyrings_cap_ipc_1.makeKeyringsCaller,
|
|
57
61
|
};
|
|
58
62
|
const clientW3N = await (0, generic_1.promiseClientSide)(clientSide, mainCAPs, extraCAPs);
|
|
59
63
|
addLogToConsoleToLogCap(clientW3N);
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This defines functions that implement 3NStorage protocol.
|
|
3
|
-
*/
|
|
4
1
|
import { NetClient } from '../request-utils';
|
|
5
2
|
import * as api from '../../lib-common/service-api/3nstorage/owner';
|
|
6
3
|
import { ServiceUser, IGetMailerIdSigner } from '../user-with-mid-session';
|
|
7
4
|
import * as keyGen from '../key-derivation';
|
|
8
5
|
import { SubscribingClient } from '../../lib-common/ipc/ws-ipc';
|
|
9
|
-
import { ObjId } from '
|
|
6
|
+
import { ObjId } from '../xsp-fs/common';
|
|
10
7
|
export type FirstSaveReqOpts = api.PutObjFirstQueryOpts;
|
|
11
8
|
export type FollowingSaveReqOpts = api.PutObjSecondQueryOpts;
|
|
12
9
|
export declare class StorageOwner extends ServiceUser {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright (C) 2015 - 2017, 2020, 2022 3NSoft Inc.
|
|
3
|
+
Copyright (C) 2015 - 2017, 2020, 2022, 2025 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
|
|
@@ -17,45 +17,31 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.StorageOwner = void 0;
|
|
20
|
-
/**
|
|
21
|
-
* This defines functions that implement 3NStorage protocol.
|
|
22
|
-
*/
|
|
23
20
|
const request_utils_1 = require("../request-utils");
|
|
24
21
|
const api = require("../../lib-common/service-api/3nstorage/owner");
|
|
25
22
|
const user_with_mid_session_1 = require("../user-with-mid-session");
|
|
26
23
|
const service_locator_1 = require("../service-locator");
|
|
27
24
|
const keyGen = require("../key-derivation");
|
|
28
|
-
const exceptions_1 = require("
|
|
25
|
+
const exceptions_1 = require("../xsp-fs/exceptions");
|
|
29
26
|
const ws_ipc_1 = require("../../lib-common/ipc/ws-ipc");
|
|
30
27
|
const assert_1 = require("../../lib-common/assert");
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
throw new Error(`Missing owner service url in 3NStorage information at ${serviceUrl}`);
|
|
37
|
-
}
|
|
38
|
-
return info.owner;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
28
|
+
const storageAccessParams = {
|
|
29
|
+
login: api.midLogin.MID_URL_PART,
|
|
30
|
+
logout: api.closeSession.URL_END,
|
|
31
|
+
canBeRedirected: true
|
|
32
|
+
};
|
|
41
33
|
class StorageOwner extends user_with_mid_session_1.ServiceUser {
|
|
42
|
-
constructor(user, getSigner,
|
|
43
|
-
super(user,
|
|
44
|
-
login: api.midLogin.MID_URL_PART,
|
|
45
|
-
logout: api.closeSession.URL_END,
|
|
46
|
-
canBeRedirected: true
|
|
47
|
-
}, getSigner, getInitServiceURI, net);
|
|
34
|
+
constructor(user, getSigner, mainUrlGetter, net) {
|
|
35
|
+
super(user, storageAccessParams, getSigner, serviceUriGetter(net, mainUrlGetter), net);
|
|
48
36
|
this.maxChunkSize = undefined;
|
|
49
37
|
Object.seal(this);
|
|
50
38
|
}
|
|
51
39
|
static make(user, getSigner, mainUrlGetter, net) {
|
|
52
|
-
const
|
|
53
|
-
const remote = new StorageOwner(user, getSigner, srvUriGetter, net);
|
|
40
|
+
const remote = new StorageOwner(user, getSigner, mainUrlGetter, net);
|
|
54
41
|
return remote;
|
|
55
42
|
}
|
|
56
43
|
static makeBeforeMidSetup(user, mainUrlGetter, net) {
|
|
57
|
-
const
|
|
58
|
-
const remote = new StorageOwner(user, undefined, srvUriGetter, net);
|
|
44
|
+
const remote = new StorageOwner(user, undefined, mainUrlGetter, net);
|
|
59
45
|
return {
|
|
60
46
|
remote,
|
|
61
47
|
setMid: getSigner => remote.setGetterOfSigner(getSigner)
|
|
@@ -356,4 +342,14 @@ class StorageOwner extends user_with_mid_session_1.ServiceUser {
|
|
|
356
342
|
exports.StorageOwner = StorageOwner;
|
|
357
343
|
Object.freeze(StorageOwner.prototype);
|
|
358
344
|
Object.freeze(StorageOwner);
|
|
345
|
+
function serviceUriGetter(net, mainUrlGetter) {
|
|
346
|
+
return async () => {
|
|
347
|
+
const serviceUrl = await mainUrlGetter();
|
|
348
|
+
const info = await (0, service_locator_1.storageInfoAt)(net, serviceUrl);
|
|
349
|
+
if (!info.owner) {
|
|
350
|
+
throw new Error(`Missing owner service url in 3NStorage information at ${serviceUrl}`);
|
|
351
|
+
}
|
|
352
|
+
return info.owner;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
359
355
|
Object.freeze(exports);
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This defines functions that implement ASMail reception protocol.
|
|
3
|
-
*/
|
|
4
1
|
import { NetClient } from '../request-utils';
|
|
5
2
|
import * as api from '../../lib-common/service-api/asmail/retrieval';
|
|
6
3
|
import { ServiceUser, IGetMailerIdSigner } from '../user-with-mid-session';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright (C) 2015, 2017 3NSoft Inc.
|
|
3
|
+
Copyright (C) 2015, 2017, 2025 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
|
|
@@ -13,15 +13,13 @@
|
|
|
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.MailRecipient = void 0;
|
|
19
20
|
exports.makeMsgNotFoundException = makeMsgNotFoundException;
|
|
20
21
|
exports.makeObjNotFoundException = makeObjNotFoundException;
|
|
21
22
|
exports.makeMsgIsBrokenException = makeMsgIsBrokenException;
|
|
22
|
-
/**
|
|
23
|
-
* This defines functions that implement ASMail reception protocol.
|
|
24
|
-
*/
|
|
25
23
|
const request_utils_1 = require("../request-utils");
|
|
26
24
|
const api = require("../../lib-common/service-api/asmail/retrieval");
|
|
27
25
|
const user_with_mid_session_1 = require("../user-with-mid-session");
|
|
@@ -55,20 +53,14 @@ function makeMsgIsBrokenException(msgId) {
|
|
|
55
53
|
};
|
|
56
54
|
return exc;
|
|
57
55
|
}
|
|
56
|
+
const inboxAccessParams = {
|
|
57
|
+
login: api.midLogin.MID_URL_PART,
|
|
58
|
+
logout: api.closeSession.URL_END,
|
|
59
|
+
canBeRedirected: true
|
|
60
|
+
};
|
|
58
61
|
class MailRecipient extends user_with_mid_session_1.ServiceUser {
|
|
59
62
|
constructor(user, getSigner, mainUrlGetter, net) {
|
|
60
|
-
super(user,
|
|
61
|
-
login: api.midLogin.MID_URL_PART,
|
|
62
|
-
logout: api.closeSession.URL_END,
|
|
63
|
-
canBeRedirected: true
|
|
64
|
-
}, getSigner, async () => {
|
|
65
|
-
const serviceUrl = await mainUrlGetter();
|
|
66
|
-
const info = await (0, service_locator_1.asmailInfoAt)(this.net, serviceUrl);
|
|
67
|
-
if (!info.retrieval) {
|
|
68
|
-
throw new Error(`Missing retrieval service url in ASMail information at ${serviceUrl}`);
|
|
69
|
-
}
|
|
70
|
-
return info.retrieval;
|
|
71
|
-
}, net);
|
|
63
|
+
super(user, inboxAccessParams, getSigner, serviceUriGetter(net, mainUrlGetter), net);
|
|
72
64
|
Object.seal(this);
|
|
73
65
|
}
|
|
74
66
|
getNet() {
|
|
@@ -213,4 +205,14 @@ class MailRecipient extends user_with_mid_session_1.ServiceUser {
|
|
|
213
205
|
exports.MailRecipient = MailRecipient;
|
|
214
206
|
Object.freeze(MailRecipient);
|
|
215
207
|
Object.freeze(MailRecipient.prototype);
|
|
208
|
+
function serviceUriGetter(net, mainUrlGetter) {
|
|
209
|
+
return async () => {
|
|
210
|
+
const serviceUrl = await mainUrlGetter();
|
|
211
|
+
const info = await (0, service_locator_1.asmailInfoAt)(net, serviceUrl);
|
|
212
|
+
if (!info.retrieval) {
|
|
213
|
+
throw new Error(`Missing retrieval service url in ASMail information at ${serviceUrl}`);
|
|
214
|
+
}
|
|
215
|
+
return info.retrieval;
|
|
216
|
+
};
|
|
217
|
+
}
|
|
216
218
|
Object.freeze(exports);
|
|
@@ -3,11 +3,15 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { NetClient } from '../request-utils';
|
|
5
5
|
import { ServiceUser, IGetMailerIdSigner } from '../user-with-mid-session';
|
|
6
|
+
type ASMailConfigParams = web3n.asmail.ASMailConfigParams;
|
|
7
|
+
export interface ParamOnServer<P extends keyof ASMailConfigParams> {
|
|
8
|
+
setOnServer: (value: ASMailConfigParams[P] | null) => Promise<void>;
|
|
9
|
+
getFromServer: () => Promise<ASMailConfigParams[P] | null>;
|
|
10
|
+
}
|
|
6
11
|
export declare class MailConfigurator extends ServiceUser {
|
|
7
|
-
paramsOnServer: {
|
|
8
|
-
[name: string]: any;
|
|
9
|
-
};
|
|
10
12
|
constructor(userId: string, getSigner: IGetMailerIdSigner, mainUrlGetter: () => Promise<string>, net: NetClient);
|
|
11
|
-
getParam<
|
|
12
|
-
setParam<
|
|
13
|
+
getParam<P extends keyof ASMailConfigParams>(param: P): Promise<ASMailConfigParams[P] | null>;
|
|
14
|
+
setParam<P extends keyof ASMailConfigParams>(param: P, value: ASMailConfigParams[P] | null): Promise<void>;
|
|
15
|
+
makeParamSetterAndGetter<P extends keyof ASMailConfigParams>(param: P): ParamOnServer<P>;
|
|
13
16
|
}
|
|
17
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright (C) 2015, 2020 3NSoft Inc.
|
|
3
|
+
Copyright (C) 2015, 2020, 2025 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
|
|
@@ -23,24 +23,18 @@ const request_utils_1 = require("../request-utils");
|
|
|
23
23
|
const api = require("../../lib-common/service-api/asmail/config");
|
|
24
24
|
const user_with_mid_session_1 = require("../user-with-mid-session");
|
|
25
25
|
const service_locator_1 = require("../service-locator");
|
|
26
|
+
const configAccessParams = {
|
|
27
|
+
login: api.midLogin.MID_URL_PART,
|
|
28
|
+
logout: api.closeSession.URL_END,
|
|
29
|
+
canBeRedirected: true
|
|
30
|
+
};
|
|
26
31
|
class MailConfigurator extends user_with_mid_session_1.ServiceUser {
|
|
27
32
|
constructor(userId, getSigner, mainUrlGetter, net) {
|
|
28
|
-
super(userId,
|
|
29
|
-
login: api.midLogin.MID_URL_PART,
|
|
30
|
-
logout: api.closeSession.URL_END,
|
|
31
|
-
canBeRedirected: true
|
|
32
|
-
}, getSigner, async () => {
|
|
33
|
-
const serviceUrl = await mainUrlGetter();
|
|
34
|
-
const info = await (0, service_locator_1.asmailInfoAt)(this.net, serviceUrl);
|
|
35
|
-
if (!info.config) {
|
|
36
|
-
throw new Error(`Missing configuration service url in ASMail information at ${serviceUrl}`);
|
|
37
|
-
}
|
|
38
|
-
return info.config;
|
|
39
|
-
}, net);
|
|
40
|
-
this.paramsOnServer = {};
|
|
33
|
+
super(userId, configAccessParams, getSigner, serviceUriGetter(net, mainUrlGetter), net);
|
|
41
34
|
Object.seal(this);
|
|
42
35
|
}
|
|
43
|
-
async getParam(
|
|
36
|
+
async getParam(param) {
|
|
37
|
+
const urlEnd = urlEndForParam(param);
|
|
44
38
|
const rep = await this.doBodylessSessionRequest({
|
|
45
39
|
appPath: urlEnd,
|
|
46
40
|
method: 'GET',
|
|
@@ -51,17 +45,48 @@ class MailConfigurator extends user_with_mid_session_1.ServiceUser {
|
|
|
51
45
|
}
|
|
52
46
|
return rep.data;
|
|
53
47
|
}
|
|
54
|
-
async setParam(
|
|
48
|
+
async setParam(param, value) {
|
|
49
|
+
const urlEnd = urlEndForParam(param);
|
|
55
50
|
const rep = await this.doJsonSessionRequest({
|
|
56
51
|
appPath: urlEnd,
|
|
57
52
|
method: 'PUT',
|
|
58
|
-
},
|
|
53
|
+
}, value);
|
|
59
54
|
if (rep.status !== api.PARAM_SC.ok) {
|
|
60
55
|
throw (0, request_utils_1.makeException)(rep, 'Unexpected status');
|
|
61
56
|
}
|
|
62
57
|
}
|
|
58
|
+
makeParamSetterAndGetter(param) {
|
|
59
|
+
return {
|
|
60
|
+
getFromServer: () => this.getParam(param),
|
|
61
|
+
setOnServer: value => this.setParam(param, value)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
63
64
|
}
|
|
64
65
|
exports.MailConfigurator = MailConfigurator;
|
|
65
66
|
Object.freeze(MailConfigurator.prototype);
|
|
66
67
|
Object.freeze(MailConfigurator);
|
|
68
|
+
function serviceUriGetter(net, mainUrlGetter) {
|
|
69
|
+
return async () => {
|
|
70
|
+
const serviceUrl = await mainUrlGetter();
|
|
71
|
+
const info = await (0, service_locator_1.asmailInfoAt)(net, serviceUrl);
|
|
72
|
+
if (!info.config) {
|
|
73
|
+
throw new Error(`Missing configuration service url in ASMail information at ${serviceUrl}`);
|
|
74
|
+
}
|
|
75
|
+
return info.config;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function urlEndForParam(param) {
|
|
79
|
+
switch (param) {
|
|
80
|
+
case 'anon-sender/invites':
|
|
81
|
+
case 'anon-sender/policy':
|
|
82
|
+
case 'auth-sender/blacklist':
|
|
83
|
+
case 'auth-sender/invites':
|
|
84
|
+
case 'auth-sender/policy':
|
|
85
|
+
case 'auth-sender/whitelist':
|
|
86
|
+
case 'init-pub-key':
|
|
87
|
+
return `param/${param}`;
|
|
88
|
+
default:
|
|
89
|
+
throw new Error(`Invalid ASMail server configuration parameter: ${param}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
67
92
|
Object.freeze(exports);
|
|
@@ -24,7 +24,7 @@ const error_1 = require("../../lib-common/exceptions/error");
|
|
|
24
24
|
const path_1 = require("path");
|
|
25
25
|
const assert_1 = require("../../lib-common/assert");
|
|
26
26
|
const serialization_for_wasm_1 = require("./serialization-for-wasm");
|
|
27
|
-
const cryptor_work_labels_1 = require("
|
|
27
|
+
const cryptor_work_labels_1 = require("./cryptor-work-labels");
|
|
28
28
|
const MAX_IDLE_MILLIS = 60 * 1000;
|
|
29
29
|
const jsWorkerFName = 'worker-js.js';
|
|
30
30
|
const wasmWorkerFName = 'worker-wasm.js';
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.makeInProcessCryptor = makeInProcessCryptor;
|
|
20
20
|
const ecma_nacl_1 = require("ecma-nacl");
|
|
21
|
-
const cryptor_work_labels_1 = require("
|
|
21
|
+
const cryptor_work_labels_1 = require("./cryptor-work-labels");
|
|
22
22
|
function onNextTick(f) {
|
|
23
23
|
return new Promise((resolve, reject) => process.nextTick(() => {
|
|
24
24
|
try {
|
|
@@ -25,7 +25,7 @@ const cryptor_proto_1 = require("../../protos/cryptor.proto");
|
|
|
25
25
|
const deferred_1 = require("../../lib-common/processes/deferred");
|
|
26
26
|
const assert_1 = require("../../lib-common/assert");
|
|
27
27
|
const error_1 = require("../../lib-common/exceptions/error");
|
|
28
|
-
const cryptor_work_labels_1 = require("
|
|
28
|
+
const cryptor_work_labels_1 = require("./cryptor-work-labels");
|
|
29
29
|
function wasmBytes() {
|
|
30
30
|
// There is a bug with electrons 12, 13, that doesn't let
|
|
31
31
|
// worker_thread read this file from asar pack, even though main thread
|
|
@@ -21,7 +21,7 @@ exports.getOrMakeAndUploadFolderIn = getOrMakeAndUploadFolderIn;
|
|
|
21
21
|
exports.uploadFolderChangesIfAny = uploadFolderChangesIfAny;
|
|
22
22
|
exports.observableFromTreeEvents = observableFromTreeEvents;
|
|
23
23
|
const rxjs_1 = require("rxjs");
|
|
24
|
-
const exceptions_1 = require("../
|
|
24
|
+
const exceptions_1 = require("../xsp-fs/exceptions");
|
|
25
25
|
async function getRemoteFolderChanges(fs, forceServerCheck = false) {
|
|
26
26
|
if (forceServerCheck) {
|
|
27
27
|
await fs.v.sync.updateStatusInfo('');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JsonKey } from '../lib-common/jwkeys';
|
|
2
1
|
import { Cryptor } from './cryptor/cryptor';
|
|
2
|
+
type JsonKey = web3n.keys.JsonKey;
|
|
3
3
|
export interface ScryptGenParams {
|
|
4
4
|
logN: number;
|
|
5
5
|
r: number;
|
|
@@ -12,3 +12,4 @@ export declare function deriveMidKeyPair(cryptor: Cryptor, pass: string, derivPa
|
|
|
12
12
|
skey: Uint8Array;
|
|
13
13
|
pkey: JsonKey;
|
|
14
14
|
}>;
|
|
15
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
Copyright (C) 2015 - 2018, 2020 3NSoft Inc.
|
|
3
|
+
Copyright (C) 2015 - 2018, 2020, 2025 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
|
|
@@ -210,7 +210,9 @@ function makeNetClient(request = makeNodeRequest()) {
|
|
|
210
210
|
return request(opts);
|
|
211
211
|
},
|
|
212
212
|
doJsonRequest(opts, json) {
|
|
213
|
-
const reqBody =
|
|
213
|
+
const reqBody = ((json === undefined) ?
|
|
214
|
+
new Uint8Array(0) :
|
|
215
|
+
buffer_utils_1.utf8.pack(JSON.stringify(json)));
|
|
214
216
|
return request(opts, 'application/json', reqBody);
|
|
215
217
|
}
|
|
216
218
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SignedLoad } from '../lib-common/jwkeys';
|
|
2
1
|
import { NetClient } from './request-utils';
|
|
3
2
|
import { promises as dnsPromises } from 'dns';
|
|
3
|
+
type SignedLoad = web3n.keys.SignedLoad;
|
|
4
4
|
export interface ASMailRoutes {
|
|
5
5
|
delivery?: string;
|
|
6
6
|
retrieval?: string;
|
|
@@ -49,3 +49,4 @@ export declare function getMailerIdInfoFor(resolver: ServiceLocator, client: Net
|
|
|
49
49
|
info: MailerIdServiceInfo;
|
|
50
50
|
domain: string;
|
|
51
51
|
}>;
|
|
52
|
+
export {};
|
|
@@ -6,6 +6,11 @@ import { Reply, RequestOpts, NetClient } from '../lib-client/request-utils';
|
|
|
6
6
|
import { user as mid } from '../lib-common/mid-sigs-NaCl-Ed';
|
|
7
7
|
import * as WebSocket from 'ws';
|
|
8
8
|
export type IGetMailerIdSigner = () => Promise<mid.MailerIdSigner>;
|
|
9
|
+
export interface ServiceAccessParams {
|
|
10
|
+
login: string;
|
|
11
|
+
logout: string;
|
|
12
|
+
canBeRedirected?: boolean;
|
|
13
|
+
}
|
|
9
14
|
export declare abstract class ServiceUser {
|
|
10
15
|
readonly userId: string;
|
|
11
16
|
private getSigner;
|
|
@@ -21,11 +26,7 @@ export declare abstract class ServiceUser {
|
|
|
21
26
|
private canBeRedirected;
|
|
22
27
|
private sessionId;
|
|
23
28
|
private loginProc;
|
|
24
|
-
protected constructor(userId: string,
|
|
25
|
-
login: string;
|
|
26
|
-
logout: string;
|
|
27
|
-
canBeRedirected?: boolean;
|
|
28
|
-
}, getSigner: IGetMailerIdSigner | undefined, getInitServiceURI: () => Promise<string>, net: NetClient);
|
|
29
|
+
protected constructor(userId: string, accessParams: ServiceAccessParams, getSigner: IGetMailerIdSigner | undefined, getInitServiceURI: () => Promise<string>, net: NetClient);
|
|
29
30
|
private get isUriSet();
|
|
30
31
|
private throwOnBadServiceURI;
|
|
31
32
|
protected setGetterOfSigner(getSigner: IGetMailerIdSigner): void;
|
|
@@ -47,7 +47,7 @@ class ServiceUser {
|
|
|
47
47
|
get loginUrl() {
|
|
48
48
|
return `${this.serviceURI}${this.loginUrlPart}`;
|
|
49
49
|
}
|
|
50
|
-
constructor(userId,
|
|
50
|
+
constructor(userId, accessParams, getSigner, getInitServiceURI, net) {
|
|
51
51
|
this.userId = userId;
|
|
52
52
|
this.getSigner = getSigner;
|
|
53
53
|
this.getInitServiceURI = getInitServiceURI;
|
|
@@ -56,13 +56,13 @@ class ServiceUser {
|
|
|
56
56
|
this.redirectedFrom = undefined;
|
|
57
57
|
this.sessionId = undefined;
|
|
58
58
|
this.loginProc = undefined;
|
|
59
|
-
this.loginUrlPart =
|
|
59
|
+
this.loginUrlPart = accessParams.login;
|
|
60
60
|
if ((this.loginUrlPart.length > 0)
|
|
61
61
|
&& (this.loginUrlPart[this.loginUrlPart.length - 1] !== '/')) {
|
|
62
62
|
this.loginUrlPart += '/';
|
|
63
63
|
}
|
|
64
|
-
this.logoutUrlEnd =
|
|
65
|
-
this.canBeRedirected = !!
|
|
64
|
+
this.logoutUrlEnd = accessParams.logout;
|
|
65
|
+
this.canBeRedirected = !!accessParams.canBeRedirected;
|
|
66
66
|
}
|
|
67
67
|
get isUriSet() {
|
|
68
68
|
return (typeof this.serviceURI === 'string');
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.XAttrs = exports.CommonAttrs = void 0;
|
|
20
|
-
const assert_1 = require("
|
|
21
|
-
const buffer_utils_1 = require("
|
|
22
|
-
const big_endian_1 = require("
|
|
20
|
+
const assert_1 = require("../../lib-common/assert");
|
|
21
|
+
const buffer_utils_1 = require("../../lib-common/buffer-utils");
|
|
22
|
+
const big_endian_1 = require("../../lib-common/big-endian");
|
|
23
23
|
class CommonAttrs {
|
|
24
24
|
constructor(ctime, mtime) {
|
|
25
25
|
this.ctime = ctime;
|