Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add installed app id to appwebsocket object #246

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading