mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-29 09:14:59 +03:00
a8255944bf
The MASQUE and XDRIVE commits left four comment blocks over the two-line cap CLAUDE.md sets for committed Go/TS.
26 lines
1.2 KiB
TypeScript
26 lines
1.2 KiB
TypeScript
import { z } from 'zod';
|
|
|
|
// Both XDRIVE ends carry the same service, folder and secrets; an absent tuning knob takes
|
|
// the core's default (segmentBytes and concurrency are capped there at 16 MiB / 64).
|
|
export const XDriveServiceSchema = z.enum(['Google Drive', 'local', 'template']);
|
|
export type XDriveService = z.infer<typeof XDriveServiceSchema>;
|
|
|
|
const MillisSchema = z.number().int().min(0);
|
|
|
|
export const XDriveStreamSettingsSchema = z.object({
|
|
service: XDriveServiceSchema.default('Google Drive'),
|
|
remoteFolder: z.string().default(''),
|
|
// Google Drive takes exactly three, in order: ClientID, ClientSecret, RefreshToken.
|
|
secrets: z.array(z.string()).default([]),
|
|
segmentBytes: z.number().int().min(0).optional(),
|
|
flushIntervalMs: MillisSchema.optional(),
|
|
pollIntervalMs: MillisSchema.optional(),
|
|
maxPollIntervalMs: MillisSchema.optional(),
|
|
sessionTtlSeconds: z.number().int().min(0).optional(),
|
|
concurrency: z.number().int().min(0).optional(),
|
|
eagerWindowMs: MillisSchema.optional(),
|
|
holeTimeoutMs: MillisSchema.optional(),
|
|
template: z.record(z.string(), z.unknown()).optional(),
|
|
});
|
|
export type XDriveStreamSettings = z.infer<typeof XDriveStreamSettingsSchema>;
|