From aaa2394b3698a04993b8feeae94f33668dafe137 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Mon, 16 Jul 2018 00:38:24 +0200 Subject: [PATCH] fix(core): clean --- dist/index.d.ts | 4 -- dist/index.js | 10 ---- dist/smartrequest.binaryrest.d.ts | 2 - dist/smartrequest.binaryrest.js | 30 ----------- dist/smartrequest.interfaces.d.ts | 5 -- dist/smartrequest.interfaces.js | 3 -- dist/smartrequest.jsonrest.d.ts | 10 ---- dist/smartrequest.jsonrest.js | 48 ----------------- dist/smartrequest.plugins.d.ts | 5 -- dist/smartrequest.plugins.js | 11 ---- dist/smartrequest.request.d.ts | 7 --- dist/smartrequest.request.js | 87 ------------------------------- test/test.ts | 4 +- 13 files changed, 3 insertions(+), 223 deletions(-) delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.js delete mode 100644 dist/smartrequest.binaryrest.d.ts delete mode 100644 dist/smartrequest.binaryrest.js delete mode 100644 dist/smartrequest.interfaces.d.ts delete mode 100644 dist/smartrequest.interfaces.js delete mode 100644 dist/smartrequest.jsonrest.d.ts delete mode 100644 dist/smartrequest.jsonrest.js delete mode 100644 dist/smartrequest.plugins.d.ts delete mode 100644 dist/smartrequest.plugins.js delete mode 100644 dist/smartrequest.request.d.ts delete mode 100644 dist/smartrequest.request.js diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 8e0f9b7..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export { request, extendedIncomingMessage } from './smartrequest.request'; -export { ISmartRequestOptions } from './smartrequest.interfaces'; -export * from './smartrequest.jsonrest'; -export * from './smartrequest.binaryrest'; diff --git a/dist/index.js b/dist/index.js deleted file mode 100644 index ecec7ab..0000000 --- a/dist/index.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -var smartrequest_request_1 = require("./smartrequest.request"); -exports.request = smartrequest_request_1.request; -__export(require("./smartrequest.jsonrest")); -__export(require("./smartrequest.binaryrest")); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLCtEQUEwRTtBQUFqRSx5Q0FBQSxPQUFPLENBQUE7QUFHaEIsNkNBQXdDO0FBQ3hDLCtDQUEwQyJ9 \ No newline at end of file diff --git a/dist/smartrequest.binaryrest.d.ts b/dist/smartrequest.binaryrest.d.ts deleted file mode 100644 index 2ab2864..0000000 --- a/dist/smartrequest.binaryrest.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as interfaces from './smartrequest.interfaces'; -export declare const getBinary: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise; diff --git a/dist/smartrequest.binaryrest.js b/dist/smartrequest.binaryrest.js deleted file mode 100644 index ee2abdd..0000000 --- a/dist/smartrequest.binaryrest.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const smartrequest_request_1 = require("./smartrequest.request"); -const plugins = require("./smartrequest.plugins"); -exports.getBinary = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () { - const done = plugins.smartq.defer(); - const response = yield smartrequest_request_1.request(domainArg, optionsArg, true); - const data = []; - response.on('data', function (chunk) { - data.push(chunk); - }).on('end', function () { - //at this point data is an array of Buffers - //so Buffer.concat() can make us a new Buffer - //of all of them together - const buffer = Buffer.concat(data); - response.body = buffer.toString('binary'); - done.resolve(); - }); - yield done.promise; - return response; -}); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyZXF1ZXN0LmJpbmFyeXJlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHJlcXVlc3QuYmluYXJ5cmVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBRUEsaUVBQWlEO0FBRWpELGtEQUFrRDtBQUVyQyxRQUFBLFNBQVMsR0FBRyxDQUFPLFNBQWlCLEVBQUUsYUFBOEMsRUFBRSxFQUFFLEVBQUU7SUFDckcsTUFBTSxJQUFJLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQUUsQ0FBQztJQUNwQyxNQUFNLFFBQVEsR0FBRyxNQUFNLDhCQUFPLENBQUMsU0FBUyxFQUFFLFVBQVUsRUFBRSxJQUFJLENBQUMsQ0FBQztJQUM1RCxNQUFNLElBQUksR0FBRyxFQUFFLENBQUM7SUFFaEIsUUFBUSxDQUFDLEVBQUUsQ0FBQyxNQUFNLEVBQUUsVUFBUyxLQUFLO1FBQzlCLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDckIsQ0FBQyxDQUFDLENBQUMsRUFBRSxDQUFDLEtBQUssRUFBRTtRQUNULDJDQUEyQztRQUMzQyw2Q0FBNkM7UUFDN0MseUJBQXlCO1FBQ3pCLE1BQU0sTUFBTSxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDbkMsUUFBUSxDQUFDLElBQUksR0FBRyxNQUFNLENBQUMsUUFBUSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQzFDLElBQUksQ0FBQyxPQUFPLEVBQUUsQ0FBQztJQUNuQixDQUFDLENBQUMsQ0FBQztJQUNILE1BQU0sSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUNuQixPQUFPLFFBQVEsQ0FBQztBQUNsQixDQUFDLENBQUEsQ0FBQSJ9 \ No newline at end of file diff --git a/dist/smartrequest.interfaces.d.ts b/dist/smartrequest.interfaces.d.ts deleted file mode 100644 index 287ccf9..0000000 --- a/dist/smartrequest.interfaces.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -import * as https from 'https'; -export interface ISmartRequestOptions extends https.RequestOptions { - requestBody?: any; -} diff --git a/dist/smartrequest.interfaces.js b/dist/smartrequest.interfaces.js deleted file mode 100644 index 6a06697..0000000 --- a/dist/smartrequest.interfaces.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyZXF1ZXN0LmludGVyZmFjZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHJlcXVlc3QuaW50ZXJmYWNlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0= \ No newline at end of file diff --git a/dist/smartrequest.jsonrest.d.ts b/dist/smartrequest.jsonrest.d.ts deleted file mode 100644 index 25a0955..0000000 --- a/dist/smartrequest.jsonrest.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as interfaces from './smartrequest.interfaces'; -/** - * gets Json and puts the right headers + handles response aggregation - * @param domainArg - * @param optionsArg - */ -export declare const getJson: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise; -export declare const postJson: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise; -export declare const putJson: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise; -export declare const delJson: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise; diff --git a/dist/smartrequest.jsonrest.js b/dist/smartrequest.jsonrest.js deleted file mode 100644 index 4d797ca..0000000 --- a/dist/smartrequest.jsonrest.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -// This file implements methods to get and post JSON in a simple manner. -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const smartrequest_request_1 = require("./smartrequest.request"); -/** - * gets Json and puts the right headers + handles response aggregation - * @param domainArg - * @param optionsArg - */ -exports.getJson = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () { - optionsArg.method = 'GET'; - optionsArg.headers = Object.assign({}, optionsArg.headers); - let response = yield smartrequest_request_1.request(domainArg, optionsArg); - return response; -}); -exports.postJson = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () { - optionsArg.method = 'POST'; - if (typeof optionsArg.requestBody === 'object' && - (!optionsArg.headers || !optionsArg.headers['Content-Type'])) { - // make sure headers exist - if (!optionsArg.headers) { - optionsArg.headers = {}; - } - // assign the right Content-Type, leaving all other headers in place - optionsArg.headers = Object.assign({}, optionsArg.headers, { 'Content-Type': 'application/json' }); - } - let response = yield smartrequest_request_1.request(domainArg, optionsArg); - return response; -}); -exports.putJson = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () { - optionsArg.method = 'PUT'; - let response = yield smartrequest_request_1.request(domainArg, optionsArg); - return response; -}); -exports.delJson = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () { - optionsArg.method = 'DELETE'; - let response = yield smartrequest_request_1.request(domainArg, optionsArg); - return response; -}); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJz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FDLE9BQU8sSUFDckIsY0FBYyxFQUFFLGtCQUFrQixHQUNuQyxDQUFDO0tBQ0g7SUFDRCxJQUFJLFFBQVEsR0FBRyxNQUFNLDhCQUFPLENBQUMsU0FBUyxFQUFFLFVBQVUsQ0FBQyxDQUFDO0lBQ3BELE9BQU8sUUFBUSxDQUFDO0FBQ2xCLENBQUMsQ0FBQSxDQUFDO0FBRVcsUUFBQSxPQUFPLEdBQUcsQ0FBTyxTQUFpQixFQUFFLGFBQThDLEVBQUUsRUFBRSxFQUFFO0lBQ25HLFVBQVUsQ0FBQyxNQUFNLEdBQUcsS0FBSyxDQUFDO0lBQzFCLElBQUksUUFBUSxHQUFHLE1BQU0sOEJBQU8sQ0FBQyxTQUFTLEVBQUUsVUFBVSxDQUFDLENBQUM7SUFDcEQsT0FBTyxRQUFRLENBQUM7QUFDbEIsQ0FBQyxDQUFBLENBQUM7QUFFVyxRQUFBLE9BQU8sR0FBRyxDQUFPLFNBQWlCLEVBQUUsYUFBOEMsRUFBRSxFQUFFLEVBQUU7SUFDbkcsVUFBVSxDQUFDLE1BQU0sR0FBRyxRQUFRLENBQUM7SUFDN0IsSUFBSSxRQUFRLEdBQUcsTUFBTSw4QkFBTyxDQUFDLFNBQVMsRUFBRSxVQUFVLENBQUMsQ0FBQztJQUNwRCxPQUFPLFFBQVEsQ0FBQztBQUNsQixDQUFDLENBQUEsQ0FBQyJ9 \ No newline at end of file diff --git a/dist/smartrequest.plugins.d.ts b/dist/smartrequest.plugins.d.ts deleted file mode 100644 index c5d9ff5..0000000 --- a/dist/smartrequest.plugins.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import * as url from 'url'; -import * as http from 'http'; -import * as https from 'https'; -import * as smartq from 'smartq'; -export { url, http, https, smartq }; diff --git a/dist/smartrequest.plugins.js b/dist/smartrequest.plugins.js deleted file mode 100644 index e91881c..0000000 --- a/dist/smartrequest.plugins.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const url = require("url"); -exports.url = url; -const http = require("http"); -exports.http = http; -const https = require("https"); -exports.https = https; -const smartq = require("smartq"); -exports.smartq = smartq; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyZXF1ZXN0LnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHJlcXVlc3QucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLDJCQUEyQjtBQU1sQixrQkFBRztBQUxaLDZCQUE2QjtBQUtmLG9CQUFJO0FBSmxCLCtCQUErQjtBQUlYLHNCQUFLO0FBRnpCLGlDQUFpQztBQUVOLHdCQUFNIn0= \ No newline at end of file diff --git a/dist/smartrequest.request.d.ts b/dist/smartrequest.request.d.ts deleted file mode 100644 index 757bffe..0000000 --- a/dist/smartrequest.request.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import * as interfaces from './smartrequest.interfaces'; -import { IncomingMessage } from 'http'; -export interface extendedIncomingMessage extends IncomingMessage { - body: any; -} -export declare let request: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions, streamArg?: boolean) => Promise; diff --git a/dist/smartrequest.request.js b/dist/smartrequest.request.js deleted file mode 100644 index 0d69362..0000000 --- a/dist/smartrequest.request.js +++ /dev/null @@ -1,87 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const plugins = require("./smartrequest.plugins"); -; -let buildResponse = (incomingMessageArg) => { - let done = plugins.smartq.defer(); - // Continuously update stream with data - let body = ''; - incomingMessageArg.on('data', function (chunkArg) { - body += chunkArg; - }); - incomingMessageArg.on('end', function () { - try { - incomingMessageArg.body = JSON.parse(body); - } - catch (err) { - incomingMessageArg.body = body; - } - done.resolve(incomingMessageArg); - }); - return done.promise; -}; -exports.request = (domainArg, optionsArg = {}, streamArg = false) => __awaiter(this, void 0, void 0, function* () { - let done = plugins.smartq.defer(); - let parsedUrl; - if (domainArg) { - parsedUrl = plugins.url.parse(domainArg); - optionsArg.hostname = parsedUrl.hostname; - if (parsedUrl.port) { - optionsArg.port = parseInt(parsedUrl.port); - } - optionsArg.path = parsedUrl.path; - } - if (!parsedUrl || parsedUrl.protocol === 'https:') { - let request = plugins.https.request(optionsArg, response => { - if (streamArg) { - done.resolve(response); - } - else { - buildResponse(response).then(done.resolve); - } - }); - if (optionsArg.requestBody) { - if (typeof optionsArg.requestBody !== 'string') { - optionsArg.requestBody = JSON.stringify(optionsArg.requestBody); - } - request.write(optionsArg.requestBody); - } - request.on('error', e => { - console.error(e); - }); - request.end(); - } - else if (parsedUrl.protocol === 'http:') { - let request = plugins.http.request(optionsArg, response => { - if (streamArg) { - done.resolve(response); - } - else { - buildResponse(response).then(done.resolve); - } - }); - if (optionsArg.requestBody) { - if (typeof optionsArg.requestBody !== 'string') { - optionsArg.requestBody = JSON.stringify(optionsArg.requestBody); - } - request.write(optionsArg.requestBody); - } - request.on('error', e => { - console.error(e); - }); - request.end(); - } - else { - throw new Error(`unsupported protocol: ${parsedUrl.protocol}`); - } - return done.promise; -}); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyZXF1ZXN0LnJlcXVlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHJlcXVlc3QucmVxdWVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQ0Esa0RBQWtEO0F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UFDdEIsQ0FBQyxDQUFBLENBQUMifQ== \ No newline at end of file diff --git a/test/test.ts b/test/test.ts index 17a1613..0899f0a 100644 --- a/test/test.ts +++ b/test/test.ts @@ -22,6 +22,8 @@ tap.test('should post a JSON document over http', async () => { .equal('fa4c6baa0812e5b5c80ed8885e55a8a6'); }); -tap.test('should deal with unix socks', async () => {}); +tap.test('should deal with unix socks', async () => { + await expect(smartrequest.request('http://unix:/var/run/docker.sock:/containers')) +}); tap.start();