UNPKG

@platform/cell.client

Version:

A strongly typed HTTP client for operating with a CellOS service end-point.

25 lines (24 loc) 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.copyFiles = void 0; var tslib_1 = require("tslib"); var common_1 = require("../common"); function copyFiles(args) { return tslib_1.__awaiter(this, void 0, void 0, function () { var urls, http, changes, permission, files, body, url, res; return tslib_1.__generator(this, function (_a) { switch (_a.label) { case 0: urls = args.urls, http = args.http, changes = args.changes, permission = args.permission; files = Array.isArray(args.files) ? args.files : [args.files]; body = { files: files }; url = urls.files.copy.query({ changes: changes, 's3:permission': permission }); return [4, http.post(url.toString(), body)]; case 1: res = _a.sent(); return [2, common_1.util.fromHttpResponse(res).toClientResponse()]; } }); }); } exports.copyFiles = copyFiles;