tool-db 2.3.1 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -74
- package/lib/adapters-base/networkAdapter.ts +215 -0
- package/lib/adapters-base/storageAdapter.ts +35 -0
- package/lib/adapters-base/userAdapter.ts +49 -0
- package/lib/crdt/baseCrdt.ts +21 -0
- package/lib/crdt/counterCrdt.ts +111 -0
- package/lib/crdt/listCrdt.ts +190 -0
- package/lib/crdt/mapCrdt.ts +119 -0
- package/{dist/index.d.ts → lib/index.ts} +8 -5
- package/lib/logger.ts +30 -0
- package/lib/messageHandlers/handleCrdtGet.ts +29 -0
- package/lib/messageHandlers/handleCrdtPut.ts +118 -0
- package/lib/messageHandlers/handleGet.ts +29 -0
- package/lib/messageHandlers/handlePing.ts +40 -0
- package/lib/messageHandlers/handlePong.ts +30 -0
- package/lib/messageHandlers/handlePut.ts +54 -0
- package/lib/messageHandlers/handleQuery.ts +25 -0
- package/lib/messageHandlers/handleSubscribe.ts +46 -0
- package/lib/server.ts +7 -0
- package/lib/shared.ts +5 -0
- package/lib/toolDbAnonSignIn.ts +5 -0
- package/lib/toolDbClientOnMessage.ts +75 -0
- package/lib/toolDbCrdtGet.ts +82 -0
- package/lib/toolDbCrdtPut.ts +77 -0
- package/lib/toolDbGet.ts +80 -0
- package/lib/toolDbKeysSignIn.ts +16 -0
- package/lib/toolDbPut.ts +83 -0
- package/lib/toolDbQueryKeys.ts +64 -0
- package/lib/toolDbSignIn.ts +31 -0
- package/lib/toolDbSignUp.ts +71 -0
- package/lib/toolDbSubscribe.ts +53 -0
- package/lib/toolDbVerificationWrapper.ts +55 -0
- package/lib/tooldb.ts +314 -0
- package/lib/types/message.ts +133 -0
- package/lib/types/tooldb.ts +89 -0
- package/lib/utils/catchReturn.ts +4 -0
- package/lib/utils/encoding/arrayBufferToHex.ts +18 -0
- package/lib/utils/encoding/arrayBufferToString.ts +8 -0
- package/lib/utils/encoding/hexToArrayBuffer.ts +13 -0
- package/lib/utils/encoding/hexToString.ts +8 -0
- package/lib/utils/encoding/hexToUint8.ts +5 -0
- package/lib/utils/encoding/stringToArrayBuffer.ts +8 -0
- package/lib/utils/getPeerSignature.ts +12 -0
- package/lib/utils/getTimestamp.ts +3 -0
- package/lib/utils/proofOfWork.ts +16 -0
- package/lib/utils/randomAnimal.ts +77 -0
- package/lib/utils/sha1.ts +7 -0
- package/lib/utils/sha256.ts +7 -0
- package/lib/utils/textRandom.ts +11 -0
- package/lib/utils/uniq.ts +3 -0
- package/lib/utils/verifyMessage.ts +88 -0
- package/lib/utils/verifyPeer.ts +15 -0
- package/package.json +31 -65
- package/tsconfig.json +10 -72
- package/.eslintrc.json +0 -74
- package/.github/workflows/main.yml +0 -29
- package/_____peer/000005.ldb +0 -0
- package/_____peer/000008.log +0 -0
- package/_____peer/CURRENT +0 -1
- package/_____peer/LOCK +0 -0
- package/_____peer/LOG +0 -0
- package/_____peer/LOG.old +0 -0
- package/_____peer/MANIFEST-000007 +0 -0
- package/_____peer_test-alice/000003.log +0 -0
- package/_____peer_test-alice/CURRENT +0 -1
- package/_____peer_test-alice/LOCK +0 -0
- package/_____peer_test-alice/LOG +0 -1
- package/_____peer_test-alice/MANIFEST-000002 +0 -0
- package/_____peer_test-base-client/000005.ldb +0 -0
- package/_____peer_test-base-client/000006.log +0 -0
- package/_____peer_test-base-client/CURRENT +0 -1
- package/_____peer_test-base-client/LOCK +0 -0
- package/_____peer_test-base-client/LOG +0 -5
- package/_____peer_test-base-client/LOG.old +0 -1
- package/_____peer_test-base-client/MANIFEST-000004 +0 -0
- package/_____peer_test-base-server/000005.ldb +0 -0
- package/_____peer_test-base-server/000006.log +0 -0
- package/_____peer_test-base-server/CURRENT +0 -1
- package/_____peer_test-base-server/LOCK +0 -0
- package/_____peer_test-base-server/LOG +0 -5
- package/_____peer_test-base-server/LOG.old +0 -1
- package/_____peer_test-base-server/MANIFEST-000004 +0 -0
- package/_____peer_test-bob/000003.log +0 -0
- package/_____peer_test-bob/CURRENT +0 -1
- package/_____peer_test-bob/LOCK +0 -0
- package/_____peer_test-bob/LOG +0 -1
- package/_____peer_test-bob/MANIFEST-000002 +0 -0
- package/_____peer_test-chris/000003.log +0 -0
- package/_____peer_test-chris/CURRENT +0 -1
- package/_____peer_test-chris/LOCK +0 -0
- package/_____peer_test-chris/LOG +0 -1
- package/_____peer_test-chris/MANIFEST-000002 +0 -0
- package/_____peer_test-node-a/000003.log +0 -0
- package/_____peer_test-node-a/CURRENT +0 -1
- package/_____peer_test-node-a/LOCK +0 -0
- package/_____peer_test-node-a/LOG +0 -1
- package/_____peer_test-node-a/MANIFEST-000002 +0 -0
- package/_____peer_test-node-b/000003.log +0 -0
- package/_____peer_test-node-b/CURRENT +0 -1
- package/_____peer_test-node-b/LOCK +0 -0
- package/_____peer_test-node-b/LOG +0 -1
- package/_____peer_test-node-b/MANIFEST-000002 +0 -0
- package/_____peer_test-store/000003.log +0 -0
- package/_____peer_test-store/CURRENT +0 -1
- package/_____peer_test-store/LOCK +0 -0
- package/_____peer_test-store/LOG +0 -1
- package/_____peer_test-store/MANIFEST-000002 +0 -0
- package/_____peer_test-verify-a/000003.log +0 -0
- package/_____peer_test-verify-a/CURRENT +0 -1
- package/_____peer_test-verify-a/LOCK +0 -0
- package/_____peer_test-verify-a/LOG +0 -1
- package/_____peer_test-verify-a/MANIFEST-000002 +0 -0
- package/babel.config.js +0 -6
- package/bundle.js +0 -1
- package/custom-test-env.js +0 -28
- package/dist/__tests__ copy/base64.d.ts +0 -1
- package/dist/__tests__ copy/base64.js +0 -61
- package/dist/__tests__ copy/base64.js.map +0 -1
- package/dist/__tests__ copy/encryption.d.ts +0 -1
- package/dist/__tests__ copy/encryption.js +0 -68
- package/dist/__tests__ copy/encryption.js.map +0 -1
- package/dist/__tests__ copy/keys.d.ts +0 -1
- package/dist/__tests__ copy/keys.js +0 -238
- package/dist/__tests__ copy/keys.js.map +0 -1
- package/dist/__tests__ copy/network.d.ts +0 -1
- package/dist/__tests__ copy/network.js +0 -206
- package/dist/__tests__ copy/network.js.map +0 -1
- package/dist/__tests__ copy/pow.d.ts +0 -1
- package/dist/__tests__ copy/pow.js +0 -25
- package/dist/__tests__ copy/pow.js.map +0 -1
- package/dist/__tests__ copy/sha1.d.ts +0 -1
- package/dist/__tests__ copy/sha1.js +0 -16
- package/dist/__tests__ copy/sha1.js.map +0 -1
- package/dist/__tests__ copy/sha256.d.ts +0 -1
- package/dist/__tests__ copy/sha256.js +0 -16
- package/dist/__tests__ copy/sha256.js.map +0 -1
- package/dist/__tests__ copy/textRandom.d.ts +0 -1
- package/dist/__tests__ copy/textRandom.js +0 -17
- package/dist/__tests__ copy/textRandom.js.map +0 -1
- package/dist/adapters/toolDbIndexedb.d.ts +0 -9
- package/dist/adapters/toolDbIndexedb.js +0 -131
- package/dist/adapters/toolDbIndexedb.js.map +0 -1
- package/dist/adapters/toolDbLeveldb.d.ts +0 -8
- package/dist/adapters/toolDbLeveldb.js +0 -109
- package/dist/adapters/toolDbLeveldb.js.map +0 -1
- package/dist/adapters/toolDbWeb3User.d.ts +0 -18
- package/dist/adapters/toolDbWeb3User.js +0 -74
- package/dist/adapters/toolDbWeb3User.js.map +0 -1
- package/dist/adapters/toolDbWebrtc.d.ts +0 -58
- package/dist/adapters/toolDbWebrtc.js +0 -487
- package/dist/adapters/toolDbWebrtc.js.map +0 -1
- package/dist/adapters/toolDbWebsocket.d.ts +0 -18
- package/dist/adapters/toolDbWebsocket.js +0 -176
- package/dist/adapters/toolDbWebsocket.js.map +0 -1
- package/dist/adapters-base/networkAdapter.d.ts +0 -58
- package/dist/adapters-base/networkAdapter.js +0 -214
- package/dist/adapters-base/networkAdapter.js.map +0 -1
- package/dist/adapters-base/storageAdapter.d.ts +0 -11
- package/dist/adapters-base/storageAdapter.js +0 -36
- package/dist/adapters-base/storageAdapter.js.map +0 -1
- package/dist/adapters-base/userAdapter.d.ts +0 -15
- package/dist/adapters-base/userAdapter.js +0 -42
- package/dist/adapters-base/userAdapter.js.map +0 -1
- package/dist/bundle.js +0 -69086
- package/dist/chain/Block.d.ts +0 -29
- package/dist/chain/Block.js +0 -142
- package/dist/chain/Block.js.map +0 -1
- package/dist/chain/ToolChain.d.ts +0 -27
- package/dist/chain/ToolChain.js +0 -253
- package/dist/chain/ToolChain.js.map +0 -1
- package/dist/chain/Tx.d.ts +0 -50
- package/dist/chain/Tx.js +0 -54
- package/dist/chain/Tx.js.map +0 -1
- package/dist/chain/Wallet.d.ts +0 -9
- package/dist/chain/Wallet.js +0 -37
- package/dist/chain/Wallet.js.map +0 -1
- package/dist/chain/isValidChain.d.ts +0 -1
- package/dist/chain/isValidChain.js +0 -37
- package/dist/chain/isValidChain.js.map +0 -1
- package/dist/chain/mempool.d.ts +0 -0
- package/dist/chain/mempool.js +0 -2
- package/dist/chain/mempool.js.map +0 -1
- package/dist/crdt/baseCrdt.d.ts +0 -9
- package/dist/crdt/baseCrdt.js +0 -27
- package/dist/crdt/baseCrdt.js.map +0 -1
- package/dist/crdt/counterCrdt.d.ts +0 -30
- package/dist/crdt/counterCrdt.js +0 -106
- package/dist/crdt/counterCrdt.js.map +0 -1
- package/dist/crdt/listCrdt.d.ts +0 -42
- package/dist/crdt/listCrdt.js +0 -159
- package/dist/crdt/listCrdt.js.map +0 -1
- package/dist/crdt/mapCrdt.d.ts +0 -32
- package/dist/crdt/mapCrdt.js +0 -118
- package/dist/crdt/mapCrdt.js.map +0 -1
- package/dist/getCrypto.d.ts +0 -1
- package/dist/getCrypto.js +0 -10
- package/dist/getCrypto.js.map +0 -1
- package/dist/index.js +0 -93
- package/dist/index.js.map +0 -1
- package/dist/infuraFilecoin.d.ts +0 -0
- package/dist/infuraFilecoin.js +0 -2
- package/dist/infuraFilecoin.js.map +0 -1
- package/dist/loadCrdtDocument.d.ts +0 -3
- package/dist/loadCrdtDocument.js +0 -43
- package/dist/loadCrdtDocument.js.map +0 -1
- package/dist/logger.d.ts +0 -2
- package/dist/logger.js +0 -29
- package/dist/logger.js.map +0 -1
- package/dist/makeTx.d.ts +0 -1
- package/dist/makeTx.js +0 -27
- package/dist/makeTx.js.map +0 -1
- package/dist/messageHandlers/handleCrdt.d.ts +0 -2
- package/dist/messageHandlers/handleCrdt.js +0 -15
- package/dist/messageHandlers/handleCrdt.js.map +0 -1
- package/dist/messageHandlers/handleCrdtGet.d.ts +0 -2
- package/dist/messageHandlers/handleCrdtGet.js +0 -29
- package/dist/messageHandlers/handleCrdtGet.js.map +0 -1
- package/dist/messageHandlers/handleCrdtPut.d.ts +0 -2
- package/dist/messageHandlers/handleCrdtPut.js +0 -93
- package/dist/messageHandlers/handleCrdtPut.js.map +0 -1
- package/dist/messageHandlers/handleGet.d.ts +0 -2
- package/dist/messageHandlers/handleGet.js +0 -29
- package/dist/messageHandlers/handleGet.js.map +0 -1
- package/dist/messageHandlers/handleJoin.d.ts +0 -2
- package/dist/messageHandlers/handleJoin.js +0 -36
- package/dist/messageHandlers/handleJoin.js.map +0 -1
- package/dist/messageHandlers/handlePing.d.ts +0 -2
- package/dist/messageHandlers/handlePing.js +0 -36
- package/dist/messageHandlers/handlePing.js.map +0 -1
- package/dist/messageHandlers/handlePong.d.ts +0 -2
- package/dist/messageHandlers/handlePong.js +0 -26
- package/dist/messageHandlers/handlePong.js.map +0 -1
- package/dist/messageHandlers/handlePut.d.ts +0 -2
- package/dist/messageHandlers/handlePut.js +0 -57
- package/dist/messageHandlers/handlePut.js.map +0 -1
- package/dist/messageHandlers/handleQuery.d.ts +0 -2
- package/dist/messageHandlers/handleQuery.js +0 -23
- package/dist/messageHandlers/handleQuery.js.map +0 -1
- package/dist/messageHandlers/handleServers.d.ts +0 -2
- package/dist/messageHandlers/handleServers.js +0 -23
- package/dist/messageHandlers/handleServers.js.map +0 -1
- package/dist/messageHandlers/handleSubscribe.d.ts +0 -2
- package/dist/messageHandlers/handleSubscribe.js +0 -44
- package/dist/messageHandlers/handleSubscribe.js.map +0 -1
- package/dist/sendJoin.d.ts +0 -2
- package/dist/sendJoin.js +0 -31
- package/dist/sendJoin.js.map +0 -1
- package/dist/server.d.ts +0 -1
- package/dist/server.js +0 -9
- package/dist/server.js.map +0 -1
- package/dist/shared.d.ts +0 -2
- package/dist/shared.js +0 -7
- package/dist/shared.js.map +0 -1
- package/dist/test.d.ts +0 -1
- package/dist/test.js +0 -17
- package/dist/test.js.map +0 -1
- package/dist/toolChainServer.d.ts +0 -8
- package/dist/toolChainServer.js +0 -60
- package/dist/toolChainServer.js.map +0 -1
- package/dist/toolDbAnonSignIn.d.ts +0 -2
- package/dist/toolDbAnonSignIn.js +0 -7
- package/dist/toolDbAnonSignIn.js.map +0 -1
- package/dist/toolDbClientOnMessage.d.ts +0 -2
- package/dist/toolDbClientOnMessage.js +0 -59
- package/dist/toolDbClientOnMessage.js.map +0 -1
- package/dist/toolDbCrdtGet.d.ts +0 -9
- package/dist/toolDbCrdtGet.js +0 -77
- package/dist/toolDbCrdtGet.js.map +0 -1
- package/dist/toolDbCrdtPut.d.ts +0 -9
- package/dist/toolDbCrdtPut.js +0 -63
- package/dist/toolDbCrdtPut.js.map +0 -1
- package/dist/toolDbGet.d.ts +0 -9
- package/dist/toolDbGet.js +0 -77
- package/dist/toolDbGet.js.map +0 -1
- package/dist/toolDbGetPubKey.d.ts +0 -2
- package/dist/toolDbGetPubKey.js +0 -18
- package/dist/toolDbGetPubKey.js.map +0 -1
- package/dist/toolDbKeysSignIn.d.ts +0 -2
- package/dist/toolDbKeysSignIn.js +0 -16
- package/dist/toolDbKeysSignIn.js.map +0 -1
- package/dist/toolDbNetwork.d.ts +0 -32
- package/dist/toolDbNetwork.js +0 -296
- package/dist/toolDbNetwork.js.map +0 -1
- package/dist/toolDbNetworkAdapter.d.ts +0 -57
- package/dist/toolDbNetworkAdapter.js +0 -188
- package/dist/toolDbNetworkAdapter.js.map +0 -1
- package/dist/toolDbPut.d.ts +0 -9
- package/dist/toolDbPut.js +0 -69
- package/dist/toolDbPut.js.map +0 -1
- package/dist/toolDbQueryKeys.d.ts +0 -8
- package/dist/toolDbQueryKeys.js +0 -66
- package/dist/toolDbQueryKeys.js.map +0 -1
- package/dist/toolDbSignIn.d.ts +0 -2
- package/dist/toolDbSignIn.js +0 -27
- package/dist/toolDbSignIn.js.map +0 -1
- package/dist/toolDbSignUp.d.ts +0 -2
- package/dist/toolDbSignUp.js +0 -101
- package/dist/toolDbSignUp.js.map +0 -1
- package/dist/toolDbSubscribe.d.ts +0 -9
- package/dist/toolDbSubscribe.js +0 -50
- package/dist/toolDbSubscribe.js.map +0 -1
- package/dist/toolDbVerificationWrapper.d.ts +0 -2
- package/dist/toolDbVerificationWrapper.js +0 -98
- package/dist/toolDbVerificationWrapper.js.map +0 -1
- package/dist/toolDbWeb3User.d.ts +0 -20
- package/dist/toolDbWeb3User.js +0 -75
- package/dist/toolDbWeb3User.js.map +0 -1
- package/dist/toolDbWebrtc.d.ts +0 -75
- package/dist/toolDbWebrtc.js +0 -472
- package/dist/toolDbWebrtc.js.map +0 -1
- package/dist/toolDbWebsocket.d.ts +0 -19
- package/dist/toolDbWebsocket.js +0 -187
- package/dist/toolDbWebsocket.js.map +0 -1
- package/dist/toolchain.d.ts +0 -1
- package/dist/toolchain.js +0 -8
- package/dist/toolchain.js.map +0 -1
- package/dist/tooldb.d.ts +0 -108
- package/dist/tooldb.js +0 -285
- package/dist/tooldb.js.map +0 -1
- package/dist/types/graph.d.ts +0 -0
- package/dist/types/graph.js +0 -2
- package/dist/types/graph.js.map +0 -1
- package/dist/types/message.d.ts +0 -100
- package/dist/types/message.js +0 -17
- package/dist/types/message.js.map +0 -1
- package/dist/types/tooldb.d.ts +0 -79
- package/dist/types/tooldb.js +0 -3
- package/dist/types/tooldb.js.map +0 -1
- package/dist/utils/arrayBufferToBase64.d.ts +0 -1
- package/dist/utils/arrayBufferToBase64.js +0 -12
- package/dist/utils/arrayBufferToBase64.js.map +0 -1
- package/dist/utils/arrayBufferToHex.d.ts +0 -1
- package/dist/utils/arrayBufferToHex.js +0 -19
- package/dist/utils/arrayBufferToHex.js.map +0 -1
- package/dist/utils/arrayBufferToString.d.ts +0 -1
- package/dist/utils/arrayBufferToString.js +0 -12
- package/dist/utils/arrayBufferToString.js.map +0 -1
- package/dist/utils/base64ToArrayBuffer.d.ts +0 -1
- package/dist/utils/base64ToArrayBuffer.js +0 -12
- package/dist/utils/base64ToArrayBuffer.js.map +0 -1
- package/dist/utils/base64ToBinaryChange.d.ts +0 -2
- package/dist/utils/base64ToBinaryChange.js +0 -18
- package/dist/utils/base64ToBinaryChange.js.map +0 -1
- package/dist/utils/base64ToBinaryDocument.d.ts +0 -2
- package/dist/utils/base64ToBinaryDocument.js +0 -18
- package/dist/utils/base64ToBinaryDocument.js.map +0 -1
- package/dist/utils/base64ToHex.d.ts +0 -1
- package/dist/utils/base64ToHex.js +0 -13
- package/dist/utils/base64ToHex.js.map +0 -1
- package/dist/utils/base64ToUint8.d.ts +0 -1
- package/dist/utils/base64ToUint8.js +0 -17
- package/dist/utils/base64ToUint8.js.map +0 -1
- package/dist/utils/catchReturn.d.ts +0 -1
- package/dist/utils/catchReturn.js +0 -8
- package/dist/utils/catchReturn.js.map +0 -1
- package/dist/utils/crypto/base64KeyToHex.d.ts +0 -1
- package/dist/utils/crypto/base64KeyToHex.js +0 -24
- package/dist/utils/crypto/base64KeyToHex.js.map +0 -1
- package/dist/utils/crypto/base64PublicKeyToHex.d.ts +0 -1
- package/dist/utils/crypto/base64PublicKeyToHex.js +0 -22
- package/dist/utils/crypto/base64PublicKeyToHex.js.map +0 -1
- package/dist/utils/crypto/decodeKeyString.d.ts +0 -1
- package/dist/utils/crypto/decodeKeyString.js +0 -13
- package/dist/utils/crypto/decodeKeyString.js.map +0 -1
- package/dist/utils/crypto/decryptData.d.ts +0 -1
- package/dist/utils/crypto/decryptData.js +0 -28
- package/dist/utils/crypto/decryptData.js.map +0 -1
- package/dist/utils/crypto/decryptWithPass.d.ts +0 -1
- package/dist/utils/crypto/decryptWithPass.js +0 -23
- package/dist/utils/crypto/decryptWithPass.js.map +0 -1
- package/dist/utils/crypto/deriveSecret.d.ts +0 -1
- package/dist/utils/crypto/deriveSecret.js +0 -18
- package/dist/utils/crypto/deriveSecret.js.map +0 -1
- package/dist/utils/crypto/encodeKeyString.d.ts +0 -1
- package/dist/utils/crypto/encodeKeyString.js +0 -13
- package/dist/utils/crypto/encodeKeyString.js.map +0 -1
- package/dist/utils/crypto/encryptData.d.ts +0 -1
- package/dist/utils/crypto/encryptData.js +0 -30
- package/dist/utils/crypto/encryptData.js.map +0 -1
- package/dist/utils/crypto/encryptWithPass.d.ts +0 -1
- package/dist/utils/crypto/encryptWithPass.js +0 -26
- package/dist/utils/crypto/encryptWithPass.js.map +0 -1
- package/dist/utils/crypto/exportKey.d.ts +0 -1
- package/dist/utils/crypto/exportKey.js +0 -14
- package/dist/utils/crypto/exportKey.js.map +0 -1
- package/dist/utils/crypto/exportKeyAsHex.d.ts +0 -1
- package/dist/utils/crypto/exportKeyAsHex.js +0 -18
- package/dist/utils/crypto/exportKeyAsHex.js.map +0 -1
- package/dist/utils/crypto/generateKeyFromPassword.d.ts +0 -1
- package/dist/utils/crypto/generateKeyFromPassword.js +0 -25
- package/dist/utils/crypto/generateKeyFromPassword.js.map +0 -1
- package/dist/utils/crypto/generateKeyPair.d.ts +0 -1
- package/dist/utils/crypto/generateKeyPair.js +0 -17
- package/dist/utils/crypto/generateKeyPair.js.map +0 -1
- package/dist/utils/crypto/generateKeysComb.d.ts +0 -4
- package/dist/utils/crypto/generateKeysComb.js +0 -60
- package/dist/utils/crypto/generateKeysComb.js.map +0 -1
- package/dist/utils/crypto/importKey.d.ts +0 -1
- package/dist/utils/crypto/importKey.js +0 -23
- package/dist/utils/crypto/importKey.js.map +0 -1
- package/dist/utils/crypto/loadKeysComb.d.ts +0 -5
- package/dist/utils/crypto/loadKeysComb.js +0 -90
- package/dist/utils/crypto/loadKeysComb.js.map +0 -1
- package/dist/utils/crypto/loadSignKeys.d.ts +0 -2
- package/dist/utils/crypto/loadSignKeys.js +0 -78
- package/dist/utils/crypto/loadSignKeys.js.map +0 -1
- package/dist/utils/crypto/recoverPubKey.d.ts +0 -1
- package/dist/utils/crypto/recoverPubKey.js +0 -27
- package/dist/utils/crypto/recoverPubKey.js.map +0 -1
- package/dist/utils/crypto/recoverPubKeyFromPrivate.d.ts +0 -1
- package/dist/utils/crypto/recoverPubKeyFromPrivate.js +0 -16
- package/dist/utils/crypto/recoverPubKeyFromPrivate.js.map +0 -1
- package/dist/utils/crypto/saveKeysComb.d.ts +0 -2
- package/dist/utils/crypto/saveKeysComb.js +0 -75
- package/dist/utils/crypto/saveKeysComb.js.map +0 -1
- package/dist/utils/crypto/saveSignKeys.d.ts +0 -2
- package/dist/utils/crypto/saveSignKeys.js +0 -67
- package/dist/utils/crypto/saveSignKeys.js.map +0 -1
- package/dist/utils/crypto/verifyData.d.ts +0 -1
- package/dist/utils/crypto/verifyData.js +0 -20
- package/dist/utils/crypto/verifyData.js.map +0 -1
- package/dist/utils/encoding/arrayBufferToBase64.d.ts +0 -1
- package/dist/utils/encoding/arrayBufferToBase64.js +0 -12
- package/dist/utils/encoding/arrayBufferToBase64.js.map +0 -1
- package/dist/utils/encoding/arrayBufferToHex.d.ts +0 -1
- package/dist/utils/encoding/arrayBufferToHex.js +0 -19
- package/dist/utils/encoding/arrayBufferToHex.js.map +0 -1
- package/dist/utils/encoding/arrayBufferToString.d.ts +0 -1
- package/dist/utils/encoding/arrayBufferToString.js +0 -12
- package/dist/utils/encoding/arrayBufferToString.js.map +0 -1
- package/dist/utils/encoding/base64ToArrayBuffer.d.ts +0 -1
- package/dist/utils/encoding/base64ToArrayBuffer.js +0 -12
- package/dist/utils/encoding/base64ToArrayBuffer.js.map +0 -1
- package/dist/utils/encoding/base64ToBinaryChange.d.ts +0 -2
- package/dist/utils/encoding/base64ToBinaryChange.js +0 -18
- package/dist/utils/encoding/base64ToBinaryChange.js.map +0 -1
- package/dist/utils/encoding/base64ToBinaryDocument.d.ts +0 -2
- package/dist/utils/encoding/base64ToBinaryDocument.js +0 -18
- package/dist/utils/encoding/base64ToBinaryDocument.js.map +0 -1
- package/dist/utils/encoding/base64ToHex.d.ts +0 -1
- package/dist/utils/encoding/base64ToHex.js +0 -13
- package/dist/utils/encoding/base64ToHex.js.map +0 -1
- package/dist/utils/encoding/base64ToUint8.d.ts +0 -1
- package/dist/utils/encoding/base64ToUint8.js +0 -17
- package/dist/utils/encoding/base64ToUint8.js.map +0 -1
- package/dist/utils/encoding/fromBase64.d.ts +0 -1
- package/dist/utils/encoding/fromBase64.js +0 -7
- package/dist/utils/encoding/fromBase64.js.map +0 -1
- package/dist/utils/encoding/hexToArrayBuffer.d.ts +0 -1
- package/dist/utils/encoding/hexToArrayBuffer.js +0 -15
- package/dist/utils/encoding/hexToArrayBuffer.js.map +0 -1
- package/dist/utils/encoding/hexToBase64.d.ts +0 -1
- package/dist/utils/encoding/hexToBase64.js +0 -12
- package/dist/utils/encoding/hexToBase64.js.map +0 -1
- package/dist/utils/encoding/hexToString.d.ts +0 -1
- package/dist/utils/encoding/hexToString.js +0 -12
- package/dist/utils/encoding/hexToString.js.map +0 -1
- package/dist/utils/encoding/hexToUint8.d.ts +0 -1
- package/dist/utils/encoding/hexToUint8.js +0 -8
- package/dist/utils/encoding/hexToUint8.js.map +0 -1
- package/dist/utils/encoding/stringToArrayBuffer.d.ts +0 -1
- package/dist/utils/encoding/stringToArrayBuffer.js +0 -12
- package/dist/utils/encoding/stringToArrayBuffer.js.map +0 -1
- package/dist/utils/encoding/toBase64.d.ts +0 -1
- package/dist/utils/encoding/toBase64.js +0 -7
- package/dist/utils/encoding/toBase64.js.map +0 -1
- package/dist/utils/encoding/uint8ArrayToHex.d.ts +0 -1
- package/dist/utils/encoding/uint8ArrayToHex.js +0 -7
- package/dist/utils/encoding/uint8ArrayToHex.js.map +0 -1
- package/dist/utils/encoding/uint8ToBase64.d.ts +0 -1
- package/dist/utils/encoding/uint8ToBase64.js +0 -15
- package/dist/utils/encoding/uint8ToBase64.js.map +0 -1
- package/dist/utils/fromBase64.d.ts +0 -1
- package/dist/utils/fromBase64.js +0 -7
- package/dist/utils/fromBase64.js.map +0 -1
- package/dist/utils/generateIv.d.ts +0 -1
- package/dist/utils/generateIv.js +0 -12
- package/dist/utils/generateIv.js.map +0 -1
- package/dist/utils/getPeerSignature.d.ts +0 -2
- package/dist/utils/getPeerSignature.js +0 -9
- package/dist/utils/getPeerSignature.js.map +0 -1
- package/dist/utils/getTimestamp.d.ts +0 -1
- package/dist/utils/getTimestamp.js +0 -7
- package/dist/utils/getTimestamp.js.map +0 -1
- package/dist/utils/hexToArrayBuffer.d.ts +0 -1
- package/dist/utils/hexToArrayBuffer.js +0 -15
- package/dist/utils/hexToArrayBuffer.js.map +0 -1
- package/dist/utils/hexToBase64.d.ts +0 -1
- package/dist/utils/hexToBase64.js +0 -12
- package/dist/utils/hexToBase64.js.map +0 -1
- package/dist/utils/hexToString.d.ts +0 -1
- package/dist/utils/hexToString.js +0 -12
- package/dist/utils/hexToString.js.map +0 -1
- package/dist/utils/hexToUint8.d.ts +0 -1
- package/dist/utils/hexToUint8.js +0 -8
- package/dist/utils/hexToUint8.js.map +0 -1
- package/dist/utils/indexedb.d.ts +0 -2
- package/dist/utils/indexedb.js +0 -116
- package/dist/utils/indexedb.js.map +0 -1
- package/dist/utils/leveldb.d.ts +0 -2
- package/dist/utils/leveldb.js +0 -83
- package/dist/utils/leveldb.js.map +0 -1
- package/dist/utils/proofOfWork.d.ts +0 -4
- package/dist/utils/proofOfWork.js +0 -16
- package/dist/utils/proofOfWork.js.map +0 -1
- package/dist/utils/randomAnimal.d.ts +0 -1
- package/dist/utils/randomAnimal.js +0 -77
- package/dist/utils/randomAnimal.js.map +0 -1
- package/dist/utils/sha1.d.ts +0 -1
- package/dist/utils/sha1.js +0 -13
- package/dist/utils/sha1.js.map +0 -1
- package/dist/utils/sha256.d.ts +0 -3
- package/dist/utils/sha256.js +0 -13
- package/dist/utils/sha256.js.map +0 -1
- package/dist/utils/signData.d.ts +0 -1
- package/dist/utils/signData.js +0 -19
- package/dist/utils/signData.js.map +0 -1
- package/dist/utils/stringToArrayBuffer.d.ts +0 -1
- package/dist/utils/stringToArrayBuffer.js +0 -12
- package/dist/utils/stringToArrayBuffer.js.map +0 -1
- package/dist/utils/textRandom.d.ts +0 -1
- package/dist/utils/textRandom.js +0 -15
- package/dist/utils/textRandom.js.map +0 -1
- package/dist/utils/toBase64.d.ts +0 -1
- package/dist/utils/toBase64.js +0 -7
- package/dist/utils/toBase64.js.map +0 -1
- package/dist/utils/uint8ArrayToHex.d.ts +0 -2
- package/dist/utils/uint8ArrayToHex.js +0 -7
- package/dist/utils/uint8ArrayToHex.js.map +0 -1
- package/dist/utils/uint8ToBase64.d.ts +0 -2
- package/dist/utils/uint8ToBase64.js +0 -15
- package/dist/utils/uint8ToBase64.js.map +0 -1
- package/dist/utils/uniq.d.ts +0 -1
- package/dist/utils/uniq.js +0 -7
- package/dist/utils/uniq.js.map +0 -1
- package/dist/utils/verifyMessage.d.ts +0 -8
- package/dist/utils/verifyMessage.js +0 -129
- package/dist/utils/verifyMessage.js.map +0 -1
- package/dist/utils/verifyPeer.d.ts +0 -2
- package/dist/utils/verifyPeer.js +0 -15
- package/dist/utils/verifyPeer.js.map +0 -1
- package/jest.config.ts +0 -195
- package/jest.setup.js +0 -0
- package/test-alice/000216.ldb +0 -0
- package/test-alice/000218.ldb +0 -0
- package/test-alice/000221.ldb +0 -0
- package/test-alice/000224.ldb +0 -0
- package/test-alice/000225.log +0 -0
- package/test-alice/CURRENT +0 -1
- package/test-alice/LOCK +0 -0
- package/test-alice/LOG +0 -5
- package/test-alice/LOG.old +0 -5
- package/test-alice/MANIFEST-000223 +0 -0
- package/test-base-client/000019.log +0 -0
- package/test-base-client/CURRENT +0 -1
- package/test-base-client/LOCK +0 -0
- package/test-base-client/LOG +0 -3
- package/test-base-client/LOG.old +0 -3
- package/test-base-client/MANIFEST-000018 +0 -0
- package/test-base-server/000019.log +0 -0
- package/test-base-server/CURRENT +0 -1
- package/test-base-server/LOCK +0 -0
- package/test-base-server/LOG +0 -3
- package/test-base-server/LOG.old +0 -3
- package/test-base-server/MANIFEST-000018 +0 -0
- package/test-bob/000231.ldb +0 -0
- package/test-bob/000233.ldb +0 -0
- package/test-bob/000234.log +0 -0
- package/test-bob/CURRENT +0 -1
- package/test-bob/LOCK +0 -0
- package/test-bob/LOG +0 -5
- package/test-bob/LOG.old +0 -14
- package/test-bob/MANIFEST-000232 +0 -0
- package/test-chris/000005.ldb +0 -0
- package/test-chris/000008.ldb +0 -0
- package/test-chris/000009.log +0 -0
- package/test-chris/CURRENT +0 -1
- package/test-chris/LOCK +0 -0
- package/test-chris/LOG +0 -5
- package/test-chris/LOG.old +0 -5
- package/test-chris/MANIFEST-000007 +0 -0
- package/test-node-a/000246.ldb +0 -0
- package/test-node-a/000248.ldb +0 -0
- package/test-node-a/000249.log +0 -0
- package/test-node-a/CURRENT +0 -1
- package/test-node-a/LOCK +0 -0
- package/test-node-a/LOG +0 -5
- package/test-node-a/LOG.old +0 -14
- package/test-node-a/MANIFEST-000247 +0 -0
- package/test-node-b/000246.ldb +0 -0
- package/test-node-b/000248.ldb +0 -0
- package/test-node-b/000249.log +0 -0
- package/test-node-b/CURRENT +0 -1
- package/test-node-b/LOCK +0 -0
- package/test-node-b/LOG +0 -5
- package/test-node-b/LOG.old +0 -14
- package/test-node-b/MANIFEST-000247 +0 -0
- package/test-store/000005.ldb +0 -0
- package/test-store/000008.ldb +0 -0
- package/test-store/000011.ldb +0 -0
- package/test-store/000014.ldb +0 -0
- package/test-store/000017.ldb +0 -0
- package/test-store/000018.log +0 -0
- package/test-store/CURRENT +0 -1
- package/test-store/LOCK +0 -0
- package/test-store/LOG +0 -6
- package/test-store/LOG.old +0 -6
- package/test-store/MANIFEST-000016 +0 -0
- package/test-verify-a/000059.ldb +0 -0
- package/test-verify-a/000066.log +0 -0
- package/test-verify-a/CURRENT +0 -1
- package/test-verify-a/LOCK +0 -0
- package/test-verify-a/LOG +0 -3
- package/test-verify-a/LOG.old +0 -3
- package/test-verify-a/MANIFEST-000065 +0 -0
package/dist/toolDbWebsocket.js
DELETED
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
-
};
|
|
20
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
var ws_1 = __importDefault(require("ws"));
|
|
22
|
-
var _1 = require(".");
|
|
23
|
-
var toolDbNetworkAdapter_1 = __importDefault(require("./toolDbNetworkAdapter"));
|
|
24
|
-
var ToolDbWebsocket = /** @class */ (function (_super) {
|
|
25
|
-
__extends(ToolDbWebsocket, _super);
|
|
26
|
-
function ToolDbWebsocket(db) {
|
|
27
|
-
var _this = _super.call(this, db) || this;
|
|
28
|
-
_this.wnd = typeof window === "undefined" ? undefined : window;
|
|
29
|
-
_this._wss = _this.wnd
|
|
30
|
-
? _this.wnd.WebSocket || _this.wnd.webkitWebSocket || _this.wnd.mozWebSocket
|
|
31
|
-
: ws_1.default;
|
|
32
|
-
_this.server = null;
|
|
33
|
-
_this._connections = {};
|
|
34
|
-
_this._awaitingConnections = [];
|
|
35
|
-
_this.removeFromAwaiting = function (id) {
|
|
36
|
-
var index = _this._awaitingConnections.findIndex(function (c) { return c.id === id; });
|
|
37
|
-
if (index !== -1) {
|
|
38
|
-
_this._awaitingConnections.slice(index, 1);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Open a connection to a server
|
|
43
|
-
* @param url URL of the server (including port)
|
|
44
|
-
* @returns websocket
|
|
45
|
-
*/
|
|
46
|
-
_this.connectTo = function (host, port, connectionId) {
|
|
47
|
-
try {
|
|
48
|
-
var wsUrl = port === 443 ? "wss://" + host : "ws://" + host + ":" + port;
|
|
49
|
-
var wss_1 = new _this._wss(wsUrl);
|
|
50
|
-
var connId_1 = (0, _1.textRandom)(10);
|
|
51
|
-
var clientId_1 = "";
|
|
52
|
-
wss_1.connId = connectionId || connId_1;
|
|
53
|
-
var previousConnection = _this._awaitingConnections.filter(function (c) { return c.id === connectionId; })[0];
|
|
54
|
-
if (connectionId && previousConnection) {
|
|
55
|
-
previousConnection.socket = wss_1;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
_this._awaitingConnections.push({
|
|
59
|
-
id: connId_1,
|
|
60
|
-
socket: wss_1,
|
|
61
|
-
tries: 0,
|
|
62
|
-
defer: null,
|
|
63
|
-
host: host,
|
|
64
|
-
port: port,
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
wss_1.onclose = function (_error) {
|
|
68
|
-
_this.tooldb.logger(_error.error);
|
|
69
|
-
_this.reconnect(connId_1);
|
|
70
|
-
};
|
|
71
|
-
wss_1.onerror = function (_error) {
|
|
72
|
-
var _a;
|
|
73
|
-
_this.tooldb.logger(_error.error);
|
|
74
|
-
if (((_a = _error === null || _error === void 0 ? void 0 : _error.error) === null || _a === void 0 ? void 0 : _a.code) !== "ETIMEDOUT") {
|
|
75
|
-
_this.reconnect(connId_1);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
wss_1.onopen = function () {
|
|
79
|
-
_this.removeFromAwaiting(connId_1);
|
|
80
|
-
_this.tooldb.logger("Connected to " + host + ": " + port + " sucessfully.");
|
|
81
|
-
// hi peer
|
|
82
|
-
wss_1.send(JSON.stringify({
|
|
83
|
-
type: "ping",
|
|
84
|
-
clientId: _this.tooldb.network.getClientAddress(),
|
|
85
|
-
to: [_this.tooldb.network.getClientAddress()],
|
|
86
|
-
isServer: _this.tooldb.options.server,
|
|
87
|
-
id: (0, _1.textRandom)(10),
|
|
88
|
-
}));
|
|
89
|
-
};
|
|
90
|
-
wss_1.onmessage = function (msg) {
|
|
91
|
-
if (!msg) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
_this.onClientMessage(msg.data, clientId_1, function (id) {
|
|
95
|
-
clientId_1 = id;
|
|
96
|
-
_this.isClientConnected[id] = function () {
|
|
97
|
-
return wss_1.readyState === wss_1.OPEN;
|
|
98
|
-
};
|
|
99
|
-
_this.clientToSend[id] = function (_msg) {
|
|
100
|
-
wss_1.send(_msg);
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
return wss_1;
|
|
105
|
-
}
|
|
106
|
-
catch (e) {
|
|
107
|
-
_this.tooldb.logger(e);
|
|
108
|
-
}
|
|
109
|
-
return undefined;
|
|
110
|
-
};
|
|
111
|
-
_this.reconnect = function (connectionId) {
|
|
112
|
-
var connection = _this._awaitingConnections.filter(function (c) { return c.id === connectionId; })[0];
|
|
113
|
-
if (connection) {
|
|
114
|
-
if (connection.defer) {
|
|
115
|
-
clearTimeout(connection.defer);
|
|
116
|
-
}
|
|
117
|
-
if (connection.tries < _this.tooldb.options.maxRetries) {
|
|
118
|
-
var defer = function () {
|
|
119
|
-
connection.tries += 1;
|
|
120
|
-
_this.tooldb.logger("Connection to " +
|
|
121
|
-
connection.host +
|
|
122
|
-
":" +
|
|
123
|
-
connection.port +
|
|
124
|
-
" retry.");
|
|
125
|
-
_this.connectTo(connection.host, connection.port, connectionId);
|
|
126
|
-
};
|
|
127
|
-
connection.defer = setTimeout(defer, _this.tooldb.options.wait);
|
|
128
|
-
}
|
|
129
|
-
else {
|
|
130
|
-
_this.tooldb.logger("Connection attempts to " +
|
|
131
|
-
connection.host +
|
|
132
|
-
":" +
|
|
133
|
-
connection.port +
|
|
134
|
-
" exceeded.");
|
|
135
|
-
_this.removeFromAwaiting(connectionId);
|
|
136
|
-
// There are no more peers to connect!
|
|
137
|
-
if (Object.keys(_this._connections).length === 0) {
|
|
138
|
-
_this.tooldb.onDisconnect();
|
|
139
|
-
_this.tooldb.isConnected = false;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
// else , attempting to reconnect to a missing peer?
|
|
144
|
-
};
|
|
145
|
-
_this.tooldb.options.peers.forEach(function (p) {
|
|
146
|
-
_this.connectTo(p.host, p.port);
|
|
147
|
-
});
|
|
148
|
-
if (_this.tooldb.options.server) {
|
|
149
|
-
_this.server = new ws_1.default.Server({
|
|
150
|
-
port: _this.tooldb.options.port,
|
|
151
|
-
server: _this.tooldb.options.httpServer,
|
|
152
|
-
});
|
|
153
|
-
_this.server.on("connection", function (socket) {
|
|
154
|
-
var clientId = null;
|
|
155
|
-
// this.tooldb.logger("new connection:", clientId);
|
|
156
|
-
socket.on("close", function () {
|
|
157
|
-
// this.tooldb.logger("closed connection:", clientId);
|
|
158
|
-
if (clientId) {
|
|
159
|
-
_this.onClientDisconnect(clientId);
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
socket.on("error", function () {
|
|
163
|
-
// this.tooldb.logger("errored connection:", clientId);
|
|
164
|
-
if (clientId) {
|
|
165
|
-
_this.onClientDisconnect(clientId);
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
socket.on("message", function (message) {
|
|
169
|
-
_this.onClientMessage(message, clientId || "", function (id) {
|
|
170
|
-
clientId = id;
|
|
171
|
-
// Set this socket's functions on the adapter
|
|
172
|
-
_this.isClientConnected[id] = function () {
|
|
173
|
-
return socket.readyState === socket.OPEN;
|
|
174
|
-
};
|
|
175
|
-
_this.clientToSend[id] = function (_msg) {
|
|
176
|
-
socket.send(_msg);
|
|
177
|
-
};
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
return _this;
|
|
183
|
-
}
|
|
184
|
-
return ToolDbWebsocket;
|
|
185
|
-
}(toolDbNetworkAdapter_1.default));
|
|
186
|
-
exports.default = ToolDbWebsocket;
|
|
187
|
-
//# sourceMappingURL=toolDbWebsocket.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolDbWebsocket.js","sourceRoot":"","sources":["../src/toolDbWebsocket.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,0CAA2B;AAC3B,sBAA4C;AAE5C,gFAA0D;AAW1D;IAA6C,mCAAoB;IA4B/D,yBAAY,EAAU;QAAtB,YACE,kBAAM,EAAE,CAAC,SA6CV;QAzEO,SAAG,GACT,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,MAA0B,CAAC;QAElE,UAAI,GAAG,KAAI,CAAC,GAAG;YACrB,CAAC,CAAC,KAAI,CAAC,GAAG,CAAC,SAAS,IAAI,KAAI,CAAC,GAAG,CAAC,eAAe,IAAI,KAAI,CAAC,GAAG,CAAC,YAAY;YACzE,CAAC,CAAC,YAAS,CAAC;QAEN,YAAM,GAA4B,IAAI,CAAC;QAEvC,kBAAY,GAOhB,EAAE,CAAC;QAEC,0BAAoB,GAAyB,EAAE,CAAC;QAEhD,wBAAkB,GAAG,UAAC,EAAU;YACtC,IAAM,KAAK,GAAG,KAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,EAAE,KAAK,EAAE,EAAX,CAAW,CAAC,C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D,IAAI,QAAQ,EAAE;wBACZ,KAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;qBACnC;gBACH,CAAC,CAAC,CAAC;gBAEH,MAAM,CAAC,EAAE,CAAC,SAAS,EAAE,UAAC,OAAe;oBACnC,KAAI,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,UAAC,EAAE;wBAC/C,QAAQ,GAAG,EAAE,CAAC;wBAEd,6CAA6C;wBAC7C,KAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,GAAG;4BAC3B,OAAO,MAAM,CAAC,UAAU,KAAK,MAAM,CAAC,IAAI,CAAC;wBAC3C,CAAC,CAAC;wBACF,KAAI,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,UAAC,IAAY;4BACnC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;wBACpB,CAAC,CAAC;oBACJ,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;;IACH,CAAC;IAqIH,sBAAC;AAAD,CAAC,AA/MD,CAA6C,8BAAoB,GA+MhE"}
|
package/dist/toolchain.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/toolchain.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var toolChainServer_1 = __importDefault(require("./toolChainServer"));
|
|
7
|
-
var server = new toolChainServer_1.default({});
|
|
8
|
-
//# sourceMappingURL=toolchain.js.map
|
package/dist/toolchain.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toolchain.js","sourceRoot":"","sources":["../src/toolchain.ts"],"names":[],"mappings":";;;;;AAAA,sEAAgD;AAEhD,IAAM,MAAM,GAAG,IAAI,yBAAe,CAAC,EAAE,CAAC,CAAC"}
|
package/dist/tooldb.d.ts
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import EventEmitter from "events";
|
|
3
|
-
import { VerificationData, verifyMessage, ToolDbOptions, ToolDbStorageAdapter, ToolDbUserAdapter, ToolDbMessage, Peer } from ".";
|
|
4
|
-
import toolDbGet from "./toolDbGet";
|
|
5
|
-
import toolDbPut from "./toolDbPut";
|
|
6
|
-
import toolDbSignIn from "./toolDbSignIn";
|
|
7
|
-
import toolDbSignUp from "./toolDbSignUp";
|
|
8
|
-
import toolDbCrdtGet from "./toolDbCrdtGet";
|
|
9
|
-
import toolDbCrdtPut from "./toolDbCrdtPut";
|
|
10
|
-
import toolDbAnonSignIn from "./toolDbAnonSignIn";
|
|
11
|
-
import toolDbClientOnMessage from "./toolDbClientOnMessage";
|
|
12
|
-
import toolDbVerificationWrapper from "./toolDbVerificationWrapper";
|
|
13
|
-
import toolDbQueryKeys from "./toolDbQueryKeys";
|
|
14
|
-
import toolDbKeysSignIn from "./toolDbKeysSignIn";
|
|
15
|
-
import toolDbSubscribe from "./toolDbSubscribe";
|
|
16
|
-
import handleGet from "./messageHandlers/handleGet";
|
|
17
|
-
import handlePut from "./messageHandlers/handlePut";
|
|
18
|
-
import handlePing from "./messageHandlers/handlePing";
|
|
19
|
-
import handlePong from "./messageHandlers/handlePong";
|
|
20
|
-
import handleQuery from "./messageHandlers/handleQuery";
|
|
21
|
-
import handleCrdtGet from "./messageHandlers/handleCrdtGet";
|
|
22
|
-
import handleCrdtPut from "./messageHandlers/handleCrdtPut";
|
|
23
|
-
import handleSubscribe from "./messageHandlers/handleSubscribe";
|
|
24
|
-
import logger from "./logger";
|
|
25
|
-
export interface Listener<T = any> {
|
|
26
|
-
key: string;
|
|
27
|
-
timeout: number | null;
|
|
28
|
-
fn: (msg: VerificationData<T>) => void;
|
|
29
|
-
}
|
|
30
|
-
interface Verificator<T> {
|
|
31
|
-
key: string;
|
|
32
|
-
fn: (msg: VerificationData<T>, previousData: T | undefined) => Promise<boolean>;
|
|
33
|
-
}
|
|
34
|
-
export default class ToolDb extends EventEmitter {
|
|
35
|
-
private _network;
|
|
36
|
-
private _store;
|
|
37
|
-
private _serverPeers;
|
|
38
|
-
private _peerAccount;
|
|
39
|
-
private _userAccount;
|
|
40
|
-
logger: typeof logger;
|
|
41
|
-
clientOnMessage: typeof toolDbClientOnMessage;
|
|
42
|
-
verifyMessage: typeof verifyMessage;
|
|
43
|
-
private _subscriptions;
|
|
44
|
-
get subscriptions(): string[];
|
|
45
|
-
private _processedIds;
|
|
46
|
-
get processedIds(): Record<string, string[]>;
|
|
47
|
-
private _processedOutHashes;
|
|
48
|
-
get processedOutHashes(): Record<string, string[]>;
|
|
49
|
-
subscribeData: typeof toolDbSubscribe;
|
|
50
|
-
isConnected: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Emitted after a disconnection, when there are no more peers connected to.
|
|
53
|
-
*/
|
|
54
|
-
onDisconnect: () => void;
|
|
55
|
-
/**
|
|
56
|
-
* Emitted the first time we are connected to a peer.
|
|
57
|
-
*/
|
|
58
|
-
onConnect: () => void;
|
|
59
|
-
onPeerDisconnect: (peerId: string) => void;
|
|
60
|
-
onPeerConnect: (peerId: string) => void;
|
|
61
|
-
getData: typeof toolDbGet;
|
|
62
|
-
putData: typeof toolDbPut;
|
|
63
|
-
putCrdt: typeof toolDbCrdtPut;
|
|
64
|
-
getCrdt: typeof toolDbCrdtGet;
|
|
65
|
-
queryKeys: typeof toolDbQueryKeys;
|
|
66
|
-
signIn: typeof toolDbSignIn;
|
|
67
|
-
anonSignIn: typeof toolDbAnonSignIn;
|
|
68
|
-
keysSignIn: typeof toolDbKeysSignIn;
|
|
69
|
-
signUp: typeof toolDbSignUp;
|
|
70
|
-
verify: typeof toolDbVerificationWrapper;
|
|
71
|
-
handlePing: typeof handlePing;
|
|
72
|
-
handlePong: typeof handlePong;
|
|
73
|
-
handleCrdtGet: typeof handleCrdtGet;
|
|
74
|
-
handleCrdtPut: typeof handleCrdtPut;
|
|
75
|
-
handleGet: typeof handleGet;
|
|
76
|
-
handlePut: typeof handlePut;
|
|
77
|
-
handleQuery: typeof handleQuery;
|
|
78
|
-
handleSubscribe: typeof handleSubscribe;
|
|
79
|
-
/**
|
|
80
|
-
* id listeners listen for a specific message ID just once
|
|
81
|
-
*/
|
|
82
|
-
_idListeners: Record<string, (msg: ToolDbMessage) => void>;
|
|
83
|
-
addIdListener: (id: string, fn: (msg: ToolDbMessage) => void) => void;
|
|
84
|
-
removeIdListener: (id: string) => void;
|
|
85
|
-
getUserNamespacedKey(key: string): string;
|
|
86
|
-
/**
|
|
87
|
-
* Key listeners listen for a specific key, as long as the listener remains active
|
|
88
|
-
*/
|
|
89
|
-
_keyListeners: (Listener | null)[];
|
|
90
|
-
addKeyListener: <T>(key: string, fn: (msg: VerificationData<T>) => void) => number;
|
|
91
|
-
removeKeyListener: (id: number) => void;
|
|
92
|
-
triggerKeyListener: <T = any>(key: string, message: VerificationData<T>) => void;
|
|
93
|
-
/**
|
|
94
|
-
* Custom verificators can enhance default verification on any key field
|
|
95
|
-
*/
|
|
96
|
-
_customVerificator: (Verificator<any> | null)[];
|
|
97
|
-
addCustomVerification: <T = any>(key: string, fn: (msg: VerificationData<T>, previous: T | undefined) => Promise<boolean>) => number;
|
|
98
|
-
removeCustomVerification: (id: number) => void;
|
|
99
|
-
private _options;
|
|
100
|
-
get options(): ToolDbOptions;
|
|
101
|
-
get network(): import(".").ToolDbNetworkAdapter;
|
|
102
|
-
get serverPeers(): Peer[];
|
|
103
|
-
get store(): ToolDbStorageAdapter;
|
|
104
|
-
get userAccount(): ToolDbUserAdapter;
|
|
105
|
-
get peerAccount(): ToolDbUserAdapter;
|
|
106
|
-
constructor(options?: Partial<ToolDbOptions>);
|
|
107
|
-
}
|
|
108
|
-
export {};
|
package/dist/tooldb.js
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __assign = (this && this.__assign) || function () {
|
|
18
|
-
__assign = Object.assign || function(t) {
|
|
19
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
-
s = arguments[i];
|
|
21
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
-
t[p] = s[p];
|
|
23
|
-
}
|
|
24
|
-
return t;
|
|
25
|
-
};
|
|
26
|
-
return __assign.apply(this, arguments);
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
var events_1 = __importDefault(require("events"));
|
|
33
|
-
var _1 = require(".");
|
|
34
|
-
var toolDbGet_1 = __importDefault(require("./toolDbGet"));
|
|
35
|
-
var toolDbPut_1 = __importDefault(require("./toolDbPut"));
|
|
36
|
-
var toolDbSignIn_1 = __importDefault(require("./toolDbSignIn"));
|
|
37
|
-
var toolDbSignUp_1 = __importDefault(require("./toolDbSignUp"));
|
|
38
|
-
var toolDbCrdtGet_1 = __importDefault(require("./toolDbCrdtGet"));
|
|
39
|
-
var toolDbCrdtPut_1 = __importDefault(require("./toolDbCrdtPut"));
|
|
40
|
-
var toolDbWebsocket_1 = __importDefault(require("./adapters/toolDbWebsocket"));
|
|
41
|
-
var toolDbAnonSignIn_1 = __importDefault(require("./toolDbAnonSignIn"));
|
|
42
|
-
var toolDbClientOnMessage_1 = __importDefault(require("./toolDbClientOnMessage"));
|
|
43
|
-
var toolDbVerificationWrapper_1 = __importDefault(require("./toolDbVerificationWrapper"));
|
|
44
|
-
var toolDbQueryKeys_1 = __importDefault(require("./toolDbQueryKeys"));
|
|
45
|
-
var toolDbKeysSignIn_1 = __importDefault(require("./toolDbKeysSignIn"));
|
|
46
|
-
var toolDbSubscribe_1 = __importDefault(require("./toolDbSubscribe"));
|
|
47
|
-
var handleGet_1 = __importDefault(require("./messageHandlers/handleGet"));
|
|
48
|
-
var handlePut_1 = __importDefault(require("./messageHandlers/handlePut"));
|
|
49
|
-
var handlePing_1 = __importDefault(require("./messageHandlers/handlePing"));
|
|
50
|
-
var handlePong_1 = __importDefault(require("./messageHandlers/handlePong"));
|
|
51
|
-
var handleQuery_1 = __importDefault(require("./messageHandlers/handleQuery"));
|
|
52
|
-
var handleCrdtGet_1 = __importDefault(require("./messageHandlers/handleCrdtGet"));
|
|
53
|
-
var handleCrdtPut_1 = __importDefault(require("./messageHandlers/handleCrdtPut"));
|
|
54
|
-
var handleSubscribe_1 = __importDefault(require("./messageHandlers/handleSubscribe"));
|
|
55
|
-
var logger_1 = __importDefault(require("./logger"));
|
|
56
|
-
var ToolDb = /** @class */ (function (_super) {
|
|
57
|
-
__extends(ToolDb, _super);
|
|
58
|
-
function ToolDb(options) {
|
|
59
|
-
if (options === void 0) { options = {}; }
|
|
60
|
-
var _this = _super.call(this) || this;
|
|
61
|
-
_this._serverPeers = [];
|
|
62
|
-
_this.logger = logger_1.default;
|
|
63
|
-
_this.clientOnMessage = toolDbClientOnMessage_1.default;
|
|
64
|
-
_this.verifyMessage = _1.verifyMessage;
|
|
65
|
-
_this._subscriptions = [];
|
|
66
|
-
_this._processedIds = {};
|
|
67
|
-
_this._processedOutHashes = {};
|
|
68
|
-
_this.subscribeData = toolDbSubscribe_1.default;
|
|
69
|
-
_this.isConnected = false;
|
|
70
|
-
/**
|
|
71
|
-
* Emitted after a disconnection, when there are no more peers connected to.
|
|
72
|
-
*/
|
|
73
|
-
_this.onDisconnect = function () {
|
|
74
|
-
//
|
|
75
|
-
};
|
|
76
|
-
/**
|
|
77
|
-
* Emitted the first time we are connected to a peer.
|
|
78
|
-
*/
|
|
79
|
-
_this.onConnect = function () {
|
|
80
|
-
//
|
|
81
|
-
};
|
|
82
|
-
_this.onPeerDisconnect = function (peerId) {
|
|
83
|
-
//
|
|
84
|
-
};
|
|
85
|
-
_this.onPeerConnect = function (peerId) {
|
|
86
|
-
//
|
|
87
|
-
};
|
|
88
|
-
_this.getData = toolDbGet_1.default;
|
|
89
|
-
_this.putData = toolDbPut_1.default;
|
|
90
|
-
_this.putCrdt = toolDbCrdtPut_1.default;
|
|
91
|
-
_this.getCrdt = toolDbCrdtGet_1.default;
|
|
92
|
-
_this.queryKeys = toolDbQueryKeys_1.default;
|
|
93
|
-
_this.signIn = toolDbSignIn_1.default;
|
|
94
|
-
_this.anonSignIn = toolDbAnonSignIn_1.default;
|
|
95
|
-
_this.keysSignIn = toolDbKeysSignIn_1.default;
|
|
96
|
-
_this.signUp = toolDbSignUp_1.default;
|
|
97
|
-
_this.verify = toolDbVerificationWrapper_1.default;
|
|
98
|
-
// All message handlers go here
|
|
99
|
-
_this.handlePing = handlePing_1.default;
|
|
100
|
-
_this.handlePong = handlePong_1.default;
|
|
101
|
-
_this.handleCrdtGet = handleCrdtGet_1.default;
|
|
102
|
-
_this.handleCrdtPut = handleCrdtPut_1.default;
|
|
103
|
-
_this.handleGet = handleGet_1.default;
|
|
104
|
-
_this.handlePut = handlePut_1.default;
|
|
105
|
-
_this.handleQuery = handleQuery_1.default;
|
|
106
|
-
_this.handleSubscribe = handleSubscribe_1.default;
|
|
107
|
-
/**
|
|
108
|
-
* id listeners listen for a specific message ID just once
|
|
109
|
-
*/
|
|
110
|
-
_this._idListeners = {};
|
|
111
|
-
_this.addIdListener = function (id, fn) {
|
|
112
|
-
_this._idListeners[id] = fn;
|
|
113
|
-
};
|
|
114
|
-
_this.removeIdListener = function (id) {
|
|
115
|
-
delete _this._idListeners[id];
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Key listeners listen for a specific key, as long as the listener remains active
|
|
119
|
-
*/
|
|
120
|
-
_this._keyListeners = [];
|
|
121
|
-
_this.addKeyListener = function (key, fn) {
|
|
122
|
-
_this.logger("Add key listener: ".concat(key));
|
|
123
|
-
var newListener = {
|
|
124
|
-
key: key,
|
|
125
|
-
timeout: null,
|
|
126
|
-
fn: fn,
|
|
127
|
-
};
|
|
128
|
-
_this._keyListeners.push(newListener);
|
|
129
|
-
return _this._keyListeners.length - 1;
|
|
130
|
-
};
|
|
131
|
-
_this.removeKeyListener = function (id) {
|
|
132
|
-
var _a, _b;
|
|
133
|
-
if ((_a = _this._keyListeners[id]) === null || _a === void 0 ? void 0 : _a.timeout) {
|
|
134
|
-
clearTimeout(((_b = _this._keyListeners[id]) === null || _b === void 0 ? void 0 : _b.timeout) || undefined);
|
|
135
|
-
}
|
|
136
|
-
_this._keyListeners[id] = null;
|
|
137
|
-
};
|
|
138
|
-
_this.triggerKeyListener = function (key, message) {
|
|
139
|
-
_this._keyListeners.forEach(function (listener) {
|
|
140
|
-
if ((listener === null || listener === void 0 ? void 0 : listener.key) === key) {
|
|
141
|
-
_this.logger("Trigger key listener: ".concat(key));
|
|
142
|
-
if (listener.timeout) {
|
|
143
|
-
clearTimeout(listener.timeout);
|
|
144
|
-
}
|
|
145
|
-
listener.timeout = setTimeout(function () { return listener.fn(message); }, _this.options.triggerDebouce);
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* Custom verificators can enhance default verification on any key field
|
|
151
|
-
*/
|
|
152
|
-
_this._customVerificator = [];
|
|
153
|
-
_this.addCustomVerification = function (key, fn) {
|
|
154
|
-
var newListener = {
|
|
155
|
-
key: key,
|
|
156
|
-
fn: fn,
|
|
157
|
-
};
|
|
158
|
-
_this._customVerificator.push(newListener);
|
|
159
|
-
return _this._customVerificator.length;
|
|
160
|
-
};
|
|
161
|
-
_this.removeCustomVerification = function (id) {
|
|
162
|
-
_this._customVerificator[id] = null;
|
|
163
|
-
};
|
|
164
|
-
_this._options = {
|
|
165
|
-
peers: [],
|
|
166
|
-
maxRetries: 5,
|
|
167
|
-
triggerDebouce: 100,
|
|
168
|
-
wait: 2000,
|
|
169
|
-
pow: 0,
|
|
170
|
-
server: false,
|
|
171
|
-
host: "127.0.0.1",
|
|
172
|
-
port: 8080,
|
|
173
|
-
debug: false,
|
|
174
|
-
httpServer: undefined,
|
|
175
|
-
networkAdapter: toolDbWebsocket_1.default,
|
|
176
|
-
userAdapter: _1.ToolDbWeb3User,
|
|
177
|
-
storageName: "tooldb",
|
|
178
|
-
storageAdapter: typeof window === "undefined" ? _1.ToolDbLeveldb : _1.ToolDbIndexedb,
|
|
179
|
-
topic: "tool-db-default",
|
|
180
|
-
};
|
|
181
|
-
_this._options = __assign(__assign({}, _this.options), options);
|
|
182
|
-
_this._store = new _this.options.storageAdapter(_this);
|
|
183
|
-
_this._peerAccount = new _this.options.userAdapter(_this);
|
|
184
|
-
_this._userAccount = new _this.options.userAdapter(_this);
|
|
185
|
-
_this._network = new _this.options.networkAdapter(_this);
|
|
186
|
-
var DEFAULT_KEYS = "%default-peer%";
|
|
187
|
-
// DO NOT USE THE DEFAULT STORE FOR KEYS
|
|
188
|
-
var tempStore = new _this.options.storageAdapter(_this, "_____peer_" + _this.options.storageName);
|
|
189
|
-
tempStore
|
|
190
|
-
.get(DEFAULT_KEYS)
|
|
191
|
-
.then(function (val) {
|
|
192
|
-
_this.peerAccount
|
|
193
|
-
.decryptAccount(JSON.parse(val), DEFAULT_KEYS)
|
|
194
|
-
.then(function (a) {
|
|
195
|
-
_this.peerAccount.setUser(a, (0, _1.randomAnimal)());
|
|
196
|
-
})
|
|
197
|
-
.finally(function () {
|
|
198
|
-
_this.emit("init", _this.userAccount.getAddress());
|
|
199
|
-
});
|
|
200
|
-
})
|
|
201
|
-
.catch(function (_e) {
|
|
202
|
-
_this.peerAccount.encryptAccount(DEFAULT_KEYS).then(function (a) {
|
|
203
|
-
tempStore
|
|
204
|
-
.put(DEFAULT_KEYS, JSON.stringify(a))
|
|
205
|
-
.catch(function () {
|
|
206
|
-
// nothing
|
|
207
|
-
})
|
|
208
|
-
.finally(function () {
|
|
209
|
-
_this.emit("init", _this.userAccount.getAddress());
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
return _this;
|
|
214
|
-
}
|
|
215
|
-
Object.defineProperty(ToolDb.prototype, "subscriptions", {
|
|
216
|
-
get: function () {
|
|
217
|
-
return this._subscriptions;
|
|
218
|
-
},
|
|
219
|
-
enumerable: false,
|
|
220
|
-
configurable: true
|
|
221
|
-
});
|
|
222
|
-
Object.defineProperty(ToolDb.prototype, "processedIds", {
|
|
223
|
-
get: function () {
|
|
224
|
-
return this._processedIds;
|
|
225
|
-
},
|
|
226
|
-
enumerable: false,
|
|
227
|
-
configurable: true
|
|
228
|
-
});
|
|
229
|
-
Object.defineProperty(ToolDb.prototype, "processedOutHashes", {
|
|
230
|
-
get: function () {
|
|
231
|
-
return this._processedOutHashes;
|
|
232
|
-
},
|
|
233
|
-
enumerable: false,
|
|
234
|
-
configurable: true
|
|
235
|
-
});
|
|
236
|
-
ToolDb.prototype.getUserNamespacedKey = function (key) {
|
|
237
|
-
var _a;
|
|
238
|
-
return ":" + (((_a = this.userAccount) === null || _a === void 0 ? void 0 : _a.getAddress()) || "") + "." + key;
|
|
239
|
-
};
|
|
240
|
-
Object.defineProperty(ToolDb.prototype, "options", {
|
|
241
|
-
get: function () {
|
|
242
|
-
return this._options;
|
|
243
|
-
},
|
|
244
|
-
enumerable: false,
|
|
245
|
-
configurable: true
|
|
246
|
-
});
|
|
247
|
-
Object.defineProperty(ToolDb.prototype, "network", {
|
|
248
|
-
get: function () {
|
|
249
|
-
return this._network;
|
|
250
|
-
},
|
|
251
|
-
enumerable: false,
|
|
252
|
-
configurable: true
|
|
253
|
-
});
|
|
254
|
-
Object.defineProperty(ToolDb.prototype, "serverPeers", {
|
|
255
|
-
get: function () {
|
|
256
|
-
return this._serverPeers;
|
|
257
|
-
},
|
|
258
|
-
enumerable: false,
|
|
259
|
-
configurable: true
|
|
260
|
-
});
|
|
261
|
-
Object.defineProperty(ToolDb.prototype, "store", {
|
|
262
|
-
get: function () {
|
|
263
|
-
return this._store;
|
|
264
|
-
},
|
|
265
|
-
enumerable: false,
|
|
266
|
-
configurable: true
|
|
267
|
-
});
|
|
268
|
-
Object.defineProperty(ToolDb.prototype, "userAccount", {
|
|
269
|
-
get: function () {
|
|
270
|
-
return this._userAccount;
|
|
271
|
-
},
|
|
272
|
-
enumerable: false,
|
|
273
|
-
configurable: true
|
|
274
|
-
});
|
|
275
|
-
Object.defineProperty(ToolDb.prototype, "peerAccount", {
|
|
276
|
-
get: function () {
|
|
277
|
-
return this._peerAccount;
|
|
278
|
-
},
|
|
279
|
-
enumerable: false,
|
|
280
|
-
configurable: true
|
|
281
|
-
});
|
|
282
|
-
return ToolDb;
|
|
283
|
-
}(events_1.default));
|
|
284
|
-
exports.default = ToolDb;
|
|
285
|
-
//# sourceMappingURL=tooldb.js.map
|
package/dist/tooldb.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooldb.js","sourceRoot":"","sources":["../src/tooldb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAkC;AAElC,sBAYW;AAEX,0DAAoC;AACpC,0D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aAAT;YACE,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;;;OAAA;IAED,sBAAI,+BAAW;aAAf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IAED,sBAAI,+BAAW;aAAf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;;;OAAA;IA6CH,aAAC;AAAD,CAAC,AAnQD,CAAoC,gBAAY,GAmQ/C"}
|
package/dist/types/graph.d.ts
DELETED
|
File without changes
|
package/dist/types/graph.js
DELETED
package/dist/types/graph.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../../src/types/graph.ts"],"names":[],"mappings":""}
|