mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-29 22:52:39 +00:00
updated updates route for spacebar client
This commit is contained in:
3 files changed
+62
-5
No files matched your search
@@ -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,
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user