"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const post_1 = __importDefault(require("lib/api/post"));
const path_1 = require("path");
async function copyPublicPath({ id, path, url, relativePath, src_project_id, target_project_id, }) {
    if (url) {
        await (0, post_1.default)("/projects/copy-url", {
            project_id: target_project_id,
            url,
            timeout: 30, // if big we do NOT want to allow copying something ridiculuos
        });
    }
    await (0, post_1.default)("/projects/copy-path", {
        src_project_id,
        url,
        target_project_id,
        path: (0, path_1.join)(path, relativePath),
        public_id: id,
        timeout: 30, // if big we do NOT want to allow copying something ridiculuos
    });
}
exports.default = copyPublicPath;
//# sourceMappingURL=copy-public-path.js.map