@readme/httpsnippet 8.0.1 → 8.1.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.
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'har-format';
2
2
  import './helpers/reducer.cjs';
3
- export { l as HTTPSnippet, k as HTTPSnippetOptions, H as HarRequest, j as Request, R as RequestExtras, f as addTarget, h as addTargetClient, m as availableTargets, n as extname } from './index-c8003aae.js';
3
+ export { n as HTTPSnippet, m as HTTPSnippetOptions, H as HarRequest, l as Request, R as RequestExtras, g as addTarget, k as addTargetClient, o as availableTargets, p as extname } from './index-7191f23f.js';
4
4
  import 'node:url';
5
5
  import './helpers/code-builder.cjs';
6
6
  import 'type-fest';
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import 'har-format';
2
2
  import './helpers/reducer.js';
3
- export { l as HTTPSnippet, k as HTTPSnippetOptions, H as HarRequest, j as Request, R as RequestExtras, f as addTarget, h as addTargetClient, m as availableTargets, n as extname } from './index-babe3117.js';
3
+ export { n as HTTPSnippet, m as HTTPSnippetOptions, H as HarRequest, l as Request, R as RequestExtras, g as addTarget, k as addTargetClient, o as availableTargets, p as extname } from './index-08ee07a8.js';
4
4
  import 'node:url';
5
5
  import './helpers/code-builder.js';
6
6
  import 'type-fest';
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { reducer } from './chunk-KT7MO6Z4.js';
2
- import { targets, getHeaderName } from './chunk-IAWYVBVW.js';
3
- export { addTarget, addTargetClient } from './chunk-IAWYVBVW.js';
2
+ import { targets, getHeaderName } from './chunk-XPQ7YGTP.js';
3
+ export { addTarget, addTargetClient } from './chunk-XPQ7YGTP.js';
4
4
  import './chunk-Y7NI4MMY.js';
5
5
  import { parse, format } from 'url';
6
6
  import formDataToString from 'formdata-to-string';
@@ -496,7 +496,8 @@ var restsharp = {
496
496
  title: "RestSharp",
497
497
  link: "http://restsharp.org/",
498
498
  description: "Simple REST and HTTP API Client for .NET",
499
- extname: ".cs"
499
+ extname: ".cs",
500
+ installation: "dotnet add package RestSharp"
500
501
  },
501
502
  convert: ({ method, fullUrl, headersObj, cookies, postData, uriObj }) => {
502
503
  const { push, join } = new CodeBuilder();
@@ -908,7 +909,8 @@ var axios = {
908
909
  title: "Axios",
909
910
  link: "https://github.com/axios/axios",
910
911
  description: "Promise based HTTP client for the browser and node.js",
911
- extname: ".js"
912
+ extname: ".js",
913
+ installation: "npm install axios --save"
912
914
  },
913
915
  convert: ({ allHeaders, method, url, queryObj, postData }, options) => {
914
916
  const opts = {
@@ -1340,7 +1342,8 @@ var axios2 = {
1340
1342
  title: "Axios",
1341
1343
  link: "https://github.com/axios/axios",
1342
1344
  description: "Promise based HTTP client for the browser and node.js",
1343
- extname: ".cjs"
1345
+ extname: ".cjs",
1346
+ install: "npm install axios --save"
1344
1347
  },
1345
1348
  convert: ({ method, fullUrl, allHeaders, postData }, options) => {
1346
1349
  const opts = {
@@ -1402,7 +1405,8 @@ var fetch2 = {
1402
1405
  title: "Fetch",
1403
1406
  link: "https://github.com/bitinn/node-fetch",
1404
1407
  description: "Simplified HTTP node-fetch client",
1405
- extname: ".cjs"
1408
+ extname: ".cjs",
1409
+ installation: "npm install node-fetch@2 --save"
1406
1410
  },
1407
1411
  convert: ({ method, fullUrl, postData, headersObj, cookies }, options) => {
1408
1412
  const opts = {
@@ -1576,7 +1580,8 @@ var request = {
1576
1580
  title: "Request",
1577
1581
  link: "https://github.com/request/request",
1578
1582
  description: "Simplified HTTP request client",
1579
- extname: ".cjs"
1583
+ extname: ".cjs",
1584
+ installation: "npm install request --save"
1580
1585
  },
1581
1586
  convert: ({ method, url, fullUrl, postData, headersObj, cookies }, options) => {
1582
1587
  const opts = {
@@ -1940,7 +1945,8 @@ var cohttp = {
1940
1945
  title: "CoHTTP",
1941
1946
  link: "https://github.com/mirage/ocaml-cohttp",
1942
1947
  description: "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",
1943
- extname: ".ml"
1948
+ extname: ".ml",
1949
+ installation: "opam install cohttp-lwt-unix cohttp-async"
1944
1950
  },
1945
1951
  convert: ({ fullUrl, allHeaders, postData, method }, options) => {
1946
1952
  const opts = {
@@ -2186,7 +2192,8 @@ var guzzle = {
2186
2192
  title: "Guzzle",
2187
2193
  link: "http://docs.guzzlephp.org/en/stable/",
2188
2194
  description: "PHP with Guzzle",
2189
- extname: ".php"
2195
+ extname: ".php",
2196
+ installation: "composer require guzzlehttp/guzzle"
2190
2197
  },
2191
2198
  convert: ({ postData, fullUrl, method, cookies, headersObj }, options) => {
2192
2199
  const opts = {
@@ -2611,7 +2618,8 @@ var requests = {
2611
2618
  title: "Requests",
2612
2619
  link: "http://docs.python-requests.org/en/latest/api/#requests.request",
2613
2620
  description: "Requests HTTP library",
2614
- extname: ".py"
2621
+ extname: ".py",
2622
+ installation: "python -m pip install requests"
2615
2623
  },
2616
2624
  convert: ({ fullUrl, postData, allHeaders, method }, options) => {
2617
2625
  const opts = {
@@ -3072,7 +3080,8 @@ var httpie = {
3072
3080
  title: "HTTPie",
3073
3081
  link: "http://httpie.org/",
3074
3082
  description: "a CLI, cURL-like tool for humans",
3075
- extname: ".sh"
3083
+ extname: ".sh",
3084
+ installation: "brew install httpie"
3076
3085
  },
3077
3086
  convert: ({ allHeaders, postData, queryObj, fullUrl, method, url }, options) => {
3078
3087
  const opts = {
@@ -3490,6 +3499,9 @@ var isClient = (client) => {
3490
3499
  }
3491
3500
  return true;
3492
3501
  };
3502
+ var addClientPlugin = (plugin) => {
3503
+ addTargetClient(plugin.target, plugin.client);
3504
+ };
3493
3505
  var addTargetClient = (targetId, client) => {
3494
3506
  if (!isClient(client)) ;
3495
3507
  if (!Object.prototype.hasOwnProperty.call(targets, targetId)) {
@@ -3503,6 +3515,7 @@ var addTargetClient = (targetId, client) => {
3503
3515
  targets[targetId].clientsById[client.info.key] = client;
3504
3516
  };
3505
3517
 
3518
+ exports.addClientPlugin = addClientPlugin;
3506
3519
  exports.addTarget = addTarget;
3507
3520
  exports.addTargetClient = addTargetClient;
3508
3521
  exports.isClient = isClient;