Files
WT-Offline/apps/launcher/src/shared/schemas/maintenance.ts
T
N0VAN0M4LY bf2ce539e7 feat(launcher): use version-independent rules for space-saving copies
Replace the single-version 2.61.0.43 SHA-256 hardlink manifest with declarative read-only asset rules in packages/patcher/tuning/hardlink-resources.jsonc (content/ and content.hq/ .dxp.bin and .grp archives with no minimum size cutoff). Space-saving installs and conversions now work across minor updates, and updating a space-saving client from a same-volume source preserves or creates hard links instead of detaching them into full copies.
2026-12-02 17:04:36 +08:00

38 lines
1.3 KiB
TypeScript

import { z } from 'zod';
import { CopyIdSchema } from './install.ts';
export const MaintenanceOperationSchema = z.enum(['check', 'repair', 'update', 'compact', 'delete', 'confirm-steam']);
export const MaintenanceRequestSchema = z.object({
id: CopyIdSchema,
operation: MaintenanceOperationSchema,
deleteData: z.boolean().default(false),
steamLocations: z.object({
copyPath: z.string().min(1),
dataPath: z.string().min(1),
}).optional(),
});
export const MaintenanceInfoSchema = z.object({
sourceVersion: z.string().nullable(),
updateAvailable: z.boolean(),
updatePreservesSpaceSaving: z.boolean(),
spaceSavingAvailable: z.boolean(),
steamConfirmationRequired: z.boolean(),
steamLocations: z.object({
copyPath: z.string(),
dataPath: z.string(),
copyInSteam: z.boolean(),
dataInSteam: z.boolean(),
}).nullable(),
});
export const MaintenanceProgressSchema = z.object({
id: CopyIdSchema,
operation: MaintenanceOperationSchema,
phase: z.enum(['checking', 'copying', 'applying']),
doneBytes: z.number().nonnegative(),
totalBytes: z.number().nonnegative(),
});
export type MaintenanceRequest = z.output<typeof MaintenanceRequestSchema>;
export type MaintenanceInfo = z.output<typeof MaintenanceInfoSchema>;
export type MaintenanceProgress = z.output<typeof MaintenanceProgressSchema>;