@readme/httpsnippet 5.1.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/helpers/code-builder.js +1 -1
  2. package/dist/helpers/form-data.js +2 -2
  3. package/dist/helpers/headers.js +1 -1
  4. package/dist/helpers/reducer.js +1 -1
  5. package/dist/helpers/shell.js +1 -1
  6. package/dist/helpers/utils.js +1 -1
  7. package/dist/index.js +14 -25
  8. package/dist/targets/c/libcurl/client.js +3 -3
  9. package/dist/targets/c/target.js +4 -4
  10. package/dist/targets/clojure/clj_http/client.js +10 -7
  11. package/dist/targets/clojure/target.js +4 -4
  12. package/dist/targets/csharp/httpclient/client.js +4 -4
  13. package/dist/targets/csharp/restsharp/client.js +3 -3
  14. package/dist/targets/csharp/target.js +4 -4
  15. package/dist/targets/go/native/client.js +3 -3
  16. package/dist/targets/go/target.js +4 -4
  17. package/dist/targets/http/http1.1/client.js +3 -3
  18. package/dist/targets/http/target.js +4 -4
  19. package/dist/targets/java/asynchttp/client.js +3 -3
  20. package/dist/targets/java/nethttp/client.js +3 -3
  21. package/dist/targets/java/okhttp/client.js +3 -3
  22. package/dist/targets/java/target.js +4 -4
  23. package/dist/targets/java/unirest/client.js +3 -3
  24. package/dist/targets/javascript/axios/client.js +6 -6
  25. package/dist/targets/javascript/axios/fixtures/application-form-encoded.js +5 -4
  26. package/dist/targets/javascript/axios/fixtures/application-json.js +4 -3
  27. package/dist/targets/javascript/axios/fixtures/cookies.js +4 -3
  28. package/dist/targets/javascript/axios/fixtures/custom-method.js +4 -3
  29. package/dist/targets/javascript/axios/fixtures/full.js +5 -4
  30. package/dist/targets/javascript/axios/fixtures/headers.js +4 -3
  31. package/dist/targets/javascript/axios/fixtures/http-insecure.js +4 -3
  32. package/dist/targets/javascript/axios/fixtures/jsonObj-multiline.js +4 -3
  33. package/dist/targets/javascript/axios/fixtures/jsonObj-null-value.js +4 -3
  34. package/dist/targets/javascript/axios/fixtures/multipart-data.js +4 -3
  35. package/dist/targets/javascript/axios/fixtures/multipart-file.js +4 -3
  36. package/dist/targets/javascript/axios/fixtures/multipart-form-data-no-params.js +4 -3
  37. package/dist/targets/javascript/axios/fixtures/multipart-form-data.js +4 -3
  38. package/dist/targets/javascript/axios/fixtures/nested.js +4 -3
  39. package/dist/targets/javascript/axios/fixtures/postdata-malformed.js +4 -3
  40. package/dist/targets/javascript/axios/fixtures/query-encoded.js +4 -3
  41. package/dist/targets/javascript/axios/fixtures/query.js +4 -3
  42. package/dist/targets/javascript/axios/fixtures/short.js +4 -3
  43. package/dist/targets/javascript/axios/fixtures/text-plain.js +4 -3
  44. package/dist/targets/javascript/fetch/client.js +6 -6
  45. package/dist/targets/javascript/fetch/fixtures/application-form-encoded.d.ts +3 -3
  46. package/dist/targets/javascript/fetch/fixtures/application-form-encoded.js +2 -1
  47. package/dist/targets/javascript/fetch/fixtures/application-json.d.ts +3 -3
  48. package/dist/targets/javascript/fetch/fixtures/application-json.js +2 -1
  49. package/dist/targets/javascript/fetch/fixtures/cookies.d.ts +2 -2
  50. package/dist/targets/javascript/fetch/fixtures/cookies.js +2 -1
  51. package/dist/targets/javascript/fetch/fixtures/custom-method.d.ts +1 -1
  52. package/dist/targets/javascript/fetch/fixtures/custom-method.js +2 -1
  53. package/dist/targets/javascript/fetch/fixtures/full.d.ts +3 -3
  54. package/dist/targets/javascript/fetch/fixtures/full.js +2 -1
  55. package/dist/targets/javascript/fetch/fixtures/headers.d.ts +2 -2
  56. package/dist/targets/javascript/fetch/fixtures/headers.js +2 -1
  57. package/dist/targets/javascript/fetch/fixtures/http-insecure.d.ts +1 -1
  58. package/dist/targets/javascript/fetch/fixtures/http-insecure.js +2 -1
  59. package/dist/targets/javascript/fetch/fixtures/jsonObj-multiline.d.ts +3 -3
  60. package/dist/targets/javascript/fetch/fixtures/jsonObj-multiline.js +2 -1
  61. package/dist/targets/javascript/fetch/fixtures/jsonObj-null-value.d.ts +3 -3
  62. package/dist/targets/javascript/fetch/fixtures/jsonObj-null-value.js +2 -1
  63. package/dist/targets/javascript/fetch/fixtures/multipart-data.js +2 -1
  64. package/dist/targets/javascript/fetch/fixtures/multipart-file.d.ts +1 -1
  65. package/dist/targets/javascript/fetch/fixtures/multipart-file.js +2 -1
  66. package/dist/targets/javascript/fetch/fixtures/multipart-form-data-no-params.d.ts +2 -2
  67. package/dist/targets/javascript/fetch/fixtures/multipart-form-data-no-params.js +2 -1
  68. package/dist/targets/javascript/fetch/fixtures/multipart-form-data.d.ts +1 -1
  69. package/dist/targets/javascript/fetch/fixtures/multipart-form-data.js +2 -1
  70. package/dist/targets/javascript/fetch/fixtures/nested.d.ts +1 -1
  71. package/dist/targets/javascript/fetch/fixtures/nested.js +2 -1
  72. package/dist/targets/javascript/fetch/fixtures/postdata-malformed.d.ts +2 -2
  73. package/dist/targets/javascript/fetch/fixtures/postdata-malformed.js +2 -1
  74. package/dist/targets/javascript/fetch/fixtures/query-encoded.d.ts +1 -1
  75. package/dist/targets/javascript/fetch/fixtures/query-encoded.js +2 -1
  76. package/dist/targets/javascript/fetch/fixtures/query.d.ts +1 -1
  77. package/dist/targets/javascript/fetch/fixtures/query.js +2 -1
  78. package/dist/targets/javascript/fetch/fixtures/short.d.ts +1 -1
  79. package/dist/targets/javascript/fetch/fixtures/short.js +2 -1
  80. package/dist/targets/javascript/fetch/fixtures/text-plain.d.ts +3 -3
  81. package/dist/targets/javascript/fetch/fixtures/text-plain.js +2 -1
  82. package/dist/targets/javascript/jquery/client.js +5 -5
  83. package/dist/targets/javascript/jquery/fixtures/application-form-encoded.d.ts +7 -7
  84. package/dist/targets/javascript/jquery/fixtures/application-json.d.ts +7 -7
  85. package/dist/targets/javascript/jquery/fixtures/cookies.d.ts +5 -5
  86. package/dist/targets/javascript/jquery/fixtures/custom-method.d.ts +5 -5
  87. package/dist/targets/javascript/jquery/fixtures/full.d.ts +6 -6
  88. package/dist/targets/javascript/jquery/fixtures/headers.d.ts +5 -5
  89. package/dist/targets/javascript/jquery/fixtures/http-insecure.d.ts +5 -5
  90. package/dist/targets/javascript/jquery/fixtures/jsonObj-multiline.d.ts +7 -7
  91. package/dist/targets/javascript/jquery/fixtures/jsonObj-null-value.d.ts +7 -7
  92. package/dist/targets/javascript/jquery/fixtures/multipart-data.d.ts +9 -9
  93. package/dist/targets/javascript/jquery/fixtures/multipart-file.d.ts +9 -9
  94. package/dist/targets/javascript/jquery/fixtures/multipart-form-data-no-params.d.ts +5 -5
  95. package/dist/targets/javascript/jquery/fixtures/multipart-form-data.d.ts +9 -9
  96. package/dist/targets/javascript/jquery/fixtures/nested.d.ts +5 -5
  97. package/dist/targets/javascript/jquery/fixtures/postdata-malformed.d.ts +5 -5
  98. package/dist/targets/javascript/jquery/fixtures/query-encoded.d.ts +5 -5
  99. package/dist/targets/javascript/jquery/fixtures/query.d.ts +5 -5
  100. package/dist/targets/javascript/jquery/fixtures/short.d.ts +5 -5
  101. package/dist/targets/javascript/jquery/fixtures/text-plain.d.ts +6 -6
  102. package/dist/targets/javascript/target.js +4 -4
  103. package/dist/targets/javascript/xhr/client.js +5 -5
  104. package/dist/targets/kotlin/okhttp/client.js +3 -3
  105. package/dist/targets/kotlin/target.js +4 -4
  106. package/dist/targets/node/axios/client.js +5 -5
  107. package/dist/targets/node/axios/fixtures/application-form-encoded.js +3 -2
  108. package/dist/targets/node/axios/fixtures/application-json.js +2 -1
  109. package/dist/targets/node/axios/fixtures/cookies.js +2 -1
  110. package/dist/targets/node/axios/fixtures/custom-method.js +2 -1
  111. package/dist/targets/node/axios/fixtures/full.js +3 -2
  112. package/dist/targets/node/axios/fixtures/headers.js +2 -1
  113. package/dist/targets/node/axios/fixtures/http-insecure.js +2 -1
  114. package/dist/targets/node/axios/fixtures/jsonObj-multiline.js +2 -1
  115. package/dist/targets/node/axios/fixtures/jsonObj-null-value.js +2 -1
  116. package/dist/targets/node/axios/fixtures/multipart-data.js +2 -1
  117. package/dist/targets/node/axios/fixtures/multipart-file.js +2 -1
  118. package/dist/targets/node/axios/fixtures/multipart-form-data-no-params.js +2 -1
  119. package/dist/targets/node/axios/fixtures/multipart-form-data.js +2 -1
  120. package/dist/targets/node/axios/fixtures/nested.js +2 -1
  121. package/dist/targets/node/axios/fixtures/postdata-malformed.js +2 -1
  122. package/dist/targets/node/axios/fixtures/query-encoded.js +2 -1
  123. package/dist/targets/node/axios/fixtures/query.js +2 -1
  124. package/dist/targets/node/axios/fixtures/short.js +2 -1
  125. package/dist/targets/node/axios/fixtures/text-plain.js +2 -1
  126. package/dist/targets/node/fetch/client.js +6 -6
  127. package/dist/targets/node/fetch/fixtures/application-form-encoded.js +2 -1
  128. package/dist/targets/node/fetch/fixtures/application-json.js +2 -1
  129. package/dist/targets/node/fetch/fixtures/cookies.js +2 -1
  130. package/dist/targets/node/fetch/fixtures/custom-method.js +2 -1
  131. package/dist/targets/node/fetch/fixtures/full.js +2 -1
  132. package/dist/targets/node/fetch/fixtures/headers.js +2 -1
  133. package/dist/targets/node/fetch/fixtures/http-insecure.js +2 -1
  134. package/dist/targets/node/fetch/fixtures/jsonObj-multiline.js +2 -1
  135. package/dist/targets/node/fetch/fixtures/jsonObj-null-value.js +2 -1
  136. package/dist/targets/node/fetch/fixtures/multipart-data.js +2 -1
  137. package/dist/targets/node/fetch/fixtures/multipart-file.js +2 -1
  138. package/dist/targets/node/fetch/fixtures/multipart-form-data-no-params.js +2 -1
  139. package/dist/targets/node/fetch/fixtures/multipart-form-data.js +2 -1
  140. package/dist/targets/node/fetch/fixtures/nested.js +2 -1
  141. package/dist/targets/node/fetch/fixtures/postdata-malformed.js +2 -1
  142. package/dist/targets/node/fetch/fixtures/query-encoded.js +2 -1
  143. package/dist/targets/node/fetch/fixtures/query.js +2 -1
  144. package/dist/targets/node/fetch/fixtures/short.js +2 -1
  145. package/dist/targets/node/fetch/fixtures/text-plain.js +2 -1
  146. package/dist/targets/node/native/client.js +10 -10
  147. package/dist/targets/node/request/client.js +7 -7
  148. package/dist/targets/node/target.js +5 -5
  149. package/dist/targets/node/unirest/client.js +10 -10
  150. package/dist/targets/objc/helpers.js +1 -1
  151. package/dist/targets/objc/nsurlsession/client.js +4 -4
  152. package/dist/targets/objc/target.js +4 -4
  153. package/dist/targets/ocaml/cohttp/client.js +3 -3
  154. package/dist/targets/ocaml/target.js +4 -4
  155. package/dist/targets/php/curl/client.js +12 -12
  156. package/dist/targets/php/guzzle/client.js +5 -5
  157. package/dist/targets/php/helpers.js +1 -1
  158. package/dist/targets/php/http1/client.js +3 -3
  159. package/dist/targets/php/http2/client.js +4 -4
  160. package/dist/targets/php/target.js +5 -5
  161. package/dist/targets/powershell/common.js +1 -1
  162. package/dist/targets/powershell/restmethod/client.js +3 -3
  163. package/dist/targets/powershell/target.js +4 -4
  164. package/dist/targets/powershell/webrequest/client.js +3 -3
  165. package/dist/targets/python/helpers.js +1 -1
  166. package/dist/targets/python/requests/client.js +3 -3
  167. package/dist/targets/python/target.js +5 -5
  168. package/dist/targets/r/httr/client.js +3 -3
  169. package/dist/targets/r/target.js +4 -4
  170. package/dist/targets/ruby/native/client.js +3 -3
  171. package/dist/targets/ruby/target.js +4 -4
  172. package/dist/targets/shell/curl/client.js +4 -4
  173. package/dist/targets/shell/httpie/client.js +4 -4
  174. package/dist/targets/shell/target.js +5 -5
  175. package/dist/targets/shell/wget/client.js +3 -3
  176. package/dist/targets/swift/helpers.js +1 -1
  177. package/dist/targets/swift/nsurlsession/client.js +4 -4
  178. package/dist/targets/swift/target.js +4 -4
  179. package/dist/targets/targets.js +4 -4
  180. package/package.json +14 -14
