feat: add approved modpack sync and StarLight instance modes
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
Some checks failed
Axolotl desktop CI / guardrails (push) Has been cancelled
Axolotl desktop CI / desktop (macos-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (ubuntu-latest) (push) Has been cancelled
Axolotl desktop CI / desktop (windows-latest) (push) Has been cancelled
Axolotl desktop CI / website (push) Has been cancelled
Repository checks / typos (push) Has been cancelled
Repository checks / tombi (push) Has been cancelled
Rust checks / shear (push) Has been cancelled
Sync source to CNB / Sync Git ref (push) Has been cancelled
This commit is contained in:
33
apps/app-frontend/src/helpers/hosted-packs.ts
Normal file
33
apps/app-frontend/src/helpers/hosted-packs.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { invoke } from '@tauri-apps/api/core'
|
||||
|
||||
export type InstanceMode = 'starlight' | 'local'
|
||||
export const getInstanceMode = (instanceId: string) =>
|
||||
invoke<InstanceMode>('plugin:install|hosted_instance_mode', { instanceId })
|
||||
export const setInstanceMode = (instanceId: string, mode: InstanceMode) =>
|
||||
invoke<void>('plugin:install|hosted_set_instance_mode', { instanceId, mode })
|
||||
|
||||
export interface HostedPublication {
|
||||
packId: string
|
||||
releaseId: number
|
||||
manifest: {
|
||||
name: string
|
||||
version: string
|
||||
format: string
|
||||
runtime: { gameVersion: string; loader: string; loaderVersion: string | null }
|
||||
files: { path: string; size: number; sha256: string }[]
|
||||
}
|
||||
}
|
||||
export interface HostedBinding {
|
||||
publication: HostedPublication
|
||||
}
|
||||
export interface HostedSyncResult {
|
||||
version: string
|
||||
downloadedBytes: number
|
||||
changedFiles: number
|
||||
preservedFiles: string[]
|
||||
}
|
||||
export const hostedCatalog = () => invoke<HostedPublication[]>('plugin:install|hosted_catalog')
|
||||
export const hostedBinding = (instanceId: string) =>
|
||||
invoke<HostedBinding | null>('plugin:install|hosted_binding', { instanceId })
|
||||
export const hostedSync = (instanceId: string, packId: string) =>
|
||||
invoke<HostedSyncResult>('plugin:install|hosted_sync', { instanceId, packId })
|
||||
@ -32,6 +32,7 @@ export interface InstallModpackPreview {
|
||||
}
|
||||
|
||||
export interface InstallCreateInstanceRequest {
|
||||
instanceMode?: 'starlight' | 'local'
|
||||
name: string
|
||||
gameVersion: string
|
||||
loader: InstanceLoader
|
||||
|
||||
Reference in New Issue
Block a user