Files
3x-ui/frontend/src/schemas/protocols/stream/xdrive.ts
T
MHSanaei a8255944bf style: trim MASQUE and XDRIVE comment blocks to two lines
The MASQUE and XDRIVE commits left four comment blocks over the
two-line cap CLAUDE.md sets for committed Go/TS.
2026-10-11 17:00:52 +02:00

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>;