"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../../Class/Functional");
const _ids_1 = require("../../../../../_ids");
class DownloadURL extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['url', 'name'],
            o: [],
        }, {}, system, _ids_1.ID_DOWNLOAD_URL);
    }
    async f({ url, name }, done) {
        const { api: { file: { downloadURL }, }, } = this.__system;
        try {
            await downloadURL({ url, name });
        }
        catch (err) {
            done(undefined, err.message);
            return;
        }
        done();
    }
}
exports.default = DownloadURL;
//# sourceMappingURL=index.js.map