"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.uploadx = void 0;
const logger_1 = require("../helpers/logger");
const upload_1 = require("../helpers/upload");
const config_1 = require("../initializers/config");
const core_1 = require("@uploadx/core");
const logger = (0, logger_1.buildLogger)('uploadx');
const uploadx = new core_1.Uploadx({
    directory: (0, upload_1.getResumableUploadPath)(),
    expiration: { maxAge: undefined, rolling: true },
    maxMetadataSize: '10MB',
    logger: {
        logLevel: config_1.CONFIG.LOG.LEVEL,
        debug: logger.debug.bind(logger),
        info: logger.info.bind(logger),
        warn: logger.warn.bind(logger),
        error: logger.error.bind(logger)
    },
    userIdentifier: (_, res) => {
        if (!res.locals.oauth)
            return undefined;
        return res.locals.oauth.token.user.id + '';
    }
});
exports.uploadx = uploadx;
//# sourceMappingURL=uploadx.js.map