@upcoming/bee-js 0.15.0 → 0.15.1
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/dist/mjs/modules/gsoc.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { System } from 'cafe-utility';
|
|
1
2
|
import WebSocket from 'isomorphic-ws';
|
|
2
3
|
import { uploadSingleOwnerChunk } from "../chunk/soc.js";
|
|
3
4
|
const endpoint = 'gsoc';
|
|
@@ -6,6 +7,9 @@ export async function send(requestOptions, soc, stamp, options) {
|
|
|
6
7
|
}
|
|
7
8
|
export function subscribe(url, reference, headers) {
|
|
8
9
|
const wsUrl = url.replace(/^http/i, 'ws');
|
|
10
|
+
if (System.whereAmI() === 'browser') {
|
|
11
|
+
return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${reference.toHex()}`);
|
|
12
|
+
}
|
|
9
13
|
return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${reference.toHex()}`, {
|
|
10
14
|
headers
|
|
11
15
|
});
|
package/dist/mjs/modules/pss.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { System } from 'cafe-utility';
|
|
1
2
|
import WebSocket from 'isomorphic-ws';
|
|
2
3
|
import { prepareRequestHeaders } from "../utils/headers.js";
|
|
3
4
|
import { http } from "../utils/http.js";
|
|
@@ -33,6 +34,9 @@ export async function send(requestOptions, topic, target, data, postageBatchId,
|
|
|
33
34
|
*/
|
|
34
35
|
export function subscribe(url, topic, headers) {
|
|
35
36
|
const wsUrl = url.replace(/^http/i, 'ws');
|
|
37
|
+
if (System.whereAmI() === 'browser') {
|
|
38
|
+
return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${topic.toHex()}`);
|
|
39
|
+
}
|
|
36
40
|
return new WebSocket(`${wsUrl}/${endpoint}/subscribe/${topic.toHex()}`, {
|
|
37
41
|
headers
|
|
38
42
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@upcoming/bee-js",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"description": "Javascript client for Bee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bee",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"axios": "^0.28.1",
|
|
66
|
-
"cafe-utility": "^27.
|
|
66
|
+
"cafe-utility": "^27.13.0",
|
|
67
67
|
"isomorphic-ws": "^4.0.1",
|
|
68
68
|
"semver": "^7.3.5",
|
|
69
69
|
"ws": "^8.7.0"
|