core-3nweb-client-lib 0.26.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api-defs/asmail.d.ts +1 -1
- package/build/api-defs/files.d.ts +278 -69
- package/build/core/app-files.js +7 -7
- package/build/core/asmail/config/common.js +2 -2
- package/build/core/asmail/config/index.js +2 -2
- package/build/core/asmail/config/published-intro-key.js +1 -1
- package/build/core/asmail/delivery/common.js +7 -7
- package/build/core/asmail/delivery/index.js +5 -5
- package/build/core/asmail/delivery/msg.js +4 -4
- package/build/core/asmail/delivery/per-recipient-wip.js +1 -1
- package/build/core/asmail/inbox/attachments/fs.js +5 -1
- package/build/core/asmail/inbox/cached-msgs.js +1 -1
- package/build/core/asmail/inbox/inbox-events.js +4 -4
- package/build/core/asmail/inbox/index.js +10 -10
- package/build/core/asmail/inbox/msg-downloader.js +1 -1
- package/build/core/asmail/inbox/msg-indexing.js +1 -1
- package/build/core/asmail/inbox/msg-on-disk.js +5 -5
- package/build/core/asmail/index.d.ts +3 -3
- package/build/core/asmail/index.js +13 -8
- package/build/core/asmail/key-verification.js +5 -5
- package/build/core/asmail/keyring/common.js +7 -6
- package/build/core/asmail/keyring/correspondent-keys.js +8 -7
- package/build/core/asmail/keyring/id-to-email-map.js +2 -1
- package/build/core/asmail/keyring/index.d.ts +7 -8
- package/build/core/asmail/keyring/index.js +15 -14
- package/build/core/asmail/keyring/keyring-storage.js +2 -1
- package/build/core/asmail/msg/opener.js +3 -3
- package/build/core/asmail/msg/packer.js +13 -13
- package/build/core/asmail/sending-params/own-params.js +2 -2
- package/build/core/asmail/sending-params/params-from-others.js +1 -1
- package/build/core/id-manager.js +6 -3
- package/build/core/index.d.ts +2 -1
- package/build/core/index.js +14 -14
- package/build/core/sign-in.js +5 -5
- package/build/core/sign-up.js +9 -9
- package/build/core/storage/common/json-saving.js +2 -2
- package/build/core/storage/common/obj-info-file.d.ts +12 -4
- package/build/core/storage/common/obj-info-file.js +66 -34
- package/build/core/storage/common/utils.d.ts +2 -0
- package/build/core/storage/common/utils.js +32 -0
- package/build/core/storage/index.d.ts +3 -17
- package/build/core/storage/index.js +56 -76
- package/build/core/storage/local/obj-files-gc.d.ts +2 -0
- package/build/core/storage/local/obj-files-gc.js +49 -37
- package/build/core/storage/local/obj-files.d.ts +4 -7
- package/build/core/storage/local/obj-files.js +7 -10
- package/build/core/storage/local/obj-status.d.ts +12 -6
- package/build/core/storage/local/obj-status.js +24 -9
- package/build/core/storage/local/storage.d.ts +9 -6
- package/build/core/storage/local/storage.js +29 -18
- package/build/core/storage/synced/downloader.js +1 -1
- package/build/core/storage/synced/obj-files-gc.d.ts +5 -1
- package/build/core/storage/synced/obj-files-gc.js +91 -37
- package/build/core/storage/synced/obj-files.d.ts +42 -36
- package/build/core/storage/synced/obj-files.js +178 -147
- package/build/core/storage/synced/obj-status.d.ts +87 -85
- package/build/core/storage/synced/obj-status.js +463 -259
- package/build/core/storage/synced/remote-events.d.ts +11 -12
- package/build/core/storage/synced/remote-events.js +73 -56
- package/build/core/storage/synced/storage.d.ts +18 -9
- package/build/core/storage/synced/storage.js +108 -48
- package/build/core/storage/synced/upload-header-file.d.ts +4 -0
- package/build/core/storage/synced/upload-header-file.js +64 -0
- package/build/core/storage/synced/upsyncer.d.ts +12 -7
- package/build/core/storage/synced/upsyncer.js +204 -280
- package/build/core/storage/system-folders/apps-data.d.ts +16 -0
- package/build/core/storage/system-folders/apps-data.js +110 -0
- package/build/core/storage/system-folders/index.d.ts +18 -0
- package/build/core/storage/system-folders/index.js +77 -0
- package/build/core-ipc/common-caps.js +3 -3
- package/build/core-ipc/generic.js +8 -8
- package/build/core-ipc/startup-caps.js +2 -2
- package/build/cryptors.js +6 -2
- package/build/ipc-via-protobuf/asmail-cap.js +58 -57
- package/build/ipc-via-protobuf/bytes.js +16 -17
- package/build/ipc-via-protobuf/connector-clients-side.d.ts +3 -0
- package/build/ipc-via-protobuf/connector-clients-side.js +61 -24
- package/build/ipc-via-protobuf/connector-services-side.js +10 -10
- package/build/ipc-via-protobuf/connector.js +4 -4
- package/build/ipc-via-protobuf/file.d.ts +48 -12
- package/build/ipc-via-protobuf/file.js +474 -126
- package/build/ipc-via-protobuf/fs.d.ts +8 -0
- package/build/ipc-via-protobuf/fs.js +577 -142
- package/build/ipc-via-protobuf/log-cap.js +2 -2
- package/build/ipc-via-protobuf/mailerid.js +3 -3
- package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -0
- package/build/ipc-via-protobuf/protobuf-msg.js +11 -7
- package/build/ipc-via-protobuf/startup-cap.js +21 -21
- package/build/ipc-via-protobuf/storage-cap.js +12 -12
- package/build/ipc.js +7 -2
- package/build/lib-client/3nstorage/exceptions.d.ts +3 -0
- package/build/lib-client/3nstorage/exceptions.js +13 -1
- package/build/lib-client/3nstorage/service.d.ts +15 -2
- package/build/lib-client/3nstorage/service.js +104 -38
- package/build/lib-client/3nstorage/util/file-based-json.d.ts +2 -1
- package/build/lib-client/3nstorage/util/file-based-json.js +1 -1
- package/build/lib-client/3nstorage/xsp-fs/attrs.js +17 -17
- package/build/lib-client/3nstorage/xsp-fs/common.d.ts +42 -18
- package/build/lib-client/3nstorage/xsp-fs/common.js +29 -19
- package/build/lib-client/3nstorage/xsp-fs/file-node.d.ts +1 -0
- package/build/lib-client/3nstorage/xsp-fs/file-node.js +17 -13
- package/build/lib-client/3nstorage/xsp-fs/file.d.ts +31 -6
- package/build/lib-client/3nstorage/xsp-fs/file.js +73 -25
- package/build/lib-client/3nstorage/xsp-fs/folder-node-serialization.js +4 -4
- package/build/lib-client/3nstorage/xsp-fs/folder-node.d.ts +24 -11
- package/build/lib-client/3nstorage/xsp-fs/folder-node.js +575 -179
- package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +35 -4
- package/build/lib-client/3nstorage/xsp-fs/fs.js +231 -110
- package/build/lib-client/3nstorage/xsp-fs/link-node.d.ts +1 -0
- package/build/lib-client/3nstorage/xsp-fs/link-node.js +7 -2
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +30 -24
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +229 -123
- package/build/lib-client/3nstorage/xsp-fs/node-persistence.d.ts +1 -1
- package/build/lib-client/3nstorage/xsp-fs/node-persistence.js +17 -18
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +3 -3
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +53 -53
- package/build/lib-client/3nweb-signup.js +4 -4
- package/build/lib-client/asmail/recipient.js +15 -15
- package/build/lib-client/asmail/sender.js +22 -22
- package/build/lib-client/asmail/service-config.js +3 -3
- package/build/lib-client/cryptor/cryptor-in-worker.js +18 -16
- package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
- package/build/lib-client/cryptor/cryptor.js +4 -2
- package/build/lib-client/cryptor/cryptor.wasm +0 -0
- package/build/lib-client/cryptor/in-proc-js.js +1 -1
- package/build/lib-client/cryptor/in-proc-wasm.js +6 -6
- package/build/lib-client/cryptor/worker-js.js +2 -2
- package/build/lib-client/cryptor/worker-wasm.js +2 -2
- package/build/lib-client/files-select.js +1 -1
- package/build/lib-client/files.d.ts +1 -1
- package/build/lib-client/files.js +71 -6
- package/build/lib-client/fs-collection.js +1 -1
- package/build/lib-client/fs-sync-utils.d.ts +5 -0
- package/build/lib-client/fs-sync-utils.js +61 -0
- package/build/lib-client/fs-view.d.ts +14 -0
- package/build/lib-client/fs-view.js +33 -0
- package/build/lib-client/key-derivation.js +1 -1
- package/build/lib-client/local-files/dev-file-sink.js +9 -9
- package/build/lib-client/local-files/dev-file-src.js +2 -2
- package/build/lib-client/local-files/device-fs.d.ts +1 -1
- package/build/lib-client/local-files/device-fs.js +56 -54
- package/build/lib-client/logging/log-to-file.d.ts +1 -1
- package/build/lib-client/logging/log-to-file.js +7 -7
- package/build/lib-client/mailer-id/login.js +7 -7
- package/build/lib-client/mailer-id/provisioner.js +12 -12
- package/build/lib-client/objs-on-disk/file-writing-proc.js +3 -3
- package/build/lib-client/objs-on-disk/obj-folders.js +31 -31
- package/build/lib-client/objs-on-disk/obj-on-disk.d.ts +13 -2
- package/build/lib-client/objs-on-disk/obj-on-disk.js +24 -9
- package/build/lib-client/request-utils.d.ts +1 -0
- package/build/lib-client/request-utils.js +13 -13
- package/build/lib-client/server-events.d.ts +3 -3
- package/build/lib-client/server-events.js +9 -8
- package/build/lib-client/service-locator.js +10 -10
- package/build/lib-client/user-with-mid-session.js +7 -7
- package/build/lib-client/user-with-pkl-session.js +25 -25
- package/build/lib-client/ws-utils.js +2 -2
- package/build/lib-common/async-cryptor-wrap.js +4 -4
- package/build/lib-common/async-fs-node.d.ts +5 -3
- package/build/lib-common/async-fs-node.js +16 -16
- package/build/lib-common/byte-streaming/pipe.js +1 -1
- package/build/lib-common/byte-streaming/wrapping.js +13 -13
- package/build/lib-common/canonical-address.js +1 -1
- package/build/lib-common/exceptions/error.d.ts +1 -0
- package/build/lib-common/exceptions/error.js +7 -6
- package/build/lib-common/exceptions/file.js +4 -0
- package/build/lib-common/ipc/ws-ipc.js +2 -2
- package/build/lib-common/mid-sigs-NaCl-Ed.js +14 -14
- package/build/lib-common/objs-on-disk/file-layout.d.ts +19 -0
- package/build/lib-common/objs-on-disk/file-layout.js +130 -12
- package/build/lib-common/objs-on-disk/obj-file.d.ts +13 -2
- package/build/lib-common/objs-on-disk/obj-file.js +96 -35
- package/build/lib-common/objs-on-disk/utils.d.ts +1 -0
- package/build/lib-common/objs-on-disk/utils.js +3 -3
- package/build/lib-common/objs-on-disk/v1-obj-file-format.js +14 -14
- package/build/lib-common/processes/labelled-exec-pools.d.ts +1 -1
- package/build/lib-common/processes/labelled-exec-pools.js +1 -1
- package/build/lib-common/processes/pressure.js +2 -2
- package/build/lib-common/processes/synced.js +1 -1
- package/build/lib-common/processes/timeout.js +2 -2
- package/build/lib-common/random-node.js +7 -7
- package/build/lib-common/service-api/3nstorage/owner.d.ts +95 -39
- package/build/lib-common/service-api/3nstorage/owner.js +82 -40
- package/build/lib-common/service-api/asmail/delivery.js +2 -2
- package/build/lib-common/service-api/asmail/retrieval.js +1 -1
- package/build/lib-common/timed-cache.d.ts +1 -0
- package/build/lib-common/timed-non-weak-cache.d.ts +1 -0
- package/build/lib-common/timed-non-weak-cache.js +11 -0
- package/build/lib-common/utils-for-observables.js +4 -4
- package/build/lib-common/weak-cache.d.ts +1 -0
- package/build/lib-common/weak-cache.js +12 -1
- package/build/lib-index.d.ts +2 -1
- package/build/lib-index.js +10 -7
- package/build/protos/asmail.proto.js +12955 -7496
- package/build/protos/file.proto.js +4867 -2744
- package/build/protos/fs.proto.js +9227 -3768
- package/package.json +6 -5
- package/protos/file.proto +91 -19
- package/protos/fs.proto +107 -8
|
@@ -1,117 +1,119 @@
|
|
|
1
|
-
import { ObjId } from '../../../lib-client/3nstorage/xsp-fs/common';
|
|
2
|
-
import { VersionsInfo } from '../common/obj-info-file';
|
|
1
|
+
import { ObjId, SyncedObjStatus } from '../../../lib-client/3nstorage/xsp-fs/common';
|
|
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';
|
|
5
|
+
import { FiniteChunk } from '../../../lib-common/objs-on-disk/file-layout';
|
|
6
|
+
import { UploadStatusRecorder } from './upsyncer';
|
|
7
|
+
declare type SyncStatus = web3n.files.SyncStatus;
|
|
5
8
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* to the server. Current is just the next version, following the server one.
|
|
13
|
-
* 4. Conflicting state indicates that current unsynced local version conflicts
|
|
14
|
-
* with version on the server, uploaded by other client.
|
|
9
|
+
* This is status information of an object in synced storage.
|
|
10
|
+
* Local references versions that haven't been synced/uploaded.
|
|
11
|
+
* Remote enumerates versions on the server.
|
|
12
|
+
* Synced marks version of latest synchronized moment.
|
|
13
|
+
* Local versions must be on disk as it is the only copy. Remote versions can
|
|
14
|
+
* be present as needed/desired.
|
|
15
15
|
*/
|
|
16
|
-
export declare type SyncState = 'synced' | 'behind' | 'unsynced' | 'conflicting';
|
|
17
16
|
export interface ObjStatusInfo {
|
|
18
17
|
objId: ObjId;
|
|
18
|
+
local?: LocalVersions;
|
|
19
|
+
synced?: SyncMarker;
|
|
20
|
+
remote: VersionsOnServer;
|
|
21
|
+
}
|
|
22
|
+
export interface LocalVersions extends VersionsInfo {
|
|
23
|
+
isArchived?: boolean;
|
|
24
|
+
archived?: undefined;
|
|
25
|
+
upload?: UploadInfo;
|
|
26
|
+
}
|
|
27
|
+
export interface SyncMarker {
|
|
28
|
+
version?: number;
|
|
29
|
+
isArchived?: boolean;
|
|
30
|
+
base?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface VersionsOnServer extends VersionsInfo {
|
|
19
33
|
isArchived?: boolean;
|
|
20
|
-
versions: VersionsInfo;
|
|
21
|
-
sync: {
|
|
22
|
-
state: SyncState;
|
|
23
|
-
latest?: number;
|
|
24
|
-
conflictingRemote?: number[];
|
|
25
|
-
remote?: number;
|
|
26
|
-
deletedOnRemote?: true;
|
|
27
|
-
};
|
|
28
|
-
syncTasks?: {
|
|
29
|
-
queued: UpSyncTaskInfo[];
|
|
30
|
-
current?: UpSyncTaskInfo;
|
|
31
|
-
};
|
|
32
34
|
}
|
|
33
35
|
export interface UploadInfo {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
createObj?: true;
|
|
37
|
-
needUpload?: {
|
|
38
|
-
header?: number;
|
|
39
|
-
segs: BytesSection[];
|
|
40
|
-
allByteOnDisk?: true;
|
|
41
|
-
};
|
|
42
|
-
version: number;
|
|
36
|
+
localVersion: number;
|
|
37
|
+
uploadVersion: number;
|
|
43
38
|
baseVersion?: number;
|
|
39
|
+
needUpload?: WholeVerOrderedUpload | DiffVerOrderedUpload;
|
|
40
|
+
}
|
|
41
|
+
export interface WholeVerOrderedUpload {
|
|
42
|
+
type: 'ordered-whole';
|
|
43
|
+
createObj?: boolean;
|
|
44
|
+
header?: number;
|
|
45
|
+
segsLeft: number;
|
|
46
|
+
segsOfs: number;
|
|
47
|
+
transactionId?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface DiffVerOrderedUpload {
|
|
50
|
+
type: 'ordered-diff';
|
|
51
|
+
diff: DiffInfo;
|
|
52
|
+
header?: number;
|
|
53
|
+
newSegsLeft: FiniteChunk[];
|
|
54
|
+
transactionId?: string;
|
|
44
55
|
}
|
|
45
56
|
export interface BytesSection {
|
|
46
57
|
ofs: number;
|
|
47
58
|
len: number;
|
|
48
59
|
}
|
|
49
|
-
export interface
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
export interface ArchivalInfo {
|
|
55
|
-
type: 'archiving';
|
|
56
|
-
archivalOfCurrent?: true;
|
|
57
|
-
}
|
|
58
|
-
export declare type UpSyncTaskInfo = UploadInfo | RemovalInfo | ArchivalInfo;
|
|
59
|
-
export interface UpSyncStatus {
|
|
60
|
-
queueTask(t: UpSyncTaskInfo): void;
|
|
61
|
-
getTaskForProcessing(): Promise<UpSyncTaskInfo | undefined>;
|
|
62
|
-
glanceOnNextTask(): UpSyncTaskInfo | undefined;
|
|
63
|
-
recordInterimStateOfCurrentTask(t: UploadInfo): Promise<void>;
|
|
64
|
-
recordTaskCompletion(t: UpSyncTaskInfo): Promise<void>;
|
|
65
|
-
isSyncDone(): boolean;
|
|
66
|
-
stat(): NonNullable<Stats['sync']>;
|
|
60
|
+
export interface NonGarbage {
|
|
61
|
+
local?: NonGarbageVersions;
|
|
62
|
+
remote: NonGarbageVersions;
|
|
63
|
+
uploadVersion?: number;
|
|
67
64
|
}
|
|
68
65
|
export declare const STATUS_FILE_NAME = "status";
|
|
69
|
-
export declare class ObjStatus implements
|
|
66
|
+
export declare class ObjStatus implements SyncedObjStatus, UploadStatusRecorder {
|
|
70
67
|
private readonly objFolder;
|
|
71
68
|
private readonly status;
|
|
72
69
|
private readonly logError;
|
|
73
70
|
private readonly saveProc;
|
|
71
|
+
private stateIndicator;
|
|
74
72
|
private constructor();
|
|
75
73
|
static readFrom(objFolder: string, objId: ObjId, logError: LogError): Promise<ObjStatus>;
|
|
76
74
|
static makeNew(objFolder: string, objId: ObjId, logError: LogError): Promise<ObjStatus>;
|
|
77
75
|
static makeForDownloadedVersion(objFolder: string, objId: ObjId, version: number, currentRemote: number, logError: LogError): Promise<ObjStatus>;
|
|
78
76
|
static fileShowsObjNotInSyncedState(objFolder: string, objId: ObjId): Promise<boolean>;
|
|
77
|
+
private updateStateIndicator;
|
|
79
78
|
isArchived(): boolean;
|
|
80
|
-
|
|
81
|
-
getNonGarbageVersions():
|
|
82
|
-
|
|
83
|
-
nonGarbage: Set<number>;
|
|
84
|
-
};
|
|
85
|
-
isRemoteVersionGreaterOrEqualTo(newRemoteVersion: number): boolean;
|
|
86
|
-
isDeletedOnRemote(): boolean;
|
|
87
|
-
syncedVersionGreaterOrEqual(version: number): boolean;
|
|
88
|
-
removeCurrentVersion(verObjs: ContainerWithDelete<number>): Promise<void>;
|
|
79
|
+
getCurrentLocalOrSynced(): number;
|
|
80
|
+
getNonGarbageVersions(): NonGarbage;
|
|
81
|
+
removeCurrentVersion(): Promise<void>;
|
|
89
82
|
private triggerSaveProc;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
recordUploadStart(info: UploadInfo): Promise<void>;
|
|
84
|
+
recordUploadInterimState(info: UploadInfo): Promise<void>;
|
|
85
|
+
recordUploadCancellation(info: UploadInfo): Promise<void>;
|
|
86
|
+
recordArchVersionRemoval(version: number): Promise<void>;
|
|
87
|
+
recordVersionArchival(version: number): Promise<void>;
|
|
88
|
+
recordRemoteRemoval(): Promise<void>;
|
|
89
|
+
recordRemoteChange(version: number): Promise<void>;
|
|
90
|
+
recordSyncOfObjRemoval(): Promise<void>;
|
|
91
|
+
recordStatusFromServer({ archived, current }: RemoteObjStatus): Promise<void>;
|
|
94
92
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
93
|
+
* When given object version is a diff on some base, this method returns
|
|
94
|
+
* a whole trace of local base versions up to synced one.
|
|
95
|
+
* Local bases, if present, are return in an array with highest version
|
|
96
|
+
* first.
|
|
97
|
+
* This returns undefined, when given object version is not a diff.
|
|
98
|
+
* @param version that is local, for which we want to get base versions, if
|
|
99
|
+
* it is a diff version.
|
|
97
100
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
delete(key: T): void;
|
|
101
|
+
baseOfLocalVersion(version: number): {
|
|
102
|
+
localBases?: number[];
|
|
103
|
+
syncedBase?: number;
|
|
104
|
+
} | undefined;
|
|
105
|
+
markLocalVersionSynced(localVersion: number, uploadVersion: number): Promise<void>;
|
|
106
|
+
setLocalCurrentVersion(version: number, baseVer: number | undefined): Promise<void>;
|
|
107
|
+
listVersions(): {
|
|
108
|
+
current?: number;
|
|
109
|
+
archived?: number[];
|
|
110
|
+
};
|
|
111
|
+
archiveCurrentVersion(): Promise<void>;
|
|
112
|
+
absorbLocalVersionBase(version: number, localBase: number): Promise<void>;
|
|
113
|
+
latestSyncedVersion(): number | undefined;
|
|
114
|
+
syncStatus(): SyncStatus;
|
|
115
|
+
neverUploaded(): boolean;
|
|
116
|
+
adoptRemoteVersion(version?: number, dropLocalVer?: boolean): Promise<void>;
|
|
115
117
|
}
|
|
116
118
|
export declare function readAndCheckStatus(objFolder: string, objId: ObjId): Promise<ObjStatusInfo>;
|
|
117
119
|
export {};
|