fix(getBinary): now returns correct response

This commit is contained in:
Philipp Kunz 2018-06-14 21:11:07 +02:00
parent 85a647cd10
commit a6920b18d4
3 changed files with 4 additions and 2 deletions

2
dist/index.d.ts vendored
View File

@ -3,7 +3,7 @@ import { extendedIncomingMessage } from './smartrequest.request';
export { request, extendedIncomingMessage } from './smartrequest.request';
export { ISmartRequestOptions } from './smartrequest.interfaces';
export declare let get: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise<extendedIncomingMessage>;
export declare let getBinary: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise<void>;
export declare let getBinary: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise<extendedIncomingMessage>;
export declare let post: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise<extendedIncomingMessage>;
export declare let put: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise<extendedIncomingMessage>;
export declare let del: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions) => Promise<extendedIncomingMessage>;

3
dist/index.js vendored
View File

@ -28,6 +28,7 @@ exports.getBinary = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void
const buffer = Buffer.concat(data);
response.body = buffer.toString('base64');
});
return response;
});
exports.post = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () {
optionsArg.method = 'POST';
@ -55,4 +56,4 @@ exports.del = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, fu
let response = yield smartrequest_request_1.request(domainArg, optionsArg);
return response;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBS0EsaUVBQTBFO0FBRTFFLCtEQUEwRTtBQUFqRSx5Q0FBQSxPQUFPLENBQUE7QUFHTCxRQUFBLEdBQUcsR0FB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ixDQUFDLENBQUEsQ0FBQztBQUVTLFFBQUEsR0FBRyxHQUFHLENBQU8sU0FBaUIsRUFBRSxhQUE4QyxFQUFFLEVBQUUsRUFBRTtJQUM3RixVQUFVLENBQUMsTUFBTSxHQUFHLFFBQVEsQ0FBQztJQUM3QixJQUFJLFFBQVEsR0FBRyxNQUFNLDhCQUFPLENBQUMsU0FBUyxFQUFFLFVBQVUsQ0FBQyxDQUFDO0lBQ3BELE9BQU8sUUFBUSxDQUFDO0FBQ2xCLENBQUMsQ0FBQSxDQUFDIn0=

View File

@ -27,6 +27,7 @@ export let getBinary = async (domainArg: string, optionsArg: interfaces.ISmartRe
const buffer = Buffer.concat(data);
response.body = buffer.toString('base64');
});
return response;
}
export let post = async (domainArg: string, optionsArg: interfaces.ISmartRequestOptions = {}) => {