Skip to content

Commit

Permalink
feat: added installed app id to appwebsocket (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed May 9, 2024
1 parent c81a993 commit a361a19
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/client.appwebsocket.installedappid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [AppWebsocket](./client.appwebsocket.md) &gt; [installedAppId](./client.appwebsocket.installedappid.md)

## AppWebsocket.installedAppId property

**Signature:**

```typescript
readonly installedAppId: InstalledAppId;
```
19 changes: 19 additions & 0 deletions docs/client.appwebsocket.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@ _(Optional)_
</td><td>
</td></tr>
<tr><td>
[installedAppId](./client.appwebsocket.installedappid.md)
</td><td>
`readonly`
</td><td>
[InstalledAppId](./client.installedappid.md)
</td><td>
</td></tr>
<tr><td>
Expand Down
4 changes: 3 additions & 1 deletion src/api/app/websocket.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Emittery, { UnsubscribeFunction } from "emittery";
import { omit } from "lodash-es";
import { AgentPubKey, CellId, RoleName } from "../../types.js";
import { AgentPubKey, CellId, InstalledAppId, RoleName } from "../../types.js";
import { AppInfo, CellType } from "../admin/index.js";
import {
catchError,
Expand Down Expand Up @@ -63,6 +63,7 @@ import { WsClient } from "../client.js";
export class AppWebsocket implements AppClient {
readonly client: WsClient;
readonly myPubKey: AgentPubKey;
readonly installedAppId: InstalledAppId;
private readonly defaultTimeout: number;
private readonly emitter: Emittery<AppEvents>;
cachedAppInfo?: AppInfo | null;
Expand Down Expand Up @@ -96,6 +97,7 @@ export class AppWebsocket implements AppClient {
) {
this.client = client;
this.myPubKey = appInfo.agent_pub_key;
this.installedAppId = appInfo.installed_app_id;
this.defaultTimeout = defaultTimeout ?? DEFAULT_TIMEOUT;
this.emitter = new Emittery<AppEvents>();
this.cachedAppInfo = appInfo;
Expand Down

0 comments on commit a361a19

Please sign in to comment.