core-3nweb-client-lib 0.30.3 → 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.d.ts +2 -2
- package/build/lib-client/cryptor/cryptor.js +3 -3
- 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 +3 -3
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type FileException = web3n.files.FileException;
|
|
2
|
+
export type FileExceptionFlag = web3n.files.FileExceptionFlag;
|
|
3
3
|
export declare const Code: web3n.files.exceptionCode;
|
|
4
4
|
export declare function makeFileExceptionFromCode(code: string | undefined, path: string, cause?: any): FileException;
|
|
5
5
|
export declare function makeFileException(flag: keyof FileExceptionFlag, path: string, cause?: any): FileException;
|
|
@@ -16,7 +16,13 @@
|
|
|
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.Code = void 0;
|
|
20
|
+
exports.makeFileExceptionFromCode = makeFileExceptionFromCode;
|
|
21
|
+
exports.makeFileException = makeFileException;
|
|
22
|
+
exports.maskPathInExc = maskPathInExc;
|
|
23
|
+
exports.ensureCorrectFS = ensureCorrectFS;
|
|
24
|
+
exports.makeNoAttrsExc = makeNoAttrsExc;
|
|
25
|
+
exports.makeVersionMismatchExc = makeVersionMismatchExc;
|
|
20
26
|
exports.Code = {
|
|
21
27
|
notFound: 'ENOENT',
|
|
22
28
|
alreadyExists: 'EEXIST',
|
|
@@ -51,7 +57,6 @@ function makeFileExceptionFromCode(code, path, cause) {
|
|
|
51
57
|
}
|
|
52
58
|
return err;
|
|
53
59
|
}
|
|
54
|
-
exports.makeFileExceptionFromCode = makeFileExceptionFromCode;
|
|
55
60
|
function makeFileException(flag, path, cause) {
|
|
56
61
|
const code = exports.Code[flag];
|
|
57
62
|
const err = {
|
|
@@ -64,7 +69,6 @@ function makeFileException(flag, path, cause) {
|
|
|
64
69
|
err[flag] = true;
|
|
65
70
|
return err;
|
|
66
71
|
}
|
|
67
|
-
exports.makeFileException = makeFileException;
|
|
68
72
|
function maskPathInExc(pathPrefixMaskLen, exc) {
|
|
69
73
|
if (!exc.runtimeException || !exc.code) {
|
|
70
74
|
return exc;
|
|
@@ -74,7 +78,6 @@ function maskPathInExc(pathPrefixMaskLen, exc) {
|
|
|
74
78
|
}
|
|
75
79
|
return exc;
|
|
76
80
|
}
|
|
77
|
-
exports.maskPathInExc = maskPathInExc;
|
|
78
81
|
function ensureCorrectFS(fs, type, writable) {
|
|
79
82
|
if (!fs) {
|
|
80
83
|
throw new Error("No file system given.");
|
|
@@ -86,7 +89,6 @@ function ensureCorrectFS(fs, type, writable) {
|
|
|
86
89
|
throw new Error(`Given file system is ${fs.writable ? '' : 'not'} writable, while it is expected to be ${writable ? '' : 'not'} writable`);
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
|
-
exports.ensureCorrectFS = ensureCorrectFS;
|
|
90
92
|
function makeNoAttrsExc(path) {
|
|
91
93
|
return {
|
|
92
94
|
runtimeException: true,
|
|
@@ -96,7 +98,6 @@ function makeNoAttrsExc(path) {
|
|
|
96
98
|
attrsNotEnabledInFS: true
|
|
97
99
|
};
|
|
98
100
|
}
|
|
99
|
-
exports.makeNoAttrsExc = makeNoAttrsExc;
|
|
100
101
|
function makeVersionMismatchExc(path) {
|
|
101
102
|
return {
|
|
102
103
|
runtimeException: true,
|
|
@@ -106,5 +107,4 @@ function makeVersionMismatchExc(path) {
|
|
|
106
107
|
versionMismatch: true
|
|
107
108
|
};
|
|
108
109
|
}
|
|
109
|
-
exports.makeVersionMismatchExc = makeVersionMismatchExc;
|
|
110
110
|
Object.freeze(exports);
|
|
@@ -15,7 +15,8 @@
|
|
|
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.makeConnectionException = makeConnectionException;
|
|
19
|
+
exports.makeHTTPException = makeHTTPException;
|
|
19
20
|
function makeConnectionException(url, method, msg, cause) {
|
|
20
21
|
const exc = {
|
|
21
22
|
runtimeException: true,
|
|
@@ -29,7 +30,6 @@ function makeConnectionException(url, method, msg, cause) {
|
|
|
29
30
|
}
|
|
30
31
|
return exc;
|
|
31
32
|
}
|
|
32
|
-
exports.makeConnectionException = makeConnectionException;
|
|
33
33
|
function makeHTTPException(url, method, status, msg, cause) {
|
|
34
34
|
const exc = {
|
|
35
35
|
runtimeException: true,
|
|
@@ -44,5 +44,4 @@ function makeHTTPException(url, method, status, msg, cause) {
|
|
|
44
44
|
}
|
|
45
45
|
return exc;
|
|
46
46
|
}
|
|
47
|
-
exports.makeHTTPException = makeHTTPException;
|
|
48
47
|
Object.freeze(exports);
|
|
@@ -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.makeRuntimeException =
|
|
19
|
+
exports.makeRuntimeException = makeRuntimeException;
|
|
20
20
|
function makeRuntimeException(type, params, flags) {
|
|
21
21
|
const exc = {
|
|
22
22
|
runtimeException: true,
|
|
@@ -34,5 +34,4 @@ function makeRuntimeException(type, params, flags) {
|
|
|
34
34
|
}
|
|
35
35
|
return exc;
|
|
36
36
|
}
|
|
37
|
-
exports.makeRuntimeException = makeRuntimeException;
|
|
38
37
|
Object.freeze(exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Observer<T> = web3n.Observer<T>;
|
|
2
2
|
export interface RawDuplex<T> {
|
|
3
3
|
/**
|
|
4
4
|
* This function triggers sending of a given message to the other side.
|
|
@@ -37,7 +37,7 @@ interface EventEndEnvelope {
|
|
|
37
37
|
channel: string;
|
|
38
38
|
err?: any;
|
|
39
39
|
}
|
|
40
|
-
export
|
|
40
|
+
export type Envelope = RequestEnvelope<any> | ReplyEnvelope<any> | EventEnvelope<any> | EventEndEnvelope;
|
|
41
41
|
export interface RequestServer extends Closable {
|
|
42
42
|
/**
|
|
43
43
|
* @param reqName is a name of request, to be handled by a given handler
|
|
@@ -51,7 +51,7 @@ export interface RequestServer extends Closable {
|
|
|
51
51
|
*/
|
|
52
52
|
notifyOfProgressOnRequest<T>(env: RequestEnvelope<any>, rep: T): void;
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export type RequestHandler<TReq, TRes> = (env: RequestEnvelope<TReq>) => Promise<TRes> | void;
|
|
55
55
|
export interface RequestingClient extends Closable {
|
|
56
56
|
/**
|
|
57
57
|
* This returns a promise, resolvable to a reply that other side sends back,
|
|
@@ -15,7 +15,11 @@
|
|
|
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.SingleObserverWrap = exports.MultiObserverWrap =
|
|
18
|
+
exports.SingleObserverWrap = exports.MultiObserverWrap = void 0;
|
|
19
|
+
exports.makeRequestingClient = makeRequestingClient;
|
|
20
|
+
exports.makeRequestServer = makeRequestServer;
|
|
21
|
+
exports.makeEventfulServer = makeEventfulServer;
|
|
22
|
+
exports.makeSubscribingClient = makeSubscribingClient;
|
|
19
23
|
const map_of_sets_1 = require("../map-of-sets");
|
|
20
24
|
const synced_1 = require("../processes/synced");
|
|
21
25
|
function toTransferrableError(e) {
|
|
@@ -173,7 +177,6 @@ Object.freeze(RequestingSide);
|
|
|
173
177
|
function makeRequestingClient(channel, comm) {
|
|
174
178
|
return (new RequestingSide(channel, comm)).wrap();
|
|
175
179
|
}
|
|
176
|
-
exports.makeRequestingClient = makeRequestingClient;
|
|
177
180
|
class ReplyingSide extends MessageHandler {
|
|
178
181
|
constructor(channel, comm) {
|
|
179
182
|
super(channel, comm);
|
|
@@ -277,7 +280,6 @@ Object.freeze(ReplyingSide);
|
|
|
277
280
|
function makeRequestServer(channel, comm) {
|
|
278
281
|
return (new ReplyingSide(channel, comm)).wrap();
|
|
279
282
|
}
|
|
280
|
-
exports.makeRequestServer = makeRequestServer;
|
|
281
283
|
function makeUnknownEventException(message) {
|
|
282
284
|
return {
|
|
283
285
|
runtimeException: true,
|
|
@@ -391,7 +393,6 @@ Object.freeze(EventsSendingSide);
|
|
|
391
393
|
function makeEventfulServer(channel, comm) {
|
|
392
394
|
return (new EventsSendingSide(channel, comm)).wrap();
|
|
393
395
|
}
|
|
394
|
-
exports.makeEventfulServer = makeEventfulServer;
|
|
395
396
|
class EventListener {
|
|
396
397
|
constructor(channel, observer, detach) {
|
|
397
398
|
this.channel = channel;
|
|
@@ -590,16 +591,15 @@ Object.freeze(IpcEventChannels);
|
|
|
590
591
|
function makeSubscribingClient(channel, comm) {
|
|
591
592
|
return (new EventsReceivingSide(channel, comm)).wrap();
|
|
592
593
|
}
|
|
593
|
-
exports.makeSubscribingClient = makeSubscribingClient;
|
|
594
594
|
class MultiObserverWrap {
|
|
595
|
+
get done() {
|
|
596
|
+
return this.isDone;
|
|
597
|
+
}
|
|
595
598
|
constructor() {
|
|
596
599
|
this.isDone = false;
|
|
597
600
|
this.obs = new Set();
|
|
598
601
|
Object.seal(this);
|
|
599
602
|
}
|
|
600
|
-
get done() {
|
|
601
|
-
return this.isDone;
|
|
602
|
-
}
|
|
603
603
|
add(obs) {
|
|
604
604
|
if (this.isDone) {
|
|
605
605
|
throw new Error(`Cannot add observer, as this source is already done`);
|
|
@@ -651,15 +651,15 @@ exports.MultiObserverWrap = MultiObserverWrap;
|
|
|
651
651
|
Object.freeze(MultiObserverWrap.prototype);
|
|
652
652
|
Object.freeze(MultiObserverWrap);
|
|
653
653
|
class SingleObserverWrap {
|
|
654
|
+
get done() {
|
|
655
|
+
return this.isDone;
|
|
656
|
+
}
|
|
654
657
|
constructor() {
|
|
655
658
|
this.isDone = false;
|
|
656
659
|
this.obs = undefined;
|
|
657
660
|
this.detach = () => this.setDone();
|
|
658
661
|
Object.seal(this);
|
|
659
662
|
}
|
|
660
|
-
get done() {
|
|
661
|
-
return this.isDone;
|
|
662
|
-
}
|
|
663
663
|
set(obs) {
|
|
664
664
|
if (this.isDone) {
|
|
665
665
|
throw new Error(`Cannot add observer, as this source is already done`);
|
|
@@ -15,7 +15,8 @@
|
|
|
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.makeEventfulServer = void 0;
|
|
19
|
+
exports.makeSubscriber = makeSubscriber;
|
|
19
20
|
const generic_ipc_1 = require("./generic-ipc");
|
|
20
21
|
var generic_ipc_2 = require("./generic-ipc");
|
|
21
22
|
Object.defineProperty(exports, "makeEventfulServer", { enumerable: true, get: function () { return generic_ipc_2.makeEventfulServer; } });
|
|
@@ -113,5 +114,4 @@ function makeSubscriber(ws, ipcChannel) {
|
|
|
113
114
|
const comm = makeJsonCommPoint(ws);
|
|
114
115
|
return (0, generic_ipc_1.makeSubscribingClient)(ipcChannel, comm);
|
|
115
116
|
}
|
|
116
|
-
exports.makeSubscriber = makeSubscriber;
|
|
117
117
|
Object.freeze(exports);
|
|
@@ -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.copy = copy;
|
|
20
|
+
exports.deepEqual = deepEqual;
|
|
21
|
+
exports.deepFind = deepFind;
|
|
22
|
+
exports.applyChangesToJSON = applyChangesToJSON;
|
|
20
23
|
/**
|
|
21
24
|
* This function creates a copy of json entity with a caveat that Buffer and
|
|
22
25
|
* byte arrays are shared between original and a copy.
|
|
@@ -62,7 +65,6 @@ function copy(orig, excludeTopFields) {
|
|
|
62
65
|
return c;
|
|
63
66
|
}
|
|
64
67
|
}
|
|
65
|
-
exports.copy = copy;
|
|
66
68
|
function deepEqual(a, b) {
|
|
67
69
|
const t = typeof a;
|
|
68
70
|
if (t !== typeof b) {
|
|
@@ -106,7 +108,6 @@ function deepEqual(a, b) {
|
|
|
106
108
|
}
|
|
107
109
|
return true;
|
|
108
110
|
}
|
|
109
|
-
exports.deepEqual = deepEqual;
|
|
110
111
|
function* deepFind(a, predicate) {
|
|
111
112
|
if ((typeof a !== 'object') || !a) {
|
|
112
113
|
if (predicate(a)) {
|
|
@@ -127,7 +128,6 @@ function* deepFind(a, predicate) {
|
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
}
|
|
130
|
-
exports.deepFind = deepFind;
|
|
131
131
|
/**
|
|
132
132
|
* This function applies given changes to object.
|
|
133
133
|
* @param json is an object that is being changed
|
|
@@ -145,5 +145,4 @@ function applyChangesToJSON(json, changes) {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
exports.applyChangesToJSON = applyChangesToJSON;
|
|
149
148
|
Object.freeze(exports);
|
|
@@ -106,7 +106,7 @@ export declare function keyToJson(key: Key): JsonKey;
|
|
|
106
106
|
export declare function getKeyCert(signedCert: SignedLoad): KeyCert;
|
|
107
107
|
export declare function getPubKey(signedCert: SignedLoad): JsonKey;
|
|
108
108
|
export declare function getPrincipalAddress(signedCert: SignedLoad): string;
|
|
109
|
-
export declare
|
|
109
|
+
export declare namespace use {
|
|
110
110
|
const MID_PKLOGIN = "login-pub-key";
|
|
111
111
|
}
|
|
112
112
|
export interface MailerIdAssertionLoad {
|
|
@@ -15,7 +15,18 @@
|
|
|
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.use = void 0;
|
|
19
|
+
exports.isLikeJsonKey = isLikeJsonKey;
|
|
20
|
+
exports.isLikeSignedLoad = isLikeSignedLoad;
|
|
21
|
+
exports.isLikeKeyCert = isLikeKeyCert;
|
|
22
|
+
exports.isLikeSignedKeyCert = isLikeSignedKeyCert;
|
|
23
|
+
exports.keyFromJson = keyFromJson;
|
|
24
|
+
exports.keyToJson = keyToJson;
|
|
25
|
+
exports.getKeyCert = getKeyCert;
|
|
26
|
+
exports.getPubKey = getPubKey;
|
|
27
|
+
exports.getPrincipalAddress = getPrincipalAddress;
|
|
28
|
+
exports.isLikeMailerIdAssertion = isLikeMailerIdAssertion;
|
|
29
|
+
exports.isLikeSignedMailerIdAssertion = isLikeSignedMailerIdAssertion;
|
|
19
30
|
/**
|
|
20
31
|
* This module defines json form of keys and signed objects.
|
|
21
32
|
*/
|
|
@@ -27,7 +38,6 @@ function isLikeJsonKey(jkey) {
|
|
|
27
38
|
('string' === typeof jkey.k) && !!jkey.k &&
|
|
28
39
|
('string' === typeof jkey.kid && !!jkey.kid));
|
|
29
40
|
}
|
|
30
|
-
exports.isLikeJsonKey = isLikeJsonKey;
|
|
31
41
|
function isLikeSignedLoad(load) {
|
|
32
42
|
return (('object' === typeof load) && !!load &&
|
|
33
43
|
('string' === typeof load.alg) && !!load.alg &&
|
|
@@ -35,7 +45,6 @@ function isLikeSignedLoad(load) {
|
|
|
35
45
|
('string' === typeof load.sig) && !!load.sig &&
|
|
36
46
|
('string' === typeof load.load && !!load.load));
|
|
37
47
|
}
|
|
38
|
-
exports.isLikeSignedLoad = isLikeSignedLoad;
|
|
39
48
|
function isLikeKeyCert(cert) {
|
|
40
49
|
return (('object' === typeof cert) && !!cert &&
|
|
41
50
|
('number' === typeof cert.expiresAt) &&
|
|
@@ -49,7 +58,6 @@ function isLikeKeyCert(cert) {
|
|
|
49
58
|
!!cert.cert.principal.address &&
|
|
50
59
|
isLikeJsonKey(cert.cert.publicKey));
|
|
51
60
|
}
|
|
52
|
-
exports.isLikeKeyCert = isLikeKeyCert;
|
|
53
61
|
function isLikeSignedKeyCert(load) {
|
|
54
62
|
if (!isLikeSignedLoad(load)) {
|
|
55
63
|
return false;
|
|
@@ -61,7 +69,6 @@ function isLikeSignedKeyCert(load) {
|
|
|
61
69
|
return false;
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
|
-
exports.isLikeSignedKeyCert = isLikeSignedKeyCert;
|
|
65
72
|
function keyFromJson(key, use, alg, klen) {
|
|
66
73
|
if (key.use === use) {
|
|
67
74
|
if (key.alg === alg) {
|
|
@@ -87,7 +94,6 @@ function keyFromJson(key, use, alg, klen) {
|
|
|
87
94
|
"', instead of '" + use + "'");
|
|
88
95
|
}
|
|
89
96
|
}
|
|
90
|
-
exports.keyFromJson = keyFromJson;
|
|
91
97
|
function keyToJson(key) {
|
|
92
98
|
return {
|
|
93
99
|
use: key.use,
|
|
@@ -96,23 +102,19 @@ function keyToJson(key) {
|
|
|
96
102
|
k: buffer_utils_1.base64.pack(key.k)
|
|
97
103
|
};
|
|
98
104
|
}
|
|
99
|
-
exports.keyToJson = keyToJson;
|
|
100
105
|
function getKeyCert(signedCert) {
|
|
101
106
|
return JSON.parse(buffer_utils_1.utf8.open(buffer_utils_1.base64.open(signedCert.load)));
|
|
102
107
|
}
|
|
103
|
-
exports.getKeyCert = getKeyCert;
|
|
104
108
|
function getPubKey(signedCert) {
|
|
105
109
|
return getKeyCert(signedCert).cert.publicKey;
|
|
106
110
|
}
|
|
107
|
-
exports.getPubKey = getPubKey;
|
|
108
111
|
function getPrincipalAddress(signedCert) {
|
|
109
112
|
return getKeyCert(signedCert).cert.principal.address;
|
|
110
113
|
}
|
|
111
|
-
exports.getPrincipalAddress = getPrincipalAddress;
|
|
112
114
|
var use;
|
|
113
115
|
(function (use) {
|
|
114
116
|
use.MID_PKLOGIN = 'login-pub-key';
|
|
115
|
-
})(use
|
|
117
|
+
})(use || (exports.use = use = {}));
|
|
116
118
|
Object.freeze(use);
|
|
117
119
|
function isLikeMailerIdAssertion(assertLoad) {
|
|
118
120
|
return (('object' === typeof assertLoad) && !!assertLoad &&
|
|
@@ -123,7 +125,6 @@ function isLikeMailerIdAssertion(assertLoad) {
|
|
|
123
125
|
('number' === typeof assertLoad.issuedAt) &&
|
|
124
126
|
(assertLoad.expiresAt > assertLoad.issuedAt));
|
|
125
127
|
}
|
|
126
|
-
exports.isLikeMailerIdAssertion = isLikeMailerIdAssertion;
|
|
127
128
|
function isLikeSignedMailerIdAssertion(load) {
|
|
128
129
|
if (!isLikeSignedLoad(load)) {
|
|
129
130
|
return false;
|
|
@@ -135,5 +136,4 @@ function isLikeSignedMailerIdAssertion(load) {
|
|
|
135
136
|
return false;
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
|
-
exports.isLikeSignedMailerIdAssertion = isLikeSignedMailerIdAssertion;
|
|
139
139
|
Object.freeze(exports);
|
|
@@ -40,7 +40,7 @@ export interface Keypair {
|
|
|
40
40
|
pkey: JsonKey;
|
|
41
41
|
skey: Key;
|
|
42
42
|
}
|
|
43
|
-
export declare
|
|
43
|
+
export declare namespace idProvider {
|
|
44
44
|
const KID_BYTES_LENGTH = 9;
|
|
45
45
|
const MAX_USER_CERT_VALIDITY: number;
|
|
46
46
|
function makeSelfSignedCert(address: string, validityPeriod: number, sjkey: JsonKey, arrFactory?: arrays.Factory): SignedLoad;
|
|
@@ -114,7 +114,7 @@ export interface CertsChain {
|
|
|
114
114
|
prov: SignedLoad;
|
|
115
115
|
root: SignedLoad;
|
|
116
116
|
}
|
|
117
|
-
export declare
|
|
117
|
+
export declare namespace relyingParty {
|
|
118
118
|
/**
|
|
119
119
|
* @param certs is a chain of certificate to be verified.
|
|
120
120
|
* @param rootAddr is MailerId service's domain.
|
|
@@ -168,7 +168,7 @@ export declare module relyingParty {
|
|
|
168
168
|
*/
|
|
169
169
|
function verifyPubKey(pubKeyCert: SignedLoad, principalAddress: string, certChain: CertsChain, rootAddr: string, validAt: number, arrFactory?: arrays.Factory): JsonKey;
|
|
170
170
|
}
|
|
171
|
-
export declare
|
|
171
|
+
export declare namespace user {
|
|
172
172
|
/**
|
|
173
173
|
* This is used by user of MailerId to create assertion that prove user's
|
|
174
174
|
* identity.
|
|
@@ -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.user = exports.relyingParty = exports.idProvider = exports.
|
|
19
|
+
exports.user = exports.relyingParty = exports.idProvider = exports.exceptionType = exports.KEY_USE = void 0;
|
|
20
|
+
exports.makeMalformedCertsException = makeMalformedCertsException;
|
|
20
21
|
/**
|
|
21
22
|
* This library handles signing and verification of signatures, used
|
|
22
23
|
* in MailerId.
|
|
@@ -80,7 +81,6 @@ function makeMalformedCertsException(msg, cause) {
|
|
|
80
81
|
cause
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
exports.makeMalformedCertsException = makeMalformedCertsException;
|
|
84
84
|
function makeSigVerifException(msg) {
|
|
85
85
|
return {
|
|
86
86
|
runtimeException: true,
|
|
@@ -241,7 +241,7 @@ var idProvider;
|
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
243
|
idProvider.makeIdProviderCertifier = makeIdProviderCertifier;
|
|
244
|
-
})(idProvider
|
|
244
|
+
})(idProvider || (exports.idProvider = idProvider = {}));
|
|
245
245
|
Object.freeze(idProvider);
|
|
246
246
|
var relyingParty;
|
|
247
247
|
(function (relyingParty) {
|
|
@@ -440,7 +440,7 @@ var relyingParty;
|
|
|
440
440
|
return verifyKeyCert(pubKeyCert, principalAddress, principalInfo.pkey, validAt, arrFactory);
|
|
441
441
|
}
|
|
442
442
|
relyingParty.verifyPubKey = verifyPubKey;
|
|
443
|
-
})(relyingParty
|
|
443
|
+
})(relyingParty || (exports.relyingParty = relyingParty = {}));
|
|
444
444
|
Object.freeze(relyingParty);
|
|
445
445
|
function correlateSKeyWithItsCert(skey, cert) {
|
|
446
446
|
const pkey = (0, jwkeys_1.keyFromJson)(cert.cert.publicKey, skey.use, ecma_nacl_1.signing.JWK_ALG_NAME, ecma_nacl_1.signing.PUBLIC_KEY_LENGTH);
|
|
@@ -555,6 +555,6 @@ var user;
|
|
|
555
555
|
return signer;
|
|
556
556
|
}
|
|
557
557
|
user.makeMailerIdSigner = makeMailerIdSigner;
|
|
558
|
-
})(user
|
|
558
|
+
})(user || (exports.user = user = {}));
|
|
559
559
|
Object.freeze(user);
|
|
560
560
|
Object.freeze(exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
type FileByteSink = web3n.files.FileByteSink;
|
|
2
|
+
export type ContinuousSink = (bytes: Uint8Array | null, err?: any) => Promise<void>;
|
|
3
3
|
export declare function makeContinuousSink(sink: FileByteSink, start?: number): ContinuousSink;
|
|
4
4
|
export declare function appendFiniteSink(sink: FileByteSink, bytes: Uint8Array, closeSink?: boolean): Promise<void>;
|
|
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.makeContinuousSink = makeContinuousSink;
|
|
20
|
+
exports.appendFiniteSink = appendFiniteSink;
|
|
20
21
|
class ContSink {
|
|
21
22
|
constructor(sink, position) {
|
|
22
23
|
this.sink = sink;
|
|
@@ -44,7 +45,6 @@ function makeContinuousSink(sink, start = 0) {
|
|
|
44
45
|
const contSink = new ContSink(sink, start);
|
|
45
46
|
return contSink.wrap();
|
|
46
47
|
}
|
|
47
|
-
exports.makeContinuousSink = makeContinuousSink;
|
|
48
48
|
async function appendFiniteSink(sink, bytes, closeSink = true) {
|
|
49
49
|
const initSize = await sink.getSize();
|
|
50
50
|
await sink.splice(initSize, 0, bytes);
|
|
@@ -52,5 +52,4 @@ async function appendFiniteSink(sink, bytes, closeSink = true) {
|
|
|
52
52
|
await sink.done();
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
exports.appendFiniteSink = appendFiniteSink;
|
|
56
55
|
Object.freeze(exports);
|
|
@@ -15,7 +15,7 @@
|
|
|
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.wrapObjSource =
|
|
18
|
+
exports.wrapObjSource = wrapObjSource;
|
|
19
19
|
function wrapObjSource(src) {
|
|
20
20
|
const synced = {
|
|
21
21
|
version: src.version,
|
|
@@ -24,5 +24,4 @@ function wrapObjSource(src) {
|
|
|
24
24
|
};
|
|
25
25
|
return synced;
|
|
26
26
|
}
|
|
27
|
-
exports.wrapObjSource = wrapObjSource;
|
|
28
27
|
Object.freeze(exports);
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Layout } from "xsp-files";
|
|
3
2
|
import { DiffInfo } from "../service-api/3nstorage/owner";
|
|
4
3
|
export interface HeaderChunkInfo {
|
|
5
4
|
len: number;
|
|
6
5
|
fileOfs: number;
|
|
7
6
|
}
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
7
|
+
export type NotOnDiskFiniteChunk = NewSegsChunk | BaseSegsChunk;
|
|
8
|
+
export type OnDiskChunk = NewSegsChunkOnDisk | BaseSegsChunkOnDisk;
|
|
9
|
+
export type FiniteSegsChunk = OnDiskChunk | NotOnDiskFiniteChunk;
|
|
10
|
+
export type SegsChunk = OnDiskChunk | NotOnDiskFiniteChunk | NewEndlessSegsChunk;
|
|
12
11
|
export interface FiniteChunk {
|
|
13
12
|
thisVerOfs: number;
|
|
14
13
|
len: number;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { Layout } from 'xsp-files';
|
|
4
2
|
import { DiffInfo } from '../service-api/3nstorage/owner';
|
|
5
3
|
import { ObjVersionFile } from './obj-file';
|
|
@@ -14,10 +12,10 @@ export interface ChunkWithSegs {
|
|
|
14
12
|
len: number;
|
|
15
13
|
segsOfs: number;
|
|
16
14
|
}
|
|
17
|
-
export
|
|
15
|
+
export type Chunk = ChunkWithHeader | ChunkWithSegs;
|
|
18
16
|
export declare function streamToObjFile(file: ObjVersionFile, content: Chunk[], src: Readable, maxBufferLen: number): Promise<void>;
|
|
19
17
|
export declare function chunksInOrderedStream(len: number, headerLen: undefined | number, segsOfs: number): Chunk[];
|
|
20
|
-
export
|
|
21
|
-
export
|
|
18
|
+
export type ObjPipe = (outStream: NodeJS.WritableStream) => Promise<void>;
|
|
19
|
+
export type GetObjFile = (objId: string | null, version: number) => Promise<ObjVersionFile>;
|
|
22
20
|
export declare function makeObjPipe(file: ObjVersionFile, header: boolean, segsOfs: number, segsLen: number, objId: string | null, getObjFile: GetObjFile): ObjPipe;
|
|
23
21
|
export declare function makeNoBaseObjPipe(file: ObjVersionFile, header: boolean, segsOfs: number, segsLen: number): ObjPipe;
|
|
@@ -16,7 +16,11 @@
|
|
|
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.diffToLayout = diffToLayout;
|
|
20
|
+
exports.streamToObjFile = streamToObjFile;
|
|
21
|
+
exports.chunksInOrderedStream = chunksInOrderedStream;
|
|
22
|
+
exports.makeObjPipe = makeObjPipe;
|
|
23
|
+
exports.makeNoBaseObjPipe = makeNoBaseObjPipe;
|
|
20
24
|
const deferred_1 = require("../processes/deferred");
|
|
21
25
|
const file_1 = require("../exceptions/file");
|
|
22
26
|
const assert_1 = require("../assert");
|
|
@@ -40,7 +44,6 @@ function diffToLayout(diff) {
|
|
|
40
44
|
}
|
|
41
45
|
return layout;
|
|
42
46
|
}
|
|
43
|
-
exports.diffToLayout = diffToLayout;
|
|
44
47
|
async function streamToObjFile(file, content, src, maxBufferLen) {
|
|
45
48
|
let deferred = (0, deferred_1.defer)();
|
|
46
49
|
const contentIter = content.values();
|
|
@@ -121,7 +124,6 @@ async function streamToObjFile(file, content, src, maxBufferLen) {
|
|
|
121
124
|
src.resume(); // noop, if stream wasn't paused
|
|
122
125
|
return deferred.promise;
|
|
123
126
|
}
|
|
124
|
-
exports.streamToObjFile = streamToObjFile;
|
|
125
127
|
function chunksInOrderedStream(len, headerLen, segsOfs) {
|
|
126
128
|
const chunks = [];
|
|
127
129
|
if (typeof headerLen === 'number') {
|
|
@@ -135,7 +137,6 @@ function chunksInOrderedStream(len, headerLen, segsOfs) {
|
|
|
135
137
|
chunks.push({ type: 'segs', segsOfs, len });
|
|
136
138
|
return chunks;
|
|
137
139
|
}
|
|
138
|
-
exports.chunksInOrderedStream = chunksInOrderedStream;
|
|
139
140
|
function makeObjPipe(file, header, segsOfs, segsLen, objId, getObjFile) {
|
|
140
141
|
const baseVersion = file.getBaseVersion();
|
|
141
142
|
if (baseVersion === undefined) {
|
|
@@ -162,7 +163,6 @@ function makeObjPipe(file, header, segsOfs, segsLen, objId, getObjFile) {
|
|
|
162
163
|
}
|
|
163
164
|
};
|
|
164
165
|
}
|
|
165
|
-
exports.makeObjPipe = makeObjPipe;
|
|
166
166
|
function makeNoBaseObjPipe(file, header, segsOfs, segsLen) {
|
|
167
167
|
return async (outStream) => {
|
|
168
168
|
if (header) {
|
|
@@ -171,5 +171,4 @@ function makeNoBaseObjPipe(file, header, segsOfs, segsLen) {
|
|
|
171
171
|
await file.streamSegsInto(outStream, segsOfs, segsLen);
|
|
172
172
|
};
|
|
173
173
|
}
|
|
174
|
-
exports.makeNoBaseObjPipe = makeNoBaseObjPipe;
|
|
175
174
|
Object.freeze(exports);
|
|
@@ -239,7 +239,7 @@ var layoutV1;
|
|
|
239
239
|
return attrs;
|
|
240
240
|
}
|
|
241
241
|
layoutV1.fromBytes = fromBytes;
|
|
242
|
-
})(layoutV1
|
|
242
|
+
})(layoutV1 || (exports.layoutV1 = layoutV1 = {}));
|
|
243
243
|
Object.freeze(layoutV1);
|
|
244
244
|
function totalLenOf(arrs) {
|
|
245
245
|
let totalLen = 0;
|
|
@@ -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.defer =
|
|
19
|
+
exports.defer = defer;
|
|
20
20
|
function defer() {
|
|
21
21
|
const d = {};
|
|
22
22
|
d.promise = new Promise((resolve, reject) => {
|
|
@@ -26,5 +26,4 @@ function defer() {
|
|
|
26
26
|
Object.freeze(d);
|
|
27
27
|
return d;
|
|
28
28
|
}
|
|
29
|
-
exports.defer = defer;
|
|
30
29
|
Object.freeze(exports);
|
|
@@ -16,11 +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.sleep =
|
|
19
|
+
exports.sleep = sleep;
|
|
20
20
|
function sleep(millis) {
|
|
21
21
|
return new Promise((resolve) => {
|
|
22
22
|
setTimeout(resolve, millis).unref();
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
exports.sleep = sleep;
|
|
26
25
|
Object.freeze(exports);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* later time. Scheduler needs a not-yet-started activity, as scheduler has
|
|
6
6
|
* control action's start.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export type Action<T> = () => Promise<T>;
|
|
9
9
|
/**
|
|
10
10
|
* This is a container of processes, labeled by some ids. It allows to track if
|
|
11
11
|
* there is a process already in progress with a given id. And, it allows to
|
|
@@ -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.SingleProc = exports.NamedProcs = void 0;
|
|
20
|
+
exports.makeSyncedFunc = makeSyncedFunc;
|
|
20
21
|
const deferred_1 = require("./deferred");
|
|
21
22
|
/**
|
|
22
23
|
* This is a container of processes, labeled by some ids. It allows to track if
|
|
@@ -164,5 +165,4 @@ Object.freeze(SingleProc);
|
|
|
164
165
|
function makeSyncedFunc(syncProc, thisArg, func) {
|
|
165
166
|
return ((...args) => syncProc.startOrChain(() => func.apply(thisArg, args)));
|
|
166
167
|
}
|
|
167
|
-
exports.makeSyncedFunc = makeSyncedFunc;
|
|
168
168
|
Object.freeze(exports);
|