@leofcoin/peernet 1.1.92 → 1.1.93
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/exports/browser/{client-Vbt0C3YZ.js → client-BScgNzXE.js} +30 -8
- package/exports/browser/{messages-BYZZUpuv.js → messages-B9TrXtD1.js} +1 -1
- package/exports/browser/{peernet-DKc812jS.js → peernet-EWyOZqOu.js} +2 -2
- package/exports/browser/peernet.d.ts +1 -1
- package/exports/browser/peernet.js +1 -1
- package/exports/types/peernet.d.ts +1 -1
- package/package.json +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as LittlePubSub } from './peernet-
|
|
1
|
+
import { L as LittlePubSub } from './peernet-EWyOZqOu.js';
|
|
2
2
|
import './identity-Cn0iQbY3.js';
|
|
3
3
|
import './value-C3vAp-wb.js';
|
|
4
4
|
|
|
@@ -42,7 +42,7 @@ class Api {
|
|
|
42
42
|
if (state !== 'open')
|
|
43
43
|
return reject(`coudn't send request to ${client.id}, no open connection found.`);
|
|
44
44
|
request.id = Math.random().toString(36).slice(-12);
|
|
45
|
-
const handler = result => {
|
|
45
|
+
const handler = (result) => {
|
|
46
46
|
if (result && result.error)
|
|
47
47
|
return reject(result.error);
|
|
48
48
|
resolve({ result, id: request.id, handler });
|
|
@@ -62,11 +62,17 @@ class Api {
|
|
|
62
62
|
},
|
|
63
63
|
subscribe: (topic = 'pubsub', cb) => {
|
|
64
64
|
this.subscribe(topic, cb);
|
|
65
|
-
return this.send(client, {
|
|
65
|
+
return this.send(client, {
|
|
66
|
+
url: 'pubsub',
|
|
67
|
+
params: { topic, subscribe: true }
|
|
68
|
+
});
|
|
66
69
|
},
|
|
67
70
|
unsubscribe: (topic = 'pubsub', cb) => {
|
|
68
71
|
this.unsubscribe(topic, cb);
|
|
69
|
-
return this.send(client, {
|
|
72
|
+
return this.send(client, {
|
|
73
|
+
url: 'pubsub',
|
|
74
|
+
params: { topic, unsubscribe: true }
|
|
75
|
+
});
|
|
70
76
|
},
|
|
71
77
|
subscribers: this._pubsub.subscribers
|
|
72
78
|
};
|
|
@@ -75,7 +81,9 @@ class Api {
|
|
|
75
81
|
return {
|
|
76
82
|
uptime: async () => {
|
|
77
83
|
try {
|
|
78
|
-
const { result, id, handler } = await this.request(client, {
|
|
84
|
+
const { result, id, handler } = await this.request(client, {
|
|
85
|
+
url: 'uptime'
|
|
86
|
+
});
|
|
79
87
|
this.unsubscribe(id, handler);
|
|
80
88
|
return result;
|
|
81
89
|
}
|
|
@@ -86,9 +94,11 @@ class Api {
|
|
|
86
94
|
ping: async () => {
|
|
87
95
|
try {
|
|
88
96
|
const now = new Date().getTime();
|
|
89
|
-
const { result, id, handler } = await this.request(client, {
|
|
97
|
+
const { result, id, handler } = await this.request(client, {
|
|
98
|
+
url: 'ping'
|
|
99
|
+
});
|
|
90
100
|
this.unsubscribe(id, handler);
|
|
91
|
-
return
|
|
101
|
+
return Number(result) - now;
|
|
92
102
|
}
|
|
93
103
|
catch (e) {
|
|
94
104
|
throw e;
|
|
@@ -121,6 +131,18 @@ class Api {
|
|
|
121
131
|
catch (e) {
|
|
122
132
|
throw e;
|
|
123
133
|
}
|
|
134
|
+
},
|
|
135
|
+
peers: async (params) => {
|
|
136
|
+
try {
|
|
137
|
+
params.peers = true;
|
|
138
|
+
const requested = { url: 'peernet', params };
|
|
139
|
+
const { result, id, handler } = await this.request(client, requested);
|
|
140
|
+
this.unsubscribe(id, handler);
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
throw e;
|
|
145
|
+
}
|
|
124
146
|
}
|
|
125
147
|
};
|
|
126
148
|
}
|
|
@@ -475,7 +497,7 @@ class Client {
|
|
|
475
497
|
});
|
|
476
498
|
}
|
|
477
499
|
else {
|
|
478
|
-
globalThis.addEventListener('beforeunload',
|
|
500
|
+
globalThis.addEventListener('beforeunload', this.close.bind(this));
|
|
479
501
|
}
|
|
480
502
|
}
|
|
481
503
|
setupStarListeners(star) {
|
|
@@ -8372,7 +8372,7 @@ class Peernet {
|
|
|
8372
8372
|
this.root = options.root;
|
|
8373
8373
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
8374
8374
|
// FolderMessageResponse
|
|
8375
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
8375
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-B9TrXtD1.js');
|
|
8376
8376
|
/**
|
|
8377
8377
|
* proto Object containing protos
|
|
8378
8378
|
* @type {Object}
|
|
@@ -8466,7 +8466,7 @@ class Peernet {
|
|
|
8466
8466
|
if (this.#starting || this.#started)
|
|
8467
8467
|
return;
|
|
8468
8468
|
this.#starting = true;
|
|
8469
|
-
const importee = await import('./client-
|
|
8469
|
+
const importee = await import('./client-BScgNzXE.js');
|
|
8470
8470
|
/**
|
|
8471
8471
|
* @access public
|
|
8472
8472
|
* @type {PeernetClient}
|
|
@@ -85,7 +85,7 @@ export default class Peernet {
|
|
|
85
85
|
*/
|
|
86
86
|
get peers(): [string, import("@netpeer/swarm/peer").default][];
|
|
87
87
|
get connections(): {
|
|
88
|
-
[
|
|
88
|
+
[index: string]: import("@netpeer/swarm/peer").default;
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
91
91
|
* @return {String} id - peerId
|
|
@@ -85,7 +85,7 @@ export default class Peernet {
|
|
|
85
85
|
*/
|
|
86
86
|
get peers(): [string, import("@netpeer/swarm/peer").default][];
|
|
87
87
|
get connections(): {
|
|
88
|
-
[
|
|
88
|
+
[index: string]: import("@netpeer/swarm/peer").default;
|
|
89
89
|
};
|
|
90
90
|
/**
|
|
91
91
|
* @return {String} id - peerId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/peernet",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.93",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "./exports/browser/peernet.js",
|
|
6
6
|
"exports": {
|
|
@@ -37,34 +37,34 @@
|
|
|
37
37
|
"@leofcoin/identity-utils": "^1.0.2",
|
|
38
38
|
"@leofcoin/multi-wallet": "^3.1.8",
|
|
39
39
|
"@leofcoin/storage": "^3.5.38",
|
|
40
|
-
"@netpeer/swarm": "^0.8.
|
|
40
|
+
"@netpeer/swarm": "^0.8.21",
|
|
41
41
|
"@vandeurenglenn/base32": "^1.2.4",
|
|
42
42
|
"@vandeurenglenn/base58": "^1.1.9",
|
|
43
43
|
"@vandeurenglenn/debug": "^1.2.6",
|
|
44
44
|
"@vandeurenglenn/is-hex": "^1.1.1",
|
|
45
45
|
"@vandeurenglenn/little-pubsub": "^1.5.1",
|
|
46
|
-
"inquirer": "^12.
|
|
46
|
+
"inquirer": "^12.9.0",
|
|
47
47
|
"multi-signature": "^1.3.1",
|
|
48
48
|
"qr-scanner": "^1.4.2",
|
|
49
49
|
"qrcode": "^1.5.4",
|
|
50
|
-
"socket-request-client": "^2.0
|
|
51
|
-
"socket-request-server": "^1.
|
|
50
|
+
"socket-request-client": "^2.1.0",
|
|
51
|
+
"socket-request-server": "^1.7.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@jest/globals": "^30.0.
|
|
54
|
+
"@jest/globals": "^30.0.5",
|
|
55
55
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
56
56
|
"@rollup/plugin-json": "^6.1.0",
|
|
57
57
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
58
58
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
59
59
|
"@rollup/plugin-wasm": "^6.2.2",
|
|
60
60
|
"@types/bs58check": "^2.1.2",
|
|
61
|
-
"@types/node": "^24.0
|
|
61
|
+
"@types/node": "^24.1.0",
|
|
62
62
|
"@types/qrcode": "^1.5.5",
|
|
63
63
|
"@types/secp256k1": "^4.0.6",
|
|
64
64
|
"@types/varint": "^6.0.3",
|
|
65
65
|
"chai": "^5.2.1",
|
|
66
|
-
"cross-env": "^
|
|
67
|
-
"rollup": "^4.
|
|
66
|
+
"cross-env": "^10.0.0",
|
|
67
|
+
"rollup": "^4.46.2",
|
|
68
68
|
"sinon": "^21.0.0"
|
|
69
69
|
}
|
|
70
70
|
}
|