Socket
Socket
Sign inDemoInstall

@platform/cell.client

Package Overview
Dependencies
6
Maintainers
1
Versions
271
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.39 to 0.0.40

48

lib/Client/ClientCellFiles.js

@@ -79,3 +79,6 @@ "use strict";

seconds: undefined,
files: files.map(function (item) { return ({ filename: item.filename }); }),
files: files.map(function (_a) {
var filename = _a.filename;
return ({ filename: filename });
}),
};

@@ -104,18 +107,35 @@ return [4, common_1.http.post(url, body)];

return tslib_1.__awaiter(_this, void 0, void 0, function () {
var props, contentType, form, headers, res, ok, status, uri, filename, expiresAt;
var url, uploadToS3, uploadToLocal, isLocal, res, ok, status, uri, filename, expiresAt;
var _this = this;
return tslib_1.__generator(this, function (_b) {
switch (_b.label) {
case 0:
props = upload.props;
contentType = upload.props['content-type'];
form = new common_1.FormData();
Object.keys(props)
.map(function (key) { return ({ key: key, value: props[key] }); })
.forEach(function (_a) {
var key = _a.key, value = _a.value;
return form.append(key, value);
});
form.append('file', data, { contentType: contentType });
headers = form.getHeaders();
return [4, common_1.http.post(upload.url, form, { headers: headers })];
url = upload.url;
uploadToS3 = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var props, contentType, form, headers;
return tslib_1.__generator(this, function (_a) {
props = upload.props;
contentType = props['content-type'];
form = new common_1.FormData();
Object.keys(props)
.map(function (key) { return ({ key: key, value: props[key] }); })
.forEach(function (_a) {
var key = _a.key, value = _a.value;
return form.append(key, value);
});
form.append('file', data, { contentType: contentType });
headers = form.getHeaders();
return [2, common_1.http.post(url, form, { headers: headers })];
});
}); };
uploadToLocal = function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var path, headers;
return tslib_1.__generator(this, function (_a) {
path = upload.props.key;
headers = { 'content-type': 'multipart/form-data', path: path };
return [2, common_1.http.post(url, data, { headers: headers })];
});
}); };
isLocal = url.startsWith('http://localhost');
return [4, (isLocal ? uploadToLocal() : uploadToS3())];
case 1:

@@ -122,0 +142,0 @@ res = _b.sent();

{
"name": "@platform/cell.client",
"version": "0.0.39",
"version": "0.0.40",
"description": "A strongly typed HTTP client for operating the REST service API.",

@@ -17,4 +17,4 @@ "main": "lib/index",

"dependencies": {
"@platform/cell.schema": "0.3.11",
"@platform/cell.types": "0.3.14",
"@platform/cell.schema": "0.3.12",
"@platform/cell.types": "0.3.15",
"@platform/http": "0.8.2",

@@ -21,0 +21,0 @@ "@platform/libs": "0.1.5",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc