core-3nweb-client-lib 0.30.3 → 0.30.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/api-defs/asmail.d.ts +9 -6
- package/build/core/app-files.d.ts +4 -4
- package/build/core/app-files.js +2 -2
- package/build/core/asmail/asmail-cap-ipc.d.ts +1 -1
- package/build/core/asmail/asmail-cap-ipc.js +2 -3
- package/build/core/asmail/config/common.d.ts +2 -2
- package/build/core/asmail/config/index.d.ts +1 -1
- package/build/core/asmail/config/invitations-anon.d.ts +1 -1
- package/build/core/asmail/config/invitations-anon.js +1 -2
- package/build/core/asmail/config/published-intro-key.d.ts +2 -2
- package/build/core/asmail/config/published-intro-key.js +1 -2
- package/build/core/asmail/delivery/common.d.ts +6 -6
- package/build/core/asmail/delivery/common.js +3 -3
- package/build/core/asmail/delivery/index.d.ts +4 -4
- package/build/core/asmail/delivery/msg.d.ts +4 -4
- package/build/core/asmail/delivery/msg.js +3 -3
- package/build/core/asmail/inbox/attachments/fs.d.ts +1 -1
- package/build/core/asmail/inbox/attachments/fs.js +1 -2
- package/build/core/asmail/inbox/inbox-events.d.ts +4 -3
- package/build/core/asmail/inbox/inbox-events.js +1 -1
- package/build/core/asmail/inbox/index.d.ts +2 -2
- package/build/core/asmail/inbox/index.js +7 -4
- package/build/core/asmail/inbox/msg-indexing/index.d.ts +2 -2
- package/build/core/asmail/inbox/msg-indexing/logs-n-entries.d.ts +3 -3
- package/build/core/asmail/inbox/msg-indexing/logs-n-entries.js +2 -2
- package/build/core/asmail/inbox/msg-indexing/sql-indexing.d.ts +1 -1
- package/build/core/asmail/inbox/msg-indexing/sql-indexing.js +1 -2
- package/build/core/asmail/inbox/msg-on-disk.d.ts +2 -2
- package/build/core/asmail/inbox/msg-on-disk.js +3 -3
- package/build/core/asmail/index.d.ts +3 -3
- package/build/core/asmail/key-verification.js +2 -3
- package/build/core/asmail/keyring/common.d.ts +1 -1
- package/build/core/asmail/keyring/common.js +7 -7
- package/build/core/asmail/keyring/correspondent-keys.d.ts +1 -1
- package/build/core/asmail/keyring/correspondent-keys.js +5 -5
- package/build/core/asmail/keyring/index.d.ts +3 -3
- package/build/core/asmail/keyring/index.js +2 -2
- package/build/core/asmail/keyring/keyring-storage.d.ts +1 -1
- package/build/core/asmail/keyring/keyring-storage.js +1 -2
- package/build/core/asmail/msg/attachments-container.d.ts +3 -3
- package/build/core/asmail/msg/attachments-container.js +7 -8
- package/build/core/asmail/msg/opener.js +2 -2
- package/build/core/asmail/msg/packer.d.ts +2 -2
- package/build/core/asmail/sending-params/index.d.ts +3 -3
- package/build/core/asmail/sending-params/own-params.d.ts +3 -3
- package/build/core/asmail/sending-params/params-from-others.d.ts +3 -3
- package/build/core/id-manager/index.d.ts +4 -4
- package/build/core/id-manager/key-storage.d.ts +1 -1
- package/build/core/id-manager/mailerid-cap-ipc.d.ts +1 -1
- package/build/core/id-manager/mailerid-cap-ipc.js +2 -3
- package/build/core/index.d.ts +3 -3
- package/build/core/startup/sign-in.d.ts +6 -6
- package/build/core/startup/sign-in.js +2 -2
- package/build/core/startup/sign-up.d.ts +1 -1
- package/build/core/startup/sign-up.js +6 -6
- package/build/core/startup/startup-cap.d.ts +2 -2
- package/build/core/startup/startup-cap.js +4 -5
- package/build/core/storage/common/obj-info-file.js +12 -13
- package/build/core/storage/common/utils.js +2 -3
- package/build/core/storage/index.d.ts +5 -5
- package/build/core/storage/index.js +2 -2
- package/build/core/storage/local/storage.d.ts +3 -3
- package/build/core/storage/storage-cap-ipc.d.ts +1 -1
- package/build/core/storage/storage-cap-ipc.js +3 -4
- package/build/core/storage/synced/obj-files.d.ts +1 -1
- package/build/core/storage/synced/obj-status.d.ts +2 -2
- package/build/core/storage/synced/obj-status.js +2 -2
- package/build/core/storage/synced/storage.d.ts +4 -4
- package/build/core/storage/synced/upload-header-file.js +3 -3
- package/build/core/storage/synced/upsyncer.d.ts +1 -1
- package/build/core/storage/system-folders/apps-data.d.ts +1 -1
- package/build/core/storage/system-folders/index.d.ts +2 -2
- package/build/core/storage/system-folders/index.js +4 -4
- package/build/core-ipc/bytes.d.ts +2 -2
- package/build/core-ipc/bytes.js +4 -5
- package/build/core-ipc/common-caps.d.ts +1 -1
- package/build/core-ipc/common-caps.js +3 -4
- package/build/core-ipc/file.d.ts +13 -14
- package/build/core-ipc/file.js +31 -31
- package/build/core-ipc/fs.d.ts +3 -3
- package/build/core-ipc/fs.js +6 -6
- package/build/core-ipc/generic.d.ts +4 -4
- package/build/core-ipc/generic.js +3 -4
- package/build/core-ipc/log-cap.d.ts +1 -1
- package/build/core-ipc/log-cap.js +2 -3
- package/build/core-ipc/startup-caps.d.ts +1 -1
- package/build/core-ipc/startup-caps.js +2 -3
- package/build/ipc-via-protobuf/connector.d.ts +6 -7
- package/build/ipc-via-protobuf/connector.js +3 -3
- package/build/ipc-via-protobuf/protobuf-msg.d.ts +1 -2
- package/build/ipc-via-protobuf/protobuf-msg.js +20 -20
- package/build/lib-client/3nstorage/exceptions.d.ts +1 -1
- package/build/lib-client/3nstorage/exceptions.js +9 -10
- package/build/lib-client/3nstorage/service.d.ts +2 -2
- package/build/lib-client/3nstorage/util/file-based-json.d.ts +3 -3
- package/build/lib-client/3nstorage/util/for-arrays.js +1 -2
- package/build/lib-client/3nstorage/xsp-fs/attrs.d.ts +1 -2
- package/build/lib-client/3nstorage/xsp-fs/common.d.ts +12 -12
- package/build/lib-client/3nstorage/xsp-fs/common.js +5 -5
- package/build/lib-client/3nstorage/xsp-fs/file-node.d.ts +4 -4
- package/build/lib-client/3nstorage/xsp-fs/file.d.ts +15 -15
- package/build/lib-client/3nstorage/xsp-fs/folder-node-serialization.js +2 -3
- package/build/lib-client/3nstorage/xsp-fs/folder-node.d.ts +7 -7
- package/build/lib-client/3nstorage/xsp-fs/fs.d.ts +27 -27
- package/build/lib-client/3nstorage/xsp-fs/link-node.d.ts +2 -2
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.d.ts +7 -7
- package/build/lib-client/3nstorage/xsp-fs/node-in-fs.js +11 -11
- package/build/lib-client/3nstorage/xsp-fs/node-persistence.d.ts +2 -2
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v1.js +1 -2
- package/build/lib-client/3nstorage/xsp-fs/xsp-payload-v2.js +3 -4
- package/build/lib-client/3nweb-signup.js +4 -5
- package/build/lib-client/asmail/recipient.d.ts +1 -1
- package/build/lib-client/asmail/recipient.js +4 -4
- package/build/lib-client/asmail/sender.d.ts +3 -3
- package/build/lib-client/asmail/sender.js +9 -9
- package/build/lib-client/cryptor/cryptor-in-worker.d.ts +2 -2
- package/build/lib-client/cryptor/cryptor-wasm.js +1 -1
- package/build/lib-client/cryptor/cryptor.d.ts +2 -2
- package/build/lib-client/cryptor/cryptor.js +3 -3
- package/build/lib-client/cryptor/cryptor.wasm +0 -0
- package/build/lib-client/cryptor/in-proc-js.js +1 -2
- package/build/lib-client/cryptor/in-proc-wasm.js +1 -2
- package/build/lib-client/cryptor/serialization-for-wasm.d.ts +1 -2
- package/build/lib-client/cryptor/serialization-for-wasm.js +6 -7
- package/build/lib-client/cryptor/wasm-mp1-modules.js +1 -2
- package/build/lib-client/cryptor-work-labels.js +1 -1
- package/build/lib-client/fs-utils/files-select.d.ts +3 -3
- package/build/lib-client/fs-utils/files-select.js +1 -2
- package/build/lib-client/fs-utils/files.d.ts +7 -7
- package/build/lib-client/fs-utils/files.js +7 -8
- package/build/lib-client/fs-utils/fs-collection.d.ts +1 -1
- package/build/lib-client/fs-utils/fs-collection.js +2 -3
- package/build/lib-client/fs-utils/fs-sync-utils.d.ts +5 -5
- package/build/lib-client/fs-utils/fs-sync-utils.js +4 -5
- package/build/lib-client/fs-utils/fs-view.d.ts +4 -4
- package/build/lib-client/fs-utils/fs-view.js +1 -2
- package/build/lib-client/key-derivation.js +3 -4
- package/build/lib-client/local-files/dev-file-sink.d.ts +2 -3
- package/build/lib-client/local-files/dev-file-src.d.ts +0 -1
- package/build/lib-client/local-files/device-fs.d.ts +18 -18
- package/build/lib-client/logging/log-to-file.d.ts +5 -5
- package/build/lib-client/logging/log-to-file.js +2 -2
- package/build/lib-client/mailer-id/login.js +2 -3
- package/build/lib-client/objs-on-disk/file-writing-proc.d.ts +1 -1
- package/build/lib-client/objs-on-disk/obj-folders.d.ts +1 -1
- package/build/lib-client/objs-on-disk/obj-folders.js +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.d.ts +6 -4
- package/build/lib-common/exceptions/error.js +15 -10
- 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 +14 -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
|
@@ -14,7 +14,7 @@ export interface Cryptor {
|
|
|
14
14
|
generate_keypair(seed: Uint8Array): Promise<signing.Keypair>;
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
export
|
|
17
|
+
export type makeCryptor = (logErr: LogError, logWarning: LogWarning, maxThreads?: number) => {
|
|
18
18
|
cryptor: Cryptor;
|
|
19
19
|
close: () => Promise<void>;
|
|
20
20
|
};
|
|
@@ -22,7 +22,7 @@ export declare const makeInWorkerCryptor: makeCryptor;
|
|
|
22
22
|
export declare const makeInWorkerWasmCryptor: makeCryptor;
|
|
23
23
|
export declare function makeInProcessCryptor(): ReturnType<makeCryptor>;
|
|
24
24
|
export declare function makeInProcessWasmCryptor(): ReturnType<makeCryptor>;
|
|
25
|
-
|
|
25
|
+
type RuntimeException = web3n.RuntimeException;
|
|
26
26
|
export interface CryptorException extends RuntimeException {
|
|
27
27
|
type: 'cryptor';
|
|
28
28
|
failedCipherVerification?: true;
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.makeInWorkerWasmCryptor = exports.makeInWorkerCryptor = void 0;
|
|
20
|
+
exports.makeInProcessCryptor = makeInProcessCryptor;
|
|
21
|
+
exports.makeInProcessWasmCryptor = makeInProcessWasmCryptor;
|
|
20
22
|
const makeInWorkerCryptor = (logErr, logWarning, maxThreads) => {
|
|
21
23
|
const mod = require('./cryptor-in-worker');
|
|
22
24
|
const makeInWorkerCryptor = mod.makeInWorkerCryptor;
|
|
@@ -34,11 +36,9 @@ function makeInProcessCryptor() {
|
|
|
34
36
|
const makeInProcessCryptor = mod.makeInProcessCryptor;
|
|
35
37
|
return { cryptor: makeInProcessCryptor(), close: async () => { } };
|
|
36
38
|
}
|
|
37
|
-
exports.makeInProcessCryptor = makeInProcessCryptor;
|
|
38
39
|
function makeInProcessWasmCryptor() {
|
|
39
40
|
const mod = require('./in-proc-wasm');
|
|
40
41
|
const makeInProcessWasmCryptor = mod.makeInProcessWasmCryptor;
|
|
41
42
|
return { cryptor: makeInProcessWasmCryptor(), close: async () => { } };
|
|
42
43
|
}
|
|
43
|
-
exports.makeInProcessWasmCryptor = makeInProcessWasmCryptor;
|
|
44
44
|
Object.freeze(exports);
|
|
Binary file
|
|
@@ -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.makeInProcessCryptor =
|
|
19
|
+
exports.makeInProcessCryptor = makeInProcessCryptor;
|
|
20
20
|
const ecma_nacl_1 = require("ecma-nacl");
|
|
21
21
|
const cryptor_work_labels_1 = require("../cryptor-work-labels");
|
|
22
22
|
function onNextTick(f) {
|
|
@@ -54,5 +54,4 @@ function makeInProcessCryptor() {
|
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
exports.makeInProcessCryptor = makeInProcessCryptor;
|
|
58
57
|
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.makeInProcessWasmCryptor =
|
|
19
|
+
exports.makeInProcessWasmCryptor = makeInProcessWasmCryptor;
|
|
20
20
|
const wasm_mp1_modules_1 = require("./wasm-mp1-modules");
|
|
21
21
|
const fs_1 = require("fs");
|
|
22
22
|
const path_1 = require("path");
|
|
@@ -173,5 +173,4 @@ function makeInProcessWasmCryptor() {
|
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
exports.makeInProcessWasmCryptor = makeInProcessWasmCryptor;
|
|
177
176
|
Object.freeze(exports);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { signing } from 'ecma-nacl';
|
|
3
2
|
export interface WasmScryptRequest {
|
|
4
3
|
func: 1;
|
|
@@ -19,7 +18,7 @@ export interface ByteArg {
|
|
|
19
18
|
val: Uint8Array;
|
|
20
19
|
}
|
|
21
20
|
export declare function toArgs(...args: Uint8Array[]): ByteArg[];
|
|
22
|
-
export
|
|
21
|
+
export type WasmRequest = WasmScryptRequest | WasmBinArgsRequest;
|
|
23
22
|
export interface WasmReply {
|
|
24
23
|
res?: ByteArg;
|
|
25
24
|
interim?: ByteArg;
|
|
@@ -16,13 +16,17 @@
|
|
|
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.toArgs = toArgs;
|
|
20
|
+
exports.toLocalErr = toLocalErr;
|
|
21
|
+
exports.packRequestToWASM = packRequestToWASM;
|
|
22
|
+
exports.unpackReplyFromWASM = unpackReplyFromWASM;
|
|
23
|
+
exports.unpackSigningKeyPair = unpackSigningKeyPair;
|
|
24
|
+
exports.unpackBoolVal = unpackBoolVal;
|
|
20
25
|
const protobuf_type_1 = require("../protobuf-type");
|
|
21
26
|
const cryptor_proto_1 = require("../../protos/cryptor.proto");
|
|
22
27
|
function toArgs(...args) {
|
|
23
28
|
return args.map(val => ({ val }));
|
|
24
29
|
}
|
|
25
|
-
exports.toArgs = toArgs;
|
|
26
30
|
function toLocalErr(replyErr) {
|
|
27
31
|
if (replyErr.condition === 'cipher-verification') {
|
|
28
32
|
return { failedCipherVerification: true };
|
|
@@ -34,25 +38,20 @@ function toLocalErr(replyErr) {
|
|
|
34
38
|
return new Error(`WASM cryptor ${replyErr.condition}: ${replyErr.message}`);
|
|
35
39
|
}
|
|
36
40
|
}
|
|
37
|
-
exports.toLocalErr = toLocalErr;
|
|
38
41
|
const wasmRequestProtoType = protobuf_type_1.ProtoType.for(cryptor_proto_1.cryptor.Request);
|
|
39
42
|
const wasmReplyProtoType = protobuf_type_1.ProtoType.for(cryptor_proto_1.cryptor.Reply);
|
|
40
43
|
function packRequestToWASM(req) {
|
|
41
44
|
return wasmRequestProtoType.pack(req);
|
|
42
45
|
}
|
|
43
|
-
exports.packRequestToWASM = packRequestToWASM;
|
|
44
46
|
function unpackReplyFromWASM(replyBytes) {
|
|
45
47
|
return wasmReplyProtoType.unpack(replyBytes);
|
|
46
48
|
}
|
|
47
|
-
exports.unpackReplyFromWASM = unpackReplyFromWASM;
|
|
48
49
|
const boolValType = protobuf_type_1.ProtoType.for(cryptor_proto_1.cryptor.BoolVal);
|
|
49
50
|
const kpairType = protobuf_type_1.ProtoType.for(cryptor_proto_1.cryptor.Keypair);
|
|
50
51
|
function unpackSigningKeyPair(bytes) {
|
|
51
52
|
return kpairType.unpack(bytes);
|
|
52
53
|
}
|
|
53
|
-
exports.unpackSigningKeyPair = unpackSigningKeyPair;
|
|
54
54
|
function unpackBoolVal(bytes) {
|
|
55
55
|
return boolValType.unpack(bytes).val;
|
|
56
56
|
}
|
|
57
|
-
exports.unpackBoolVal = unpackBoolVal;
|
|
58
57
|
Object.freeze(exports);
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.startWasmFrom =
|
|
12
|
+
exports.startWasmFrom = startWasmFrom;
|
|
13
13
|
class MP1 {
|
|
14
14
|
constructor(wasmBytes) {
|
|
15
15
|
this.sinkMsgFromWasmInstance = undefined;
|
|
@@ -75,5 +75,4 @@ function startWasmFrom(wasmModuleBytes) {
|
|
|
75
75
|
setMsgListener: listener => mp1.setMsgListener(listener)
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
exports.startWasmFrom = startWasmFrom;
|
|
79
78
|
Object.freeze(exports);
|
|
@@ -66,7 +66,7 @@ var cryptoWorkLabels;
|
|
|
66
66
|
return (low + (high * 0x100000000));
|
|
67
67
|
}
|
|
68
68
|
cryptoWorkLabels.makeRandom = makeRandom;
|
|
69
|
-
})(cryptoWorkLabels
|
|
69
|
+
})(cryptoWorkLabels || (exports.cryptoWorkLabels = cryptoWorkLabels = {}));
|
|
70
70
|
Object.freeze(cryptoWorkLabels);
|
|
71
71
|
class LabeledWorkQueues {
|
|
72
72
|
constructor() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type ReadonlyFS = web3n.files.ReadonlyFS;
|
|
2
|
+
type SelectCriteria = web3n.files.SelectCriteria;
|
|
3
|
+
type FSCollection = web3n.files.FSCollection;
|
|
4
4
|
export declare function selectInFS(fs: ReadonlyFS, path: string, criteria: SelectCriteria): Promise<{
|
|
5
5
|
items: FSCollection;
|
|
6
6
|
completion: Promise<void>;
|
|
@@ -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.selectInFS =
|
|
18
|
+
exports.selectInFS = selectInFS;
|
|
19
19
|
const fs_collection_1 = require("./fs-collection");
|
|
20
20
|
const path_1 = require("path");
|
|
21
21
|
async function selectInFS(fs, path, criteria) {
|
|
@@ -40,7 +40,6 @@ async function selectInFS(fs, path, criteria) {
|
|
|
40
40
|
const completion = deepIter(fs, '/', iterCB, criteria.depth);
|
|
41
41
|
return { items, completion };
|
|
42
42
|
}
|
|
43
|
-
exports.selectInFS = selectInFS;
|
|
44
43
|
function match(entry, criteria) {
|
|
45
44
|
if (!matchType(entry, criteria.type)) {
|
|
46
45
|
return false;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
type FS = web3n.files.FS;
|
|
2
|
+
type FSType = web3n.files.FSType;
|
|
3
|
+
type ReadonlyFS = web3n.files.ReadonlyFS;
|
|
4
|
+
type WritableFS = web3n.files.WritableFS;
|
|
5
|
+
type File = web3n.files.File;
|
|
6
|
+
type ReadonlyFile = web3n.files.ReadonlyFile;
|
|
7
|
+
type WritableFile = web3n.files.WritableFile;
|
|
8
8
|
export interface LinkParameters<T> {
|
|
9
9
|
storageType: FSType;
|
|
10
10
|
readonly?: boolean;
|
|
@@ -16,13 +16,18 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.wrapFileImplementation = wrapFileImplementation;
|
|
20
|
+
exports.wrapWritableFile = wrapWritableFile;
|
|
21
|
+
exports.wrapReadonlyFile = wrapReadonlyFile;
|
|
22
|
+
exports.wrapFSImplementation = wrapFSImplementation;
|
|
23
|
+
exports.wrapWritableFS = wrapWritableFS;
|
|
24
|
+
exports.wrapReadonlyFS = wrapReadonlyFS;
|
|
25
|
+
exports.wrapIntoVersionlessReadonlyFS = wrapIntoVersionlessReadonlyFS;
|
|
20
26
|
function wrapFileImplementation(fImpl) {
|
|
21
27
|
return (fImpl.writable ?
|
|
22
28
|
wrapWritableFile(fImpl) :
|
|
23
29
|
wrapReadonlyFile(fImpl));
|
|
24
30
|
}
|
|
25
|
-
exports.wrapFileImplementation = wrapFileImplementation;
|
|
26
31
|
function wrapWritableFile(fImpl) {
|
|
27
32
|
ensureWritable(fImpl);
|
|
28
33
|
const w = {
|
|
@@ -47,7 +52,6 @@ function wrapWritableFile(fImpl) {
|
|
|
47
52
|
};
|
|
48
53
|
return addParamsAndFreezeFileWrap(w, fImpl);
|
|
49
54
|
}
|
|
50
|
-
exports.wrapWritableFile = wrapWritableFile;
|
|
51
55
|
function ensureWritable(o) {
|
|
52
56
|
if (!o.writable) {
|
|
53
57
|
throw Error(`File/FS object with unexpected flags is given`);
|
|
@@ -112,7 +116,6 @@ function wrapReadonlyFile(fImpl) {
|
|
|
112
116
|
};
|
|
113
117
|
return addParamsAndFreezeFileWrap(w, fImpl);
|
|
114
118
|
}
|
|
115
|
-
exports.wrapReadonlyFile = wrapReadonlyFile;
|
|
116
119
|
function wrapReadonlyFileVersionedAPI(vImpl) {
|
|
117
120
|
if (!vImpl) {
|
|
118
121
|
return;
|
|
@@ -147,7 +150,6 @@ function wrapFSImplementation(fsImpl) {
|
|
|
147
150
|
wrapWritableFS(fsImpl) :
|
|
148
151
|
wrapReadonlyFS(fsImpl));
|
|
149
152
|
}
|
|
150
|
-
exports.wrapFSImplementation = wrapFSImplementation;
|
|
151
153
|
function wrapWritableFS(fsImpl) {
|
|
152
154
|
ensureWritable(fsImpl);
|
|
153
155
|
const w = {
|
|
@@ -194,7 +196,6 @@ function wrapWritableFS(fsImpl) {
|
|
|
194
196
|
};
|
|
195
197
|
return addParamsAndFreezeFSWrap(w, fsImpl);
|
|
196
198
|
}
|
|
197
|
-
exports.wrapWritableFS = wrapWritableFS;
|
|
198
199
|
function addParamsAndFreezeFSWrap(w, fsImpl) {
|
|
199
200
|
if (typeof fsImpl.getLinkParams === 'function') {
|
|
200
201
|
w.getLinkParams =
|
|
@@ -269,7 +270,6 @@ function wrapReadonlyFS(fsImpl) {
|
|
|
269
270
|
};
|
|
270
271
|
return addParamsAndFreezeFSWrap(w, fsImpl);
|
|
271
272
|
}
|
|
272
|
-
exports.wrapReadonlyFS = wrapReadonlyFS;
|
|
273
273
|
function wrapReadonlyFSVersionedAPI(vImpl) {
|
|
274
274
|
if (!vImpl) {
|
|
275
275
|
return;
|
|
@@ -338,7 +338,6 @@ function wrapIntoVersionlessReadonlyFS(fs, type) {
|
|
|
338
338
|
};
|
|
339
339
|
return Object.freeze(w);
|
|
340
340
|
}
|
|
341
|
-
exports.wrapIntoVersionlessReadonlyFS = wrapIntoVersionlessReadonlyFS;
|
|
342
341
|
/**
|
|
343
342
|
* This wraps given versioned file into readonly versionless file that will fail
|
|
344
343
|
* to be linked. So, use this function for non linkable storages like
|
|
@@ -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.readonlyWrapFSCollection = readonlyWrapFSCollection;
|
|
20
|
+
exports.makeFSCollection = makeFSCollection;
|
|
20
21
|
const rxjs_1 = require("rxjs");
|
|
21
22
|
const utils_for_observables_1 = require("../../lib-common/utils-for-observables");
|
|
22
23
|
class FSItemsCollection {
|
|
@@ -97,9 +98,7 @@ function readonlyWrapFSCollection(c) {
|
|
|
97
98
|
};
|
|
98
99
|
return Object.freeze(w);
|
|
99
100
|
}
|
|
100
|
-
exports.readonlyWrapFSCollection = readonlyWrapFSCollection;
|
|
101
101
|
function makeFSCollection() {
|
|
102
102
|
return (new FSItemsCollection()).wrap();
|
|
103
103
|
}
|
|
104
|
-
exports.makeFSCollection = makeFSCollection;
|
|
105
104
|
Object.freeze(exports);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
type WritableFS = web3n.files.WritableFS;
|
|
3
|
+
type ReadonlyFS = web3n.files.ReadonlyFS;
|
|
4
|
+
type RemoteEvent = web3n.files.RemoteEvent;
|
|
5
|
+
type FileEvent = web3n.files.FileEvent;
|
|
6
|
+
type FolderEvent = web3n.files.FolderEvent;
|
|
7
7
|
export declare function getRemoteFolderChanges(fs: WritableFS, forceServerCheck?: boolean): Promise<void>;
|
|
8
8
|
export declare function getOrMakeAndUploadFolderIn(fs: WritableFS, folder: string): Promise<WritableFS>;
|
|
9
9
|
export declare function uploadFolderChangesIfAny(fs: WritableFS): Promise<void>;
|
|
@@ -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.getRemoteFolderChanges = getRemoteFolderChanges;
|
|
20
|
+
exports.getOrMakeAndUploadFolderIn = getOrMakeAndUploadFolderIn;
|
|
21
|
+
exports.uploadFolderChangesIfAny = uploadFolderChangesIfAny;
|
|
22
|
+
exports.observableFromTreeEvents = observableFromTreeEvents;
|
|
20
23
|
const rxjs_1 = require("rxjs");
|
|
21
24
|
const exceptions_1 = require("../3nstorage/exceptions");
|
|
22
25
|
async function getRemoteFolderChanges(fs, forceServerCheck = false) {
|
|
@@ -38,7 +41,6 @@ async function getRemoteFolderChanges(fs, forceServerCheck = false) {
|
|
|
38
41
|
});
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
|
-
exports.getRemoteFolderChanges = getRemoteFolderChanges;
|
|
42
44
|
async function getOrMakeAndUploadFolderIn(fs, folder) {
|
|
43
45
|
try {
|
|
44
46
|
const childFolder = await fs.writableSubRoot(folder, { create: false });
|
|
@@ -56,7 +58,6 @@ async function getOrMakeAndUploadFolderIn(fs, folder) {
|
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
}
|
|
59
|
-
exports.getOrMakeAndUploadFolderIn = getOrMakeAndUploadFolderIn;
|
|
60
61
|
async function uploadFolderChangesIfAny(fs) {
|
|
61
62
|
const { state } = await fs.v.sync.status('');
|
|
62
63
|
if (state === 'unsynced') {
|
|
@@ -64,9 +65,7 @@ async function uploadFolderChangesIfAny(fs) {
|
|
|
64
65
|
await fs.v.sync.upload('');
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
exports.uploadFolderChangesIfAny = uploadFolderChangesIfAny;
|
|
68
68
|
function observableFromTreeEvents(fs, rootPath) {
|
|
69
69
|
return new rxjs_1.Observable(obs => fs.watchTree(rootPath, undefined, obs));
|
|
70
70
|
}
|
|
71
|
-
exports.observableFromTreeEvents = observableFromTreeEvents;
|
|
72
71
|
Object.freeze(exports);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type ReadonlyFS = web3n.files.ReadonlyFS;
|
|
2
|
+
type WritableFS = web3n.files.WritableFS;
|
|
3
|
+
type WritableFile = web3n.files.WritableFile;
|
|
4
4
|
export interface FSReadView extends ReadonlyFS {
|
|
5
5
|
}
|
|
6
6
|
export interface FSWriteView extends WritableFS {
|
|
7
7
|
rollbackWrite(): Promise<void>;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type FSWrite = FSReadView | FSWriteView;
|
|
10
10
|
export interface FileWriteView extends WritableFile {
|
|
11
11
|
rollbackWrite(): Promise<void>;
|
|
12
12
|
}
|
|
@@ -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.readonlyFSView =
|
|
19
|
+
exports.readonlyFSView = readonlyFSView;
|
|
20
20
|
async function readonlyFSView(fs, state) {
|
|
21
21
|
// XXX
|
|
22
22
|
// Notes:
|
|
@@ -29,5 +29,4 @@ async function readonlyFSView(fs, state) {
|
|
|
29
29
|
// as being part of sync wall.
|
|
30
30
|
throw new Error('Function not implemented.');
|
|
31
31
|
}
|
|
32
|
-
exports.readonlyFSView = readonlyFSView;
|
|
33
32
|
Object.freeze(exports);
|
|
@@ -15,7 +15,9 @@
|
|
|
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.checkParams = checkParams;
|
|
19
|
+
exports.deriveStorageSKey = deriveStorageSKey;
|
|
20
|
+
exports.deriveMidKeyPair = deriveMidKeyPair;
|
|
19
21
|
const jwkeys_1 = require("../lib-common/jwkeys");
|
|
20
22
|
const buffer_utils_1 = require("../lib-common/buffer-utils");
|
|
21
23
|
const ecma_nacl_1 = require("ecma-nacl");
|
|
@@ -34,13 +36,11 @@ function checkParams(params) {
|
|
|
34
36
|
}
|
|
35
37
|
return true;
|
|
36
38
|
}
|
|
37
|
-
exports.checkParams = checkParams;
|
|
38
39
|
function deriveStorageSKey(cryptor, pass, derivParams, progressCB) {
|
|
39
40
|
const passBytes = buffer_utils_1.utf8.pack(pass);
|
|
40
41
|
const saltBytes = buffer_utils_1.base64.open(derivParams.salt);
|
|
41
42
|
return cryptor.scrypt(passBytes, saltBytes, derivParams.logN, derivParams.r, derivParams.p, ecma_nacl_1.secret_box.KEY_LENGTH, progressCB);
|
|
42
43
|
}
|
|
43
|
-
exports.deriveStorageSKey = deriveStorageSKey;
|
|
44
44
|
async function deriveMidKeyPair(cryptor, pass, derivParams, progressCB, use = '', kid = '') {
|
|
45
45
|
const passBytes = buffer_utils_1.utf8.pack(pass);
|
|
46
46
|
const saltBytes = buffer_utils_1.base64.open(derivParams.salt);
|
|
@@ -57,5 +57,4 @@ async function deriveMidKeyPair(cryptor, pass, derivParams, progressCB, use = ''
|
|
|
57
57
|
pkey: pkeyJSON
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
exports.deriveMidKeyPair = deriveMidKeyPair;
|
|
61
60
|
Object.freeze(exports);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import * as fs from '../../lib-common/async-fs-node';
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
type FileByteSink = web3n.files.FileByteSink;
|
|
3
|
+
type Layout = web3n.files.FileLayout;
|
|
5
4
|
export declare class DevFileByteSink implements FileByteSink {
|
|
6
5
|
private readonly path;
|
|
7
6
|
private readonly pathPrefixMaskLen;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { LinkParameters, Linkable } from '../fs-utils/files';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
type Stats = web3n.files.Stats;
|
|
3
|
+
type FS = web3n.files.FS;
|
|
4
|
+
type WritableFS = web3n.files.WritableFS;
|
|
5
|
+
type ReadonlyFS = web3n.files.ReadonlyFS;
|
|
6
|
+
type File = web3n.files.File;
|
|
7
|
+
type WritableFile = web3n.files.WritableFile;
|
|
8
|
+
type ReadonlyFile = web3n.files.ReadonlyFile;
|
|
9
|
+
type FSType = web3n.files.FSType;
|
|
10
|
+
type ListingEntry = web3n.files.ListingEntry;
|
|
11
|
+
type SymLink = web3n.files.SymLink;
|
|
12
|
+
type FolderEvent = web3n.files.FolderEvent;
|
|
13
|
+
type FileEvent = web3n.files.FileEvent;
|
|
14
|
+
type Observer<T> = web3n.Observer<T>;
|
|
15
|
+
type SelectCriteria = web3n.files.SelectCriteria;
|
|
16
|
+
type FSCollection = web3n.files.FSCollection;
|
|
17
|
+
type FileByteSource = web3n.files.FileByteSource;
|
|
18
|
+
type FileByteSink = web3n.files.FileByteSink;
|
|
19
|
+
type XAttrsChanges = web3n.files.XAttrsChanges;
|
|
20
20
|
interface FolderLinkParams {
|
|
21
21
|
path: string;
|
|
22
22
|
}
|
|
@@ -2,10 +2,10 @@ export declare const LOGS_FOLDER = "logs";
|
|
|
2
2
|
export declare function makeLogger(utilDir: string): Readonly<{
|
|
3
3
|
logError: (err: any, msg?: string) => Promise<void>;
|
|
4
4
|
logWarning: (msg: string, err?: any) => Promise<void>;
|
|
5
|
-
appLog: (type:
|
|
5
|
+
appLog: (type: "error" | "info" | "warning", appDomain: string, msg: string, err?: any) => Promise<void>;
|
|
6
6
|
recordUnhandledRejectionsInProcess: () => void;
|
|
7
7
|
}>;
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
8
|
+
export type Logger = ReturnType<typeof makeLogger>;
|
|
9
|
+
export type LogError = Logger['logError'];
|
|
10
|
+
export type LogWarning = Logger['logWarning'];
|
|
11
|
+
export type AppLog = Logger['appLog'];
|
|
@@ -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.LOGS_FOLDER = void 0;
|
|
20
|
+
exports.makeLogger = makeLogger;
|
|
20
21
|
const error_1 = require("../../lib-common/exceptions/error");
|
|
21
22
|
const synced_1 = require("../../lib-common/processes/synced");
|
|
22
23
|
const async_fs_node_1 = require("../../lib-common/async-fs-node");
|
|
@@ -127,6 +128,5 @@ ${(0, error_1.stringifyErr)(err)}`;
|
|
|
127
128
|
logError, logWarning, appLog, recordUnhandledRejectionsInProcess
|
|
128
129
|
});
|
|
129
130
|
}
|
|
130
|
-
exports.makeLogger = makeLogger;
|
|
131
131
|
function noop() { }
|
|
132
132
|
Object.freeze(exports);
|
|
@@ -16,7 +16,8 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
19
|
+
exports.startMidSession = startMidSession;
|
|
20
|
+
exports.authenticateMidSession = authenticateMidSession;
|
|
20
21
|
const api = require("../../lib-common/service-api/mailer-id/login");
|
|
21
22
|
const request_utils_1 = require("../request-utils");
|
|
22
23
|
const url_1 = require("url");
|
|
@@ -53,7 +54,6 @@ async function startMidSession(userId, net, loginUrl) {
|
|
|
53
54
|
throw (0, request_utils_1.makeException)(rep, 'Unexpected status');
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
exports.startMidSession = startMidSession;
|
|
57
57
|
async function authenticateMidSession(sessionId, midSigner, net, loginUrl) {
|
|
58
58
|
const domain = (0, url_1.parse)(loginUrl).hostname;
|
|
59
59
|
const reqData = {
|
|
@@ -81,5 +81,4 @@ async function authenticateMidSession(sessionId, midSigner, net, loginUrl) {
|
|
|
81
81
|
throw (0, request_utils_1.makeException)(rep, 'Unexpected status');
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
exports.authenticateMidSession = authenticateMidSession;
|
|
85
84
|
Object.freeze(exports);
|
|
@@ -19,7 +19,7 @@ export interface Cfg {
|
|
|
19
19
|
export interface CfgWithGens extends Cfg {
|
|
20
20
|
generations: GenerationCfg[];
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type CanMoveObjToDeeperCache = (objId: string, folderPath: string) => Promise<boolean>;
|
|
23
23
|
export declare class ObjFolders {
|
|
24
24
|
private readonly path;
|
|
25
25
|
private readonly numOfSplits;
|
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.ObjFolders =
|
|
19
|
+
exports.ObjFolders = void 0;
|
|
20
|
+
exports.makeNotFoundExc = makeNotFoundExc;
|
|
21
|
+
exports.makeAlreadyExistExc = makeAlreadyExistExc;
|
|
20
22
|
const fs = require("../../lib-common/async-fs-node");
|
|
21
23
|
const synced_1 = require("../../lib-common/processes/synced");
|
|
22
24
|
const xsp_files_1 = require("xsp-files");
|
|
@@ -31,7 +33,6 @@ function makeNotFoundExc(msg) {
|
|
|
31
33
|
notFound: true
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
|
-
exports.makeNotFoundExc = makeNotFoundExc;
|
|
35
36
|
function makeAlreadyExistExc(msg) {
|
|
36
37
|
return {
|
|
37
38
|
runtimeException: true,
|
|
@@ -40,7 +41,6 @@ function makeAlreadyExistExc(msg) {
|
|
|
40
41
|
alreadyExist: true
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
exports.makeAlreadyExistExc = makeAlreadyExistExc;
|
|
44
44
|
function alreadyExistsOrReThrow(exc) {
|
|
45
45
|
if (!exc.alreadyExists) {
|
|
46
46
|
throw exc;
|
|
@@ -4,7 +4,7 @@ import { FileWrite } from './file-writing-proc';
|
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { NotOnDiskFiniteChunk, FiniteChunk } from '../../lib-common/objs-on-disk/file-layout';
|
|
6
6
|
import { DiffInfo } from '../../lib-common/service-api/3nstorage/owner';
|
|
7
|
-
export
|
|
7
|
+
export type GetBaseSegsOnDisk = (version: number, ofs: number, len: number) => Promise<(Uint8Array | NotOnDiskFiniteChunk)[]>;
|
|
8
8
|
export declare class ObjOnDisk {
|
|
9
9
|
readonly objId: ObjId;
|
|
10
10
|
readonly version: number;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { HTTPException } from '../lib-common/exceptions/http';
|
|
4
2
|
import * as https from 'https';
|
|
5
3
|
import { ClientRequest } from 'http';
|
|
@@ -28,8 +26,8 @@ export interface RequestOpts {
|
|
|
28
26
|
export interface Headers {
|
|
29
27
|
get(name: string): string | undefined;
|
|
30
28
|
}
|
|
31
|
-
export
|
|
32
|
-
export
|
|
29
|
+
export type ContentType = 'application/json' | 'application/octet-stream' | 'text/plain';
|
|
30
|
+
export type RequestFn<T> = (opts: RequestOpts, contentType?: ContentType, reqBody?: Uint8Array) => Promise<Reply<T>>;
|
|
33
31
|
export declare function processRequest<T>(requester: (opts: https.RequestOptions) => ClientRequest, httpsOpts: https.RequestOptions, opts: RequestOpts, reqBody: Uint8Array | undefined, attempt?: number): Promise<Reply<T>>;
|
|
34
32
|
export declare function formHttpsReqOpts(opts: RequestOpts, contentType?: ContentType, reqBody?: Uint8Array): https.RequestOptions;
|
|
35
33
|
/**
|