"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HlsPlaylistHeaderDto = exports.HlsSegmentHeaderDto = exports.HlsSegmentParamDto = exports.HlsVariantParamDto = exports.HlsSessionParamDto = void 0;
const openapi = require("@nestjs/swagger");
const nestjs_zod_1 = require("nestjs-zod");
const enum_1 = require("../enum");
const zod_1 = __importDefault(require("zod"));
const HlsSessionParamSchema = zod_1.default.object({
    id: zod_1.default.uuidv4(),
    sessionId: zod_1.default.uuidv4(),
});
class HlsSessionParamDto extends (0, nestjs_zod_1.createZodDto)(HlsSessionParamSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.HlsSessionParamDto = HlsSessionParamDto;
const HlsVariantParamSchema = zod_1.default.object({
    id: zod_1.default.uuidv4(),
    sessionId: zod_1.default.uuidv4(),
    variantIndex: zod_1.default.coerce.number().int().min(0),
});
class HlsVariantParamDto extends (0, nestjs_zod_1.createZodDto)(HlsVariantParamSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.HlsVariantParamDto = HlsVariantParamDto;
const HlsSegmentParamSchema = zod_1.default.object({
    id: zod_1.default.uuidv4(),
    sessionId: zod_1.default.uuidv4(),
    variantIndex: zod_1.default.coerce.number().int().min(0),
    filename: zod_1.default.string().regex(/^(init\.mp4|seg_\d+\.m4s)$/, { error: 'Invalid HLS segment filename' }),
});
class HlsSegmentParamDto extends (0, nestjs_zod_1.createZodDto)(HlsSegmentParamSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.HlsSegmentParamDto = HlsSegmentParamDto;
const HlsSegmentHeaderSchema = zod_1.default.object({
    [enum_1.ImmichHeader.HlsInitSegment]: zod_1.default.coerce.number().int().min(0).optional(),
});
class HlsSegmentHeaderDto extends (0, nestjs_zod_1.createZodDto)(HlsSegmentHeaderSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.HlsSegmentHeaderDto = HlsSegmentHeaderDto;
const HlsPlaylistHeaderSchema = zod_1.default.object({
    [enum_1.ImmichHeader.HlsPosition]: zod_1.default.coerce.number().min(0).optional(),
});
class HlsPlaylistHeaderDto extends (0, nestjs_zod_1.createZodDto)(HlsPlaylistHeaderSchema) {
    static _OPENAPI_METADATA_FACTORY() {
        return {};
    }
}
exports.HlsPlaylistHeaderDto = HlsPlaylistHeaderDto;
//# sourceMappingURL=streaming.dto.js.map