"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMediaStorageProvider = getMediaStorageProvider;
const file_s3_storage_provider_1 = require("./file-s3-storage-provider");
const file_storage_provider_1 = require("./file-storage-provider");
const create_media_storage_provider_metadata_dto_1 = require("../../dtos/create-media-storage-provider-metadata.dto");
async function getMediaStorageProvider(moduleRef, type) {
    switch (type) {
        case create_media_storage_provider_metadata_dto_1.MediaStorageProviderType.Filesystem:
            return await moduleRef.get(file_storage_provider_1.FileStorageProvider, { strict: false });
        case create_media_storage_provider_metadata_dto_1.MediaStorageProviderType.AwsS3:
            return await moduleRef.get(file_s3_storage_provider_1.FileS3StorageProvider, { strict: false });
        default:
            throw new Error(`Unknown media storage provider type ${type}`);
    }
}
//# sourceMappingURL=index.js.map