Compare commits
37 Commits
Author | SHA1 | Date |
---|---|---|
semantic-release-bot | b8d6a88a2b | |
Derrick Hammer | 9d447ec6e7 | |
Derrick Hammer | 3d32281d39 | |
semantic-release-bot | d17c090383 | |
Derrick Hammer | d7ff92545c | |
Derrick Hammer | da7c03f2fd | |
semantic-release-bot | b59237559c | |
Derrick Hammer | c58cea452e | |
Derrick Hammer | 11550ded76 | |
semantic-release-bot | fbd83ab15c | |
Derrick Hammer | 3fd4e21330 | |
Derrick Hammer | bf285a4ef8 | |
semantic-release-bot | 85081ddd66 | |
Derrick Hammer | 8bfe6ea4f4 | |
Derrick Hammer | 9d2b5ba2c4 | |
semantic-release-bot | 76e371275a | |
Derrick Hammer | 2aa574b0ac | |
Derrick Hammer | f512cb86fd | |
semantic-release-bot | ee359bfefe | |
Derrick Hammer | 365d54e844 | |
Derrick Hammer | bae26a3e01 | |
semantic-release-bot | 8f9f70bbd3 | |
Derrick Hammer | b2a741ab2a | |
Derrick Hammer | 35838ef20c | |
semantic-release-bot | 37bd68ff51 | |
Derrick Hammer | ac4b1bb29c | |
semantic-release-bot | 315a43e07a | |
Derrick Hammer | dffcda67c1 | |
Derrick Hammer | ebb4b8df73 | |
semantic-release-bot | 662c5232c4 | |
Derrick Hammer | 091e36883a | |
Derrick Hammer | 543b32c6ed | |
semantic-release-bot | 4521180f9f | |
Derrick Hammer | 30e98d881f | |
Derrick Hammer | 7a1f169707 | |
semantic-release-bot | 14e3df654a | |
Derrick Hammer | 743e76bcf1 |
|
@ -0,0 +1,13 @@
|
|||
name: Build/Publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- develop
|
||||
- develop-*
|
||||
|
||||
jobs:
|
||||
main:
|
||||
uses: lumeweb/github-node-deploy-workflow/.github/workflows/main.yml@master
|
||||
secrets: inherit
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"preset": ["@lumeweb/node-library-preset"]
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
## [0.0.2-develop.13](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.12...v0.0.2-develop.13) (2023-10-13)
|
||||
|
||||
## [0.0.2-develop.12](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.11...v0.0.2-develop.12) (2023-09-03)
|
||||
|
||||
## [0.0.2-develop.11](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.10...v0.0.2-develop.11) (2023-09-03)
|
||||
|
||||
## [0.0.2-develop.10](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.9...v0.0.2-develop.10) (2023-09-02)
|
||||
|
||||
## [0.0.2-develop.9](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.8...v0.0.2-develop.9) (2023-09-02)
|
||||
|
||||
## [0.0.2-develop.8](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.7...v0.0.2-develop.8) (2023-07-12)
|
||||
|
||||
## [0.0.2-develop.7](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.6...v0.0.2-develop.7) (2023-07-03)
|
||||
|
||||
## [0.0.2-develop.6](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.5...v0.0.2-develop.6) (2023-07-02)
|
||||
|
||||
## [0.0.2-develop.5](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.4...v0.0.2-develop.5) (2023-07-01)
|
||||
|
||||
## [0.0.2-develop.4](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.3...v0.0.2-develop.4) (2023-07-01)
|
||||
|
||||
## [0.0.2-develop.3](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.2...v0.0.2-develop.3) (2023-07-01)
|
||||
|
||||
## [0.0.2-develop.2](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.2-develop.1...v0.0.2-develop.2) (2023-07-01)
|
||||
|
||||
## [0.0.2-develop.1](https://git.lumeweb.com/LumeWeb/hyperswarm-web/compare/v0.0.1...v0.0.2-develop.1) (2023-07-01)
|
||||
|
||||
|
||||
### Reverts
|
||||
|
||||
* Revert "*Store copy of activeRelay size to prevent infinite loop" ([cb16b87](https://git.lumeweb.com/LumeWeb/hyperswarm-web/commit/cb16b87b73e104aa2e6ad3dad1b827cb0a85243a))
|
|
@ -1,44 +0,0 @@
|
|||
import DhtNode from "@hyperswarm/dht-relay";
|
||||
import Hyperswarm from "hyperswarm";
|
||||
import EventEmitter, { OnOptions } from "eventemitter2";
|
||||
export default class HyperswarmWeb extends EventEmitter {
|
||||
private _options;
|
||||
private _discovery;
|
||||
private _queuedEmActions;
|
||||
private _connectionMutex;
|
||||
constructor(opts?: any);
|
||||
private _relays;
|
||||
get relays(): string[];
|
||||
private _activeRelay;
|
||||
get activeRelay(): Hyperswarm;
|
||||
private _ready;
|
||||
get ready(): boolean;
|
||||
init(): Promise<void>;
|
||||
connect(pubkey: string, options?: {}): Promise<DhtNode>;
|
||||
addRelay(pubkey: string): Promise<void>;
|
||||
removeRelay(pubkey: string): boolean;
|
||||
clearRelays(): void;
|
||||
on(eventName: string | symbol, listener: (...args: any[]) => void): Hyperswarm;
|
||||
onSelf(eventName: string | symbol, listener: (...args: any[]) => void, options?: boolean | OnOptions): Hyperswarm;
|
||||
addListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||
off(eventName: string | symbol, listener: (...args: any[]) => void): Hyperswarm;
|
||||
offSelf(eventName: string | symbol, listener: (...args: any[]) => void): Hyperswarm;
|
||||
removeListener(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||
emit(eventName: string | symbol, ...args: any[]): boolean;
|
||||
emitSelf(eventName: string | symbol, ...args: any[]): boolean;
|
||||
once(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||
onceSelf(eventName: string | symbol, listener: (...args: any[]) => void): this;
|
||||
join(topic: Uint8Array, opts?: {}): void;
|
||||
joinPeer(publicKey: Uint8Array): void;
|
||||
leave(topic: Uint8Array): void;
|
||||
leavePeer(publicKey: Uint8Array): void;
|
||||
status(publicKey: Uint8Array): any;
|
||||
topics(): string[];
|
||||
flush(): Promise<any>;
|
||||
clear(): Promise<any>;
|
||||
private ensureConnection;
|
||||
private isServerAvailable;
|
||||
private _processOrQueueAction;
|
||||
private _processQueuedActions;
|
||||
}
|
||||
//# sourceMappingURL=index.d.ts.map
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
|
@ -1,189 +0,0 @@
|
|||
// @ts-ignore
|
||||
import DhtNode from "@hyperswarm/dht-relay";
|
||||
// @ts-ignore
|
||||
import Stream from "@hyperswarm/dht-relay/ws";
|
||||
import { createClient } from "@lumeweb/kernel-peer-discovery-client";
|
||||
import { load } from "@lumeweb/libkernel-universal";
|
||||
// @ts-ignore
|
||||
import Hyperswarm from "hyperswarm";
|
||||
import randomNumber from "random-number-csprng";
|
||||
import EventEmitter from "eventemitter2";
|
||||
import { Mutex } from "async-mutex";
|
||||
export default class HyperswarmWeb extends EventEmitter {
|
||||
_options;
|
||||
_discovery;
|
||||
_queuedEmActions = [];
|
||||
_connectionMutex = new Mutex();
|
||||
constructor(opts = {}) {
|
||||
super();
|
||||
opts.custodial = false;
|
||||
this._options = opts;
|
||||
this._discovery = createClient();
|
||||
}
|
||||
_relays = new Set();
|
||||
get relays() {
|
||||
return [...this._relays.values()];
|
||||
}
|
||||
_activeRelay;
|
||||
get activeRelay() {
|
||||
return this._activeRelay;
|
||||
}
|
||||
_ready = false;
|
||||
get ready() {
|
||||
return this._ready;
|
||||
}
|
||||
init() {
|
||||
return this.ensureConnection();
|
||||
}
|
||||
async connect(pubkey, options = {}) {
|
||||
if (!this._activeRelay) {
|
||||
await this.ensureConnection();
|
||||
}
|
||||
return this._activeRelay.connect(pubkey, options);
|
||||
}
|
||||
async addRelay(pubkey) {
|
||||
this._relays.add(pubkey);
|
||||
}
|
||||
removeRelay(pubkey) {
|
||||
if (!this._relays.has(pubkey)) {
|
||||
return false;
|
||||
}
|
||||
this._relays.delete(pubkey);
|
||||
return true;
|
||||
}
|
||||
clearRelays() {
|
||||
this._relays.clear();
|
||||
}
|
||||
on(eventName, listener) {
|
||||
return this._processOrQueueAction("on", ...arguments);
|
||||
}
|
||||
onSelf(eventName, listener, options) {
|
||||
return super.on(eventName, listener, options);
|
||||
}
|
||||
addListener(eventName, listener) {
|
||||
return this.on(eventName, listener);
|
||||
}
|
||||
off(eventName, listener) {
|
||||
return this._processOrQueueAction("off", ...arguments);
|
||||
}
|
||||
offSelf(eventName, listener) {
|
||||
return super.off(eventName, listener);
|
||||
}
|
||||
removeListener(eventName, listener) {
|
||||
return this.off(eventName, listener);
|
||||
}
|
||||
emit(eventName, ...args) {
|
||||
return this._processOrQueueAction("emit", ...arguments);
|
||||
}
|
||||
emitSelf(eventName, ...args) {
|
||||
return super.emit(eventName, ...args);
|
||||
}
|
||||
once(eventName, listener) {
|
||||
return this._processOrQueueAction("once", ...arguments);
|
||||
}
|
||||
onceSelf(eventName, listener) {
|
||||
return this.once(eventName, listener);
|
||||
}
|
||||
join(topic, opts = {}) {
|
||||
return this._processOrQueueAction("join", ...arguments);
|
||||
}
|
||||
joinPeer(publicKey) {
|
||||
return this._processOrQueueAction("joinPeer", ...arguments);
|
||||
}
|
||||
leave(topic) {
|
||||
return this._processOrQueueAction("leave", ...arguments);
|
||||
}
|
||||
leavePeer(publicKey) {
|
||||
return this._processOrQueueAction("leavePeer", ...arguments);
|
||||
}
|
||||
status(publicKey) {
|
||||
return this._activeRelay?.status(publicKey);
|
||||
}
|
||||
topics() {
|
||||
return this._activeRelay?.topics();
|
||||
}
|
||||
async flush() {
|
||||
return this._activeRelay?.flush();
|
||||
}
|
||||
async clear() {
|
||||
return this._activeRelay?.clear();
|
||||
}
|
||||
async ensureConnection() {
|
||||
const logErr = (await load()).logErr;
|
||||
await this._connectionMutex.acquire();
|
||||
if (this._activeRelay) {
|
||||
this._connectionMutex.release();
|
||||
return;
|
||||
}
|
||||
const relays = this.relays;
|
||||
if (relays.length > 0) {
|
||||
do {
|
||||
const index = relays.length > 1 ? await randomNumber(0, relays.length - 1) : 0;
|
||||
const relay = relays[index];
|
||||
let ret;
|
||||
try {
|
||||
ret = await this._discovery.discover(relay);
|
||||
}
|
||||
catch (e) {
|
||||
logErr(e);
|
||||
relays.splice(index, 1);
|
||||
continue;
|
||||
}
|
||||
if (!ret) {
|
||||
relays.splice(index, 1);
|
||||
continue;
|
||||
}
|
||||
ret = ret;
|
||||
const connection = `wss://${ret.host}:${ret.port}`;
|
||||
if (!(await this.isServerAvailable(connection))) {
|
||||
relays.splice(index, 1);
|
||||
continue;
|
||||
}
|
||||
this._activeRelay = new Hyperswarm({
|
||||
dht: new DhtNode(new Stream(true, new WebSocket(connection)), this._options),
|
||||
keyPair: this._options.keyPair,
|
||||
});
|
||||
this._activeRelay.dht._protocol._stream.once("close", () => {
|
||||
this._activeRelay = undefined;
|
||||
this._ready = false;
|
||||
this.emitSelf("close");
|
||||
});
|
||||
} while (relays.length > 0 && !this._activeRelay);
|
||||
}
|
||||
if (!this._activeRelay) {
|
||||
this._connectionMutex.release();
|
||||
throw new Error("Failed to find an available relay");
|
||||
}
|
||||
this.emitSelf("init");
|
||||
this._processQueuedActions();
|
||||
await this._activeRelay.dht.ready();
|
||||
this._connectionMutex.release();
|
||||
this._ready = true;
|
||||
this.emit("ready");
|
||||
}
|
||||
async isServerAvailable(connection) {
|
||||
return new Promise((resolve) => {
|
||||
const ws = new WebSocket(connection);
|
||||
ws.addEventListener("open", () => {
|
||||
ws.close();
|
||||
resolve(true);
|
||||
});
|
||||
ws.addEventListener("error", () => {
|
||||
resolve(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
_processOrQueueAction(method, ...args) {
|
||||
if (this._activeRelay) {
|
||||
return this._activeRelay[method](...args);
|
||||
}
|
||||
this._queuedEmActions.push([method, args]);
|
||||
return this;
|
||||
}
|
||||
_processQueuedActions() {
|
||||
for (const action of this._queuedEmActions) {
|
||||
this._activeRelay[action[0]](...action[1]);
|
||||
}
|
||||
this._queuedEmActions = [];
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
38
package.json
38
package.json
|
@ -1,25 +1,45 @@
|
|||
{
|
||||
"name": "@lumeweb/hyperswarm-web",
|
||||
"type": "module",
|
||||
"version": "0.1.0",
|
||||
"main": "dist/index.js",
|
||||
"version": "0.0.2-develop.13",
|
||||
"main": "lib/index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "gitea@git.lumeweb.com:LumeWeb/hyperswarm-web.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rimraf dist && tsc"
|
||||
"prepare": "presetter bootstrap",
|
||||
"build": "run build",
|
||||
"semantic-release": "semantic-release"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@lumeweb/node-library-preset": "^0.2.7",
|
||||
"@types/random-number-csprng": "^1.0.0",
|
||||
"@types/ws": "^8.5.4",
|
||||
"@types/ws": "^8.5.5",
|
||||
"async-mutex": "^0.4.0",
|
||||
"esbuild": "^0.14.54",
|
||||
"prettier": "^2.8.3",
|
||||
"eventemitter2": "^6.4.9",
|
||||
"hyperswarm": "^4.5.1",
|
||||
"presetter": "*",
|
||||
"prettier": "^2.8.8",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"@hyperswarm/dht-relay": "^0.3.0",
|
||||
"@lumeweb/kernel-peer-discovery-client": "git+https://git.lumeweb.com/LumeWeb/kernel-peer-discovery-client.git",
|
||||
"@lumeweb/libkernel-universal": "git+https://git.lumeweb.com/LumeWeb/libkernel-universal.git",
|
||||
"@hyperswarm/dht-relay": "^0.4.1",
|
||||
"@lumeweb/kernel-peer-discovery-client": "^0.0.2-develop.18",
|
||||
"@lumeweb/libkernel": "0.1.0-develop.39",
|
||||
"async-mutex": "^0.4.0",
|
||||
"emittery": "^1.0.1",
|
||||
"eventemitter2": "^6.4.9",
|
||||
"hyperswarm": "^4.3.7"
|
||||
"hyperswarm": "^4.5.1",
|
||||
"random-number-csprng": "^1.0.2"
|
||||
},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"files": [
|
||||
"lib/**"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
}
|
||||
}
|
||||
|
|
801
pnpm-lock.yaml
801
pnpm-lock.yaml
|
@ -1,801 +0,0 @@
|
|||
lockfileVersion: 5.4
|
||||
|
||||
specifiers:
|
||||
'@hyperswarm/dht-relay': ^0.3.0
|
||||
'@lumeweb/kernel-peer-discovery-client': git+https://git.lumeweb.com/LumeWeb/kernel-peer-discovery-client.git
|
||||
'@lumeweb/libkernel-universal': git+https://git.lumeweb.com/LumeWeb/libkernel-universal.git
|
||||
'@types/random-number-csprng': ^1.0.0
|
||||
'@types/ws': ^8.5.4
|
||||
async-mutex: ^0.4.0
|
||||
esbuild: ^0.14.54
|
||||
eventemitter2: ^6.4.9
|
||||
hyperswarm: ^4.3.7
|
||||
prettier: ^2.8.3
|
||||
rimraf: ^3.0.2
|
||||
typescript: ^4.9.5
|
||||
|
||||
dependencies:
|
||||
'@hyperswarm/dht-relay': 0.3.0
|
||||
'@lumeweb/kernel-peer-discovery-client': git.lumeweb.com/LumeWeb/kernel-peer-discovery-client/63bd27fed253f3fd7e94a357d8ce88809328f34c
|
||||
'@lumeweb/libkernel-universal': git.lumeweb.com/LumeWeb/libkernel-universal/abb26748abb3ca76d4489bf87a1c10a9901367ab
|
||||
async-mutex: 0.4.0
|
||||
eventemitter2: 6.4.9
|
||||
hyperswarm: 4.3.7
|
||||
|
||||
devDependencies:
|
||||
'@types/random-number-csprng': 1.0.0
|
||||
'@types/ws': 8.5.4
|
||||
esbuild: 0.14.54
|
||||
prettier: 2.8.3
|
||||
rimraf: 3.0.2
|
||||
typescript: 4.9.5
|
||||
|
||||
packages:
|
||||
|
||||
/@esbuild/linux-loong64/0.14.54:
|
||||
resolution: {integrity: sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@hyperswarm/dht-relay/0.3.0:
|
||||
resolution: {integrity: sha512-HOg8B+WNdI0/l6LCDdXhau7BmMhd0Eq//EvmlMvR1MlwJ7T8YCDaXm1EeqCnOSvTf7/DP90O8Jd23yXd3B9OiQ==}
|
||||
dependencies:
|
||||
'@hyperswarm/dht': 6.4.4
|
||||
'@hyperswarm/secret-stream': 6.1.2
|
||||
b4a: 1.6.1
|
||||
compact-encoding: 2.11.0
|
||||
compact-encoding-net: 1.2.0
|
||||
events: 3.3.0
|
||||
protomux: 3.4.1
|
||||
safety-catch: 1.0.2
|
||||
sodium-universal: 3.1.0
|
||||
streamx: 2.13.2
|
||||
timeout-refresh: 2.0.1
|
||||
dev: false
|
||||
|
||||
/@hyperswarm/dht/6.4.4:
|
||||
resolution: {integrity: sha512-yqOZ4iaOS9MYIMdC03lZ8scam+ptspTwL0rMFJILF+LU3LT8QjUCRHRUbUOaZFjZ0tf0g7+DICRILMTRwSQ/Ug==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
'@hyperswarm/secret-stream': 6.1.2
|
||||
b4a: 1.6.1
|
||||
bogon: 1.1.0
|
||||
compact-encoding: 2.11.0
|
||||
compact-encoding-net: 1.2.0
|
||||
debugging-stream: 2.0.0
|
||||
dht-rpc: 6.6.2
|
||||
events: 3.3.0
|
||||
hypercore-crypto: 3.3.1
|
||||
noise-curve-ed: 2.0.1
|
||||
noise-handshake: 3.0.2
|
||||
record-cache: 1.2.0
|
||||
safety-catch: 1.0.2
|
||||
sodium-universal: 4.0.0
|
||||
xache: 1.1.0
|
||||
dev: false
|
||||
|
||||
/@hyperswarm/secret-stream/6.1.2:
|
||||
resolution: {integrity: sha512-oem+ZEG+wOU1K47qGi51pKyqG1N3F+zz42xmReHeGZVR84y+K+6VQIXCON4EozYad8HEGCixpupt8yH8W4sMxg==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
hypercore-crypto: 3.3.1
|
||||
noise-curve-ed: 2.0.1
|
||||
noise-handshake: 3.0.2
|
||||
sodium-secretstream: 1.1.0
|
||||
sodium-universal: 4.0.0
|
||||
streamx: 2.13.2
|
||||
timeout-refresh: 2.0.1
|
||||
dev: false
|
||||
|
||||
/@skynetlabs/libskynet/0.0.48:
|
||||
resolution: {integrity: sha512-wFqPLVuGyfuEU1PsE7AMC+ANcoJiz7iruJPUrNZC0riDv1qMrZw+tx44HlBXLJ1H50JZiGtRPr9zLgkPFhf9OA==}
|
||||
dev: false
|
||||
|
||||
/@types/node/18.11.18:
|
||||
resolution: {integrity: sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==}
|
||||
dev: true
|
||||
|
||||
/@types/random-number-csprng/1.0.0:
|
||||
resolution: {integrity: sha512-JmNWSCGbay5HGkHb/WF0Ju3XTHP0tMLUhAOk4fsw+b1GQ9rC/WP9uLeuulWLVERCg3KoyTCNzsJX4jSi4ShKaw==}
|
||||
dev: true
|
||||
|
||||
/@types/ws/8.5.4:
|
||||
resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==}
|
||||
dependencies:
|
||||
'@types/node': 18.11.18
|
||||
dev: true
|
||||
|
||||
/async-mutex/0.4.0:
|
||||
resolution: {integrity: sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA==}
|
||||
dependencies:
|
||||
tslib: 2.5.0
|
||||
dev: false
|
||||
|
||||
/b4a/1.6.1:
|
||||
resolution: {integrity: sha512-AsKjNhz72yxteo/0EtQEiwkMUgk/tGmycXlbG4g3Ard2/ULtNLUykGOkeK0egmN27h0xMAhb76jYccW+XTBExA==}
|
||||
dev: false
|
||||
|
||||
/balanced-match/1.0.2:
|
||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||
dev: true
|
||||
|
||||
/blake2b-wasm/2.4.0:
|
||||
resolution: {integrity: sha512-S1kwmW2ZhZFFFOghcx73+ZajEfKBqhP82JMssxtLVMxlaPea1p9uoLiUZ5WYyHn0KddwbLc+0vh4wR0KBNoT5w==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
nanoassert: 2.0.0
|
||||
dev: false
|
||||
|
||||
/blake2b/2.1.4:
|
||||
resolution: {integrity: sha512-AyBuuJNI64gIvwx13qiICz6H6hpmjvYS5DGkG6jbXMOT8Z3WUJ3V1X0FlhIoT1b/5JtHE3ki+xjtMvu1nn+t9A==}
|
||||
dependencies:
|
||||
blake2b-wasm: 2.4.0
|
||||
nanoassert: 2.0.0
|
||||
dev: false
|
||||
|
||||
/bogon/1.1.0:
|
||||
resolution: {integrity: sha512-a6SnToksXHuUlgeMvI/txWmTcKz7c7iBa8f0HbXL4toN1Uza/CTQ4F7n9jSDX49TCpxv3KUP100q4sZfwLyLiw==}
|
||||
dependencies:
|
||||
compact-encoding: 2.11.0
|
||||
compact-encoding-net: 1.2.0
|
||||
dev: false
|
||||
|
||||
/brace-expansion/1.1.11:
|
||||
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
concat-map: 0.0.1
|
||||
dev: true
|
||||
|
||||
/chacha20-universal/1.0.4:
|
||||
resolution: {integrity: sha512-/IOxdWWNa7nRabfe7+oF+jVkGjlr2xUL4J8l/OvzZhj+c9RpMqoo3Dq+5nU1j/BflRV4BKnaQ4+4oH1yBpQG1Q==}
|
||||
dependencies:
|
||||
nanoassert: 2.0.0
|
||||
dev: false
|
||||
|
||||
/compact-encoding-net/1.2.0:
|
||||
resolution: {integrity: sha512-LVXpNpF7PGQeHRVVLGgYWzuVoYAaDZvKUsUxRioGfkotzvOh4AzoQF1HBH3zMNaSnx7gJXuUr3hkjnijaH/Eng==}
|
||||
dependencies:
|
||||
compact-encoding: 2.11.0
|
||||
dev: false
|
||||
|
||||
/compact-encoding/2.11.0:
|
||||
resolution: {integrity: sha512-CRfTuyy9Tg7EwxNKvIq3yFIr2JnJLyVr9Yj234VsDCL59hdXcZH3TdzY/2kwbAqVogIoRBJjnNKCEnXbxTIEeg==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
dev: false
|
||||
|
||||
/concat-map/0.0.1:
|
||||
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
|
||||
dev: true
|
||||
|
||||
/debugging-stream/2.0.0:
|
||||
resolution: {integrity: sha512-xwfl6wB/3xc553uwtGnSa94jFxnGOc02C0WU2Nmzwr80gzeqn1FX4VcbvoKIhe8L/lPq4BTQttAbrTN94uN8rA==}
|
||||
dependencies:
|
||||
streamx: 2.13.2
|
||||
dev: false
|
||||
|
||||
/dht-rpc/6.6.2:
|
||||
resolution: {integrity: sha512-tOG4cEwere/Vi5y8zJb1D55ApPFRMyHwgVLmjPeROQhYc0/L2ZYw/h4u3XqGYI0i+vweBN2ZEJ99vk9iBsxd3A==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
compact-encoding: 2.11.0
|
||||
compact-encoding-net: 1.2.0
|
||||
events: 3.3.0
|
||||
fast-fifo: 1.1.0
|
||||
kademlia-routing-table: 1.0.1
|
||||
nat-sampler: 1.0.1
|
||||
sodium-universal: 4.0.0
|
||||
streamx: 2.13.2
|
||||
time-ordered-set: 1.0.2
|
||||
udx-native: 1.5.3
|
||||
dev: false
|
||||
|
||||
/esbuild-android-64/0.14.54:
|
||||
resolution: {integrity: sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-android-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-darwin-64/0.14.54:
|
||||
resolution: {integrity: sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-darwin-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-freebsd-64/0.14.54:
|
||||
resolution: {integrity: sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-freebsd-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-32/0.14.54:
|
||||
resolution: {integrity: sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-64/0.14.54:
|
||||
resolution: {integrity: sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-arm/0.14.54:
|
||||
resolution: {integrity: sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-mips64le/0.14.54:
|
||||
resolution: {integrity: sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-ppc64le/0.14.54:
|
||||
resolution: {integrity: sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-riscv64/0.14.54:
|
||||
resolution: {integrity: sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-s390x/0.14.54:
|
||||
resolution: {integrity: sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-netbsd-64/0.14.54:
|
||||
resolution: {integrity: sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-openbsd-64/0.14.54:
|
||||
resolution: {integrity: sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-sunos-64/0.14.54:
|
||||
resolution: {integrity: sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-32/0.14.54:
|
||||
resolution: {integrity: sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-64/0.14.54:
|
||||
resolution: {integrity: sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild/0.14.54:
|
||||
resolution: {integrity: sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@esbuild/linux-loong64': 0.14.54
|
||||
esbuild-android-64: 0.14.54
|
||||
esbuild-android-arm64: 0.14.54
|
||||
esbuild-darwin-64: 0.14.54
|
||||
esbuild-darwin-arm64: 0.14.54
|
||||
esbuild-freebsd-64: 0.14.54
|
||||
esbuild-freebsd-arm64: 0.14.54
|
||||
esbuild-linux-32: 0.14.54
|
||||
esbuild-linux-64: 0.14.54
|
||||
esbuild-linux-arm: 0.14.54
|
||||
esbuild-linux-arm64: 0.14.54
|
||||
esbuild-linux-mips64le: 0.14.54
|
||||
esbuild-linux-ppc64le: 0.14.54
|
||||
esbuild-linux-riscv64: 0.14.54
|
||||
esbuild-linux-s390x: 0.14.54
|
||||
esbuild-netbsd-64: 0.14.54
|
||||
esbuild-openbsd-64: 0.14.54
|
||||
esbuild-sunos-64: 0.14.54
|
||||
esbuild-windows-32: 0.14.54
|
||||
esbuild-windows-64: 0.14.54
|
||||
esbuild-windows-arm64: 0.14.54
|
||||
dev: true
|
||||
|
||||
/eventemitter2/6.4.9:
|
||||
resolution: {integrity: sha512-JEPTiaOt9f04oa6NOkc4aH+nVp5I3wEjpHbIPqfgCdD5v5bUzy7xQqwcVO2aDQgOWhI28da57HksMrzK9HlRxg==}
|
||||
dev: false
|
||||
|
||||
/events/3.3.0:
|
||||
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
|
||||
engines: {node: '>=0.8.x'}
|
||||
dev: false
|
||||
|
||||
/fast-fifo/1.1.0:
|
||||
resolution: {integrity: sha512-Kl29QoNbNvn4nhDsLYjyIAaIqaJB6rBx5p3sL9VjaefJ+eMFBWVZiaoguaoZfzEKr5RhAti0UgM8703akGPJ6g==}
|
||||
dev: false
|
||||
|
||||
/fs.realpath/1.0.0:
|
||||
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
|
||||
dev: true
|
||||
|
||||
/function-bind/1.1.1:
|
||||
resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==}
|
||||
dev: false
|
||||
|
||||
/glob/7.2.3:
|
||||
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
|
||||
dependencies:
|
||||
fs.realpath: 1.0.0
|
||||
inflight: 1.0.6
|
||||
inherits: 2.0.4
|
||||
minimatch: 3.1.2
|
||||
once: 1.4.0
|
||||
path-is-absolute: 1.0.1
|
||||
dev: true
|
||||
|
||||
/has/1.0.3:
|
||||
resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==}
|
||||
engines: {node: '>= 0.4.0'}
|
||||
dependencies:
|
||||
function-bind: 1.1.1
|
||||
dev: false
|
||||
|
||||
/hypercore-crypto/3.3.1:
|
||||
resolution: {integrity: sha512-Fo0ZBMDW3P7HFh58AQdxsVop0Xh0Bper4Pyl5Dpc+tvGos6je2ufJpeepaHaI0mNkKq4we1ikd47kTnx2XJd/w==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
compact-encoding: 2.11.0
|
||||
sodium-universal: 4.0.0
|
||||
dev: false
|
||||
|
||||
/hyperswarm/4.3.7:
|
||||
resolution: {integrity: sha512-COL8cMmBUa0ElZ85oFT1KQnZh1UkfJ75VavyypXZplGErlajqbnI2CDNF9K7cGiIk7xXR0RI6otx3495WSOB2Q==}
|
||||
dependencies:
|
||||
'@hyperswarm/dht': 6.4.4
|
||||
b4a: 1.6.1
|
||||
events: 3.3.0
|
||||
safety-catch: 1.0.2
|
||||
shuffled-priority-queue: 2.1.0
|
||||
dev: false
|
||||
|
||||
/inflight/1.0.6:
|
||||
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
|
||||
dependencies:
|
||||
once: 1.4.0
|
||||
wrappy: 1.0.2
|
||||
dev: true
|
||||
|
||||
/inherits/2.0.4:
|
||||
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
|
||||
dev: true
|
||||
|
||||
/is-core-module/2.11.0:
|
||||
resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==}
|
||||
dependencies:
|
||||
has: 1.0.3
|
||||
dev: false
|
||||
|
||||
/kademlia-routing-table/1.0.1:
|
||||
resolution: {integrity: sha512-dKk19sC3/+kWhBIvOKCthxVV+JH0NrswSBq4sA4eOkkPMqQM1rRuOWte1WSKXeP8r9Nx4NuiH2gny3lMddJTpw==}
|
||||
dev: false
|
||||
|
||||
/libkernel/0.1.48:
|
||||
resolution: {integrity: sha512-h86j/D+5gnpw/h8DTQE1C9hWFRmQnw5ZU9L3fYTZIPqPEIIU40z+tnDp66Zbb6mcfYCr8+SGkhcCy3XsyHOvyQ==}
|
||||
dependencies:
|
||||
'@skynetlabs/libskynet': 0.0.48
|
||||
libskynet: 0.0.64
|
||||
dev: false
|
||||
|
||||
/libkmodule/0.2.53:
|
||||
resolution: {integrity: sha512-fwMcssu6mwH+xeuUwUFdGDYQgGvwuVs0RMtbBPEYHvPPOBDNbdesPmlax/+XwDn6XiGggg+wSvq7st2m4VbwEw==}
|
||||
dependencies:
|
||||
libskynet: 0.1.9
|
||||
dev: false
|
||||
|
||||
/libskynet/0.0.64:
|
||||
resolution: {integrity: sha512-OPIxvxNTbo7H6KWU1YgQkfksNGTSQYVDsmGTji05/Gv2ZpwTOVJF4AMvggCHyLije8fNe4ZXRrBEtLQI3kpAaQ==}
|
||||
dev: false
|
||||
|
||||
/libskynet/0.1.9:
|
||||
resolution: {integrity: sha512-lYP4GUbDZXUd0PyTyHz7RBPXGSBFmFZrc2JirnV7tlL4ii3Zi6m79z73zGWoiDBrHI25RR9s9gdm/LdBeXz9nQ==}
|
||||
dev: false
|
||||
|
||||
/minimatch/3.1.2:
|
||||
resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==}
|
||||
dependencies:
|
||||
brace-expansion: 1.1.11
|
||||
dev: true
|
||||
|
||||
/nanoassert/2.0.0:
|
||||
resolution: {integrity: sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==}
|
||||
dev: false
|
||||
|
||||
/napi-macros/2.2.2:
|
||||
resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==}
|
||||
dev: false
|
||||
|
||||
/nat-sampler/1.0.1:
|
||||
resolution: {integrity: sha512-yQvyNN7xbqR8crTKk3U8gRgpcV1Az+vfCEijiHu9oHHsnIl8n3x+yXNHl42M6L3czGynAVoOT9TqBfS87gDdcw==}
|
||||
dev: false
|
||||
|
||||
/node-gyp-build/4.6.0:
|
||||
resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==}
|
||||
hasBin: true
|
||||
dev: false
|
||||
|
||||
/noise-curve-ed/2.0.1:
|
||||
resolution: {integrity: sha512-8HMZ40Wmarg8RQjVemLrjB49JSL6eGeOD+tlzaQW5/p+hNPfHFEMC3UZZ57zUqUprMuz6GN+gsPExpz2DWL+iA==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
nanoassert: 2.0.0
|
||||
sodium-universal: 4.0.0
|
||||
dev: false
|
||||
|
||||
/noise-handshake/3.0.2:
|
||||
resolution: {integrity: sha512-4RQ9/6R/GLKA3DPcLDeo954ZBZezHBNpc4YnhyisZ9DPiTRnc81aGdCbH3J9pHllDfj82/f9wKHRRsU7C6pNEg==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
nanoassert: 2.0.0
|
||||
sodium-universal: 4.0.0
|
||||
dev: false
|
||||
|
||||
/once/1.4.0:
|
||||
resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
|
||||
dependencies:
|
||||
wrappy: 1.0.2
|
||||
dev: true
|
||||
|
||||
/path-is-absolute/1.0.1:
|
||||
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/path-parse/1.0.7:
|
||||
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
|
||||
dev: false
|
||||
|
||||
/prettier/2.8.3:
|
||||
resolution: {integrity: sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==}
|
||||
engines: {node: '>=10.13.0'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/protomux/3.4.1:
|
||||
resolution: {integrity: sha512-V8MDCiDGqxM4/hGOewmezbCX7HZfcYGtpdO0MK6pEhBLSknENuqqE98OEWyQuwDalfHULVO8ml7LSwTB5g5Z6g==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
compact-encoding: 2.11.0
|
||||
queue-tick: 1.0.1
|
||||
safety-catch: 1.0.2
|
||||
dev: false
|
||||
|
||||
/queue-tick/1.0.1:
|
||||
resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==}
|
||||
dev: false
|
||||
|
||||
/record-cache/1.2.0:
|
||||
resolution: {integrity: sha512-kyy3HWCez2WrotaL3O4fTn0rsIdfRKOdQQcEJ9KpvmKmbffKVvwsloX063EgRUlpJIXHiDQFhJcTbZequ2uTZw==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
dev: false
|
||||
|
||||
/resolve/1.22.1:
|
||||
resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
is-core-module: 2.11.0
|
||||
path-parse: 1.0.7
|
||||
supports-preserve-symlinks-flag: 1.0.0
|
||||
dev: false
|
||||
|
||||
/rimraf/3.0.2:
|
||||
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
glob: 7.2.3
|
||||
dev: true
|
||||
|
||||
/safety-catch/1.0.2:
|
||||
resolution: {integrity: sha512-C1UYVZ4dtbBxEtvOcpjBaaD27nP8MlvyAQEp2fOTOEe6pfUpk1cDUxij6BR1jZup6rSyUTaBBplK7LanskrULA==}
|
||||
dev: false
|
||||
|
||||
/sha256-universal/1.2.1:
|
||||
resolution: {integrity: sha512-ghn3muhdn1ailCQqqceNxRgkOeZSVfSE13RQWEg6njB+itsFzGVSJv+O//2hvNXZuxVIRyNzrgsZ37SPDdGJJw==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
sha256-wasm: 2.2.2
|
||||
dev: false
|
||||
|
||||
/sha256-wasm/2.2.2:
|
||||
resolution: {integrity: sha512-qKSGARvao+JQlFiA+sjJZhJ/61gmW/3aNLblB2rsgIxDlDxsJPHo8a1seXj12oKtuHVgJSJJ7QEGBUYQN741lQ==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
nanoassert: 2.0.0
|
||||
dev: false
|
||||
|
||||
/sha512-universal/1.2.1:
|
||||
resolution: {integrity: sha512-kehYuigMoRkIngCv7rhgruLJNNHDnitGTBdkcYbCbooL8Cidj/bS78MDxByIjcc69M915WxcQTgZetZ1JbeQTQ==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
sha512-wasm: 2.3.4
|
||||
dev: false
|
||||
|
||||
/sha512-wasm/2.3.4:
|
||||
resolution: {integrity: sha512-akWoxJPGCB3aZCrZ+fm6VIFhJ/p8idBv7AWGFng/CZIrQo51oQNsvDbTSRXWAzIiZJvpy16oIDiCCPqTe21sKg==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
nanoassert: 2.0.0
|
||||
dev: false
|
||||
|
||||
/shuffled-priority-queue/2.1.0:
|
||||
resolution: {integrity: sha512-xhdh7fHyMsr0m/w2kDfRJuBFRS96b9l8ZPNWGaQ+PMvnUnZ/Eh+gJJ9NsHBd7P9k0399WYlCLzsy18EaMfyadA==}
|
||||
dependencies:
|
||||
unordered-set: 2.0.1
|
||||
dev: false
|
||||
|
||||
/siphash24/1.3.1:
|
||||
resolution: {integrity: sha512-moemC3ZKiTzH29nbFo3Iw8fbemWWod4vNs/WgKbQ54oEs6mE6XVlguxvinYjB+UmaE0PThgyED9fUkWvirT8hA==}
|
||||
dependencies:
|
||||
nanoassert: 2.0.0
|
||||
dev: false
|
||||
|
||||
/sodium-javascript/0.8.0:
|
||||
resolution: {integrity: sha512-rEBzR5mPxPES+UjyMDvKPIXy9ImF17KOJ32nJNi9uIquWpS/nfj+h6m05J5yLJaGXjgM72LmQoUbWZVxh/rmGg==}
|
||||
dependencies:
|
||||
blake2b: 2.1.4
|
||||
chacha20-universal: 1.0.4
|
||||
nanoassert: 2.0.0
|
||||
sha256-universal: 1.2.1
|
||||
sha512-universal: 1.2.1
|
||||
siphash24: 1.3.1
|
||||
xsalsa20: 1.2.0
|
||||
dev: false
|
||||
|
||||
/sodium-native/3.4.1:
|
||||
resolution: {integrity: sha512-PaNN/roiFWzVVTL6OqjzYct38NSXewdl2wz8SRB51Br/MLIJPrbM3XexhVWkq7D3UWMysfrhKVf1v1phZq6MeQ==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
node-gyp-build: 4.6.0
|
||||
dev: false
|
||||
|
||||
/sodium-native/4.0.1:
|
||||
resolution: {integrity: sha512-OQTaxrVLtMvrnfcwZVsOTHe58MfDApJiHJNoOwcmmrhwvlYkfaUt2WuzRio8PgEMOd96R5aDHY49DCtock1zsA==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
node-gyp-build: 4.6.0
|
||||
dev: false
|
||||
|
||||
/sodium-secretstream/1.1.0:
|
||||
resolution: {integrity: sha512-Qg7D2xomELDjDCWAmE4izk1aecG/il8pQIGmSWFaKgah/V58BVWG/PuSZF6vseTpcqnetIFGaOWzmPNzyTD50A==}
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
sodium-universal: 4.0.0
|
||||
dev: false
|
||||
|
||||
/sodium-universal/3.1.0:
|
||||
resolution: {integrity: sha512-N2gxk68Kg2qZLSJ4h0NffEhp4BjgWHCHXVlDi1aG1hA3y+ZeWEmHqnpml8Hy47QzfL1xLy5nwr9LcsWAg2Ep0A==}
|
||||
dependencies:
|
||||
blake2b: 2.1.4
|
||||
chacha20-universal: 1.0.4
|
||||
nanoassert: 2.0.0
|
||||
resolve: 1.22.1
|
||||
sha256-universal: 1.2.1
|
||||
sha512-universal: 1.2.1
|
||||
siphash24: 1.3.1
|
||||
sodium-javascript: 0.8.0
|
||||
sodium-native: 3.4.1
|
||||
xsalsa20: 1.2.0
|
||||
dev: false
|
||||
|
||||
/sodium-universal/4.0.0:
|
||||
resolution: {integrity: sha512-iKHl8XnBV96k1c75gwwzANFdephw/MDWSjQAjPmBE+du0y3P23Q8uf7AcdcfFsYAMwLg7WVBfSAIBtV/JvRsjA==}
|
||||
dependencies:
|
||||
blake2b: 2.1.4
|
||||
chacha20-universal: 1.0.4
|
||||
nanoassert: 2.0.0
|
||||
sha256-universal: 1.2.1
|
||||
sha512-universal: 1.2.1
|
||||
siphash24: 1.3.1
|
||||
sodium-javascript: 0.8.0
|
||||
sodium-native: 4.0.1
|
||||
xsalsa20: 1.2.0
|
||||
dev: false
|
||||
|
||||
/streamx/2.13.2:
|
||||
resolution: {integrity: sha512-+TWqixPhGDXEG9L/XczSbhfkmwAtGs3BJX5QNU6cvno+pOLKeszByWcnaTu6dg8efsTYqR8ZZuXWHhZfgrxMvA==}
|
||||
dependencies:
|
||||
fast-fifo: 1.1.0
|
||||
queue-tick: 1.0.1
|
||||
dev: false
|
||||
|
||||
/supports-preserve-symlinks-flag/1.0.0:
|
||||
resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}
|
||||
engines: {node: '>= 0.4'}
|
||||
dev: false
|
||||
|
||||
/time-ordered-set/1.0.2:
|
||||
resolution: {integrity: sha512-vGO99JkxvgX+u+LtOKQEpYf31Kj3i/GNwVstfnh4dyINakMgeZCpew1e3Aj+06hEslhtHEd52g7m5IV+o1K8Mw==}
|
||||
dev: false
|
||||
|
||||
/timeout-refresh/2.0.1:
|
||||
resolution: {integrity: sha512-SVqEcMZBsZF9mA78rjzCrYrUs37LMJk3ShZ851ygZYW1cMeIjs9mL57KO6Iv5mmjSQnOe/29/VAfGXo+oRCiVw==}
|
||||
dev: false
|
||||
|
||||
/tslib/2.5.0:
|
||||
resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
|
||||
dev: false
|
||||
|
||||
/typescript/4.9.5:
|
||||
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
|
||||
engines: {node: '>=4.2.0'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/udx-native/1.5.3:
|
||||
resolution: {integrity: sha512-xoMrEYR5Hahsvx04w06WSc52Sq0Xe2KQtbucyixhIlg/paWN+PXN1J3Ca6h/67K9fo1kB+j8C3fAik/Jv5Q1Mg==}
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
events: 3.3.0
|
||||
napi-macros: 2.2.2
|
||||
node-gyp-build: 4.6.0
|
||||
streamx: 2.13.2
|
||||
dev: false
|
||||
|
||||
/unordered-set/2.0.1:
|
||||
resolution: {integrity: sha512-eUmNTPzdx+q/WvOHW0bgGYLWvWHNT3PTKEQLg0MAQhc0AHASHVHoP/9YytYd4RBVariqno/mEUhVZN98CmD7bg==}
|
||||
dev: false
|
||||
|
||||
/wrappy/1.0.2:
|
||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||
dev: true
|
||||
|
||||
/xache/1.1.0:
|
||||
resolution: {integrity: sha512-RQGZDHLy/uCvnIrAvaorZH/e6Dfrtxj16iVlGjkj4KD2/G/dNXNqhk5IdSucv5nSSnDK00y8Y/2csyRdHveJ+Q==}
|
||||
dev: false
|
||||
|
||||
/xsalsa20/1.2.0:
|
||||
resolution: {integrity: sha512-FIr/DEeoHfj7ftfylnoFt3rAIRoWXpx2AoDfrT2qD2wtp7Dp+COajvs/Icb7uHqRW9m60f5iXZwdsJJO3kvb7w==}
|
||||
dev: false
|
||||
|
||||
git.lumeweb.com/LumeWeb/kernel-peer-discovery-client/63bd27fed253f3fd7e94a357d8ce88809328f34c:
|
||||
resolution: {commit: 63bd27fed253f3fd7e94a357d8ce88809328f34c, repo: https://git.lumeweb.com/LumeWeb/kernel-peer-discovery-client.git, type: git}
|
||||
name: '@lumeweb/kernel-peer-discovery-client'
|
||||
version: 0.1.0
|
||||
dependencies:
|
||||
'@hyperswarm/dht-relay': 0.3.0
|
||||
'@lumeweb/libkernel-universal': git.lumeweb.com/LumeWeb/libkernel-universal/abb26748abb3ca76d4489bf87a1c10a9901367ab
|
||||
'@lumeweb/peer-discovery': git.lumeweb.com/LumeWeb/peer-discovery/d2bd926275103d60fdd3c7c432eae5c278f49261
|
||||
'@siaweb/libweb': git.lumeweb.com/LumeWeb/libsiaweb/5e6cdba3e7d9a4b94e21ddcd5f2b5138fb440ee8
|
||||
hyperswarm: 4.3.7
|
||||
libkernel: 0.1.48
|
||||
libkmodule: 0.2.53
|
||||
dev: false
|
||||
|
||||
git.lumeweb.com/LumeWeb/libkernel-universal/abb26748abb3ca76d4489bf87a1c10a9901367ab:
|
||||
resolution: {commit: abb26748abb3ca76d4489bf87a1c10a9901367ab, repo: https://git.lumeweb.com/LumeWeb/libkernel-universal.git, type: git}
|
||||
name: '@lumeweb/libkernel-universal'
|
||||
version: 0.1.0
|
||||
dependencies:
|
||||
'@siaweb/libweb': git.lumeweb.com/LumeWeb/libsiaweb/5e6cdba3e7d9a4b94e21ddcd5f2b5138fb440ee8
|
||||
eventemitter2: 6.4.9
|
||||
libkernel: 0.1.48
|
||||
libkmodule: 0.2.53
|
||||
dev: false
|
||||
|
||||
git.lumeweb.com/LumeWeb/libsiaweb/5e6cdba3e7d9a4b94e21ddcd5f2b5138fb440ee8:
|
||||
resolution: {commit: 5e6cdba3e7d9a4b94e21ddcd5f2b5138fb440ee8, repo: https://git.lumeweb.com/LumeWeb/libsiaweb.git, type: git}
|
||||
name: '@siaweb/libweb'
|
||||
version: 0.1.0
|
||||
dev: false
|
||||
|
||||
git.lumeweb.com/LumeWeb/peer-discovery/d2bd926275103d60fdd3c7c432eae5c278f49261:
|
||||
resolution: {commit: d2bd926275103d60fdd3c7c432eae5c278f49261, repo: https://git.lumeweb.com/LumeWeb/peer-discovery.git, type: git}
|
||||
name: '@lumeweb/peer-discovery'
|
||||
version: 0.1.0
|
||||
dependencies:
|
||||
b4a: 1.6.1
|
||||
dev: false
|
42
src/index.ts
42
src/index.ts
|
@ -7,15 +7,14 @@ import type {
|
|||
PeerDiscoveryClient,
|
||||
Peer,
|
||||
} from "@lumeweb/kernel-peer-discovery-client";
|
||||
import { load } from "@lumeweb/libkernel-universal";
|
||||
|
||||
// @ts-ignore
|
||||
import Hyperswarm from "hyperswarm";
|
||||
import randomNumber from "random-number-csprng";
|
||||
import EventEmitter, { OnOptions } from "eventemitter2";
|
||||
import { Mutex } from "async-mutex";
|
||||
import { logErr } from "@lumeweb/libkernel";
|
||||
import Emittery from "emittery";
|
||||
|
||||
export default class HyperswarmWeb extends EventEmitter {
|
||||
export default class HyperswarmWeb extends Emittery {
|
||||
private _options: any;
|
||||
private _discovery: PeerDiscoveryClient;
|
||||
private _queuedEmActions: [string, any][] = [];
|
||||
|
@ -76,9 +75,10 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
this._relays.clear();
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
on(
|
||||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
listener: (...args: any[]) => void,
|
||||
): Hyperswarm {
|
||||
return this._processOrQueueAction("on", ...arguments);
|
||||
}
|
||||
|
@ -86,54 +86,56 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
onSelf(
|
||||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void,
|
||||
options?: boolean | OnOptions
|
||||
): Hyperswarm {
|
||||
return super.on(eventName, listener, options);
|
||||
return super.on(eventName, listener);
|
||||
}
|
||||
|
||||
addListener(
|
||||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
listener: (...args: any[]) => void,
|
||||
): this {
|
||||
return this.on(eventName, listener);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
off(
|
||||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
listener: (...args: any[]) => void,
|
||||
): Hyperswarm {
|
||||
return this._processOrQueueAction("off", ...arguments);
|
||||
}
|
||||
|
||||
offSelf(
|
||||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
listener: (...args: any[]) => void,
|
||||
): Hyperswarm {
|
||||
return super.off(eventName, listener);
|
||||
}
|
||||
|
||||
removeListener(
|
||||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
listener: (...args: any[]) => void,
|
||||
): this {
|
||||
return this.off(eventName, listener);
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
emit(eventName: string | symbol, ...args: any[]): boolean {
|
||||
return this._processOrQueueAction("emit", ...arguments);
|
||||
}
|
||||
|
||||
emitSelf(eventName: string | symbol, ...args: any[]): boolean {
|
||||
return super.emit(eventName, ...args);
|
||||
async emitSelf(eventName: string | symbol, ...args: any): Promise<void> {
|
||||
return super.emit(eventName, { ...args });
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
once(eventName: string | symbol, listener: (...args: any[]) => void): this {
|
||||
return this._processOrQueueAction("once", ...arguments);
|
||||
}
|
||||
|
||||
onceSelf(
|
||||
eventName: string | symbol,
|
||||
listener: (...args: any[]) => void
|
||||
listener: (...args: any[]) => void,
|
||||
): this {
|
||||
return this.once(eventName, listener);
|
||||
}
|
||||
|
@ -171,8 +173,6 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
}
|
||||
|
||||
private async ensureConnection(): Promise<any> {
|
||||
const logErr = (await load()).logErr;
|
||||
|
||||
await this._connectionMutex.acquire();
|
||||
|
||||
if (this._activeRelay) {
|
||||
|
@ -214,15 +214,15 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
this._activeRelay = new Hyperswarm({
|
||||
dht: new DhtNode(
|
||||
new Stream(true, new WebSocket(connection)),
|
||||
this._options
|
||||
this._options,
|
||||
),
|
||||
keyPair: this._options.keyPair,
|
||||
});
|
||||
|
||||
this._activeRelay.dht._protocol._stream.once("close", () => {
|
||||
this._activeRelay.dht._protocol._stream.once("close", async () => {
|
||||
this._activeRelay = undefined;
|
||||
this._ready = false;
|
||||
this.emitSelf("close");
|
||||
await this.emitSelf("close");
|
||||
});
|
||||
} while (relays.length > 0 && !this._activeRelay);
|
||||
}
|
||||
|
@ -232,14 +232,14 @@ export default class HyperswarmWeb extends EventEmitter {
|
|||
throw new Error("Failed to find an available relay");
|
||||
}
|
||||
|
||||
this.emitSelf("init");
|
||||
await this.emitSelf("init");
|
||||
|
||||
this._processQueuedActions();
|
||||
await this._activeRelay.dht.ready();
|
||||
this._connectionMutex.release();
|
||||
|
||||
this._ready = true;
|
||||
this.emit("ready");
|
||||
await this.emit("ready");
|
||||
}
|
||||
|
||||
private async isServerAvailable(connection: string): Promise<boolean> {
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"strict": true,
|
||||
"module": "esnext",
|
||||
"target": "esnext",
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": false,
|
||||
"rootDir": "src",
|
||||
"outDir": "dist",
|
||||
"typeRoots": [
|
||||
"node_modules/@types",
|
||||
],
|
||||
"moduleResolution": "node",
|
||||
"declarationMap": true,
|
||||
"declarationDir": "dist",
|
||||
"emitDeclarationOnly": false,
|
||||
"allowJs": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue