@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.
@@ -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://127.0.0.1:${env.ADMIN_INTERFACE_PORT}`);
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.`);
@@ -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://127.0.0.1:${env.APP_INTERFACE_PORT}`);
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(`Timed out in ${ms}ms: ${tag}`)), ms);
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
  /**
@@ -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, getBaseRoleNameFromCloneId, isCloneId, } from "./common.js";
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";
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.43.0"
8
+ "packageVersion": "7.43.1"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/client",
3
- "version": "0.17.0-dev.8",
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 node --loader ts-node/esm test/e2e/app-agent-websocket.ts",
36
- "test:utils": "RUST_LOG=error RUST_BACKTRACE=1 node --loader ts-node/esm test/e2e/utils.ts",
37
- "test": "RUST_LOG=error RUST_BACKTRACE=1 node --loader ts-node/esm test/index.ts",
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
- "ts-node": "^10.9.1",
72
+ "tsx": "^4.7.2",
73
73
  "typescript": "^4.9.5"
74
74
  }
75
- }
75
+ }