@holochain/conductor-api
Advanced tools
Comparing version 0.0.1-dev.11 to 0.0.1-dev.12
import { Requester } from "./common"; | ||
import { AgentPubKey, MembraneProof, DnaProperties, AppId, CellId, CellNick, InstalledApp } from "./types"; | ||
import { AgentPubKey, MembraneProof, DnaProperties, InstalledAppId, CellId, CellNick, InstalledApp } from "./types"; | ||
export declare type ActivateAppRequest = { | ||
app_id: AppId; | ||
installed_app_id: InstalledAppId; | ||
}; | ||
@@ -14,3 +14,3 @@ export declare type ActivateAppResponse = null; | ||
export declare type DeactivateAppRequest = { | ||
app_id: AppId; | ||
installed_app_id: InstalledAppId; | ||
}; | ||
@@ -25,3 +25,3 @@ export declare type DeactivateAppResponse = null; | ||
export declare type InstallAppRequest = { | ||
app_id: AppId; | ||
installed_app_id: InstalledAppId; | ||
agent_key: AgentPubKey; | ||
@@ -35,4 +35,4 @@ dnas: Array<InstallAppDnaPayload>; | ||
export declare type ListCellIdsResponse = Array<CellId>; | ||
export declare type ListActiveAppIdsRequest = void; | ||
export declare type ListActiveAppIdsResponse = Array<AppId>; | ||
export declare type ListActiveAppsRequest = void; | ||
export declare type ListActiveAppsResponse = Array<InstalledAppId>; | ||
export interface AdminApi { | ||
@@ -47,3 +47,3 @@ activateApp: Requester<ActivateAppRequest, ActivateAppResponse>; | ||
listCellIds: Requester<ListCellIdsRequest, ListCellIdsResponse>; | ||
listActiveAppIds: Requester<ListActiveAppIdsRequest, ListActiveAppIdsResponse>; | ||
listActiveApps: Requester<ListActiveAppsRequest, ListActiveAppsResponse>; | ||
} | ||
@@ -50,0 +50,0 @@ declare type InstallAppDnaPayload = { |
import { Requester } from "./common"; | ||
import { CellId, CapSecret, AgentPubKey, AppId, InstalledApp } from "./types"; | ||
import { CellId, CapSecret, AgentPubKey, InstalledAppId, InstalledApp } from "./types"; | ||
export declare type CallZomeRequestGeneric<Payload> = { | ||
@@ -15,3 +15,3 @@ cap: CapSecret | null; | ||
export declare type AppInfoRequest = { | ||
app_id: AppId; | ||
installed_app_id: InstalledAppId; | ||
}; | ||
@@ -18,0 +18,0 @@ export declare type AppInfoResponse = InstalledApp; |
/// <reference types="node" /> | ||
export declare type HoloHash = Buffer; | ||
export declare type AgentPubKey = HoloHash; | ||
export declare type AppId = string; | ||
export declare type InstalledAppId = string; | ||
export declare type CapSecret = Buffer; | ||
@@ -10,3 +10,3 @@ export declare type CellId = [HoloHash, AgentPubKey]; | ||
export declare type InstalledApp = { | ||
app_id: AppId; | ||
installed_app_id: InstalledAppId; | ||
cell_data: Array<InstalledCell>; | ||
@@ -13,0 +13,0 @@ }; |
@@ -33,3 +33,3 @@ /** | ||
listCellIds: Requester<Api.ListCellIdsRequest, Api.ListCellIdsResponse>; | ||
listActiveAppIds: Requester<Api.ListActiveAppIdsRequest, Api.ListActiveAppIdsResponse>; | ||
listActiveApps: Requester<Api.ListActiveAppsRequest, Api.ListActiveAppsResponse>; | ||
} |
@@ -45,3 +45,3 @@ "use strict"; | ||
this.listCellIds = this._requester('list_cell_ids'); | ||
this.listActiveAppIds = this._requester('list_active_app_ids'); | ||
this.listActiveApps = this._requester('list_active_apps'); | ||
this.client = client; | ||
@@ -48,0 +48,0 @@ } |
{ | ||
"name": "@holochain/conductor-api", | ||
"version": "0.0.1-dev.11", | ||
"version": "0.0.1-dev.12", | ||
"description": "Encode/decode messages to/from the Holochain Conductor API over Websocket", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -25,3 +25,3 @@ # holochain/conductor-api | ||
[041ad6c2fd88c06eace450074621be2bace0eb05](https://github.com/holochain/holochain/commit/041ad6c2fd88c06eace450074621be2bace0eb05) (Nov 16, 2020) | ||
[2dfe85db10a5d9ba3ee25ff33f4bedb1a28f875f](https://github.com/holochain/holochain/commit/2dfe85db10a5d9ba3ee25ff33f4bedb1a28f875f) (Nov 16, 2020) | ||
@@ -32,7 +32,7 @@ If updating this code, please make changes to the git `rev/sha` in 3 places: | ||
```bash | ||
REV=041ad6c2fd88c06eace450074621be2bace0eb05 | ||
REV=2dfe85db10a5d9ba3ee25ff33f4bedb1a28f875f | ||
``` | ||
3. and this line in `test/e2e/fixtures/zomes/foo/Cargo.toml` | ||
``` | ||
hdk3 = { git = "https://github.com/holochain/holochain", rev = "041ad6c2fd88c06eace450074621be2bace0eb05", package = "hdk3" } | ||
hdk3 = { git = "https://github.com/holochain/holochain", rev = "2dfe85db10a5d9ba3ee25ff33f4bedb1a28f875f", package = "hdk3" } | ||
``` | ||
@@ -39,0 +39,0 @@ |
import { Requester } from "./common" | ||
import { AgentPubKey, MembraneProof, DnaProperties, AppId, CellId, CellNick, InstalledApp } from "./types" | ||
import { AgentPubKey, MembraneProof, DnaProperties, InstalledAppId, CellId, CellNick, InstalledApp } from "./types" | ||
export type ActivateAppRequest = { app_id: AppId } | ||
export type ActivateAppRequest = { installed_app_id: InstalledAppId } | ||
export type ActivateAppResponse = null | ||
@@ -10,3 +10,3 @@ | ||
export type DeactivateAppRequest = { app_id: AppId } | ||
export type DeactivateAppRequest = { installed_app_id: InstalledAppId } | ||
export type DeactivateAppResponse = null | ||
@@ -21,3 +21,3 @@ | ||
export type InstallAppRequest = { | ||
app_id: AppId, | ||
installed_app_id: InstalledAppId, | ||
agent_key: AgentPubKey, | ||
@@ -34,4 +34,4 @@ dnas: Array<InstallAppDnaPayload>, | ||
export type ListActiveAppIdsRequest = void | ||
export type ListActiveAppIdsResponse = Array<AppId> | ||
export type ListActiveAppsRequest = void | ||
export type ListActiveAppsResponse = Array<InstalledAppId> | ||
@@ -47,3 +47,3 @@ export interface AdminApi { | ||
listCellIds: Requester<ListCellIdsRequest, ListCellIdsResponse> | ||
listActiveAppIds: Requester<ListActiveAppIdsRequest, ListActiveAppIdsResponse> | ||
listActiveApps: Requester<ListActiveAppsRequest, ListActiveAppsResponse> | ||
} | ||
@@ -50,0 +50,0 @@ |
import { Requester } from "./common" | ||
import { CellId, CapSecret, AgentPubKey, AppId, InstalledApp } from "./types" | ||
import { CellId, CapSecret, AgentPubKey, InstalledAppId, InstalledApp } from "./types" | ||
@@ -16,3 +16,3 @@ export type CallZomeRequestGeneric<Payload> = { | ||
export type AppInfoRequest = { app_id: AppId } | ||
export type AppInfoRequest = { installed_app_id: InstalledAppId } | ||
export type AppInfoResponse = InstalledApp | ||
@@ -19,0 +19,0 @@ |
export type HoloHash = Buffer // length 39 | ||
export type AgentPubKey = HoloHash | ||
export type AppId = string | ||
export type InstalledAppId = string | ||
export type CapSecret = Buffer | ||
@@ -9,4 +9,4 @@ export type CellId = [HoloHash, AgentPubKey] | ||
export type InstalledApp = { | ||
app_id: AppId | ||
cell_data: Array<InstalledCell> | ||
installed_app_id: InstalledAppId, | ||
cell_data: Array<InstalledCell>, | ||
} | ||
@@ -13,0 +13,0 @@ export type InstalledCell = [CellId, CellNick] |
@@ -60,4 +60,4 @@ /** | ||
= this._requester('list_cell_ids') | ||
listActiveAppIds: Requester<Api.ListActiveAppIdsRequest, Api.ListActiveAppIdsResponse> | ||
= this._requester('list_active_app_ids') | ||
listActiveApps: Requester<Api.ListActiveAppsRequest, Api.ListActiveAppsResponse> | ||
= this._requester('list_active_apps') | ||
} | ||
@@ -64,0 +64,0 @@ |
@@ -16,3 +16,3 @@ | ||
const app_id = 'app' | ||
const installed_app_id = 'app' | ||
const admin = await AdminWebsocket.connect(`http://localhost:${ADMIN_PORT}`) | ||
@@ -24,20 +24,20 @@ | ||
await admin.installApp({ | ||
app_id, agent_key, dnas: [] | ||
installed_app_id, agent_key, dnas: [] | ||
}) | ||
const activeApps1 = await admin.listActiveAppIds() | ||
const activeApps1 = await admin.listActiveApps() | ||
t.equal(activeApps1.length, 0) | ||
await admin.activateApp({ app_id }) | ||
await admin.activateApp({ installed_app_id }) | ||
const activeApps2 = await admin.listActiveAppIds() | ||
const activeApps2 = await admin.listActiveApps() | ||
t.equal(activeApps2.length, 1) | ||
t.equal(activeApps2[0], app_id) | ||
t.equal(activeApps2[0], installed_app_id) | ||
await admin.attachAppInterface({ port: 0 }) | ||
await admin.deactivateApp({ app_id }) | ||
await admin.deactivateApp({ installed_app_id }) | ||
const dnas = await admin.listDnas() | ||
t.equal(dnas.length, 0) | ||
const activeApps3 = await admin.listActiveAppIds() | ||
const activeApps3 = await admin.listActiveApps() | ||
t.equal(activeApps3.length, 0) | ||
@@ -49,4 +49,4 @@ // NB: missing dumpState because it requires a valid cell_id | ||
test('can call a zome function', withConductor(ADMIN_PORT, async t => { | ||
const [app_id, cell_id, nick, client] = await installAppAndDna(ADMIN_PORT) | ||
const info = await client.appInfo({ app_id }) | ||
const [installed_app_id, cell_id, nick, client] = await installAppAndDna(ADMIN_PORT) | ||
const info = await client.appInfo({ installed_app_id }) | ||
t.deepEqual(info.cell_data[0][0], cell_id) | ||
@@ -69,3 +69,3 @@ t.equal(info.cell_data[0][1], nick) | ||
try { | ||
const [_app_id, cell_id, _nick, client] = await installAppAndDna(ADMIN_PORT, signalCb) | ||
const [installed_app_id, cell_id, _nick, client] = await installAppAndDna(ADMIN_PORT, signalCb) | ||
function signalCb (signal: AppSignal) { | ||
@@ -99,3 +99,3 @@ t.deepEqual(signal, { | ||
withConductor(ADMIN_PORT, async (t) => { | ||
const [_app_id, cell_id, _nick, client] = await installAppAndDna(ADMIN_PORT) | ||
const [installed_app_id, cell_id, _nick, client] = await installAppAndDna(ADMIN_PORT) | ||
try { | ||
@@ -102,0 +102,0 @@ await client.callZome({ |
import { spawn } from 'child_process' | ||
import fs from 'fs' | ||
import os from 'os' | ||
import { AppId, CellId, CellNick } from '../../src/api/types' | ||
import { InstalledAppId, CellId, CellNick } from '../../src/api/types' | ||
import { AppWebsocket } from '../../src/websocket/app' | ||
@@ -82,4 +82,4 @@ import { AdminWebsocket } from '../../src/websocket/admin' | ||
signalCb: (signal: any) => void = () => {} | ||
): Promise<[AppId, CellId, CellNick, AppWebsocket]> => { | ||
const app_id = 'app' | ||
): Promise<[InstalledAppId, CellId, CellNick, AppWebsocket]> => { | ||
const installed_app_id = 'app' | ||
const nick = 'mydna' | ||
@@ -89,3 +89,3 @@ const admin = await AdminWebsocket.connect(`http://localhost:${adminPort}`) | ||
const app = await admin.installApp({ | ||
app_id, | ||
installed_app_id, | ||
agent_key: agent, | ||
@@ -100,7 +100,7 @@ dnas: [ | ||
const cell_id = app.cell_data[0][0] | ||
await admin.activateApp({ app_id }) | ||
await admin.activateApp({ installed_app_id }) | ||
// destructure to get whatever open port was assigned to the interface | ||
const { port: appPort } = await admin.attachAppInterface({ port: 0 }) | ||
const client = await AppWebsocket.connect(`http://localhost:${appPort}`, signalCb) | ||
return [app_id, cell_id, nick, client] | ||
return [installed_app_id, cell_id, nick, client] | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
79743
0