@microlink/cli 2.1.24 → 2.1.26

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@microlink/cli",
3
3
  "description": "Interacting with Microlink API from your terminal.",
4
4
  "homepage": "https://github.com/microlinkhq/cli",
5
- "version": "2.1.24",
5
+ "version": "2.1.26",
6
6
  "main": "src/index.js",
7
7
  "bin": {
8
8
  "microlink": "bin/microlink",
@@ -33,10 +33,10 @@
33
33
  "microlink"
34
34
  ],
35
35
  "dependencies": {
36
- "@microlink/mql": "~0.13.4",
36
+ "@microlink/mql": "~0.13.5",
37
37
  "clipboardy": "~2.3.0",
38
38
  "jsome": "~2.5.0",
39
- "localhost-url-regex": "~1.0.9",
39
+ "localhost-url-regex": "~1.0.11",
40
40
  "mri": "~1.2.0",
41
41
  "nanospinner": "~1.1.0",
42
42
  "picocolors": "~1.0.0",
package/src/api.js CHANGED
@@ -44,9 +44,9 @@ const fetch = async (cli, gotOpts) => {
44
44
 
45
45
  try {
46
46
  spinner.start()
47
- const { body, response } = await mql.buffer(url, mqlOpts, gotOpts)
47
+ const response = await mql.buffer(url, mqlOpts, gotOpts)
48
48
  spinner.stop()
49
- return { body, response, flags: { copy, pretty } }
49
+ return { response, flags: { copy, pretty } }
50
50
  } catch (error) {
51
51
  spinner.stop()
52
52
  error.flags = cli.flags
@@ -54,8 +54,8 @@ const fetch = async (cli, gotOpts) => {
54
54
  }
55
55
  }
56
56
 
57
- const render = ({ body, response, flags }) => {
58
- const { headers, timings, requestUrl: uri } = response
57
+ const render = ({ response, flags }) => {
58
+ const { headers, timings, requestUrl: uri, body } = response
59
59
  if (!flags.pretty) return console.log(body.toString())
60
60
 
61
61
  const contentType = headers['content-type'].toLowerCase()
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const cli = require('../src/cli')
4
- cli.flags.endpoint = 'https://beta.microlink.io'
5
- delete cli.flags.apiKey
6
-
7
- require('../src/api')(cli, {
8
- headers: {
9
- authorization: require('../../api/src/constant').MICROLINK_API_AUTHORIZATION
10
- }
11
- })
package/bin/microlink-dev DELETED
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const cli = require('../src/cli')
4
- cli.flags.endpoint = 'http://localhost:3000'
5
- delete cli.flags.apiKey
6
-
7
- require('../src/api')(cli, {
8
- retry: 0,
9
- headers: {
10
- authorization: require('../../api/src/constant').MICROLINK_API_AUTHORIZATION
11
- }
12
- })
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const cli = require('../src/cli')
4
- cli.flags.endpoint = 'https://next.microlink.io'
5
- delete cli.flags.apiKey
6
-
7
- require('../src/api')(cli, {
8
- headers: {
9
- authorization: require('../../api/src/constant').MICROLINK_API_AUTHORIZATION
10
- }
11
- })
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const cli = require('../src/cli')
4
- cli.flags.endpoint = 'https://vercel.microlink.io'
5
- require('../src/api')(cli)