updated updates route for spacebar client

This commit is contained in:
Puyodead1 committed 2023-12-20 02:43:58 -05:00
1 parent 9a286e1f74
commit 07db919bc9
3 files changed
+62 -5

No files matched your search

+22 -1
View File
@@ -36,9 +36,26 @@ router.get(
body: "APIErrorResponse",
},
},
query: {
platform: {
type: "string",
required: true,
description: "The platform to get the manifest for",
},
arch: {
type: "string",
required: true,
description: "The architecture to get the manifest for",
},
channel: {
type: "string",
required: true,
description: "The release channel to get the manifest for",
},
},
}),
async (req: Request, res: Response) => {
const platform = req.query.platform;
const { platform, arch, channel } = req.query;
if (!platform)
throw FieldErrors({
@@ -52,15 +69,19 @@ router.get(
where: {
enabled: true,
platform: platform as string,
arch: arch as string,
channel: channel as string,
},
order: { pub_date: "DESC" },
});
res.json({
version: release.version,
name: release.name,
pub_date: release.pub_date,
url: release.url,
notes: release.notes,
signature: release.signature,
});
},
);
+15 -3
View File
@@ -25,17 +25,29 @@ export class Release extends BaseClass {
name: string;
@Column()
pub_date: Date;
version: string;
@Column()
url: string;
pub_date: Date;
@Column({ nullable: true })
url: string | null;
@Column()
platform: string;
@Column()
arch: string;
@Column()
enabled: boolean;
@Column({ nullable: true })
notes?: string;
notes: string | null;
@Column({ nullable: true })
signature: string | null;
@Column({ default: "stable" })
channel: string;
}
+25 -1
View File
@@ -17,8 +17,32 @@
*/
export interface UpdatesResponse {
/**
* Version to install.
* Tauri Specific
*/
version: string;
/**
* The latest host version.
*/
name: string;
/**
* When the update was published
*/
pub_date: string;
url: string;
/**
* The URL to the corresponding installer.
* Only provided if auto updates are available for the selected platform.
*/
url: string | null;
/**
* Any extra notes for the update
* Only provided if auto updates are available for the selected platform.
*/
notes: string | null;
/**
* The signature of the update.
* Tauri Specific
*/
signature: string | null;
}