@holochain/client 0.17.0-dev.8 → 0.17.0-dev.9
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/lib/api/admin/websocket.js +1 -1
- package/lib/api/app/websocket.js +1 -1
- package/lib/api/common.js +9 -11
- package/lib/api/index.d.ts +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/package.json +6 -6
|
@@ -33,7 +33,7 @@ export class AdminWebsocket {
|
|
|
33
33
|
// Check if we are in the launcher's environment, and if so, redirect the url to connect to
|
|
34
34
|
const env = getLauncherEnvironment();
|
|
35
35
|
if (env?.ADMIN_INTERFACE_PORT) {
|
|
36
|
-
options.url = new URL(`ws://
|
|
36
|
+
options.url = new URL(`ws://localhost:${env.ADMIN_INTERFACE_PORT}`);
|
|
37
37
|
}
|
|
38
38
|
if (!options.url) {
|
|
39
39
|
throw new HolochainError("ConnectionUrlMissing", `unable to connect to Conductor API - no url provided and not in a launcher environment.`);
|
package/lib/api/app/websocket.js
CHANGED
|
@@ -43,7 +43,7 @@ export class AppWebsocket extends Emittery {
|
|
|
43
43
|
// Check if we are in the launcher's environment, and if so, redirect the url to connect to
|
|
44
44
|
const env = getLauncherEnvironment();
|
|
45
45
|
if (env?.APP_INTERFACE_PORT) {
|
|
46
|
-
options.url = new URL(`ws://
|
|
46
|
+
options.url = new URL(`ws://localhost:${env.APP_INTERFACE_PORT}`);
|
|
47
47
|
}
|
|
48
48
|
if (!options.url) {
|
|
49
49
|
throw new HolochainError("ConnectionUrlMissing", `unable to connect to Conductor API - no url provided and not in a launcher environment.`);
|
package/lib/api/common.js
CHANGED
|
@@ -45,18 +45,16 @@ export const catchError = (res) => {
|
|
|
45
45
|
export const promiseTimeout = (promise, tag, ms) => {
|
|
46
46
|
let id;
|
|
47
47
|
const timeout = new Promise((_, reject) => {
|
|
48
|
-
id = setTimeout(() => reject(new Error(`
|
|
49
|
-
});
|
|
50
|
-
return new Promise((res, rej) => {
|
|
51
|
-
Promise.race([promise, timeout])
|
|
52
|
-
.then((a) => {
|
|
53
|
-
clearTimeout(id);
|
|
54
|
-
return res(a);
|
|
55
|
-
})
|
|
56
|
-
.catch((e) => {
|
|
57
|
-
return rej(e);
|
|
58
|
-
});
|
|
48
|
+
id = setTimeout(() => reject(new Error(`Request timed out in ${ms} ms: ${tag}`)), ms);
|
|
59
49
|
});
|
|
50
|
+
return new Promise((res, rej) => Promise.race([promise, timeout])
|
|
51
|
+
.then((a) => {
|
|
52
|
+
clearTimeout(id);
|
|
53
|
+
return res(a);
|
|
54
|
+
})
|
|
55
|
+
.catch((e) => {
|
|
56
|
+
return rej(e);
|
|
57
|
+
}));
|
|
60
58
|
};
|
|
61
59
|
const CLONE_ID_DELIMITER = ".";
|
|
62
60
|
/**
|
package/lib/api/index.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export * from "./admin/index.js";
|
|
|
3
3
|
export * from "./app-agent/index.js";
|
|
4
4
|
export * from "./app/index.js";
|
|
5
5
|
export { IsoWebSocket, WsClient } from "./client.js";
|
|
6
|
-
export { CloneId, HolochainError, Requester, Transformer, WebsocketConnectionOptions, WsClientOptions,
|
|
6
|
+
export { CloneId, HolochainError, getBaseRoleNameFromCloneId, isCloneId, type Requester, type Transformer, type WebsocketConnectionOptions, type WsClientOptions, } from "./common.js";
|
|
7
7
|
export * from "./zome-call-signing.js";
|
package/lib/tsdoc-metadata.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holochain/client",
|
|
3
|
-
"version": "0.17.0-dev.
|
|
3
|
+
"version": "0.17.0-dev.9",
|
|
4
4
|
"description": "A JavaScript client for the Holochain Conductor API",
|
|
5
5
|
"author": "Holochain Foundation <info@holochain.org> (http://holochain.org)",
|
|
6
6
|
"license": "CAL-1.0",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"scripts": {
|
|
34
34
|
"lint": "eslint --fix --ext .ts src test .eslintrc.cjs",
|
|
35
|
-
"test:app-agent": "RUST_LOG=error RUST_BACKTRACE=1
|
|
36
|
-
"test:utils": "RUST_LOG=error RUST_BACKTRACE=1
|
|
37
|
-
"test": "RUST_LOG=error RUST_BACKTRACE=1
|
|
35
|
+
"test:app-agent": "RUST_LOG=error RUST_BACKTRACE=1 tsx test/e2e/app-agent-websocket.ts",
|
|
36
|
+
"test:utils": "RUST_LOG=error RUST_BACKTRACE=1 tsx test/e2e/utils.ts",
|
|
37
|
+
"test": "RUST_LOG=error RUST_BACKTRACE=1 tsx test/index.ts",
|
|
38
38
|
"build:lib": "rimraf ./lib && tsc -p tsconfig.build.json",
|
|
39
39
|
"build:docs": "api-extractor run --local && api-documenter markdown -i docs/temp -o docs",
|
|
40
40
|
"build": "npm run build:lib && npm run build:docs",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"prettier": "^2.8.8",
|
|
70
70
|
"rimraf": "^3.0.2",
|
|
71
71
|
"tape": "^5.6.6",
|
|
72
|
-
"
|
|
72
|
+
"tsx": "^4.7.2",
|
|
73
73
|
"typescript": "^4.9.5"
|
|
74
74
|
}
|
|
75
|
-
}
|
|
75
|
+
}
|