@@ -13,7 +13,7 @@ var __assign = (this && this.__assign) || function () {
13
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
15
15
  };
16
- exports.__esModule = true;
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.unirest = void 0;
18
18
  var stringify_object_1 = __importDefault(require("stringify-object"));
19
19
  var code_builder_1 = require("../../../helpers/code-builder");
@@ -22,14 +22,14 @@ exports.unirest = {
22
22
  key: 'unirest',
23
23
  title: 'Unirest',
24
24
  link: 'http://unirest.io/nodejs.html',
25
- description: 'Lightweight HTTP Request Client Library'
25
+ description: 'Lightweight HTTP Request Client Library',
26
26
  },
27
27
  convert: function (_a, options) {
28
28
  var method = _a.method, url = _a.url, cookies = _a.cookies, queryObj = _a.queryObj, postData = _a.postData, headersObj = _a.headersObj;
29
29
  var opts = __assign({ indent: ' ' }, options);
30
30
  var includeFS = false;
31
31
  var _b = new code_builder_1.CodeBuilder({
32
- indent: opts.indent
32
+ indent: opts.indent,
33
33
  }), addPostProcessor = _b.addPostProcessor, blank = _b.blank, join = _b.join, push = _b.push, unshift = _b.unshift;
34
34
  push("const unirest = require('unirest');");
35
35
  blank();
@@ -44,24 +44,24 @@ exports.unirest = {
44
44
  blank();
45
45
  }
46
46
  if (Object.keys(queryObj).length) {
47
- push("req.query(".concat((0, stringify_object_1["default"])(queryObj, { indent: opts.indent }), ");"));
47
+ push("req.query(".concat((0, stringify_object_1.default)(queryObj, { indent: opts.indent }), ");"));
48
48
  blank();
49
49
  }
50
50
  if (Object.keys(headersObj).length) {
51
- push("req.headers(".concat((0, stringify_object_1["default"])(headersObj, { indent: opts.indent }), ");"));
51
+ push("req.headers(".concat((0, stringify_object_1.default)(headersObj, { indent: opts.indent }), ");"));
52
52
  blank();
53
53
  }
54
54
  switch (postData.mimeType) {
55
55
  case 'application/x-www-form-urlencoded':
56
56
  if (postData.paramsObj) {
57
- push("req.form(".concat((0, stringify_object_1["default"])(postData.paramsObj, { indent: opts.indent }), ");"));
57
+ push("req.form(".concat((0, stringify_object_1.default)(postData.paramsObj, { indent: opts.indent }), ");"));
58
58
  blank();
59
59
  }
60
60
  break;
61
61
  case 'application/json':
62
62
  if (postData.jsonObj) {
63
63
  push("req.type('json');");
64
- push("req.send(".concat((0, stringify_object_1["default"])(postData.jsonObj, { indent: opts.indent }), ");"));
64
+ push("req.send(".concat((0, stringify_object_1.default)(postData.jsonObj, { indent: opts.indent }), ");"));
65
65
  blank();
66
66
  }
67
67
  break;
@@ -87,13 +87,13 @@ exports.unirest = {
87
87
  multipart_1.push(part);
88
88
  }
89
89
  });
