@holochain/client 0.18.0-dev.10 → 0.18.0-dev.12

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.
@@ -180,6 +180,17 @@ export type GenerateAgentPubKeyRequest = void;
180
180
  * @public
181
181
  */
182
182
  export type GenerateAgentPubKeyResponse = AgentPubKey;
183
+ /**
184
+ * @public
185
+ */
186
+ export type RevokeAgentKeyRequest = {
187
+ agent_key: AgentPubKey;
188
+ app_id: InstalledAppId;
189
+ };
190
+ /**
191
+ * @public
192
+ */
193
+ export type RevokeAgentKeyResponse = void;
183
194
  /**
184
195
  * @public
185
196
  */
@@ -398,8 +409,11 @@ export type NetworkSeed = string;
398
409
  export type InstallAppRequest = {
399
410
  /**
400
411
  * The agent to use when creating Cells for this App.
412
+ * If not specified, a new agent will be generated by Holochain.
413
+ * If DPKI is enabled (default), and the agent key is not specified here,
414
+ * a new agent key will be derived from the DPKI device seed and registered with DPKI.
401
415
  */
402
- agent_key: AgentPubKey;
416
+ agent_key?: AgentPubKey;
403
417
  /**
404
418
  * The unique identifier for an installed app in this conductor.
405
419
  * If not specified, it will be derived from the app name in the bundle manifest.
@@ -523,7 +537,7 @@ export interface DeleteCloneCellRequest {
523
537
  /**
524
538
  * The clone id or cell id of the clone cell
525
539
  */
526
- clone_cell_id: RoleName | CellId;
540
+ clone_cell_id: RoleName | DnaHash;
527
541
  }
528
542
  /**
529
543
  * @public
@@ -2,7 +2,7 @@ import { CapSecret, GrantedFunctions } from "../../hdk/index.js";
2
2
  import type { AgentPubKey, CellId } from "../../types.js";
3
3
  import { WsClient } from "../client.js";
4
4
  import { Requester, Transformer, WebsocketConnectionOptions } from "../common.js";
5
- import { AddAgentInfoRequest, AddAgentInfoResponse, AdminApi, AgentInfoRequest, AgentInfoResponse, AttachAppInterfaceRequest, AttachAppInterfaceResponse, DeleteCloneCellRequest, DeleteCloneCellResponse, DisableAppRequest, DisableAppResponse, DumpFullStateRequest, DumpFullStateResponse, DumpNetworkStatsRequest, DumpNetworkStatsResponse, DumpStateRequest, DumpStateResponse, EnableAppRequest, EnableAppResponse, GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse, GetCompatibleCellsRequest, GetCompatibleCellsResponse, GetDnaDefinitionRequest, GetDnaDefinitionResponse, GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse, InstallAppRequest, InstallAppResponse, IssueAppAuthenticationTokenRequest, IssueAppAuthenticationTokenResponse, ListAppInterfacesRequest, ListAppInterfacesResponse, ListAppsRequest, ListAppsResponse, ListCellIdsRequest, ListCellIdsResponse, ListDnasRequest, ListDnasResponse, RegisterDnaRequest, RegisterDnaResponse, StorageInfoRequest, StorageInfoResponse, UninstallAppRequest, UninstallAppResponse, UpdateCoordinatorsRequest, UpdateCoordinatorsResponse } from "./types.js";
5
+ import { AddAgentInfoRequest, AddAgentInfoResponse, AdminApi, AgentInfoRequest, AgentInfoResponse, AttachAppInterfaceRequest, AttachAppInterfaceResponse, DeleteCloneCellRequest, DeleteCloneCellResponse, DisableAppRequest, DisableAppResponse, DumpFullStateRequest, DumpFullStateResponse, DumpNetworkStatsRequest, DumpNetworkStatsResponse, DumpStateRequest, DumpStateResponse, EnableAppRequest, EnableAppResponse, GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse, GetCompatibleCellsRequest, GetCompatibleCellsResponse, GetDnaDefinitionRequest, GetDnaDefinitionResponse, GrantZomeCallCapabilityRequest, GrantZomeCallCapabilityResponse, InstallAppRequest, InstallAppResponse, IssueAppAuthenticationTokenRequest, IssueAppAuthenticationTokenResponse, ListAppInterfacesRequest, ListAppInterfacesResponse, ListAppsRequest, ListAppsResponse, ListCellIdsRequest, ListCellIdsResponse, ListDnasRequest, ListDnasResponse, RegisterDnaRequest, RegisterDnaResponse, RevokeAgentKeyRequest, RevokeAgentKeyResponse, StorageInfoRequest, StorageInfoResponse, UninstallAppRequest, UninstallAppResponse, UpdateCoordinatorsRequest, UpdateCoordinatorsResponse } from "./types.js";
6
6
  /**
7
7
  * A class for interacting with a conductor's Admin API.
8
8
  *
@@ -51,6 +51,10 @@ export declare class AdminWebsocket implements AdminApi {
51
51
  * Generate a new agent pub key.
52
52
  */
