Add connected library for Git modpack manifests
Some checks failed
Build / verify (push) Failing after 18m55s
Some checks failed
Build / verify (push) Failing after 18m55s
This commit is contained in:
60
apps/app-frontend/src/helpers/connected-library.ts
Normal file
60
apps/app-frontend/src/helpers/connected-library.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
export interface ConnectedPack {
|
||||
id: string
|
||||
sourceUrl: string
|
||||
manifestUrl: string
|
||||
name: string
|
||||
version: string
|
||||
versionId: string
|
||||
mrpackUrl: string
|
||||
sha512: string
|
||||
changelog: string | null
|
||||
profilePath: string | null
|
||||
installedVersionId: string | null
|
||||
autoUpdate: boolean
|
||||
lastChecked: string | null
|
||||
lastError: string | null
|
||||
created: string
|
||||
updated: string
|
||||
updateAvailable: boolean
|
||||
}
|
||||
|
||||
export interface ConnectedCheckResult {
|
||||
pack: ConnectedPack
|
||||
installed: boolean
|
||||
}
|
||||
|
||||
export async function list_connected_packs(): Promise<ConnectedPack[]> {
|
||||
return await invoke('plugin:connected-library|connected_library_list')
|
||||
}
|
||||
|
||||
export async function connect_pack(sourceUrl: string): Promise<ConnectedPack> {
|
||||
return await invoke('plugin:connected-library|connected_library_connect', { sourceUrl })
|
||||
}
|
||||
|
||||
export async function remove_connected_pack(id: string): Promise<void> {
|
||||
return await invoke('plugin:connected-library|connected_library_remove', { id })
|
||||
}
|
||||
|
||||
export async function set_connected_pack_auto_update(
|
||||
id: string,
|
||||
autoUpdate: boolean,
|
||||
): Promise<ConnectedPack> {
|
||||
return await invoke('plugin:connected-library|connected_library_set_auto_update', {
|
||||
id,
|
||||
autoUpdate,
|
||||
})
|
||||
}
|
||||
|
||||
export async function check_connected_pack(id: string): Promise<ConnectedCheckResult> {
|
||||
return await invoke('plugin:connected-library|connected_library_check', { id })
|
||||
}
|
||||
|
||||
export async function check_all_connected_packs(): Promise<ConnectedCheckResult[]> {
|
||||
return await invoke('plugin:connected-library|connected_library_check_all')
|
||||
}
|
||||
|
||||
export async function install_connected_pack(id: string): Promise<ConnectedPack> {
|
||||
return await invoke('plugin:connected-library|connected_library_install', { id })
|
||||
}
|
||||
Reference in New Issue
Block a user