@holochain/client
Advanced tools
Comparing version 0.10.3 to 0.10.4
@@ -222,7 +222,6 @@ /// <reference types="node" /> | ||
export declare type DeleteArchivedCloneCellsResponse = void; | ||
export interface GrantZomeCallCapabilityPayload { | ||
export interface GrantZomeCallCapabilityRequest { | ||
cell_id: CellId; | ||
cap_grant: ZomeCallCapGrant; | ||
} | ||
export declare type GrantZomeCallCapabilityRequest = GrantZomeCallCapabilityPayload; | ||
export declare type GrantZomeCallCapabilityResponse = void; | ||
@@ -229,0 +228,0 @@ export interface AdminApi { |
import { InstalledAppId } from "../types.js"; | ||
export declare const LAUNCHER_ENV_URL = "/.launcher-env.json"; | ||
export interface LauncherEnvironment { | ||
@@ -8,2 +7,3 @@ APP_INTERFACE_PORT: number; | ||
} | ||
export declare function getLauncherEnvironment(): Promise<LauncherEnvironment | undefined>; | ||
export declare const isLauncher: boolean; | ||
export declare const getLauncherEnvironment: () => LauncherEnvironment | undefined; |
@@ -1,38 +0,5 @@ | ||
import fetch from "cross-fetch"; | ||
// This is based on | ||
// https://github.com/holochain/launcher/blob/213aae208c58f2496811d80859723b71f6750426/crates/holochain_web_app_manager/src/caddy/utils.rs#L49 | ||
export const LAUNCHER_ENV_URL = "/.launcher-env.json"; | ||
async function fetchLauncherEnvironment() { | ||
const env = await fetch(LAUNCHER_ENV_URL); | ||
if (env.ok) { | ||
const launcherEnvironment = await env.json(); | ||
return launcherEnvironment; | ||
} | ||
else { | ||
// We are not in the launcher environment | ||
if (env.status === 404) { | ||
console.warn("[@holochain/conductor-api]: you are in a development environment. When this UI is run in the Holochain Launcher, `AppWebsocket.connect()`, `AdminWebsocket.connect()` and `appWebsocket.appInfo()` will have their parameters ignored and substituted by the ones provided by the Holochain Launcher."); | ||
return undefined; | ||
} | ||
else { | ||
throw new Error(`Error trying to fetch the launcher environment: ${env.statusText}`); | ||
} | ||
} | ||
} | ||
const isBrowser = typeof window !== "undefined"; | ||
const isJest = typeof process !== "undefined" && | ||
process.env && | ||
process.env.JEST_WORKER_ID !== undefined; | ||
let promise; | ||
if (isBrowser && !isJest) { | ||
promise = fetchLauncherEnvironment().catch(console.error); | ||
} | ||
export async function getLauncherEnvironment() { | ||
if (isBrowser) { | ||
return promise; | ||
} | ||
else { | ||
return undefined; | ||
} | ||
} | ||
export const isLauncher = typeof window === "object" && "__HC_LAUNCHER_ENV__" in window; | ||
export const getLauncherEnvironment = () => isLauncher | ||
? window.__HC_LAUNCHER_ENV__ | ||
: undefined; | ||
//# sourceMappingURL=launcher.js.map |
{ | ||
"name": "@holochain/client", | ||
"version": "0.10.3", | ||
"version": "0.10.4", | ||
"description": "A JavaScript client for the Holochain Conductor API", | ||
@@ -40,3 +40,2 @@ "author": "Holochain Foundation <info@holochain.org> (http://holochain.org)", | ||
"@msgpack/msgpack": "^2.7.2", | ||
"cross-fetch": "^3.1.5", | ||
"emittery": "^1.0.1", | ||
@@ -43,0 +42,0 @@ "isomorphic-ws": "^5.0.0", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
5
0
0
77834
1470
- Removedcross-fetch@^3.1.5
- Removedcross-fetch@3.1.8(transitive)
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)