@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.
@@ -10,6 +10,7 @@ type ClientId = string;
10
10
  interface ClientInfo {
11
11
  description: string;
12
12
  extname: Extension;
13
+ installation?: string;
13
14
  key: ClientId;
14
15
  link: string;
15
16
  title: string;
@@ -19,6 +20,10 @@ interface Client<T extends Record<string, any> = Record<string, any>> {
19
20
  convert: Converter<T>;
20
21
  info: ClientInfo;
21
22
  }
23
+ interface ClientPlugin {
24
+ client: Client;
25
+ target: TargetId;
26
+ }
22
27
  type Extension = `.${string}` | null;
23
28
  interface TargetInfo {
24
29
  cli?: string;
@@ -54,6 +59,7 @@ declare const targets: {
54
59
  declare const isTarget: (target: Target) => target is Target;
55
60
  declare const addTarget: (target: Target) => void;
56
61
  declare const isClient: (client: Client) => client is Client<Record<string, any>>;
62
+ declare const addClientPlugin: (plugin: ClientPlugin) => void;
57
63
  declare const addTargetClient: (targetId: TargetId, client: Client) => void;
58
64
 
59
65
  interface AvailableTarget extends TargetInfo {
@@ -155,4 +161,4 @@ declare class HTTPSnippet {
155
161
  convert(targetId: TargetId, clientId?: ClientId, options?: any): Promise<string | false | string[]>;
156
162
  }
157
163
 
158
- export { ClientId as C, Extension as E, HarRequest as H, RequestExtras as R, TargetId as T, ClientInfo as a, Converter as b, Client as c, TargetInfo as d, Target as e, addTarget as f, isClient as g, addTargetClient as h, isTarget as i, Request as j, HTTPSnippetOptions as k, HTTPSnippet as l, availableTargets as m, extname as n, targets as t };
164
+ export { ClientId as C, Extension as E, HarRequest as H, RequestExtras as R, TargetId as T, ClientInfo as a, Converter as b, Client as c, ClientPlugin as d, TargetInfo as e, Target as f, addTarget as g, isClient as h, isTarget as i, addClientPlugin as j, addTargetClient as k, Request as l, HTTPSnippetOptions as m, HTTPSnippet as n, availableTargets as o, extname as p, targets as t };
@@ -10,6 +10,7 @@ type ClientId = string;
10
10
  interface ClientInfo {
11
11
  description: string;
12
12
  extname: Extension;
13
+ installation?: string;
13
14
  key: ClientId;
14
15
  link: string;
15
16
  title: string;
@@ -19,6 +20,10 @@ interface Client<T extends Record<string, any> = Record<string, any>> {
19
20
  convert: Converter<T>;
20
21
  info: ClientInfo;
21
22
  }
23
+ interface ClientPlugin {
24
+ client: Client;
25
+ target: TargetId;
26
+ }
22
27
  type Extension = `.${string}` | null;
23
28
  interface TargetInfo {
24
29
  cli?: string;
@@ -54,6 +59,7 @@ declare const targets: {
54
59
  declare const isTarget: (target: Target) => target is Target;
55
60
  declare const addTarget: (target: Target) => void;
56
61
  declare const isClient: (client: Client) => client is Client<Record<string, any>>;
62
+ declare const addClientPlugin: (plugin: ClientPlugin) => void;
57
63
  declare const addTargetClient: (targetId: TargetId, client: Client) => void;
58
64
 
59
65
  interface AvailableTarget extends TargetInfo {
@@ -155,4 +161,4 @@ declare class HTTPSnippet {
155
161
  convert(targetId: TargetId, clientId?: ClientId, options?: any): Promise<string | false | string[]>;
156
162
  }
157
163
 
158
- export { ClientId as C, Extension as E, HarRequest as H, RequestExtras as R, TargetId as T, ClientInfo as a, Converter as b, Client as c, TargetInfo as d, Target as e, addTarget as f, isClient as g, addTargetClient as h, isTarget as i, Request as j, HTTPSnippetOptions as k, HTTPSnippet as l, availableTargets as m, extname as n, targets as t };
164
+ export { ClientId as C, Extension as E, HarRequest as H, RequestExtras as R, TargetId as T, ClientInfo as a, Converter as b, Client as c, ClientPlugin as d, TargetInfo as e, Target as f, addTarget as g, isClient as h, isTarget as i, addClientPlugin as j, addTargetClient as k, Request as l, HTTPSnippetOptions as m, HTTPSnippet as n, availableTargets as o, extname as p, targets as t };
package/dist/index.cjs CHANGED
@@ -517,7 +517,8 @@ var restsharp = {
517
517
  title: "RestSharp",
518
518
  link: "http://restsharp.org/",
519
519
  description: "Simple REST and HTTP API Client for .NET",
520
- extname: ".cs"
520
+ extname: ".cs",
521
+ installation: "dotnet add package RestSharp"
521
522
  },
522
523
  convert: ({ method, fullUrl, headersObj, cookies, postData, uriObj }) => {
523
524
  const { push, join } = new CodeBuilder();
@@ -929,7 +930,8 @@ var axios = {
929
930
  title: "Axios",
930
931
  link: "https://github.com/axios/axios",
931
932
  description: "Promise based HTTP client for the browser and node.js",
932
- extname: ".js"
933
+ extname: ".js",
934
+ installation: "npm install axios --save"
933
935
  },
934
936
  convert: ({ allHeaders, method, url, queryObj, postData }, options) => {
935
937
  const opts = {
@@ -1361,7 +1363,8 @@ var axios2 = {
1361
1363
  title: "Axios",
1362
1364
  link: "https://github.com/axios/axios",
1363
1365
  description: "Promise based HTTP client for the browser and node.js",
1364
- extname: ".cjs"
1366
+ extname: ".cjs",
1367
+ install: "npm install axios --save"
1365
1368
  },
1366
1369
  convert: ({ method, fullUrl, allHeaders, postData }, options) => {
1367
1370
  const opts = {
@@ -1423,7 +1426,8 @@ var fetch2 = {
1423
1426
  title: "Fetch",
1424
1427
  link: "https://github.com/bitinn/node-fetch",
1425
1428
  description: "Simplified HTTP node-fetch client",
1426
- extname: ".cjs"
1429
+ extname: ".cjs",
1430
+ installation: "npm install node-fetch@2 --save"
1427
1431
  },
1428
1432
  convert: ({ method, fullUrl, postData, headersObj, cookies }, options) => {
1429
1433
  const opts = {
@@ -1597,7 +1601,8 @@ var request = {
1597
1601
  title: "Request",
1598
1602
  link: "https://github.com/request/request",
1599
1603
  description: "Simplified HTTP request client",
1600
- extname: ".cjs"
1604
+ extname: ".cjs",
1605
+ installation: "npm install request --save"
1601
1606
  },
1602
1607
  convert: ({ method, url, fullUrl, postData, headersObj, cookies }, options) => {
1603
1608
  const opts = {
@@ -1961,7 +1966,8 @@ var cohttp = {
1961
1966
  title: "CoHTTP",
1962
1967
  link: "https://github.com/mirage/ocaml-cohttp",
1963
1968
  description: "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",
1964
- extname: ".ml"
1969
+ extname: ".ml",
1970
+ installation: "opam install cohttp-lwt-unix cohttp-async"
1965
1971
  },
1966
1972
  convert: ({ fullUrl, allHeaders, postData, method }, options) => {
1967
1973
  const opts = {
@@ -2207,7 +2213,8 @@ var guzzle = {
2207
2213
  title: "Guzzle",
2208
2214
  link: "http://docs.guzzlephp.org/en/stable/",
2209
2215
  description: "PHP with Guzzle",
2210
- extname: ".php"
2216
+ extname: ".php",
2217
+ installation: "composer require guzzlehttp/guzzle"
2211
2218
  },
2212
2219
  convert: ({ postData, fullUrl, method, cookies, headersObj }, options) => {
2213
2220
  const opts = {
@@ -2632,7 +2639,8 @@ var requests = {
2632
2639
  title: "Requests",
2633
2640
  link: "http://docs.python-requests.org/en/latest/api/#requests.request",
2634
2641
  description: "Requests HTTP library",
2635
- extname: ".py"
2642
+ extname: ".py",
2643
+ installation: "python -m pip install requests"
2636
2644
  },
2637
2645
  convert: ({ fullUrl, postData, allHeaders, method }, options) => {
2638
2646
  const opts = {
@@ -3093,7 +3101,8 @@ var httpie = {
3093
3101
  title: "HTTPie",
3094
3102
  link: "http://httpie.org/",
3095
3103
  description: "a CLI, cURL-like tool for humans",
3096
- extname: ".sh"
3104
+ extname: ".sh",
3105
+ installation: "brew install httpie"
3097
3106
  },
3098
3107
  convert: ({ allHeaders, postData, queryObj, fullUrl, method, url }, options) => {
3099
3108
  const opts = {