53
53
  generateAgentPubKey: Requester<GenerateAgentPubKeyRequest, GenerateAgentPubKeyResponse>;
54
+ /**
55
+ * Generate a new agent pub key.
56
+ */
57
+ revokeAgentKey: Requester<RevokeAgentKeyRequest, RevokeAgentKeyResponse>;
54
58
  /**
55
59
  * Register a DNA for later app installation.
56
60
  *
@@ -68,6 +68,10 @@ export class AdminWebsocket {
68
68
  * Generate a new agent pub key.
69
69
  */
70
70
  generateAgentPubKey = this._requester("generate_agent_pub_key");
71
+ /**
72
+ * Generate a new agent pub key.
73
+ */
74
+ revokeAgentKey = this._requester("revoke_agent_key");
71
75
  /**
72
76
  * Register a DNA for later app installation.
73
77
  *
@@ -152,7 +152,7 @@ export interface DisableCloneCellRequest {
152
152
  /**
153
153
  * The clone id or cell id of the clone cell
154
154
  */
155
- clone_cell_id: RoleName | CellId;
155
+ clone_cell_id: RoleName | DnaHash;
156
156
  }
157
157
  /**
158
158
  * @public
@@ -0,0 +1,11 @@
1
+ import { CellId } from "../types.js";
2
+ /**
3
+ * Check if two cell ids are identical.
4
+ *
5
+ * @param cellId1 - Cell id 1 to compare.
6
+ * @param cellId2 - Cell id 1 to compare.
7
+ * @returns True if the cell ids are identical.
8
+ *
9
+ * @public
10
+ */
11
+ export declare const isSameCell: (cellId1: CellId, cellId2: CellId) => boolean;
@@ -0,0 +1,17 @@
1
+ import { encodeHashToBase64 } from "./base64.js";
2
+ /**
3
+ * Check if two cell ids are identical.
4
+ *
5
+ * @param cellId1 - Cell id 1 to compare.
6
+ * @param cellId2 - Cell id 1 to compare.
7
+ * @returns True if the cell ids are identical.
8
+ *
9
+ * @public
10
+ */
11
+ export const isSameCell = (cellId1, cellId2) => {
12
+ const dnaHashB64_1 = encodeHashToBase64(cellId1[0]);
13
+ const agentPubKeyB64_1 = encodeHashToBase64(cellId1[1]);
14
+ const dnaHashB64_2 = encodeHashToBase64(cellId2[0]);
15
+ const agentPubKeyB64_2 = encodeHashToBase64(cellId2[1]);
16
+ return dnaHashB64_1 === dnaHashB64_2 && agentPubKeyB64_1 === agentPubKeyB64_2;
17
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./base64.js";
2
2
  export * from "./fake-hash.js";
3
3
  export * from "./hash-parts.js";
4
+ export * from "./cell.js";
@@ -1,3 +1,4 @@
1
1
  export * from "./base64.js";
2
2
  export * from "./fake-hash.js";
3
3
  export * from "./hash-parts.js";
4
+ export * from "./cell.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/client",
3
- "version": "0.18.0-dev.10",
3
+ "version": "0.18.0-dev.12",
4
4
  "description": "A JavaScript client for the Holochain Conductor API",
5
5
  "author": "Holochain Foundation <info@holochain.org> (https://holochain.org)",
6
6
  "license": "CAL-1.0",