add exports

This commit is contained in:
Philipp Kunz 2017-01-29 01:12:42 +01:00
parent f50403467f
commit f4dd3551bf
8 changed files with 20 additions and 20 deletions

12
dist/index.d.ts vendored
View File

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

5
dist/index.js vendored
View File

@ -8,7 +8,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
const smartrequest_request_1 = require("./smartrequest.request");
exports.request = smartrequest_request_1.request;
var smartrequest_request_2 = require("./smartrequest.request");
exports.request = smartrequest_request_2.request;
exports.get = (domainArg, optionsArg = {}) => __awaiter(this, void 0, void 0, function* () {
optionsArg.method = 'GET';
let response = yield smartrequest_request_1.request(domainArg, optionsArg);
@ -29,4 +30,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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1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UFDLENBQUEsQ0FBQTtBQUVVLFFBQUEsR0FBRyxHQUFHLENBQU8sU0FBaUIsRUFBRSxhQUE4QyxFQUFFO0lBQ3ZGLFVBQVUsQ0FBQyxNQUFNLEdBQUcsUUFBUSxDQUFBO0lBQzVCLElBQUksUUFBUSxHQUFHLE1BQU0sOEJBQU8sQ0FBQyxTQUFTLEVBQUUsVUFBVSxDQUFDLENBQUE7SUFDbkQsTUFBTSxDQUFDLFFBQVEsQ0FBQTtBQUNuQixDQUFDLENBQUEsQ0FBQSJ9

View File

@ -1,4 +1,4 @@
import * as https from 'https';
export interface SmartRequestOptions extends https.RequestOptions {
export interface ISmartRequestOptions extends https.RequestOptions {
requestBody?: any;
}

View File

@ -1,2 +1,2 @@
import * as interfaces from './smartrequest.interfaces';
export declare let request: (domainArg: string, optionsArg?: interfaces.SmartRequestOptions, streamArg?: boolean) => Promise<{}>;
export declare let request: (domainArg: string, optionsArg?: interfaces.ISmartRequestOptions, streamArg?: boolean) => Promise<{}>;

View File

@ -82,4 +82,4 @@ exports.request = (domainArg, optionsArg = {}, streamArg = false) => __awaiter(t
}
return done.promise;
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRyZXF1ZXN0LnJlcXVlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydHJlcXVlc3QucmVxdWVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7QUFDQSxrREFBaUQ7QUFHakQsSUFBSSxhQUFhLEdBQUcsQ0FBQyxXQUFXO0lBQzVCLElBQUksSUFBSSxHQUFHLE9BQU8sQ0FBQyxDQUFDLENBQUMsS0FBSyxFQUFFLENBQUE7SUFDNUIsdUNBQXVDO0lBQ3ZDLElBQUksSUFBSSxHQUFHLEVBQUUsQ0FBQztJQUNkLFdBQVcsQ0FBQyxFQUFFLENBQUMsTUFBTSxFQUFFLFVBQVUsUUFBUT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DLElBQUksQ0FBQyxDQUFDO2dCQUNKLGFBQWEsQ0FBQyxRQUFRLENBQUMsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFBO1lBQzlDLENBQUM7UUFDTCxDQUFDLENBQUMsQ0FBQTtRQUNGLEVBQUUsQ0FBQyxDQUFDLFVBQVUsQ0FBQyxXQUFXLENBQUMsQ0FBQyxDQUFDO1lBQ3pCLEVBQUUsQ0FBQSxDQUFDLE9BQU8sVUFBVSxDQUFDLFdBQVcsS0FBSyxRQUFRLENBQUMsQ0FBQyxDQUFDO2dCQUM1QyxVQUFVLENBQUMsV0FBVyxHQUFHLElBQUksQ0FBQyxTQUFTLENBQUMsVUFBVSxDQUFDLFdBQVcsQ0FBQyxDQUFBO1lBQ25FLENBQUM7WUFDRCxPQUFPLENBQUMsS0FBSyxDQUFDLFVBQVUsQ0FBQyxXQUFXLENBQUMsQ0FBQTtRQUN6QyxDQUFDO1FBQ0QsT0FBTyxDQUFDLEVBQUUsQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQUFDO1lBQ2xCLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDckIsQ0FBQyxDQUFDLENBQUE7UUFDRixPQUFPLENBQUMsR0FBRyxFQUFFLENBQUE7SUFDakIsQ0FBQztJQUFDLElBQUksQ0FBQyxDQUFDO1FBQ0osTUFBTSxJQUFJLEtBQUssQ0FBQyx5QkFBeUIsU0FBUyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUE7SUFDbEUsQ0FBQztJQUNELE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFBO0FBQ3ZCLENBQUMsQ0FBQSxDQUFBIn0=

View File

@ -6,29 +6,28 @@ import * as interfaces from './smartrequest.interfaces'
import { request } from './smartrequest.request'
export {
request
}
export { request } from './smartrequest.request'
export { ISmartRequestOptions } from './smartrequest.interfaces'
export let get = async (domainArg: string, optionsArg: interfaces.SmartRequestOptions = {}) => {
export let get = async (domainArg: string, optionsArg: interfaces.ISmartRequestOptions = {}) => {
optionsArg.method = 'GET'
let response = await request(domainArg, optionsArg)
return response
}
export let post = async (domainArg: string, optionsArg: interfaces.SmartRequestOptions = {}) => {
export let post = async (domainArg: string, optionsArg: interfaces.ISmartRequestOptions = {}) => {
optionsArg.method = 'POST'
let response = await request(domainArg, optionsArg)
return response
}
export let put = async (domainArg: string, optionsArg: interfaces.SmartRequestOptions = {}) => {
export let put = async (domainArg: string, optionsArg: interfaces.ISmartRequestOptions = {}) => {
optionsArg.method = 'PUT'
let response = await request(domainArg, optionsArg)
return response
}
export let del = async (domainArg: string, optionsArg: interfaces.SmartRequestOptions = {}) => {
export let del = async (domainArg: string, optionsArg: interfaces.ISmartRequestOptions = {}) => {
optionsArg.method = 'DELETE'
let response = await request(domainArg, optionsArg)
return response

View File

@ -1,6 +1,6 @@
import * as plugins from './smartrequest.plugins'
import * as https from 'https'
export interface SmartRequestOptions extends https.RequestOptions {
export interface ISmartRequestOptions extends https.RequestOptions {
requestBody?: any
}

View File

@ -20,7 +20,7 @@ let buildResponse = (responseArg): Promise<any> => {
return done.promise
}
export let request = async (domainArg: string, optionsArg: interfaces.SmartRequestOptions = {}, streamArg: boolean = false) => {
export let request = async (domainArg: string, optionsArg: interfaces.ISmartRequestOptions = {}, streamArg: boolean = false) => {
let done = plugins.q.defer()
let parsedUrl: plugins.url.Url
if (domainArg) {