From c8a518476808fa4a2356b318d5993bc9a4964a1e Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Wed, 15 Jun 2022 10:10:02 +0000 Subject: [PATCH 1/3] Fix listUpdateable --- src/manager/apps.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/manager/apps.ts b/src/manager/apps.ts index b469e04..648d120 100644 --- a/src/manager/apps.ts +++ b/src/manager/apps.ts @@ -61,7 +61,23 @@ export class ManagerApps extends ApiConnection { /** * Get a list of all apps which can be updates */ - async listUpdateable(): Promise { - return await this.get(`/updates`); + async listUpdatable(): Promise< + Record< + string, + { + updateFrom: string; + updateTo: string; + } + > + > { + return await this.get< + Record< + string, + { + updateFrom: string; + updateTo: string; + } + > + >(`/updates`); } } From 0b1d71741c3e78bb6854581c4f28f6a8feabaa4d Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Wed, 15 Jun 2022 10:13:20 +0000 Subject: [PATCH 2/3] Add types for app.yml 4 --- src/common/types.ts | 62 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/src/common/types.ts b/src/common/types.ts index ca8ec1f..0a98eb9 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -3,7 +3,7 @@ export type Dependency = 'bitcoind' | 'electrum' | 'lnd' | 'c-lightning'; /** * Defines an app */ -export type app = { +export type OldApp = { /** The id of the app, the name as a simple string without spaces */ id: string; /** A category for the app, used for grouping apps on the dashboard */ @@ -42,6 +42,66 @@ export type app = { compatible: boolean; }; +export type MetadataV4 = { + /** + * The category for the app + */ + category: string; + /** + * The app's default password. Can also be $APP_SEED for a random password + */ + defaultPassword?: string | undefined; + developers: Record; + /** + * A list of promo images for the apps + */ + gallery?: string[] | undefined; + /** + * The name of the app + */ + name: string; + /** + * The path the "Open" link on the dashboard should lead to + */ + path?: string | undefined; + /** + * Permissions the app requires + */ + permissions?: Array; + /** + * App repository name -> repo URL + */ + repo: Record; + /** + * A support link for the app + */ + support: string; + /** + * A short tagline for the app + */ + tagline: string; + /** + * True if the app only works over Tor + */ + torOnly?: boolean; + /** + * A list of containers to update automatically (still validated by the Citadel team) + */ + updateContainers?: string[] | undefined; + /** + * The version of the app + */ + version: string; + /** Automatically added */ + hiddenService?: string; + /** Automatically added */ + installed?: boolean; + /** Automatically added */ + compatible: boolean; +}; + +export type app = MetadataV4 | OldApp; + type BuildPowersOf2LengthArrays< N extends number, R extends never[][], From 0e3736940ce8e7fcd118319cc0c1e813875f2c9f Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Wed, 15 Jun 2022 10:44:31 +0000 Subject: [PATCH 3/3] Allow starting quick update --- src/manager/system.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/manager/system.ts b/src/manager/system.ts index 9d35743..b8166ed 100644 --- a/src/manager/system.ts +++ b/src/manager/system.ts @@ -59,6 +59,10 @@ export class ManagerSystem extends ApiConnection { await this.post('update'); } + async startQuickUpdate(): Promise { + await this.post('quick-update'); + } + async updateStatus(): Promise { return await this.get('update-status'); }