@leofcoin/peernet 1.1.10 → 1.1.11
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-3c5cc737.js → client-ca55ff27.js} +6 -12
- package/exports/browser/{index-62470ce4.js → index-90ab3466.js} +1 -1
- package/exports/browser/{messages-9bda9ff7.js → messages-b40420dd.js} +1 -1
- package/exports/browser/{peernet-4b44a873.js → peernet-627f9af1.js} +3 -3
- package/exports/browser/peernet.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './peernet-
|
|
1
|
+
import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './peernet-627f9af1.js';
|
|
2
2
|
import './value-157ab062.js';
|
|
3
3
|
|
|
4
4
|
function commonjsRequire(path) {
|
|
@@ -10529,7 +10529,7 @@ var p2pt_umd = {
|
|
|
10529
10529
|
this.responseWaiting[peer.id][data.id]([peer, msg]);
|
|
10530
10530
|
delete this.responseWaiting[peer.id][data.id];
|
|
10531
10531
|
} else {
|
|
10532
|
-
this.emit('msg', peer, msg, data.from);
|
|
10532
|
+
this.emit('msg', peer, msg, data.id, data.from);
|
|
10533
10533
|
}
|
|
10534
10534
|
this._destroyChunks(data.id);
|
|
10535
10535
|
}
|
|
@@ -40922,15 +40922,9 @@ class P2PTPeer {
|
|
|
40922
40922
|
this.options = options;
|
|
40923
40923
|
}
|
|
40924
40924
|
|
|
40925
|
-
_handleMessage(
|
|
40926
|
-
message = JSON.parse(new TextDecoder().decode(message.slice(1)));
|
|
40927
|
-
// allow sharding (multiple peers share data)
|
|
40928
|
-
pubsub.publish('peernet:shard', message);
|
|
40929
|
-
const { id, from } = message;
|
|
40930
|
-
|
|
40925
|
+
_handleMessage(data, id, from) {
|
|
40931
40926
|
// console.log(new TextDecoder().decode(new Uint8Array(Object.values(JSON.parse(message.msg)))));
|
|
40932
|
-
|
|
40933
|
-
pubsub.publish('peer:data', { id, data, from, peer: this });
|
|
40927
|
+
pubsub.publish('peer:data', { id, data, from, peer: this });
|
|
40934
40928
|
|
|
40935
40929
|
this.bw.down += data.byteLength || data.length;
|
|
40936
40930
|
}
|
|
@@ -41043,11 +41037,11 @@ class P2PTClient extends P2PT {
|
|
|
41043
41037
|
pubsub.publish('peer:left', this.#discovered[peer.id]);
|
|
41044
41038
|
});
|
|
41045
41039
|
|
|
41046
|
-
this.on('msg', async (peer, data) => {
|
|
41040
|
+
this.on('msg', async (peer, data, id, from) => {
|
|
41047
41041
|
const hasPeer = this.#discovered[peer.id];
|
|
41048
41042
|
if (!hasPeer) this.#discovered[peer.id] = await new P2PTPeer(peer, this);
|
|
41049
41043
|
|
|
41050
|
-
this.#discovered[peer.id]?._handleMessage(new Uint8Array(Object.values(data)));
|
|
41044
|
+
this.#discovered[peer.id]?._handleMessage(new Uint8Array(Object.values(data)), id, from);
|
|
41051
41045
|
this.bw.down += data.length || data.byteLength;
|
|
41052
41046
|
});
|
|
41053
41047
|
|
|
@@ -16086,7 +16086,7 @@ class Identity {
|
|
|
16086
16086
|
globalThis.peernet.selectedAccount = new TextDecoder().decode(selected);
|
|
16087
16087
|
}
|
|
16088
16088
|
else {
|
|
16089
|
-
const importee = await import(/* webpackChunkName: "generate-account" */ './index-
|
|
16089
|
+
const importee = await import(/* webpackChunkName: "generate-account" */ './index-90ab3466.js');
|
|
16090
16090
|
const { identity, accounts } = await importee.default(password, this.network);
|
|
16091
16091
|
await globalThis.accountStore.put('public', JSON.stringify({ walletId: identity.walletId }));
|
|
16092
16092
|
await globalThis.walletStore.put('version', String(1));
|
|
@@ -16257,7 +16257,7 @@ class Peernet {
|
|
|
16257
16257
|
this.root = options.root;
|
|
16258
16258
|
const { RequestMessage, ResponseMessage, PeerMessage, PeerMessageResponse, PeernetMessage, DHTMessage, DHTMessageResponse, DataMessage, DataMessageResponse, PsMessage, ChatMessage, PeernetFile
|
|
16259
16259
|
// FolderMessageResponse
|
|
16260
|
-
} = await import(/* webpackChunkName: "messages" */ './messages-
|
|
16260
|
+
} = await import(/* webpackChunkName: "messages" */ './messages-b40420dd.js');
|
|
16261
16261
|
/**
|
|
16262
16262
|
* proto Object containing protos
|
|
16263
16263
|
* @type {Object}
|
|
@@ -16328,7 +16328,7 @@ class Peernet {
|
|
|
16328
16328
|
if (this.#starting || this.#started)
|
|
16329
16329
|
return;
|
|
16330
16330
|
this.#starting = true;
|
|
16331
|
-
const importee = await import('./client-
|
|
16331
|
+
const importee = await import('./client-ca55ff27.js');
|
|
16332
16332
|
/**
|
|
16333
16333
|
* @access public
|
|
16334
16334
|
* @type {PeernetClient}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { P as default } from './peernet-
|
|
1
|
+
export { P as default } from './peernet-627f9af1.js';
|
|
2
2
|
import './value-157ab062.js';
|