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

Backport: New install app payload #300

Merged
merged 6 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Added
### 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`.
### Fixed
### Removed

Expand Down
1 change: 0 additions & 1 deletion doc-test-app-ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const appInfo = await adminWs.installApp({
agent_key,
path: "./test/e2e/fixture/test.happ",
installed_app_id,
membrane_proofs: {},
});
await adminWs.enableApp({ installed_app_id });
if (!(CellType.Provisioned in appInfo.cell_info[role_name][0])) {
Expand Down
1 change: 0 additions & 1 deletion doc-test-signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const appInfo = await adminWs.installApp({
agent_key,
path: "./test/e2e/fixture/test.happ",
installed_app_id,
membrane_proofs: {},
});
await adminWs.enableApp({ installed_app_id });
if (!(CellType.Provisioned in appInfo.cell_info[role_name][0])) {
Expand Down
19 changes: 19 additions & 0 deletions docs/client.dnamodifiersopt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- 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?: YamlProperties;
origin_time?: Timestamp;
quantum_time?: Duration;
};
```
**References:** [NetworkSeed](./client.networkseed.md)<!-- -->, [YamlProperties](./client.yamlproperties.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)

41 changes: 41 additions & 0 deletions docs/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,16 @@ 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 @@ -2619,6 +2629,26 @@ 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 Expand Up @@ -2809,6 +2839,17 @@ If the key could not be deleted from all cells, the call [RevokeAgentKeyRequest]



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

[YamlProperties](./client.yamlproperties.md)


</td><td>

Any value that is serializable to a Yaml value


</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)

21 changes: 21 additions & 0 deletions docs/client.rolesettings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- 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)

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

[Home](./index.md) &gt; [@holochain/client](./client.md) &gt; [YamlProperties](./client.yamlproperties.md)

## YamlProperties type

Any value that is serializable to a Yaml value

**Signature:**

```typescript
export type YamlProperties = unknown;
```
63 changes: 21 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"devDependencies": {
"@microsoft/api-documenter": "^7.21.7",
"@microsoft/api-extractor": "^7.34.4",
"@types/js-yaml": "4.0.9",
"@types/libsodium-wrappers": "^0.7.11",
"@types/lodash-es": "^4.17.6",
"@types/tape": "^4.13.2",
Expand All @@ -65,7 +66,7 @@
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-tsdoc": "^0.2.17",
"js-yaml": "^3.14.1",
"js-yaml": "^4.1.0",
"prettier": "^2.8.8",
"rimraf": "^3.0.2",
"tape": "^5.6.6",
Expand Down
48 changes: 41 additions & 7 deletions src/api/admin/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,42 @@ export type MembraneProof = Uint8Array;
/**
* @public
*/
export type MemproofMap = { [key: string]: MembraneProof };
export type MemproofMap = { [key: RoleName]: MembraneProof };

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

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

/**
* @public
* Any value that is serializable to a Yaml value
*/
export type YamlProperties = unknown;

/**
* @public
*/
export type DnaModifiersOpt = {
network_seed?: NetworkSeed;
properties?: YamlProperties;
origin_time?: Timestamp;
quantum_time?: Duration;
};

/**
* @public
Expand Down Expand Up @@ -476,18 +511,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
Loading
Loading