parent
0621237195
commit
118b31bd2f
@ -1,65 +1,30 @@
|
||||
export interface Modpack {
|
||||
_id: string;
|
||||
type: 'modpack';
|
||||
name: string;
|
||||
author: string;
|
||||
revisions: Revision[];
|
||||
}
|
||||
|
||||
export type Revision = RevisionBase | RevisionDiff;
|
||||
|
||||
export interface RevisionBase {
|
||||
id: string;
|
||||
tag?: RevisionTag;
|
||||
type: 'base';
|
||||
tree: FileTree;
|
||||
}
|
||||
|
||||
export interface RevisionDiff {
|
||||
id: string;
|
||||
tag?: RevisionTag;
|
||||
type: 'diff';
|
||||
tree: Diff[];
|
||||
}
|
||||
|
||||
export interface RevisionTag {
|
||||
type: 'alpha' | 'beta' | 'rc' | 'stable';
|
||||
version: string;
|
||||
}
|
||||
|
||||
export type FileTree = Folder | File;
|
||||
|
||||
export interface Folder {
|
||||
type: 'folder';
|
||||
children: Record<string, FileTree>;
|
||||
}
|
||||
|
||||
export type File = FileInline | FileBlob;
|
||||
|
||||
export interface FileInline {
|
||||
type: 'file';
|
||||
inline: true;
|
||||
content: string;
|
||||
sha1: string;
|
||||
sha512: string;
|
||||
}
|
||||
|
||||
export interface FileBlob {
|
||||
type: 'file';
|
||||
inline: false;
|
||||
sha1: string;
|
||||
sha512: string;
|
||||
}
|
||||
|
||||
export type Diff = DiffSet | DiffDelete;
|
||||
|
||||
export interface DiffSet {
|
||||
path: string[];
|
||||
type: 'set';
|
||||
value: FileTree;
|
||||
}
|
||||
|
||||
export interface DiffDelete {
|
||||
path: string[];
|
||||
type: 'delete';
|
||||
}
|
||||
import type { z } from 'zod';
|
||||
import type {
|
||||
diffDeleteSchema,
|
||||
diffSchema,
|
||||
diffSetSchema,
|
||||
fileBlobSchema,
|
||||
fileInlineSchema,
|
||||
fileSchema,
|
||||
fileTreeSchema,
|
||||
folderSchema,
|
||||
modpackSchema,
|
||||
revisionBaseSchema,
|
||||
revisionDiffSchema,
|
||||
revisionSchema,
|
||||
revisionTagSchema
|
||||
} from './types-zod';
|
||||
|
||||
export type Modpack = z.infer<typeof modpackSchema>;
|
||||
export type Revision = z.infer<typeof revisionSchema>;
|
||||
export type RevisionBase = z.infer<typeof revisionBaseSchema>;
|
||||
export type RevisionDiff = z.infer<typeof revisionDiffSchema>;
|
||||
export type RevisionTag = z.infer<typeof revisionTagSchema>;
|
||||
export type FileTree = z.infer<typeof fileTreeSchema>;
|
||||
export type Folder = z.infer<typeof folderSchema>;
|
||||
export type File = z.infer<typeof fileSchema>;
|
||||
export type FileInline = z.infer<typeof fileInlineSchema>;
|
||||
export type FileBlob = z.infer<typeof fileBlobSchema>;
|
||||
export type Diff = z.infer<typeof diffSchema>;
|
||||
export type DiffSet = z.infer<typeof diffSetSchema>;
|
||||
export type DiffDelete = z.infer<typeof diffDeleteSchema>;
|
||||
|
Loading…
Reference in new issue