@meteor-it/xrest
Advanced tools
Comparing version 1.3.37 to 1.3.39
@@ -1,6 +0,11 @@ | ||
import path from 'path'; | ||
import { open, read } from '@meteor-it/fs'; | ||
const { basename } = path; | ||
export const DEFAULT_BOUNDARY = 'ce47607d67d74a658a058ba6697de227'; | ||
export class File { | ||
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const path_1 = __importDefault(require("path")); | ||
const fs_1 = require("@meteor-it/fs"); | ||
const { basename } = path_1.default; | ||
exports.DEFAULT_BOUNDARY = 'ce47607d67d74a658a058ba6697de227'; | ||
class File { | ||
constructor(path, filename, fileSize, encoding = 'binary', contentType = 'application/octet-stream') { | ||
@@ -14,3 +19,4 @@ this.path = path; | ||
} | ||
export class FileStream { | ||
exports.File = File; | ||
class FileStream { | ||
constructor(stream, filename, dataLength, encoding = 'binary', contentType = 'application/octet-stream') { | ||
@@ -24,3 +30,4 @@ this.stream = stream; | ||
} | ||
export class Part { | ||
exports.FileStream = FileStream; | ||
class Part { | ||
constructor(name, value, boundary) { | ||
@@ -69,3 +76,3 @@ this.name = name; | ||
if (this.value instanceof File) { | ||
let fd = await open(this.value.path, 'r', '0666'); | ||
let fd = await fs_1.open(this.value.path, 'r', '0666'); | ||
let position = 0; | ||
@@ -75,3 +82,3 @@ let moreData = true; | ||
let chunk = new Buffer(4096); | ||
await read(fd, chunk, 0, 4096, position); | ||
await fs_1.read(fd, chunk, 0, 4096, position); | ||
stream.write(chunk); | ||
@@ -106,4 +113,5 @@ position += 4096; | ||
} | ||
export class MultiPartRequest { | ||
constructor(encoding = 'binary', data, boundary = DEFAULT_BOUNDARY) { | ||
exports.Part = Part; | ||
class MultiPartRequest { | ||
constructor(encoding = 'binary', data, boundary = exports.DEFAULT_BOUNDARY) { | ||
this.encoding = encoding; | ||
@@ -137,3 +145,4 @@ this.boundary = boundary; | ||
} | ||
export function sizeOf(parts, boundary = DEFAULT_BOUNDARY) { | ||
exports.MultiPartRequest = MultiPartRequest; | ||
function sizeOf(parts, boundary = exports.DEFAULT_BOUNDARY) { | ||
let totalSize = 0; | ||
@@ -144,3 +153,4 @@ for (let name in parts) | ||
} | ||
export async function write(encoding = 'binary', stream, data, boundary = DEFAULT_BOUNDARY) { | ||
exports.sizeOf = sizeOf; | ||
async function write(encoding = 'binary', stream, data, boundary = exports.DEFAULT_BOUNDARY) { | ||
let multiPartRequest = new MultiPartRequest(encoding, data, boundary); | ||
@@ -150,3 +160,4 @@ await multiPartRequest.write(stream); | ||
} | ||
exports.write = write; | ||
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInhyZXN0L211bHRpcGFydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLElBQUksTUFBTSxNQUFNLENBQUM7QUFDeEIsT0FBTyxFQUFFLElBQUksRUFBRSxJQUFJLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFHM0MsTUFBTSxFQUFFLFFBQVEsRUFBRSxHQUFHLElBQUksQ0FBQztBQUUxQixNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRyxrQ0FBa0MsQ0FBQztBQUNuRSxNQUFNLE9BQU8sSUFBSTtJQU9iLFlBQVksSUFBWSxFQUFFLFFBQXVCLEVBQUUsUUFBZ0IsRUFBRSxXQUFtQixRQUFRLEVBQUUsY0FBc0IsMEJBQTBCO1FBQzlJLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1FBQ2pCLElBQUksQ0FBQyxRQUFRLEdBQUcsUUFBUSxJQUFJLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUMzQyxJQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztRQUN6QixJQUFJLENBQUMsUUFBUSxHQUFHLFFBQVEsQ0FBQztRQUN6QixJQUFJLENBQUMs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NpemUgKyB0aGlzLmhlYWRlcigpLmxlbmd0aCArIDI7XG4gICAgfVxuXG4gICAgLy8gV3JpdGVzIHRoZSBQYXJ0IG91dCB0byBhIHdyaXRhYmxlIHN0cmVhbSB0aGF0IHN1cHBvcnRzIHRoZSB3cml0ZShkYXRhKSBtZXRob2RcbiAgICB3cml0ZShzdHJlYW06IFdyaXRhYmxlU3RyZWFtKTogUHJvbWlzZTx2b2lkPiB7XG4gICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShhc3luYyAocmVzb2x2ZSkgPT4ge1xuICAgICAgICAgICAgLy9maXJzdCB3cml0ZSB0aGUgQ29udGVudC1EaXNwb3NpdGlvblxuICAgICAgICAgICAgc3RyZWFtLndyaXRlKHRoaXMuaGVhZGVyKCkpO1xuXG4gICAgICAgICAgICAvL05vdyB3cml0ZSBvdXQgdGhlIGJvZHkgb2YgdGhlIFBhcnRcbiAgICAgICAgICAgIGlmICh0aGlzLnZhbHVlIGluc3RhbmNlb2YgRmlsZSkge1xuICAgICAgICAgICAgICAgIGxldCBmZCA9IGF3YWl0IG9wZW4odGhpcy52YWx1ZS5wYXRoLCAncicsICcwNjY2Jyk7XG4gICAgICAgICAgICAgICAgbGV0IHBvc2l0aW9uID0gMDtcbiAgICAgICAgICAgICAgICBsZXQgbW9yZURhdGEgPSB0cnVlO1xuICAgICAgICAgICAgICAgIHdoaWxlIChtb3JlRGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBsZXQgY2h1bmsgPSBuZXcgQnVmZmVyKDQwOTYpO1xuICAgICAgICAgICAgICAgICAgICBhd2FpdCByZWFkKGZkLCBjaHVuaywgMCwgNDA5NiwgcG9zaXRpb24pO1xuICAgICAgICAgICAgICAgICAgICBzdHJlYW0ud3JpdGUoY2h1bmspO1xuICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiArPSA0MDk2O1xuICAgICAgICAgICAgICAgICAgICBpZiAoY2h1bmspIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vcmVEYXRhID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbS53cml0ZSgnXFxyXFxuJyk7XG4gICAgICAgICAgICAgICAgICAgICAgICBhd2FpdCBmZC5jbG9zZSgpO1xuICAgICAgICAgICAgICAgICAgICAgICAgbW9yZURhdGEgPSBmYWxzZTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSBpZiAodGhpcy52YWx1ZSBpbnN0YW5jZW9mIEZpbGVTdHJlYW0pIHtcbiAgICAgICAgICAgICAgICB0aGlzLnZhbHVlLnN0cmVhbS5vbignZW5kJywgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBzdHJlYW0ud3JpdGUoJ1xcclxcbicpO1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICB0aGlzLnZhbHVlLnN0cmVhbS5waXBlKHN0cmVhbSwge1xuICAgICAgICAgICAgICAgICAgICBlbmQ6IGZhbHNlIC8vIERvIG5vdCBlbmQgd3JpdGluZyBzdHJlYW1zLCBtYXkgYmUgdGhlcmUgaXMgbW9yZSBkYXRhIGluY29taW5nXG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIHN0cmVhbS53cml0ZShgJHt0aGlzLnZhbHVlfVxcclxcbmApO1xuICAgICAgICAgICAgICAgIHJlc29sdmUoKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSlcbiAgICB9XG59XG5cbmV4cG9ydCB0eXBlIElNdWx0aVBhcnREYXRhID0geyBba2V5OiBzdHJpbmddOiBJUGFydERhdGEgfTtcbmV4cG9ydCBjbGFzcyBNdW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ZVN0cmVhbSk6IFByb21pc2U8dm9pZD4ge1xuICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoYXN5bmMgKHJlc29sdmUpID0+IHtcbiAgICAgICAgICAgIC8vZmlyc3Qgd3JpdGUgdGhlIENvbnRlbnQtRGlzcG9zaXRpb25cbiAgICAgICAgICAgIHN0cmVhbS53cml0ZSh0aGlzLmhlYWRlcigpKTtcblxuICAgICAgICAgICAgLy9Ob3cgd3JpdGUgb3V0IHRoZSBib2R5IG9mIHRoZSBQYXJ0XG4gICAgICAgICAgICBpZiAodGhpcy52YWx1ZSBpbnN0YW5jZW9mIEZpbGUpIHtcbiAgICAgICAgICAgICAgICBsZXQgZmQgPSBhd2FpdCBvcGVuKHRoaXMudmFsdWUucGF0aCwgJ3InLCAnMDY2NicpO1xuICAgICAgICAgICAgICAgIGxldCBwb3NpdGlvbiA9IDA7XG4gICAgICAgICAgICAgICAgbGV0IG1vcmVEYXRhID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICB3aGlsZSAobW9yZURhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGNodW5rID0gbmV3IEJ1ZmZlcig0MDk2KTtcbiAgICAgICAgICAgICAgICAgICAgYXdhaXQgcmVhZChmZCwgY2h1bmssIDAsIDQwOTYsIHBvc2l0aW9uKTtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLndyaXRlKGNodW5rKTtcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gKz0gNDA5NjtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGNodW5rKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBtb3JlRGF0YSA9IHRydWU7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0ud3JpdGUoJ1xcclxcbicpO1xuICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgZmQuY2xvc2UoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIG1vcmVEYXRhID0gZmFsc2U7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMudmFsdWUgaW5zdGFuY2VvZiBGaWxlU3RyZWFtKSB7XG4gICAgICAgICAgICAgICAgdGhpcy52YWx1ZS5zdHJlYW0ub24oJ2VuZCcsICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgc3RyZWFtLndyaXRlKCdcXHJcXG4nKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgdGhpcy52YWx1ZS5zdHJlYW0ucGlwZShzdHJlYW0sIHtcbiAgICAgICAgICAgICAgICAgICAgZW5kOiBmYWxzZSAvLyBEbyBub3QgZW5kIHdyaXRpbmcgc3RyZWFtcywgbWF5IGJlIHRoZXJlIGlzIG1vcmUgZGF0YSBpbmNvbWluZ1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBzdHJlYW0ud3JpdGUoYCR7dGhpcy52YWx1ZX1cXHJcXG5gKTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pXG4gICAgfVxufVxuXG5leHBvcnQgdHlwZSBJTXVsdGlQYXJ0RGF0YSA9IHsgW2tleTogc3RyaW5nXTogSVBhcnREYXRhIH07XG5leHBvcnQgY2xhc3MgTXVsdGlQYXJ0UmVxdWVzdCB7XG4gICAgZW5jb2Rpbmc6IHN0cmluZztcbiAgICBib3VuZGFyeTogc3RyaW5nO1xuICAgIGRhdGE6IElNdWx0aVBhcnREYXRhO1xuICAgIHByaXZhdGUgX3BhcnROYW1lczogc3RyaW5nW107XG5cbiAgICBjb25zdHJ1Y3R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||
return multiPartRequest; | ||
} | ||
} |
{ | ||
"name": "@meteor-it/xrest", | ||
"version": "1.3.37", | ||
"version": "1.3.39", | ||
"description": "Powerfull REST client library", | ||
@@ -15,5 +15,5 @@ "module": "index.mjs", | ||
"dependencies": { | ||
"@meteor-it/fs": "^1.2.4", | ||
"@meteor-it/logger": "^2.3.27", | ||
"iconv-lite": "^0.4.23" | ||
"@meteor-it/fs": "^1.2.6", | ||
"@meteor-it/logger": "^2.3.29", | ||
"iconv-lite": "^0.4.24" | ||
}, | ||
@@ -24,3 +24,3 @@ "sideEffects": false, | ||
}, | ||
"gitHead": "0e43397d67a69c7e26d790f7edadb1e75e547a7d" | ||
"gitHead": "db571851dc50018d77598a58dda3d008c096c39d" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202851
2430
Updated@meteor-it/fs@^1.2.6
Updated@meteor-it/logger@^2.3.29
Updatediconv-lite@^0.4.24