50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
// noinspection JSUnusedGlobalSymbols
|
|
|
|
type Region = "cn" | "jp" | "en" | "tw" | "kr";
|
|
type Step = "suite" | "mysekai" | "birthday";
|
|
|
|
interface UploadUrlGeneral {
|
|
mode: "general";
|
|
url: string;
|
|
}
|
|
|
|
interface UploadUrlEach {
|
|
mode: "each";
|
|
suite: string | null;
|
|
mysekai: string | null;
|
|
birthday: string | null;
|
|
}
|
|
|
|
interface UploadMixinStep {
|
|
name: string;
|
|
hosts: (Region | string)[];
|
|
target: Step | string;
|
|
}
|
|
|
|
interface UploadMixinProfile {
|
|
name: string;
|
|
steps: UploadMixinStep[];
|
|
}
|
|
|
|
interface UploadMixinUploadIgnoreProfile {
|
|
name: Region;
|
|
steps: Step[];
|
|
}
|
|
|
|
interface UploadMixinUpload {
|
|
ignore?: "*" | (Region | UploadMixinUploadIgnoreProfile)[]; // never ignore defined profile in mixin context
|
|
}
|
|
|
|
interface UploadMixin {
|
|
profiles?: UploadMixinProfile[];
|
|
upload?: UploadMixinUpload;
|
|
}
|
|
|
|
export interface UploadProfileCustom {
|
|
type: "CUSTOM";
|
|
id: string;
|
|
uploadUrl: UploadUrlGeneral | UploadUrlEach;
|
|
headers: Record<string, "$original_url" | "$file_name" | "$user_id" | string>;
|
|
mixin?: UploadMixin;
|
|
}
|