-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
88 lines (68 loc) · 3.13 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/**
*
* Package: request-apis
* Author: Ganesh B
* Description:
* Install: npm i request-apis --save
* Github: https://github.com/ganeshkbhat/apis-require
* npmjs Link: https://www.npmjs.com/package/request-apis
* File: index.js
* File Description:
*
*
*/
/* eslint no-console: 0 */
'use strict';
const {
_isValidURL, _getProtocol, _checkHttpsProtocol,
isValidURL, getProtocol, checkHttpsProtocol,
_fetch, _getRequireOrImport,
_optionsRequest, _deleteRequest, _getRequest, _postRequest, _putRequest, _patchRequest, _request,
optionsRequest, deleteRequest, getRequest, postRequest, putRequest, patchRequest, request,
options, del, get, post, put, patch,
textResponseTransformer, jsonResponseTransformer, xmlResponseTransformer,
ymlResponseTransformer, iniResponseTransformer,
csvResponseTransformer, dotenvResponseTransformer
} = require("./src/requests.js");
const { CONTENT_TYPE } = require("./src/constants/content_types");
const { PROTOCOLS, PROTOCOL_NODE_MODULES } = require("./src/constants/http_protocols");
const { REQUEST_HEADERS, REQUEST_HEADERS_CATEGORIZED } = require("./src/constants/http_request_headers");
const { RESPONSE_HEADERS, RESPONSE_HEADERS_CATEGORIZED } = require("./src/constants/http_response_headers");
// Make requests
module.exports._deleteRequest = _deleteRequest;
module.exports._getRequest = _getRequest;
module.exports._postRequest = _postRequest;
module.exports._putRequest = _putRequest;
module.exports._patchRequest = _patchRequest;
module.exports._optionsRequest = _optionsRequest;
module.exports._request = _request;
module.exports.deleteRequest = deleteRequest;
module.exports.getRequest = getRequest;
module.exports.postRequest = postRequest;
module.exports.putRequest = putRequest;
module.exports.patchRequest = patchRequest;
module.exports.optionsRequest = optionsRequest;
module.exports.request = request;
module.exports.del = del;
module.exports.get = get;
module.exports.post = post;
module.exports.put = put;
module.exports.patch = patch;
module.exports.options = options;
// Make http checks
module.exports._isValidURL = _isValidURL;
module.exports._getProtocol = _getProtocol;
module.exports._checkHttpsProtocol = _checkHttpsProtocol;
module.exports.isValidURL = isValidURL;
module.exports.getProtocol = getProtocol;
module.exports.checkHttpsProtocol = checkHttpsProtocol;
module.exports._fetch = _fetch;
module.exports._getRequireOrImport = _getRequireOrImport;
module.exports.textResponseTransformer = textResponseTransformer;
module.exports.jsonResponseTransformer = jsonResponseTransformer;
module.exports.xmlResponseTransformer = xmlResponseTransformer;
module.exports.ymlResponseTransformer = ymlResponseTransformer;
module.exports.iniResponseTransformer = iniResponseTransformer;
module.exports.csvResponseTransformer = csvResponseTransformer;
module.exports.dotenvResponseTransformer = dotenvResponseTransformer;
module.exports.constants = { CONTENT_TYPE, PROTOCOLS, PROTOCOL_NODE_MODULES, REQUEST_HEADERS, REQUEST_HEADERS_CATEGORIZED, RESPONSE_HEADERS, RESPONSE_HEADERS_CATEGORIZED };