90
- push("req.multipart(".concat((0, stringify_object_1["default"])(multipart_1, { indent: opts.indent }), ");"));
90
+ push("req.multipart(".concat((0, stringify_object_1.default)(multipart_1, { indent: opts.indent }), ");"));
91
91
  blank();
92
92
  break;
93
93
  }
94
94
  default:
95
95
  if (postData.text) {
96
- push("req.send(".concat((0, stringify_object_1["default"])(postData.text, { indent: opts.indent }), ");"));
96
+ push("req.send(".concat((0, stringify_object_1.default)(postData.text, { indent: opts.indent }), ");"));
97
97
  blank();
98
98
  }
99
99
  }
@@ -106,5 +106,5 @@ exports.unirest = {
106
106
  push('console.log(res.body);', 1);
107
107
  push('});');
108
108
  return join();
109
- }
109
+ },
110
110
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.literalRepresentation = exports.nsDeclaration = void 0;
4
4
  /**
5
5
  * Create a string corresponding to a valid declaration and initialization of an Objective-C object literal.
@@ -26,7 +26,7 @@ var __read = (this && this.__read) || function (o, n) {
26
26
  }
27
27
  return ar;
28
28
  };
29
- exports.__esModule = true;
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
30
  exports.nsurlsession = void 0;
31
31
  var code_builder_1 = require("../../../helpers/code-builder");
32
32
  var helpers_1 = require("../helpers");
@@ -35,7 +35,7 @@ exports.nsurlsession = {
35
35
  key: 'nsurlsession',
36
36
  title: 'NSURLSession',
37
37
  link: 'https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html',
38
- description: "Foundation's NSURLSession request"
38
+ description: "Foundation's NSURLSession request",
39
39
  },
40
40
  convert: function (_a, options) {
41
41
  var allHeaders = _a.allHeaders, postData = _a.postData, method = _a.method, fullUrl = _a.fullUrl;
@@ -44,7 +44,7 @@ exports.nsurlsession = {
44
44
  // Markers for headers to be created as literal objects and later be set on the NSURLRequest if exist
45
45
  var req = {
46
46
  hasHeaders: false,
47
- hasBody: false
47
+ hasBody: false,
48
48
  };
49
49
  // We just want to make sure people understand that is the only dependency
50
50
  push('#import <Foundation/Foundation.h>');
@@ -138,5 +138,5 @@ exports.nsurlsession = {
138
138
  push(' }];');
139
139
  push('[dataTask resume];');
140
140
  return join();
141
- }
141
+ },
142
142
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.objc = void 0;
4
4
  var client_1 = require("./nsurlsession/client");
5
5
  exports.objc = {
@@ -7,9 +7,9 @@ exports.objc = {
7
7
  key: 'objc',
8
8
  title: 'Objective-C',
9
9
  extname: '.m',
10
- "default": 'nsurlsession'
10
+ default: 'nsurlsession',
11
11
  },
12
12
  clientsById: {
13
- nsurlsession: client_1.nsurlsession
14
- }
13
+ nsurlsession: client_1.nsurlsession,
14
+ },
15
15
  };
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- exports.__esModule = true;
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.cohttp = void 0;
15
15
  var code_builder_1 = require("../../../helpers/code-builder");
16
16
  exports.cohttp = {
@@ -18,7 +18,7 @@ exports.cohttp = {
18
18
  key: 'cohttp',
19
19
  title: 'CoHTTP',
20
20
  link: 'https://github.com/mirage/ocaml-cohttp',
21
- description: 'Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml'
21
+ description: 'Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml',
22
22
  },
23
23
  convert: function (_a, options) {
24
24
  var fullUrl = _a.fullUrl, allHeaders = _a.allHeaders, postData = _a.postData, method = _a.method;
@@ -59,5 +59,5 @@ exports.cohttp = {
59
59
  push('>>= fun (res, body_stream) ->');
60
60
  push('(* Do stuff with the result *)', 1);
61
61
  return join();
62
- }
62
+ },
63
63
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ocaml = void 0;
4
4
  var client_1 = require("./cohttp/client");
5
5
  exports.ocaml = {
@@ -7,9 +7,9 @@ exports.ocaml = {
7
7
  key: 'ocaml',
8
8
  title: 'OCaml',
9
9
  extname: '.ml',
10
- "default": 'cohttp'
10
+ default: 'cohttp',
11
11
  },
12
12
  clientsById: {
13
- cohttp: client_1.cohttp
14
- }
13
+ cohttp: client_1.cohttp,
14
+ },
15
15
  };
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- exports.__esModule = true;
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.curl = void 0;
15
15
  var code_builder_1 = require("../../../helpers/code-builder");
16
16
  exports.curl = {
@@ -18,7 +18,7 @@ exports.curl = {
18
18
  key: 'curl',
19
19
  title: 'cURL',
20
20
  link: 'http://php.net/manual/en/book.curl.php',
21
- description: 'PHP with ext-curl'
21
+ description: 'PHP with ext-curl',
22
22
  },
23
23
  convert: function (_a, options) {
24
24
  var uriObj = _a.uriObj, postData = _a.postData, fullUrl = _a.fullUrl, method = _a.method, httpVersion = _a.httpVersion, cookies = _a.cookies, headersObj = _a.headersObj;
@@ -34,47 +34,47 @@ exports.curl = {
34
34
  {
35
35
  escape: true,
36
36
  name: 'CURLOPT_PORT',
37
- value: uriObj.port
37
+ value: uriObj.port,
38
38
  },
39
39
  {
40
40
  escape: true,
41
41
  name: 'CURLOPT_URL',
42
- value: fullUrl
42
+ value: fullUrl,
43
43
  },
44
44
  {
45
45
  escape: false,
46
46
  name: 'CURLOPT_RETURNTRANSFER',
47
- value: 'true'
47
+ value: 'true',
48
48
  },
49
49
  {
50
50
  escape: true,
51
51
  name: 'CURLOPT_ENCODING',
52
- value: ''
52
+ value: '',
53
53
  },
54
54
  {
55
55
  escape: false,
56
56
  name: 'CURLOPT_MAXREDIRS',
57
- value: opts.maxRedirects
57
+ value: opts.maxRedirects,
58
58
  },
59
59
  {
60
60
  escape: false,
61
61
  name: 'CURLOPT_TIMEOUT',
62
- value: opts.timeout
62
+ value: opts.timeout,
63
63
  },
64
64
  {
65
65
  escape: false,
66
66
  name: 'CURLOPT_HTTP_VERSION',
67
- value: httpVersion === 'HTTP/1.0' ? 'CURL_HTTP_VERSION_1_0' : 'CURL_HTTP_VERSION_1_1'
67
+ value: httpVersion === 'HTTP/1.0' ? 'CURL_HTTP_VERSION_1_0' : 'CURL_HTTP_VERSION_1_1',
68
68
  },
69
69
  {
70
70
  escape: true,
71
71
  name: 'CURLOPT_CUSTOMREQUEST',
72
- value: method
72
+ value: method,
73
73
  },
74
74
  {
75
75
  escape: true,
76
76
  name: 'CURLOPT_POSTFIELDS',
77
- value: postData ? postData.text : undefined
77
+ value: postData ? postData.text : undefined,
78
78
  },
79
79
  ];
80
80
  push('curl_setopt_array($curl, [');
@@ -122,5 +122,5 @@ exports.curl = {
122
122
  push('?>');
123
123
  }
124
124
  return join();
125
- }
125
+ },
126
126
  };
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- exports.__esModule = true;
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.guzzle = void 0;
15
15
  var code_builder_1 = require("../../../helpers/code-builder");
16
16
  var headers_1 = require("../../../helpers/headers");
@@ -20,7 +20,7 @@ exports.guzzle = {
20
20
  key: 'guzzle',
21
21
  title: 'Guzzle',
22
22
  link: 'http://docs.guzzlephp.org/en/stable/',
23
- description: 'PHP with Guzzle'
23
+ description: 'PHP with Guzzle',
24
24
  },
25
25
  convert: function (_a, options) {
26
26
  var postData = _a.postData, fullUrl = _a.fullUrl, method = _a.method, cookies = _a.cookies, headersObj = _a.headersObj;
@@ -44,7 +44,7 @@ exports.guzzle = {
44
44
  var field = {
45
45
  name: param.name,
46
46
  filename: param.fileName,
47
- contents: param.value
47
+ contents: param.value,
48
48
  };
49
49
  if (param.contentType) {
50
50
  field.headers = { 'Content-Type': param.contentType };
@@ -54,7 +54,7 @@ exports.guzzle = {
54
54
  else if (param.value) {
55
55
  fields_1.push({
56
56
  name: param.name,
57
- contents: param.value
57
+ contents: param.value,
58
58
  });
59
59
  }
60
60
  });
@@ -113,5 +113,5 @@ exports.guzzle = {
113
113
  push('?>');
114
114
  }
115
115
  return join();
116
- }
116
+ },
117
117
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.supportedMethods = exports.convertType = void 0;
4
4
  var convertType = function (obj, indent, lastIndent) {
5
5
  lastIndent = lastIndent || '';
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- exports.__esModule = true;
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.http1 = void 0;
15
15
  var code_builder_1 = require("../../../helpers/code-builder");
16
16
  var helpers_1 = require("../helpers");
@@ -19,7 +19,7 @@ exports.http1 = {
19
19
  key: 'http1',
20
20
  title: 'HTTP v1',
21
21
  link: 'http://php.net/manual/en/book.http.php',
22
- description: 'PHP with pecl/http v1'
22
+ description: 'PHP with pecl/http v1',
23
23
  },
24
24
  convert: function (_a, options) {
25
25
  var method = _a.method, url = _a.url, postData = _a.postData, queryObj = _a.queryObj, headersObj = _a.headersObj, cookiesObj = _a.cookiesObj;
@@ -77,5 +77,5 @@ exports.http1 = {
77
77
  push('?>');
78
78
  }
79
79
  return join();
80
- }
80
+ },
81
81
  };
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- exports.__esModule = true;
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.http2 = void 0;
15
15
  var code_builder_1 = require("../../../helpers/code-builder");
16
16
  var headers_1 = require("../../../helpers/headers");
@@ -20,7 +20,7 @@ exports.http2 = {
20
20
  key: 'http2',
21
21
  title: 'HTTP v2',
22
22
  link: 'http://devel-m6w6.rhcloud.com/mdref/http',
23
- description: 'PHP with pecl/http v2'
23
+ description: 'PHP with pecl/http v2',
24
24
  },
25
25
  convert: function (_a, options) {
26
26
  var postData = _a.postData, headersObj = _a.headersObj, method = _a.method, queryObj = _a.queryObj, cookiesObj = _a.cookiesObj, url = _a.url;
@@ -54,7 +54,7 @@ exports.http2 = {
54
54
  name: name,
55
55
  type: contentType,
56
56
  file: fileName,
57
- data: value
57
+ data: value,
58
58
  });
59
59
  return;
60
60
  }
@@ -115,5 +115,5 @@ exports.http2 = {
115
115
  push('?>');
116
116
  }
117
117
  return join();
118
- }
118
+ },
119
119
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.php = void 0;
4
4
  var client_1 = require("./curl/client");
5
5
  var client_2 = require("./guzzle/client");
@@ -10,13 +10,13 @@ exports.php = {
10
10
  key: 'php',
11
11
  title: 'PHP',
12
12
  extname: '.php',
13
- "default": 'curl',
14
- cli: 'php %s'
13
+ default: 'curl',
14
+ cli: 'php %s',
15
15
  },
16
16
  clientsById: {
17
17
  curl: client_1.curl,
18
18
  guzzle: client_2.guzzle,
19
19
  http1: client_3.http1,
20
- http2: client_4.http2
21
- }
20
+ http2: client_4.http2,
21
+ },
22
22
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generatePowershellConvert = void 0;
4
4
  var code_builder_1 = require("../../helpers/code-builder");
5
5
  var headers_1 = require("../../helpers/headers");
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.restmethod = void 0;
4
4
  var common_1 = require("../common");
5
5
  exports.restmethod = {
@@ -7,7 +7,7 @@ exports.restmethod = {
7
7
  key: 'restmethod',
8
8
  title: 'Invoke-RestMethod',
9
9
  link: 'https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod',
10
- description: 'Powershell Invoke-RestMethod client'
10
+ description: 'Powershell Invoke-RestMethod client',
11
11
  },
12
- convert: (0, common_1.generatePowershellConvert)('Invoke-RestMethod')
12
+ convert: (0, common_1.generatePowershellConvert)('Invoke-RestMethod'),
13
13
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.powershell = void 0;
4
4
  var client_1 = require("./restmethod/client");
5
5
  var client_2 = require("./webrequest/client");
@@ -8,10 +8,10 @@ exports.powershell = {
8
8
  key: 'powershell',
9
9
  title: 'Powershell',
10
10
  extname: '.ps1',
11
- "default": 'webrequest'
11
+ default: 'webrequest',
12
12
  },
13
13
  clientsById: {
14
14
  webrequest: client_2.webrequest,
15
- restmethod: client_1.restmethod
16
- }
15
+ restmethod: client_1.restmethod,
16
+ },
17
17
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.webrequest = void 0;
4
4
  var common_1 = require("../common");
5
5
  exports.webrequest = {
@@ -7,7 +7,7 @@ exports.webrequest = {
7
7
  key: 'webrequest',
8
8
  title: 'Invoke-WebRequest',
9
9
  link: 'https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest',
10
- description: 'Powershell Invoke-WebRequest client'
10
+ description: 'Powershell Invoke-WebRequest client',
11
11
  },
12
- convert: (0, common_1.generatePowershellConvert)('Invoke-WebRequest')
12
+ convert: (0, common_1.generatePowershellConvert)('Invoke-WebRequest'),
13
13
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.literalRepresentation = void 0;
4
4
  /**
5
5
  * Create an string of given length filled with blank spaces
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- exports.__esModule = true;
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.requests = void 0;
15
15
  var code_builder_1 = require("../../../helpers/code-builder");
16
16
  var headers_1 = require("../../../helpers/headers");
@@ -20,7 +20,7 @@ exports.requests = {
20
20
  key: 'requests',
21
21
  title: 'Requests',
22
22
  link: 'http://docs.python-requests.org/en/latest/api/#requests.request',
23
- description: 'Requests HTTP library'
23
+ description: 'Requests HTTP library',
24
24
  },
25
25
  convert: function (_a, options) {
26
26
  var fullUrl = _a.fullUrl, postData = _a.postData, allHeaders = _a.allHeaders, method = _a.method;
@@ -157,5 +157,5 @@ exports.requests = {
157
157
  // Print response
158
158
  push('print(response.text)');
159
159
  return join();
160
- }
160
+ },
161
161
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.python = void 0;
4
4
  var client_1 = require("./requests/client");
5
5
  exports.python = {
@@ -7,10 +7,10 @@ exports.python = {
7
7
  key: 'python',
8
8
  title: 'Python',
9
9
  extname: '.py',
10
- "default": 'requests',
11
- cli: 'python3 %s'
10
+ default: 'requests',
11
+ cli: 'python3 %s',
12
12
  },
13
13
  clientsById: {
14
- requests: client_1.requests
15
- }
14
+ requests: client_1.requests,
15
+ },
16
16
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.httr = void 0;
4
4
  var code_builder_1 = require("../../../helpers/code-builder");
5
5
  exports.httr = {
@@ -7,7 +7,7 @@ exports.httr = {
7
7
  key: 'httr',
8
8
  title: 'httr',
9
9
  link: 'https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html',
10
- description: 'httr: Tools for Working with URLs and HTTP'
10
+ description: 'httr: Tools for Working with URLs and HTTP',
11
11
  },
12
12
  convert: function (_a) {
13
13
  var url = _a.url, queryObj = _a.queryObj, queryString = _a.queryString, postData = _a.postData, allHeaders = _a.allHeaders, method = _a.method;
@@ -112,5 +112,5 @@ exports.httr = {
112
112
  // Print response
113
113
  push('content(response, "text")');
114
114
  return join();
115
- }
115
+ },
116
116
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.r = void 0;
4
4
  var client_1 = require("./httr/client");
5
5
  exports.r = {
@@ -7,9 +7,9 @@ exports.r = {
7
7
  key: 'r',
8
8
  title: 'R',
9
9
  extname: '.r',
10
- "default": 'httr'
10
+ default: 'httr',
11
11
  },
12
12
  clientsById: {
13
- httr: client_1.httr
14
- }
13
+ httr: client_1.httr,
14
+ },
15
15
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.native = void 0;
4
4
  var code_builder_1 = require("../../../helpers/code-builder");
5
5
  exports.native = {
@@ -7,7 +7,7 @@ exports.native = {
7
7
  key: 'native',
8
8
  title: 'net::http',
9
9
  link: 'http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html',
10
- description: 'Ruby HTTP client'
10
+ description: 'Ruby HTTP client',
11
11
  },
12
12
  convert: function (_a) {
13
13
  var uriObj = _a.uriObj, rawMethod = _a.method, fullUrl = _a.fullUrl, postData = _a.postData, allHeaders = _a.allHeaders;
@@ -65,5 +65,5 @@ exports.native = {
65
65
  push('response = http.request(request)');
66
66
  push('puts response.read_body');
67
67
  return join();
68
- }
68
+ },
69
69
  };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- exports.__esModule = true;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ruby = void 0;
4
4
  var client_1 = require("./native/client");
5
5
  exports.ruby = {
@@ -7,9 +7,9 @@ exports.ruby = {
7
7
  key: 'ruby',
8
8
  title: 'Ruby',
9
9
  extname: '.rb',
10
- "default": 'native'
10
+ default: 'native',
11
11
  },
12
12
  clientsById: {
13
- native: client_1.native
14
- }
13
+ native: client_1.native,
14
+ },
15
15
  };
@@ -10,7 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  };
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
- exports.__esModule = true;
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.curl = void 0;
15
15
  var code_builder_1 = require("../../../helpers/code-builder");
16
16
  var headers_1 = require("../../../helpers/headers");
@@ -26,7 +26,7 @@ var params = {
26
26
  header: 'H',
27
27
  cookie: 'b',
28
28
  form: 'F',
29
- data: 'd'
29
+ data: 'd',
30
30
  };
31
31
  var getArg = function (short) { return function (longName) {
32
32
  if (short) {
@@ -43,7 +43,7 @@ exports.curl = {
43
43
  key: 'curl',
44
44
  title: 'cURL',
45
45
  link: 'http://curl.haxx.se/',
46
- description: 'cURL is a command line tool and library for transferring data with URL syntax'
46
+ description: 'cURL is a command line tool and library for transferring data with URL syntax',
47
47
  },
48
48
  convert: function (_a, options) {
49
49
  var _b;
@@ -160,5 +160,5 @@ exports.curl = {
160
160
  }
161
161
  }
162
162
  return join();
163
- }
163
+ },
164
164
  };