Skip to content

Commit

Permalink
update InstallAppRequest type to new format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Nov 25, 2024
1 parent 7660915 commit 33ead65
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 12 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
### Fixed
### Changed
- Change `InstallAppRequest` type to adhere to the new format that includes the `roles_settings` field and removes
the `membrane_proofs` field as membrane proofs are now specified as part of the `roles_settings`.
### Removed

## 2024-11-21: v0.19.0-dev.5
Expand All @@ -24,7 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## 2024-11-12: v0.19.0-dev.2
### Added
- AppWebsocket calls to interact with countersigning sessions, i.e. `GetCountersigningSessionState` as well as `AbandonCountersigningSession` and `PublishCountersigningSession` when a session could not be resolved automatically. Countersigning is an unstable feature which must explicitly be enabled in Holochain.

## 2024-10-28: v0.19.0-dev.1
### Added
- Bring back a websocket reconnection automation for Admin and App websockets. When either of them is closed and a new request made, it will attempt to reconnect using the same app authentication token that was used to initially authenticate the websocket. A specific `InvalidTokenError` is returned if that fails.
Expand Down
18 changes: 18 additions & 0 deletions docs/client.dnamodifiersopt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [DnaModifiersOpt](./client.dnamodifiersopt.md)

## DnaModifiersOpt type

**Signature:**

```typescript
export type DnaModifiersOpt = {
network_seed?: NetworkSeed;
properties?: Uint8Array;
origin_time?: Timestamp;
quantum_time?: Duration;
};
```
**References:** [NetworkSeed](./client.networkseed.md)<!-- -->, [Timestamp](./client.timestamp.md)<!-- -->, [Duration](./client.duration.md)

4 changes: 2 additions & 2 deletions docs/client.installapprequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
export type InstallAppRequest = {
agent_key?: AgentPubKey;
installed_app_id?: InstalledAppId;
membrane_proofs: MemproofMap;
network_seed?: NetworkSeed;
roles_settings?: RoleSettingsMap;
ignore_genesis_failure?: boolean;
} & AppBundleSource;
```
**References:** [AgentPubKey](./client.agentpubkey.md)<!-- -->, [InstalledAppId](./client.installedappid.md)<!-- -->, [MemproofMap](./client.memproofmap.md)<!-- -->, [NetworkSeed](./client.networkseed.md)<!-- -->, [AppBundleSource](./client.appbundlesource.md)
**References:** [AgentPubKey](./client.agentpubkey.md)<!-- -->, [InstalledAppId](./client.installedappid.md)<!-- -->, [NetworkSeed](./client.networkseed.md)<!-- -->, [RoleSettingsMap](./client.rolesettingsmap.md)<!-- -->, [AppBundleSource](./client.appbundlesource.md)

28 changes: 28 additions & 0 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -1862,6 +1862,15 @@ This type is meant to be opaque



</td></tr>
<tr><td>

[DnaModifiersOpt](./client.dnamodifiersopt.md)


</td><td>


</td></tr>
<tr><td>

Expand Down Expand Up @@ -2718,6 +2727,25 @@ If the key could not be deleted from all cells, the call [RevokeAgentKeyRequest]



</td></tr>
<tr><td>

[RoleSettings](./client.rolesettings.md)


</td><td>


</td></tr>
<tr><td>

[RoleSettingsMap](./client.rolesettingsmap.md)


</td><td>



</td></tr>
<tr><td>

Expand Down
4 changes: 2 additions & 2 deletions docs/client.memproofmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

```typescript
export type MemproofMap = {
[key: string]: MembraneProof;
[key: RoleName]: MembraneProof;
};
```
**References:** [MembraneProof](./client.membraneproof.md)
**References:** [RoleName](./client.rolename.md)<!-- -->, [MembraneProof](./client.membraneproof.md)

20 changes: 20 additions & 0 deletions docs/client.rolesettings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [RoleSettings](./client.rolesettings.md)

## RoleSettings type

**Signature:**

```typescript
export type RoleSettings = {
type: "UseExisting";
cell_id: CellId;
} | {
type: "Provisioned";
membrane_proof?: MembraneProof;
modifiers?: DnaModifiersOpt;
};
```
**References:** [CellId](./client.cellid.md)<!-- -->, [MembraneProof](./client.membraneproof.md)<!-- -->, [DnaModifiersOpt](./client.dnamodifiersopt.md)

16 changes: 16 additions & 0 deletions docs/client.rolesettingsmap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [RoleSettingsMap](./client.rolesettingsmap.md)

## RoleSettingsMap type


**Signature:**

```typescript
export type RoleSettingsMap = {
[key: RoleName]: RoleSettings;
};
```
**References:** [RoleName](./client.rolename.md)<!-- -->, [RoleSettings](./client.rolesettings.md)

36 changes: 29 additions & 7 deletions src/api/admin/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,30 @@ export type MembraneProof = Uint8Array;
/**
* @public
*/
export type MemproofMap = { [key: string]: MembraneProof };
export type MemproofMap = { [key: RoleName]: MembraneProof };

/**
* @public
*/
export type RoleSettingsMap = { [key: RoleName]: RoleSettings };

export type RoleSettings =
| {
type: "UseExisting";
cell_id: CellId;
}
| {
type: "Provisioned";
membrane_proof?: MembraneProof;
modifiers?: DnaModifiersOpt;
};

export type DnaModifiersOpt = {
network_seed?: NetworkSeed;
properties?: Uint8Array;
origin_time?: Timestamp;
quantum_time?: Duration;
};

/**
* @public
Expand Down Expand Up @@ -477,18 +500,17 @@ export type InstallAppRequest = {
*/
installed_app_id?: InstalledAppId;

/**
* Include proof-of-membrane-membership data for cells that require it,
* keyed by the CellNick specified in the app bundle manifest.
*/
membrane_proofs: MemproofMap;

/**
* Optional global network seed override. If set will override the network seed value for all
* DNAs in the bundle.
*/
network_seed?: NetworkSeed;

/**
* Specify role specific settings or modifiers that will override any settings in the dna manifest.
*/
roles_settings?: RoleSettingsMap;

/**
* Optional: If app installation fails due to genesis failure, normally the app will be immediately uninstalled.
* When this flag is set, the app is left installed with empty cells intact. This can be useful for
Expand Down

0 comments on commit 33ead65

Please sign in to comment.